Search in sources :

Example 1 with ContainerTableExtension

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);
}
Also used : TableBasedMetadataStore(io.pravega.segmentstore.storage.metadata.TableBasedMetadataStore) ContainerTableExtension(io.pravega.segmentstore.server.tables.ContainerTableExtension)

Example 2 with ContainerTableExtension

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();
    }
}
Also used : lombok.val(lombok.val) SimpleStorageFactory(io.pravega.segmentstore.storage.SimpleStorageFactory) ContainerTableExtension(io.pravega.segmentstore.server.tables.ContainerTableExtension) TableBasedMetadataStore(io.pravega.segmentstore.storage.metadata.TableBasedMetadataStore)

Aggregations

ContainerTableExtension (io.pravega.segmentstore.server.tables.ContainerTableExtension)2 TableBasedMetadataStore (io.pravega.segmentstore.storage.metadata.TableBasedMetadataStore)2 SimpleStorageFactory (io.pravega.segmentstore.storage.SimpleStorageFactory)1 lombok.val (lombok.val)1