Class BucketingManager
java.lang.Object
com.evolveum.midpoint.repo.common.activity.run.buckets.BucketingManager
Responsible for managing task work state:
1. Obtains new buckets to be processed:
getWorkBucket(String, String, ActivityPath, GetBucketOperationOptions, ActivityBucketManagementStatistics, OperationResult)
.
2. Marks buckets as complete: completeWorkBucket(String, String, ActivityPath, int, ActivityBucketManagementStatistics, Consumer, OperationResult)
.
3. Releases work buckets in case they are not going to be processed: releaseWorkBucket(String, String, ActivityPath, int, ActivityBucketManagementStatistics, OperationResult)
.
4. Computes query narrowing for given work bucket: narrowQueryForWorkBucket(Class, ObjectQuery, ActivityDistributionDefinition, ItemDefinitionProvider, WorkBucketType)
.
(The last method should be probably moved to a separate class.)-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
completeWorkBucket
(@NotNull String coordinatorTaskOid, @Nullable String workerTaskOid, @NotNull ActivityPath activityPath, int sequentialNumber, @Nullable ActivityBucketManagementStatistics statistics, @Nullable Consumer<BucketProgressOverviewType> bucketProgressConsumer, @NotNull OperationResult result) Marks a work bucket as complete.getWorkBucket
(@NotNull String coordinatorTaskOid, @Nullable String workerTaskOid, @NotNull ActivityPath activityPath, @Nullable GetBucketOperationOptions options, ActivityBucketManagementStatistics statistics, @NotNull OperationResult result) Obtains work bucket.narrowQueryForWorkBucket
(@NotNull Class<? extends Containerable> type, ObjectQuery query, @NotNull ActivityDistributionDefinition distributionDefinition, @Nullable ItemDefinitionProvider itemDefinitionProvider, @NotNull WorkBucketType workBucket) Narrows a query by taking specified bucket into account.void
releaseAllWorkBucketsFromWorker
(@NotNull String coordinatorTaskOid, @NotNull String workerTaskOid, @NotNull ActivityPath activityPath, ActivityBucketManagementStatistics statistics, OperationResult result) Releases all work buckets from a suspended worker.void
releaseWorkBucket
(@NotNull String coordinatorTaskOid, @NotNull String workerTaskOid, @NotNull ActivityPath activityPath, int sequentialNumber, ActivityBucketManagementStatistics statistics, OperationResult result) Releases work bucket.
-
Constructor Details
-
BucketingManager
public BucketingManager()
-
-
Method Details
-
getWorkBucket
public WorkBucketType getWorkBucket(@NotNull @NotNull String coordinatorTaskOid, @Nullable @Nullable String workerTaskOid, @NotNull @NotNull ActivityPath activityPath, @Nullable @Nullable GetBucketOperationOptions options, ActivityBucketManagementStatistics statistics, @NotNull @NotNull OperationResult result) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, InterruptedException Obtains work bucket. If no free work buckets are currently present it tries to create one. If there is already delegated work bucket for given worker task, it is returned. -
completeWorkBucket
public void completeWorkBucket(@NotNull @NotNull String coordinatorTaskOid, @Nullable @Nullable String workerTaskOid, @NotNull @NotNull ActivityPath activityPath, int sequentialNumber, @Nullable @Nullable ActivityBucketManagementStatistics statistics, @Nullable @Nullable Consumer<BucketProgressOverviewType> bucketProgressConsumer, @NotNull @NotNull OperationResult result) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException Marks a work bucket as complete. -
releaseWorkBucket
public void releaseWorkBucket(@NotNull @NotNull String coordinatorTaskOid, @NotNull @NotNull String workerTaskOid, @NotNull @NotNull ActivityPath activityPath, int sequentialNumber, ActivityBucketManagementStatistics statistics, OperationResult result) throws ObjectNotFoundException, SchemaException Releases work bucket. -
releaseAllWorkBucketsFromWorker
@Experimental public void releaseAllWorkBucketsFromWorker(@NotNull @NotNull String coordinatorTaskOid, @NotNull @NotNull String workerTaskOid, @NotNull @NotNull ActivityPath activityPath, ActivityBucketManagementStatistics statistics, OperationResult result) throws ObjectNotFoundException, SchemaException Releases all work buckets from a suspended worker. Will change in the future - there are some preconditions to be checked within the modification operation. -
narrowQueryForWorkBucket
public ObjectQuery narrowQueryForWorkBucket(@NotNull @NotNull Class<? extends Containerable> type, ObjectQuery query, @NotNull @NotNull ActivityDistributionDefinition distributionDefinition, @Nullable @Nullable ItemDefinitionProvider itemDefinitionProvider, @NotNull @NotNull WorkBucketType workBucket) throws SchemaException Narrows a query by taking specified bucket into account.- Throws:
SchemaException
-