use of io.pravega.segmentstore.storage.SimpleStorageFactory in project pravega by pravega.
the class StreamSegmentContainer method createStorage.
private Storage createStorage(StorageFactory storageFactory) {
if (storageFactory instanceof SimpleStorageFactory) {
val simpleFactory = (SimpleStorageFactory) storageFactory;
// Initialize storage metadata table segment
ContainerTableExtension tableExtension = getExtension(ContainerTableExtension.class);
String s = NameUtils.getStorageMetadataSegmentName(this.metadata.getContainerId());
val metadataStore = new TableBasedMetadataStore(s, tableExtension, simpleFactory.getChunkedSegmentStorageConfig(), simpleFactory.getExecutor());
return simpleFactory.createStorageAdapter(this.metadata.getContainerId(), metadataStore);
} else {
return storageFactory.createStorageAdapter();
}
}
Aggregations