use of io.pravega.controller.store.stream.InMemoryBucketStore in project pravega by pravega.
the class BucketServiceFactory method createWatermarkingService.
public BucketManager createWatermarkingService(Duration executionDuration, BucketWork work, ScheduledExecutorService executorService) {
switch(bucketStore.getStoreType()) {
case Zookeeper:
ZookeeperBucketStore zkBucketStore = (ZookeeperBucketStore) bucketStore;
Function<Integer, BucketService> zkSupplier = bucket -> new ZooKeeperBucketService(BucketStore.ServiceType.WatermarkingService, bucket, zkBucketStore, executorService, maxConcurrentExecutions, executionDuration, work);
return new ZooKeeperBucketManager(hostId, zkBucketStore, BucketStore.ServiceType.WatermarkingService, executorService, zkSupplier);
case InMemory:
InMemoryBucketStore inMemoryBucketStore = (InMemoryBucketStore) bucketStore;
Function<Integer, BucketService> inMemorySupplier = bucket -> new InMemoryBucketService(BucketStore.ServiceType.WatermarkingService, bucket, inMemoryBucketStore, executorService, maxConcurrentExecutions, executionDuration, work);
return new InMemoryBucketManager(hostId, (InMemoryBucketStore) bucketStore, BucketStore.ServiceType.WatermarkingService, executorService, inMemorySupplier);
default:
throw new IllegalArgumentException(String.format("store type %s not supported", bucketStore.getStoreType().name()));
}
}
use of io.pravega.controller.store.stream.InMemoryBucketStore in project pravega by pravega.
the class BucketServiceFactory method createRetentionService.
public BucketManager createRetentionService(Duration executionDuration, BucketWork work, ScheduledExecutorService executorService) {
switch(bucketStore.getStoreType()) {
case Zookeeper:
ZookeeperBucketStore zkBucketStore = (ZookeeperBucketStore) bucketStore;
Function<Integer, BucketService> zkSupplier = bucket -> new ZooKeeperBucketService(BucketStore.ServiceType.RetentionService, bucket, zkBucketStore, executorService, maxConcurrentExecutions, executionDuration, work);
return new ZooKeeperBucketManager(hostId, zkBucketStore, BucketStore.ServiceType.RetentionService, executorService, zkSupplier);
case InMemory:
InMemoryBucketStore inMemoryBucketStore = (InMemoryBucketStore) bucketStore;
Function<Integer, BucketService> inMemorySupplier = bucket -> new InMemoryBucketService(BucketStore.ServiceType.RetentionService, bucket, inMemoryBucketStore, executorService, maxConcurrentExecutions, executionDuration, work);
return new InMemoryBucketManager(hostId, (InMemoryBucketStore) bucketStore, BucketStore.ServiceType.RetentionService, executorService, inMemorySupplier);
default:
throw new IllegalArgumentException(String.format("store type %s not supported", bucketStore.getStoreType().name()));
}
}
Aggregations