ジョブキューはQueue Handlerによって管理されます。各QueueハンドラはそのJob Queueを管理し、3つのハンドラがプリインストールされています:
system
: システムジョブ(クリーンアップ、パフォーマンス、バックアップジョブ)のデフォルトハンドラservice
default
: ユーザ・ジョブ(Materialization、Replication、SQLジョブ)のデフォルト・ハンドラ。
SYSADMIN.createQueueHandler
プロシージャを使用して追加のハンドラを作成し、SYSADMIN.editQueueHandler
プロシージャを使用して既存のハンドラを編集することができます。QueueハンドラをDropする必要がある場合、SYSADMIN.dropQueueHandler
プロシージャを使用してDrop することができます(プリインストールされている3つのハンドラはDrop できません)。キューハンドラの統計はSYSADMIN.JobQueueStats
テーブルで利用可能です。 各キューハンドラのスレッドプールステータスはSYSADMIN.JobQueueHandlersStats
テーブルで利用可能です。
Queue Handlerはスケジュールのパラメータです。CreateSchedule
とUpdateSchedule
プロシージャには、キューハンドラを指定するためのオプションのqueueHandler
パラメータがあります。queueHandler
が設定されていない場合、デフォルトのハンドラが使用されます ( システムジョブにはsystem
が、その他のジョブにはdefault
が使用されます)。
Queue Handler は、並列での実行可能なジョブ数を定義する特別なthreadCount
パラメータを持っています。同じQueue Handlerを持つ他のジョブはQueueに入れられ、このHandlerで実行されている他のジョブが終了すると実行を開始します。プリインストールされたQueue Handlerの場合、threadCount
には以下の値があります:
Queue handler |
|
---|---|
| 2 |
| 2 |
| 15 |
ジョブがキューにある間、ジョブとスケジュールに対して以下のアクションがサポートされます:
To view the full table, click the expand button in its top right corner
Action | Description | Status | Failure reason |
---|---|---|---|
Stop job | The job will not run |
| 'The job was stopped.' |
Disable job | The job remains |
| 'The schedule with id=<> did not run because its job (id=<>) is disabled.' |
Delete job | The job will not run |
| 'The job was deleted.' |
Disable schedule | Disabling the schedule after it has already placed the job in a queue does not affect the job. The job remains in the queue and runs as if nothing happens. Subsequent job run that was to be triggered by this disabled schedule will not start | - | - |
Delete schedule | Deleting a schedule after it has already placed a job in a queue does not affect the job. The job remains in the queue and runs as if nothing happened | - | - |
特定のキューにあるすべてのジョブはSYSADMIN.JobQueue
テーブルで閲覧することができ、キューをクリーニングするにはSYSADMIN.cleanupJobQueue
プロシージャを使用します。キューの合計サイズはMAX_JOB_QUEUE_SIZE
オプションで管理されます (Default: 10000
)。
実行中のユーザージョブの数は、<max active plans value>
- <system jobs thread count>
- <service jobs thread count>
- 1を超えることはできません。この制限に達した場合、ジョブは以下の理由でキューに入れられます:"システムの設定が間違っています。max-active-plans
の値がすべてのQueue Handlerスレッドの合計+1以上になるようにJob Queueを設定してください。