go.temporal.io/server/common/schedules/id.go

51 LOC · 20 covered · 31 uncovered · 5 ranges · 54 concepts · 4 introducers · 36 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the fileTestScheduleBackfillerTask_ConsistentLabels · 0 introduced LOCTestScheduleBackfillerTa…TestBackfillTask_InclusiveStartEnd · 0 introduced LOCTestBackfillTask_Inclusi…backfiller_tasks.go ×4 · 13 introduced LOCbackfiller_tasks.go ×4TestBackfillTask_CompleteFill · 0 introduced LOCTestBackfillTask_Complet…backfiller_tasks.go ×2 · 30 introduced LOCbackfiller_tasks.go ×2backfiller_tasks.go ×1 · 2 introduced LOCbackfiller_tasks.go ×1scheduler.go ×9 · 22 introduced LOCscheduler.go ×9TestGeneratorTask_ExecuteBufferTask_Basic · 0 introduced LOCTestGeneratorTask_Execut…TestCreateSchedulerFromMigration_NoRunning · 0 introduced LOCTestCreateSchedulerFromM…TestBackfillTask_BufferCompletelyFull · 0 introduced LOCTestBackfillTask_BufferC…TestBackfillTask_TriggerImmediateFullBuffer · 0 introduced LOCTestBackfillTask_Trigger…backfiller_tasks.go ×1 · 15 introduced LOCbackfiller_tasks.go ×1backfiller_tasks.go ×2 · 14 introduced LOCbackfiller_tasks.go ×2backfiller.go ×1 · 2 introduced LOCbackfiller.go ×1generator_tasks.go ×2 · 10 introduced LOCgenerator_tasks.go ×2TestGeneratorTask_MaxBufferSizeDisabledBuffersAll · 0 introduced LOCTestGeneratorTask_MaxBuf…TestProcessTimeRange_LimitedActions · 0 introduced LOCTestProcessTimeRange_Lim…tree.go ×1 · 1 introduced LOCtree.go ×1TestProcessTimeRange_Limit · 0 introduced LOCTestProcessTimeRange_Lim…generator_tasks.go ×1 · 2 introduced LOCgenerator_tasks.go ×1TestProcessTimeRange_UpdateBetweenNominalAndJitter · 0 introduced LOCTestProcessTimeRange_Upd…TestProcessTimeRange_CatchupWindow · 0 introduced LOCTestProcessTimeRange_Cat…TestProcessTimeRange_Basic · 0 introduced LOCTestProcessTimeRange_Bas…TestProcessTimeRange_ManualDoesNotDrop · 0 introduced LOCTestProcessTimeRange_Man…spec_processor.go ×1 · 8 introduced LOCspec_processor.go ×1TestProcessTimeRange_OverlapPolicy · 0 introduced LOCTestProcessTimeRange_Ove…invoker.go ×1 · 2 introduced LOCinvoker.go ×1scheduler.go ×1 · 7 introduced LOCscheduler.go ×1up_to_recentActionCount_is_fully_discounted · 0 introduced LOCup_to_recentActionCount_…empty_buffer_keeps_full_capacity, beyond_recentActionCount_reduces_capacity_1:1, +2 · 0 introduced LOCempty_buffer_keeps_full_…spec_processor.go ×1 · 1 introduced LOCspec_processor.go ×1spec_processor.go ×1 · 1 introduced LOCspec_processor.go ×1spec_processor.go ×1 · 3 introduced LOCspec_processor.go ×1spec_processor.go ×1 · 11 introduced LOCspec_processor.go ×1spec_processor.go ×1 · 1 introduced LOCspec_processor.go ×1spec_processor.go ×1 · 10 introduced LOCspec_processor.go ×1util.go ×1 · 10 introduced LOCutil.go ×1TestEventLog_EachComponentHasOwn · 0 introduced LOCTestEventLog_EachCompone…scheduler.go ×1 · 7 introduced LOCscheduler.go ×1backfiller.go ×2 · 12 introduced LOCbackfiller.go ×2TestMigrateFailure · 0 introduced LOCTestMigrateFailureTestMigrateDynamicConfigFailure · 0 introduced LOCTestMigrateDynamicConfig…TestMigrateFailureThenRetrySuccess · 0 introduced LOCTestMigrateFailureThenRe…TestMigrateDynamicConfigFlipsMidRun · 0 introduced LOCTestMigrateDynamicConfig…migration.go ×5 · 22 introduced LOCmigration.go ×5migration.go ×1 · 1 introduced LOCmigration.go ×1migration.go ×4 · 25 introduced LOCmigration.go ×4migration.go ×5 · 29 introduced LOCmigration.go ×5message.pb.go ×1 · 4 introduced LOCmessage.pb.go ×1id.go ×1 · 3 introduced LOCid.go ×1migration.go ×2 · 29 introduced LOCmigration.go ×2id.go ×1 · 2 introduced LOCid.go ×1id.go ×2 · 11 introduced LOCid.go ×2id.go ×1 · 4 introduced LOCid.go ×1beyond_recentActionCount_reduces_capacity_1:1 · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestAllowedBufferedStartsDiscountsRetainedHistory/beyond_recentActionCount_reduces_capacity_1:1beyond_recentActionCount…buffer_full_of_actionable_starts_clamps_to_zero · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestAllowedBufferedStartsDiscountsRetainedHistory/buffer_full_of_actionable_starts_clamps_to_zerobuffer_full_of_actionabl…empty_buffer_keeps_full_capacity · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestAllowedBufferedStartsDiscountsRetainedHistory/empty_buffer_keeps_full_capacityempty_buffer_keeps_full_…up_to_recentActionCount_is_fully_discounted · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestAllowedBufferedStartsDiscountsRetainedHistory/up_to_recentActionCount_is_fully_discountedup_to_recentActionCount_…TestBackfillTask_BufferCompletelyFull · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_BufferCompletelyFullTestBackfillTask_BufferC…TestBackfillTask_CompleteFill · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_CompleteFillTestBackfillTask_Complet…TestBackfillTask_InclusiveStartEnd · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_InclusiveStartEndTestBackfillTask_Inclusi…TestBackfillTask_PartialFill · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_PartialFillTestBackfillTask_Partial…TestBackfillTask_TriggerImmediate · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_TriggerImmediateTestBackfillTask_Trigger…TestBackfillTask_TriggerImmediateFullBuffer · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_TriggerImmediateFullBufferTestBackfillTask_Trigger…TestBackfillTask_Validate_MigrationPending · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestBackfillTask_Validate_MigrationPendingTestBackfillTask_Validat…TestCompletedHistoryDoesNotConsumeBackfillCapacity · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestCompletedHistoryDoesNotConsumeBackfillCapacityTestCompletedHistoryDoes…TestCreateSchedulerFromMigration_NoRunning · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestCreateSchedulerFromMigration_NoRunningTestCreateSchedulerFromM…TestEventLog_EachComponentHasOwn · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestEventLog_EachComponentHasOwnTestEventLog_EachCompone…TestGeneratorTask_BufferOverrunDropsActions · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestGeneratorTask_BufferOverrunDropsActionsTestGeneratorTask_Buffer…TestGeneratorTask_ExecuteBufferTask_Basic · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestGeneratorTask_ExecuteBufferTask_BasicTestGeneratorTask_Execut…TestGeneratorTask_MaxBufferSizeDisabledBuffersAll · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestGeneratorTask_MaxBufferSizeDisabledBuffersAllTestGeneratorTask_MaxBuf…TestProcessTimeRange_Basic · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_BasicTestProcessTimeRange_Bas…TestProcessTimeRange_CatchupWindow · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_CatchupWindowTestProcessTimeRange_Cat…TestProcessTimeRange_Limit · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_LimitTestProcessTimeRange_Lim…TestProcessTimeRange_LimitedActions · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_LimitedActionsTestProcessTimeRange_Lim…TestProcessTimeRange_ManualDoesNotDrop · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_ManualDoesNotDropTestProcessTimeRange_Man…TestProcessTimeRange_OverlapPolicy · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_OverlapPolicyTestProcessTimeRange_Ove…TestProcessTimeRange_UpdateAfterHighWatermark · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_UpdateAfterHighWatermarkTestProcessTimeRange_Upd…TestProcessTimeRange_UpdateBetweenNominalAndJitter · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestProcessTimeRange_UpdateBetweenNominalAndJitterTestProcessTimeRange_Upd…TestScheduleBackfillerTask_ConsistentLabels · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestScheduleBackfillerTask_ConsistentLabelsTestScheduleBackfillerTa…TestUnpause_ResumesProcessing · introduced test · go.temporal.io/server/chasm/lib/scheduler/TestUnpause_ResumesProcessingTestUnpause_ResumesProce…TestConvertRunningWorkflowsToBufferedStarts_UniqueRequestIDs · introduced test · go.temporal.io/server/chasm/lib/scheduler/migration/TestConvertRunningWorkflowsToBufferedStarts_UniqueRequestIDsTestConvertRunningWorkfl…TestLegacyToCreateFromMigrationStateRequest · introduced test · go.temporal.io/server/chasm/lib/scheduler/migration/TestLegacyToCreateFromMigrationStateRequestTestLegacyToCreateFromMi…TestLegacyToCreateFromMigrationStateRequest_DeduplicatesRunningWorkflows · introduced test · go.temporal.io/server/chasm/lib/scheduler/migration/TestLegacyToCreateFromMigrationStateRequest_DeduplicatesRunningWorkflowsTestLegacyToCreateFromMi…TestGenerateRequestID · introduced test · go.temporal.io/server/common/schedules/TestGenerateRequestIDTestGenerateRequestIDTestGenerateWorkflowID · introduced test · go.temporal.io/server/common/schedules/TestGenerateWorkflowIDTestGenerateWorkflowIDTestMigrateDynamicConfigFailure · introduced test · go.temporal.io/server/service/worker/scheduler/TestWorkflow/TestMigrateDynamicConfigFailureTestMigrateDynamicConfig…TestMigrateDynamicConfigFlipsMidRun · introduced test · go.temporal.io/server/service/worker/scheduler/TestWorkflow/TestMigrateDynamicConfigFlipsMidRunTestMigrateDynamicConfig…TestMigrateFailure · introduced test · go.temporal.io/server/service/worker/scheduler/TestWorkflow/TestMigrateFailureTestMigrateFailureTestMigrateFailureThenRetrySuccess · introduced test · go.temporal.io/server/service/worker/scheduler/TestWorkflow/TestMigrateFailureThenRetrySuccessTestMigrateFailureThenRe…Focused file · go.temporal.io/server/common/schedules/id.go · 51 LOCschedules/id.go

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package schedules
2
3 import (
4 "fmt"
5 "time"
6
7 "github.com/google/uuid"
8 )
9
10 // GenerateRequestID generates a deterministic request ID for a buffered action's
11 // time. The request ID is deterministic because the jittered actual time (as
12 // well as the spec's nominal time) is, in turn, also deterministic.
13 //
14 // backfillID should be left blank for actions that are being started
15 // automatically, based on the schedule spec. It must be set for backfills,
16 // as backfills may generate buffered actions that overlap with both
17 // automatically-buffered actions, as well as other requested backfills.
18 func GenerateRequestID(
19 namespaceID string,
20 scheduleID string,
21 conflictToken int64,
22 backfillID string,
23 nominal time.Time,
24 actual time.Time,
25 > ) string { id.go ×2
26 > if backfillID == "" {
27 > backfillID = "auto" id.go ×1
28 > }
29 > return fmt.Sprintf( id.go ×2
30 > "sched-%s-%s-%s-%d-%d-%d",
31 > backfillID,
32 > namespaceID,
33 > scheduleID,
34 > conflictToken,
35 > nominal.UnixMilli(),
36 > actual.UnixMilli(),
37 > )
38 }
39
40 // GenerateWorkflowID generates a deterministic workflow ID for a buffered
41 // action by combining the base workflow ID with the truncated nominal time.
42 > func GenerateWorkflowID(baseWorkflowID string, nominalTime time.Time) string { id.go ×1
43 > nominalTimeSec := nominalTime.Truncate(time.Second)
44 > return fmt.Sprintf("%s-%s", baseWorkflowID, nominalTimeSec.UTC().Format(time.RFC3339))
45 > }
46
47 // GenerateBackfillerID generates a unique ID for a Backfiller component.
48 // This ID is used to identify and deduplicate backfill requests.
49 > func GenerateBackfillerID() string { id.go ×1
50 > return uuid.NewString()
51 > }