@Test public void shouldShutdownBeforeStart () { metricManager.shutdown(); }
@Override public void shutdown () { synchronized ( monitor ) { if ( scheduler.isShutdown() ) { return; } call( new ShutdownTasks(), "shutting down" ); scheduler.shutdown(); try { if ( scheduler.awaitTermination( 30, SECONDS ) ) { LOGGER.info( "Shutdown completed" ); } else { LOGGER.warn( "await termination timed out" ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); LOGGER.error( "Interrupted while awaiting termination" ); } } }
MetricManagerImpl implements MetricManager { @Override public void shutdown () { synchronized ( monitor ) { if ( scheduler.isShutdown() ) { return; } call( new ShutdownTasks(), "shutting down" ); scheduler.shutdown(); try { if ( scheduler.awaitTermination( 30, SECONDS ) ) { LOGGER.info( "Shutdown completed" ); } else { LOGGER.warn( "await termination timed out" ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); LOGGER.error( "Interrupted while awaiting termination" ); } } } }
MetricManagerImpl implements MetricManager { @Override public void shutdown () { synchronized ( monitor ) { if ( scheduler.isShutdown() ) { return; } call( new ShutdownTasks(), "shutting down" ); scheduler.shutdown(); try { if ( scheduler.awaitTermination( 30, SECONDS ) ) { LOGGER.info( "Shutdown completed" ); } else { LOGGER.warn( "await termination timed out" ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); LOGGER.error( "Interrupted while awaiting termination" ); } } } @Inject  MetricManagerImpl( final JokerConfig jokerConfig,
                               final MetricRegistry pipelineMetricRegistry,
                               final ThreadMXBean threadMXBean,
                               final RuntimeMXBean runtimeMXBean,
                               final OperatingSystemMXBean osMXBean,
                               @Named( JOKER_THREAD_GROUP_NAME ) final ThreadGroup threadGroup ); }
MetricManagerImpl implements MetricManager { @Override public void shutdown () { synchronized ( monitor ) { if ( scheduler.isShutdown() ) { return; } call( new ShutdownTasks(), "shutting down" ); scheduler.shutdown(); try { if ( scheduler.awaitTermination( 30, SECONDS ) ) { LOGGER.info( "Shutdown completed" ); } else { LOGGER.warn( "await termination timed out" ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); LOGGER.error( "Interrupted while awaiting termination" ); } } } @Inject  MetricManagerImpl( final JokerConfig jokerConfig,
                               final MetricRegistry pipelineMetricRegistry,
                               final ThreadMXBean threadMXBean,
                               final RuntimeMXBean runtimeMXBean,
                               final OperatingSystemMXBean osMXBean,
                               @Named( JOKER_THREAD_GROUP_NAME ) final ThreadGroup threadGroup ); @Override void start( final int flowVersion, final List<PipelineMeter> pipelineMeters ); @Override void pause(); @Override void update( int flowVersion, List<PipelineId> pipelineIdsToRemove, List<PipelineMeter> newPipelineMeters ); @Override void resume(); @Override FlowMetrics getMetrics(); @Override LatencyMeter createLatencyMeter( final FlowDef flow, final String sinkOperatorId, final int replicaIndex ); @Override void shutdown(); }
MetricManagerImpl implements MetricManager { @Override public void shutdown () { synchronized ( monitor ) { if ( scheduler.isShutdown() ) { return; } call( new ShutdownTasks(), "shutting down" ); scheduler.shutdown(); try { if ( scheduler.awaitTermination( 30, SECONDS ) ) { LOGGER.info( "Shutdown completed" ); } else { LOGGER.warn( "await termination timed out" ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); LOGGER.error( "Interrupted while awaiting termination" ); } } } @Inject  MetricManagerImpl( final JokerConfig jokerConfig,
                               final MetricRegistry pipelineMetricRegistry,
                               final ThreadMXBean threadMXBean,
                               final RuntimeMXBean runtimeMXBean,
                               final OperatingSystemMXBean osMXBean,
                               @Named( JOKER_THREAD_GROUP_NAME ) final ThreadGroup threadGroup ); @Override void start( final int flowVersion, final List<PipelineMeter> pipelineMeters ); @Override void pause(); @Override void update( int flowVersion, List<PipelineId> pipelineIdsToRemove, List<PipelineMeter> newPipelineMeters ); @Override void resume(); @Override FlowMetrics getMetrics(); @Override LatencyMeter createLatencyMeter( final FlowDef flow, final String sinkOperatorId, final int replicaIndex ); @Override void shutdown();  }