use of io.pravega.controller.server.bucket.ZooKeeperBucketManager in project pravega by pravega.
the class RetentionServiceHealthContributorTest method setup.
@Before
public void setup() {
BucketStore bucketStore = mock(ZookeeperBucketStore.class);
doReturn(StoreType.Zookeeper).when(bucketStore).getStoreType();
String hostId = UUID.randomUUID().toString();
BucketServiceFactory bucketStoreFactory = spy(new BucketServiceFactory(hostId, bucketStore, 2));
ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
PeriodicRetention periodicRetention = mock(PeriodicRetention.class);
retentionService = spy(bucketStoreFactory.createWatermarkingService(Duration.ofMillis(5), periodicRetention::retention, executor));
doReturn(CompletableFuture.completedFuture(null)).when((ZooKeeperBucketManager) retentionService).initializeService();
doNothing().when((ZooKeeperBucketManager) retentionService).startBucketOwnershipListener();
doReturn(true).when(retentionService).isHealthy();
contributor = new RetentionServiceHealthContributor("retentionservice", retentionService);
builder = Health.builder().name("retentionservice");
}
use of io.pravega.controller.server.bucket.ZooKeeperBucketManager in project pravega by pravega.
the class WatermarkingServiceHealthContibutorTest method setup.
@Before
public void setup() {
ZookeeperBucketStore bucketStore = mock(ZookeeperBucketStore.class);
doReturn(StoreType.Zookeeper).when(bucketStore).getStoreType();
String hostId = UUID.randomUUID().toString();
BucketServiceFactory bucketStoreFactory = new BucketServiceFactory(hostId, bucketStore, 2);
ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
PeriodicWatermarking periodicWatermarking = mock(PeriodicWatermarking.class);
watermarkingService = spy(bucketStoreFactory.createWatermarkingService(Duration.ofMillis(10), periodicWatermarking::watermark, executor));
doReturn(CompletableFuture.completedFuture(null)).when((ZooKeeperBucketManager) watermarkingService).initializeService();
doNothing().when((ZooKeeperBucketManager) watermarkingService).startBucketOwnershipListener();
doReturn(true).when(watermarkingService).isHealthy();
contributor = new WatermarkingServiceHealthContributor("watermarkingservice", watermarkingService);
builder = Health.builder().name("watermark");
}
Aggregations