Class DifferenceFlux

All Implemented Interfaces:
Expression, HasImports

public final class DifferenceFlux extends AbstractParametrizedFlux
Difference computes the difference between subsequent non null records. See SPEC.

Options

  • nonNegative - Indicates if the derivative is allowed to be negative. If a value is encountered which is less than the previous value then it is assumed the previous value should have been a zero [boolean].
  • columns - The list of columns on which to compute the difference. Defaults ["_value"] [array of strings].

Example

 Flux flux = Flux
     .from("telegraf")
     .groupBy("_measurement")
     .difference();

 Flux flux = Flux
     .from("telegraf")
     .range(-5L, ChronoUnit.MINUTES)
     .difference(new String[]{"_value", "_time"}, false)
 
Author:
Jakub Bednar (bednar@github) (17/07/2018 12:28)
  • Constructor Details

    • DifferenceFlux

      public DifferenceFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

      @Nonnull protected String operatorName()
      Specified by:
      operatorName in class AbstractParametrizedFlux
      Returns:
      name of function
    • withNonNegative

      @Nonnull public DifferenceFlux withNonNegative(boolean nonNegative)
      Parameters:
      nonNegative - indicates if the derivative is allowed to be negative
      Returns:
      this
    • withColumns

      @Nonnull public DifferenceFlux withColumns(@Nonnull String[] columns)
      Parameters:
      columns - list of columns on which to compute the difference
      Returns:
      this
    • withColumns

      @Nonnull public DifferenceFlux withColumns(@Nonnull Collection<String> columns)
      Parameters:
      columns - list of columns on which to compute the difference
      Returns:
      this
    • collectImports

      public void collectImports(@Nonnull Set<String> collectedImports)
      Description copied from class: Flux
      Collects all imports of the flux.
      Overrides:
      collectImports in class Flux
      Parameters:
      collectedImports - a set to be filled by the used imports