use of io.pravega.segmentstore.server.tables.ContainerTableExtension in project pravega by pravega.
the class StreamSegmentContainer method createMetadataStore.
private MetadataStore createMetadataStore() {
MetadataStore.Connector connector = new MetadataStore.Connector(this.metadata, this::mapSegmentId, this::deleteSegmentImmediate, this::deleteSegmentDelayed, this::runMetadataCleanup);
ContainerTableExtension tableExtension = getExtension(ContainerTableExtension.class);
Preconditions.checkArgument(tableExtension != null, "ContainerTableExtension required for initialization.");
return new TableMetadataStore(connector, tableExtension, tableExtension.getConfig(), this.executor);
}
use of io.pravega.segmentstore.server.tables.ContainerTableExtension 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