Package com.wavefront.agent.handlers
Class ReportableEntityHandlerFactoryImpl
- java.lang.Object
-
- com.wavefront.agent.handlers.ReportableEntityHandlerFactoryImpl
-
- All Implemented Interfaces:
ReportableEntityHandlerFactory
public class ReportableEntityHandlerFactoryImpl extends Object implements ReportableEntityHandlerFactory
Caching factory forReportableEntityHandler
objects. Makes sure there's only one handler for eachHandlerKey
, which makes it possible to spin up handlers on demand at runtime, as well as redirecting traffic to a different pipeline.- Author:
- [email protected]
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Map<com.wavefront.data.ReportableEntityType,ReportableEntityHandler<?,?>>>
handlers
static Logger
VALID_HISTOGRAMS_LOGGER
static Logger
VALID_POINTS_LOGGER
-
Constructor Summary
Constructors Constructor Description ReportableEntityHandlerFactoryImpl(SenderTaskFactory senderTaskFactory, int blockedItemsPerBatch, com.wavefront.api.agent.ValidationConfiguration validationConfig, Logger blockedPointsLogger, Logger blockedHistogramsLogger, Logger blockedSpansLogger, Function<wavefront.report.Histogram,wavefront.report.Histogram> histogramRecompressor, EntityPropertiesFactory entityPropertiesFactory)
Create new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,U>
ReportableEntityHandler<T,U>getHandler(HandlerKey handlerKey)
Create, or return existing,ReportableEntityHandler
.void
shutdown(String handle)
Shutdown pipeline for a specific handle.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.wavefront.agent.handlers.ReportableEntityHandlerFactory
getHandler
-
-
-
-
Constructor Detail
-
ReportableEntityHandlerFactoryImpl
public ReportableEntityHandlerFactoryImpl(SenderTaskFactory senderTaskFactory, int blockedItemsPerBatch, @Nonnull com.wavefront.api.agent.ValidationConfiguration validationConfig, Logger blockedPointsLogger, Logger blockedHistogramsLogger, Logger blockedSpansLogger, @Nullable Function<wavefront.report.Histogram,wavefront.report.Histogram> histogramRecompressor, EntityPropertiesFactory entityPropertiesFactory)
Create new instance.- Parameters:
senderTaskFactory
- SenderTaskFactory instance used to create SenderTasks for new handlers.blockedItemsPerBatch
- controls sample rate of how many blocked points are written into the main log file.validationConfig
- validation configuration.
-
-
Method Detail
-
getHandler
public <T,U> ReportableEntityHandler<T,U> getHandler(HandlerKey handlerKey)
Description copied from interface:ReportableEntityHandlerFactory
Create, or return existing,ReportableEntityHandler
.- Specified by:
getHandler
in interfaceReportableEntityHandlerFactory
- Parameters:
handlerKey
- unique identifier for the handler.- Returns:
- new or existing handler.
-
shutdown
public void shutdown(@Nonnull String handle)
Description copied from interface:ReportableEntityHandlerFactory
Shutdown pipeline for a specific handle.- Specified by:
shutdown
in interfaceReportableEntityHandlerFactory
-
-