use of com.wavefront.ingester.PickleProtocolDecoder 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);
}
Aggregations