Search in sources :

Example 1 with StreamIngester

use of com.wavefront.ingester.StreamIngester in project java by wavefrontHQ.

the class PushAgent method startPickleListener.

protected void startPickleListener(String strPort, GraphiteFormatter formatter) {
    if (prefix != null && !prefix.isEmpty()) {
        preprocessors.forPort(strPort).forReportPoint().addTransformer(new ReportPointAddPrefixTransformer(prefix));
    }
    preprocessors.forPort(strPort).forReportPoint().addFilter(new ReportPointTimestampInRangeFilter(dataBackfillCutoffHours, dataPrefillCutoffHours));
    int port = Integer.parseInt(strPort);
    // Set up a custom handler
    ChannelHandler handler = new ChannelByteArrayHandler(new PickleProtocolDecoder("unknown", customSourceTags, formatter.getMetricMangler(), port), new PointHandlerImpl(strPort, pushValidationLevel, pushBlockedSamples, getFlushTasks(strPort)), preprocessors.forPort(strPort));
    // to the decoder.
    class FrameDecoderFactoryImpl implements StreamIngester.FrameDecoderFactory {

        @Override
        public ChannelInboundHandler getDecoder() {
            return new LengthFieldBasedFrameDecoder(ByteOrder.BIG_ENDIAN, 1000000, 0, 4, 0, 4, false);
        }
    }
    startAsManagedThread(new StreamIngester(new FrameDecoderFactoryImpl(), handler, port).withChildChannelOptions(childChannelOptions), "listener-binary-pickle-" + port);
}
Also used : StreamIngester(com.wavefront.ingester.StreamIngester) ReportPointAddPrefixTransformer(com.wavefront.agent.preprocessor.ReportPointAddPrefixTransformer) PickleProtocolDecoder(com.wavefront.ingester.PickleProtocolDecoder) ReportPointTimestampInRangeFilter(com.wavefront.agent.preprocessor.ReportPointTimestampInRangeFilter) QueuingChannelHandler(com.wavefront.agent.histogram.QueuingChannelHandler) ChannelHandler(io.netty.channel.ChannelHandler) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder)

Aggregations

QueuingChannelHandler (com.wavefront.agent.histogram.QueuingChannelHandler)1 ReportPointAddPrefixTransformer (com.wavefront.agent.preprocessor.ReportPointAddPrefixTransformer)1 ReportPointTimestampInRangeFilter (com.wavefront.agent.preprocessor.ReportPointTimestampInRangeFilter)1 PickleProtocolDecoder (com.wavefront.ingester.PickleProtocolDecoder)1 StreamIngester (com.wavefront.ingester.StreamIngester)1 ChannelHandler (io.netty.channel.ChannelHandler)1 LengthFieldBasedFrameDecoder (io.netty.handler.codec.LengthFieldBasedFrameDecoder)1