private void startExporter(ServiceName<Partition> partitionName, Partition partition) { final StateStorage stateStorage = partition.getStateStorageFactory().create(EXPORTER_PROCESSOR_ID, PROCESSOR_NAME); final SnapshotController snapshotController = new StateSnapshotController( DefaultZeebeDbFactory.defaultFactory(ExporterColumnFamilies.class), stateStorage); streamProcessorServiceFactory .createService(partition, partitionName) .processorId(EXPORTER_PROCESSOR_ID) .processorName(PROCESSOR_NAME) .snapshotController(snapshotController) .streamProcessorFactory( (zeebeDb) -> new ExporterStreamProcessor( zeebeDb, partition.getInfo().getPartitionId(), exporterRepository.getExporters().values())) .build(); }
private void startExporter(ServiceName<Partition> partitionName, Partition partition) { final StateStorage stateStorage = partition.getStateStorageFactory().create(EXPORTER_PROCESSOR_ID, PROCESSOR_NAME); final SnapshotController snapshotController = new StateSnapshotController( DefaultZeebeDbFactory.defaultFactory(ExporterColumnFamilies.class), stateStorage); streamProcessorServiceFactory .createService(partition, partitionName) .processorId(EXPORTER_PROCESSOR_ID) .processorName(PROCESSOR_NAME) .snapshotController(snapshotController) .streamProcessorFactory( (zeebeDb) -> new ExporterStreamProcessor( zeebeDb, partition.getInfo().getPartitionId(), exporterRepository.getExporters().values())) .build(); }
public void startStreamProcessors( final ServiceName<Partition> partitionServiceName, final Partition partition) { final int partitionId = partition.getInfo().getPartitionId(); final Builder streamProcessorServiceBuilder = streamProcessorServiceFactory .createService(partition, partitionServiceName) .processorId(partitionId) .processorName(PROCESSOR_NAME); final StateStorage stateStorage = partition.getStateStorageFactory().create(partitionId, PROCESSOR_NAME); final StateSnapshotController stateSnapshotController = new StateSnapshotController(DefaultZeebeDbFactory.DEFAULT_DB_FACTORY, stateStorage); streamProcessorServiceBuilder .snapshotController(stateSnapshotController) .streamProcessorFactory( (zeebeDb) -> { final ZeebeState zeebeState = new ZeebeState(partitionId, zeebeDb); final TypedStreamEnvironment streamEnvironment = new TypedStreamEnvironment( partition.getLogStream(), clientApiTransport.getOutput()); return createTypedStreamProcessor( partitionServiceName, partitionId, streamEnvironment, zeebeState); }) .build(); }
public void startStreamProcessors( final ServiceName<Partition> partitionServiceName, final Partition partition) { final int partitionId = partition.getInfo().getPartitionId(); final Builder streamProcessorServiceBuilder = streamProcessorServiceFactory .createService(partition, partitionServiceName) .processorId(partitionId) .processorName(PROCESSOR_NAME); final StateStorage stateStorage = partition.getStateStorageFactory().create(partitionId, PROCESSOR_NAME); final StateSnapshotController stateSnapshotController = new StateSnapshotController(DefaultZeebeDbFactory.DEFAULT_DB_FACTORY, stateStorage); streamProcessorServiceBuilder .snapshotController(stateSnapshotController) .streamProcessorFactory( (zeebeDb) -> { final ZeebeState zeebeState = new ZeebeState(partitionId, zeebeDb); final TypedStreamEnvironment streamEnvironment = new TypedStreamEnvironment( partition.getLogStream(), clientApiTransport.getOutput()); return createTypedStreamProcessor( partitionServiceName, partitionId, streamEnvironment, zeebeState); }) .build(); }
private StreamProcessorService buildStreamProcessorController() { final String name = "processor"; final StateStorage stateStorage = getStateStorageFactory().create(streamProcessorId, name); currentSnapshotController = new StateSnapshotController(zeebeDbFactory, stateStorage); return LogStreams.createStreamProcessor(name, streamProcessorId) .logStream(stream) .snapshotController(currentSnapshotController) .actorScheduler(actorScheduler) .serviceContainer(serviceContainer) .streamProcessorFactory( zeebeDb -> { currentStreamProcessor.wrap(factory.createProcessor(zeebeDb)); return currentStreamProcessor; }) .build() .join(); } }
private StreamProcessorService buildStreamProcessorController() { final String name = "processor"; final StateStorage stateStorage = getStateStorageFactory().create(streamProcessorId, name); currentSnapshotController = new StateSnapshotController(zeebeDbFactory, stateStorage); return LogStreams.createStreamProcessor(name, streamProcessorId) .logStream(stream) .snapshotController(currentSnapshotController) .actorScheduler(actorScheduler) .serviceContainer(serviceContainer) .streamProcessorFactory( zeebeDb -> { currentStreamProcessor.wrap(factory.createProcessor(zeebeDb)); return currentStreamProcessor; }) .build() .join(); } }