private void installPartition( final ServiceStartContext startContext, final RaftPersistentConfiguration configuration) { final String partitionName = Partition.getPartitionName(configuration.getPartitionId()); final ServiceName<Void> partitionInstallServiceName = partitionInstallServiceName(partitionName); final PartitionInstallService partitionInstallService = new PartitionInstallService(brokerCfg, configuration); startContext .createService(partitionInstallServiceName, partitionInstallService) .dependency( clientTransport(REPLICATION_API_CLIENT_NAME), partitionInstallService.getClientTransportInjector()) .install(); }
private void installPartition( final ServiceStartContext startContext, final RaftPersistentConfiguration configuration) { final String partitionName = Partition.getPartitionName(configuration.getPartitionId()); final ServiceName<Void> partitionInstallServiceName = partitionInstallServiceName(partitionName); final PartitionInstallService partitionInstallService = new PartitionInstallService(brokerCfg, configuration); startContext .createService(partitionInstallServiceName, partitionInstallService) .dependency( clientTransport(REPLICATION_API_CLIENT_NAME), partitionInstallService.getClientTransportInjector()) .install(); }
public void startBroker() { startTime = System.currentTimeMillis(); broker = new Broker(brokerCfg, newTemporaryFolder.getAbsolutePath(), controlledActorClock); final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); try { // Hack: block until the system stream processor is available // this is required in the broker-test suite, because the client rule does not perform request // retries // How to make it better: https://github.com/zeebe-io/zeebe/issues/196 final String partitionName = Partition.getPartitionName(Protocol.DEPLOYMENT_PARTITION); serviceContainer .createService(TestService.NAME, new TestService()) .dependency(ClusterBaseLayerServiceNames.leaderPartitionServiceName(partitionName)) .dependency( TransportServiceNames.serverTransport(TransportServiceNames.CLIENT_API_SERVER_NAME)) .dependency(WORKFLOW_REPOSITORY_SERVICE) .install() .get(timeout, TimeUnit.SECONDS); } catch (final InterruptedException | ExecutionException | TimeoutException e) { stopBroker(); throw new RuntimeException( String.format( "System partition not installed into the container withing %d seconds.", timeout), e); } dataDirectories = broker.getBrokerContext().getBrokerConfiguration().getData().getDirectories(); }
public void startBroker() { startTime = System.currentTimeMillis(); broker = new Broker(brokerCfg, newTemporaryFolder.getAbsolutePath(), controlledActorClock); final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); try { // Hack: block until the system stream processor is available // this is required in the broker-test suite, because the client rule does not perform request // retries // How to make it better: https://github.com/zeebe-io/zeebe/issues/196 final String partitionName = Partition.getPartitionName(Protocol.DEPLOYMENT_PARTITION); serviceContainer .createService(TestService.NAME, new TestService()) .dependency(ClusterBaseLayerServiceNames.leaderPartitionServiceName(partitionName)) .dependency( TransportServiceNames.serverTransport(TransportServiceNames.CLIENT_API_SERVER_NAME)) .dependency(WORKFLOW_REPOSITORY_SERVICE) .install() .get(timeout, TimeUnit.SECONDS); } catch (final InterruptedException | ExecutionException | TimeoutException e) { stopBroker(); throw new RuntimeException( String.format( "System partition not installed into the container withing %d seconds.", timeout), e); } dataDirectories = broker.getBrokerContext().getBrokerConfiguration().getData().getDirectories(); }
public static void printRecords(final Broker broker, final int partitionId) { try { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final ServiceName<LogStream> logStreamServiceName = LogStreamServiceNames.logStreamServiceName(Partition.getPartitionName(partitionId)); final PrinterService printerService = new PrinterService(); serviceContainer .createService(PRINTER_SERVICE_NAME, printerService) .dependency(logStreamServiceName, printerService.getLogStreamInjector()) .install() .join(); serviceContainer.removeService(PRINTER_SERVICE_NAME).join(); } catch (final Exception e) { LOGGER.error( "Could not print log entries. This exception is not propagated to avoid interference with the test.", e); } }
public static void printRecords(final Broker broker, final int partitionId) { try { final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer(); final ServiceName<LogStream> logStreamServiceName = LogStreamServiceNames.logStreamServiceName(Partition.getPartitionName(partitionId)); final PrinterService printerService = new PrinterService(); serviceContainer .createService(PRINTER_SERVICE_NAME, printerService) .dependency(logStreamServiceName, printerService.getLogStreamInjector()) .install() .join(); serviceContainer.removeService(PRINTER_SERVICE_NAME).join(); } catch (final Exception e) { LOGGER.error( "Could not print log entries. This exception is not propagated to avoid interference with the test.", e); } }
final String partitionName = Partition.getPartitionName(Protocol.DEPLOYMENT_PARTITION);
final String partitionName = Partition.getPartitionName(Protocol.DEPLOYMENT_PARTITION);