public abstract class AbstractStreamService extends com.google.common.util.concurrent.AbstractScheduledService implements StreamService
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStreamService(StreamCoordinatorClient streamCoordinatorClient,
StreamFileJanitorService janitorService,
StreamWriterSizeCollector sizeCollector,
MetricStore metricStore) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doShutdown()
Children classes should implement this method to add logic to the shutdown of this
Service. |
protected ScheduledExecutorService |
executor() |
protected StreamCoordinatorClient |
getStreamCoordinatorClient() |
protected long |
getStreamEventsSize(Id.Stream streamId)
Get the size of events ingested by a stream since its creation, in bytes.
|
protected abstract void |
initialize()
Children classes should implement this method to add logic to the start of this
Service. |
protected com.google.common.util.concurrent.AbstractScheduledService.Scheduler |
scheduler() |
protected void |
shutDown() |
protected void |
startUp() |
addListener, isRunning, runOneIteration, start, startAndWait, state, stop, stopAndWait, toStringprotected AbstractStreamService(StreamCoordinatorClient streamCoordinatorClient, StreamFileJanitorService janitorService, StreamWriterSizeCollector sizeCollector, MetricStore metricStore)
protected abstract void initialize()
throws Exception
Service.Exception - in case of any error while initializingprotected abstract void doShutdown()
throws Exception
Service.Exception - in case of any error while shutting downprotected StreamCoordinatorClient getStreamCoordinatorClient()
StreamCoordinatorClient used by this StreamService.protected final void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected final void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected com.google.common.util.concurrent.AbstractScheduledService.Scheduler scheduler()
scheduler in class com.google.common.util.concurrent.AbstractScheduledServiceprotected ScheduledExecutorService executor()
executor in class com.google.common.util.concurrent.AbstractScheduledServiceprotected long getStreamEventsSize(Id.Stream streamId) throws IOException
streamId - id of the streamIOException - when getting an error retrieving the metricCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.