Class TimeShiftFlux

All Implemented Interfaces:
Expression, HasImports

public final class TimeShiftFlux extends AbstractParametrizedFlux
Shift add a fixed duration to time columns. See SPEC.

Options

  • duration - The amount to add to each time value [duration]
  • columns - The list of all columns that should be shifted. Defaults `["_start", "_stop", "_time"]` [array of strings].

Example

 Flux flux = Flux
     .from("telegraf")
     .timeShift(10L, ChronoUnit.HOURS);

 Flux flux = Flux
     .from("telegraf")
     .timeShift(10L, ChronoUnit.HOURS, new String[]{"_time", "custom"});
 
Author:
Jakub Bednar (bednar@github) (29/06/2018 10:27)
  • Constructor Details

    • TimeShiftFlux

      public TimeShiftFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

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

      @Nonnull public TimeShiftFlux withDuration(@Nonnull Long amount, @Nonnull ChronoUnit unit)
      Parameters:
      amount - The amount to add to each time value
      unit - a ChronoUnit determining how to interpret the amount parameter
      Returns:
      this
    • withDuration

      @Nonnull public TimeShiftFlux withDuration(@Nonnull String amount)
      Parameters:
      amount - The amount to add to each time value
      Returns:
      this
    • withColumns

      @Nonnull public TimeShiftFlux withColumns(@Nonnull String[] columns)
      Parameters:
      columns - The list of all columns that should be shifted.
      Returns:
      this
    • withColumns

      @Nonnull public TimeShiftFlux withColumns(@Nonnull Collection<String> columns)
      Parameters:
      columns - The list of all columns that should be shifted.
      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