/** * Creates a new instance of StreamSegmentStore using the components generated by this class. */ public StreamSegmentStore createStreamSegmentService() { return getSingleton(this.streamSegmentService, this.streamSegmentStoreCreator); }
/** * Creates or gets the instance of the SegmentContainerRegistry used throughout this ServiceBuilder. */ private SegmentContainerRegistry getSegmentContainerRegistry() { return getSingleton(this.containerRegistry, this::createSegmentContainerRegistry); }
protected StorageFactory createStorageFactory() { return getSingleton(this.storageFactory, this.storageFactoryCreator); }
protected SegmentContainerFactory createSegmentContainerFactory() { ReadIndexFactory readIndexFactory = getSingleton(this.readIndexFactory, this::createReadIndexFactory); AttributeIndexFactory attributeIndexFactory = getSingleton(this.attributeIndexFactory, this::createAttributeIndexFactory); StorageFactory storageFactory = createStorageFactory(); OperationLogFactory operationLogFactory = getSingleton(this.operationLogFactory, this::createOperationLogFactory); WriterFactory writerFactory = getSingleton(this.writerFactory, this::createWriterFactory); ContainerConfig containerConfig = this.serviceBuilderConfig.getConfig(ContainerConfig::builder); return new StreamSegmentContainerFactory(containerConfig, operationLogFactory, readIndexFactory, attributeIndexFactory, writerFactory, storageFactory, this::createContainerExtensions, this.coreExecutor); }
private Map<Class<? extends SegmentContainerExtension>, SegmentContainerExtension> createContainerExtensions( SegmentContainer container, ScheduledExecutorService executor) { CacheFactory cacheFactory = getSingleton(this.cacheFactory, this.cacheFactoryCreator); return Collections.singletonMap(ContainerTableExtension.class, new ContainerTableExtensionImpl(container, cacheFactory, this.cacheManager, executor)); }
private SegmentContainerRegistry createSegmentContainerRegistry() { SegmentContainerFactory containerFactory = getSingleton(this.containerFactory, this::createSegmentContainerFactory); return new StreamSegmentContainerRegistry(containerFactory, this.coreExecutor); }
protected OperationLogFactory createOperationLogFactory() { DurableDataLogFactory dataLogFactory = getSingleton(this.dataLogFactory, this.dataLogFactoryCreator); DurableLogConfig durableLogConfig = this.serviceBuilderConfig.getConfig(DurableLogConfig::builder); return new DurableLogFactory(durableLogConfig, dataLogFactory, this.coreExecutor); }
protected AttributeIndexFactory createAttributeIndexFactory() { CacheFactory cacheFactory = getSingleton(this.cacheFactory, this.cacheFactoryCreator); AttributeIndexConfig config = this.serviceBuilderConfig.getConfig(AttributeIndexConfig::builder); return new ContainerAttributeIndexFactoryImpl(config, cacheFactory, this.cacheManager, this.coreExecutor); }
/** * Initializes the ServiceBuilder. * * @throws DurableDataLogException If unable to initialize DurableDataLogFactory. */ public void initialize() throws DurableDataLogException { this.cacheManager.startAsync().awaitRunning(); getSingleton(this.dataLogFactory, this.dataLogFactoryCreator).initialize(); getSingleton(this.containerManager, this.segmentContainerManagerCreator).initialize(); }
protected ReadIndexFactory createReadIndexFactory() { CacheFactory cacheFactory = getSingleton(this.cacheFactory, this.cacheFactoryCreator); ReadIndexConfig readIndexConfig = this.serviceBuilderConfig.getConfig(ReadIndexConfig::builder); return new ContainerReadIndexFactory(readIndexConfig, cacheFactory, this.cacheManager, this.coreExecutor); }
/** * Creates a new instance of TableStore using the components generated by this class. */ public TableStore createTableStoreService() { return getSingleton(this.tableStoreService, setup -> new TableService(setup.getContainerRegistry(), setup.getSegmentToContainerMapper())); }