Search in sources :

Example 1 with SimpleStorageFactory

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();
    }
}
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)1 SimpleStorageFactory (io.pravega.segmentstore.storage.SimpleStorageFactory)1 TableBasedMetadataStore (io.pravega.segmentstore.storage.metadata.TableBasedMetadataStore)1 lombok.val (lombok.val)1