Class StringSerializer

All Implemented Interfaces:
IMonitoringRecordSerializer

public class StringSerializer extends AbstractMonitoringRecordSerializer
String serializer for monitoring records based on the record's toString method.
Since:
1.13
Author:
Holger Knoche
  • Constructor Details

    • StringSerializer

      public StringSerializer(Configuration configuration)
      Creates a new serializer using the given configuration.
      Parameters:
      configuration - The configuration to use
  • Method Details

    • serializeRecord

      public int serializeRecord(IMonitoringRecord record, ByteBuffer buffer)
      Description copied from interface: IMonitoringRecordSerializer
      Serializes a single record into the given byte buffer.
      Parameters:
      record - The record to serialize
      buffer - The buffer to write to
      Returns:
      The number of bytes written to the buffer
    • serializeRecords

      public int serializeRecords(Collection<IMonitoringRecord> records, ByteBuffer buffer)
      Description copied from interface: IMonitoringRecordSerializer
      Serializes multiple monitoring records into the given byte buffer.
      Parameters:
      records - The records to serialize
      buffer - The buffer to write to
      Returns:
      The number of bytes written to the buffer
    • onInitialization

      public void onInitialization()
      Description copied from interface: IMonitoringRecordSerializer
      Called by the collector during initialization (before any records are written).
    • onTermination

      public void onTermination()
      Description copied from interface: IMonitoringRecordSerializer
      Called by the collector upon termination (after remaining records have been flushed).