@Test public void shouldThrowExceptionIfSnapshotPeriodIsTooSmall() { final BrokerCfg brokerCfg = new BrokerCfg(); brokerCfg.getData().setSnapshotPeriod(Duration.ofSeconds(1)); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Snapshot period PT1S needs to be larger then or equals to one minute."); initSystemContext(brokerCfg); }
private void initSystemContext(final ActorClock clock, final String basePath) { LOG.debug("Initializing system with base path {}", basePath); brokerCfg.init(basePath); validateConfiguration(); stepTimeout = brokerCfg.getStepTimeout(); final var cluster = brokerCfg.getCluster(); final String brokerId = String.format("Broker-%d", cluster.getNodeId()); diagnosticContext = Collections.singletonMap(BROKER_ID_LOG_PROPERTY, brokerId); scheduler = initScheduler(clock, brokerId); setStepTimeout(stepTimeout); }
SystemContext { private void initSystemContext(final ActorClock clock, final String basePath) { LOG.debug("Initializing system with base path {}", basePath); brokerCfg.init(basePath); validateConfiguration(); stepTimeout = brokerCfg.getStepTimeout(); final var cluster = brokerCfg.getCluster(); final String brokerId = String.format("Broker-%d", cluster.getNodeId()); diagnosticContext = Collections.singletonMap(BROKER_ID_LOG_PROPERTY, brokerId); scheduler = initScheduler(clock, brokerId); setStepTimeout(stepTimeout); } }
SystemContext { private void initSystemContext(final ActorClock clock, final String basePath) { LOG.debug("Initializing system with base path {}", basePath); brokerCfg.init(basePath); validateConfiguration(); stepTimeout = brokerCfg.getStepTimeout(); final var cluster = brokerCfg.getCluster(); final String brokerId = String.format("Broker-%d", cluster.getNodeId()); diagnosticContext = Collections.singletonMap(BROKER_ID_LOG_PROPERTY, brokerId); scheduler = initScheduler(clock, brokerId); setStepTimeout(stepTimeout); } SystemContext(final BrokerCfg brokerCfg, final String basePath, final ActorClock clock); }
SystemContext { private void initSystemContext(final ActorClock clock, final String basePath) { LOG.debug("Initializing system with base path {}", basePath); brokerCfg.init(basePath); validateConfiguration(); stepTimeout = brokerCfg.getStepTimeout(); final var cluster = brokerCfg.getCluster(); final String brokerId = String.format("Broker-%d", cluster.getNodeId()); diagnosticContext = Collections.singletonMap(BROKER_ID_LOG_PROPERTY, brokerId); scheduler = initScheduler(clock, brokerId); setStepTimeout(stepTimeout); } SystemContext(final BrokerCfg brokerCfg, final String basePath, final ActorClock clock); ActorScheduler getScheduler(); BrokerCfg getBrokerConfiguration(); Map<String, String> getDiagnosticContext(); Duration getStepTimeout(); }
SystemContext { private void initSystemContext(final ActorClock clock, final String basePath) { LOG.debug("Initializing system with base path {}", basePath); brokerCfg.init(basePath); validateConfiguration(); stepTimeout = brokerCfg.getStepTimeout(); final var cluster = brokerCfg.getCluster(); final String brokerId = String.format("Broker-%d", cluster.getNodeId()); diagnosticContext = Collections.singletonMap(BROKER_ID_LOG_PROPERTY, brokerId); scheduler = initScheduler(clock, brokerId); setStepTimeout(stepTimeout); } SystemContext(final BrokerCfg brokerCfg, final String basePath, final ActorClock clock); ActorScheduler getScheduler(); BrokerCfg getBrokerConfiguration(); Map<String, String> getDiagnosticContext(); Duration getStepTimeout(); static final Logger LOG; }