All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavefront.ingester.ReportableEntityDecoder Maven / Gradle / Ivy

There is a newer version: 2023-22.3
Show newest version
package com.wavefront.ingester;

import javax.annotation.Nullable;
import java.util.List;

/**
 * A decoder for input data. A more generic version of {@link Decoder},
 * that supports other object types besides points.
 *
 * @author [email protected]
 */
public interface ReportableEntityDecoder {
  /**
   * Decode graphite points and dump them into an output array. The supplied customer id will be set
   * and no customer id extraction will be attempted.
   *
   * @param msg         Message to parse.
   * @param out         List to output the parsed point.
   * @param customerId  The customer id to use as the table for the result ReportPoint.
   * @param ctx         The ingester context with extra params for decoding.
   */
  void decode(T msg, List out, String customerId, @Nullable IngesterContext ctx);

  /**
   * Decode entities (points, spans, etc) and dump them into an output array. The supplied customer
   * id will be set and no customer id extraction will be attempted.
   *
   * @param msg        Message to parse.
   * @param out        List to output the parsed point.
   * @param customerId The customer id to use as the table for the resulting entities.
   */
  default void decode(T msg, List out, String customerId) {
    decode(msg, out, customerId, null);
  }

  /**
   * Certain decoders support decoding the customer id from the input line itself.
   *
   * @param msg Message to parse.
   * @param out List to output the parsed point.
   */
  default void decode(T msg, List out) {
    decode(msg, out, "dummy");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy