Class GroupFlux

All Implemented Interfaces:
Expression, HasImports

public final class GroupFlux extends AbstractParametrizedFlux
Groups results by a user-specified set of tags. See SPEC.

Options

  • columns - List of columns used to calculate the new group key. Default [] [array of strings]
  • mode - The grouping mode, can be one of by or except. The default is by [string].

Example

 Flux.from("telegraf")
     .range(-30L, ChronoUnit.MINUTES)
     .groupBy(new String[]{"tag_a", "tag_b"});

 Flux.from("telegraf")
     .range(-30L, ChronoUnit.MINUTES)
     .groupBy("tag_a"});

 Flux.from("telegraf")
     .range(-30L, ChronoUnit.MINUTES)
     .groupExcept(new String[]{"tag_c"});
 
Author:
Jakub Bednar (bednar@github) (25/06/2018 14:56)
  • Constructor Details

    • GroupFlux

      public GroupFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

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

      @Nonnull public GroupFlux withBy(@Nonnull String groupBy)
      Parameters:
      groupBy - Group by these specific tag name.
      Returns:
      this
    • withBy

      @Nonnull public GroupFlux withBy(@Nonnull String[] groupBy)
      Parameters:
      groupBy - Group by these specific tag names.
      Returns:
      this
    • withBy

      @Nonnull public GroupFlux withBy(@Nonnull Collection<String> groupBy)
      Parameters:
      groupBy - Group by these specific tag names.
      Returns:
      this
    • withExcept

      @Nonnull public GroupFlux withExcept(@Nonnull String except)
      Parameters:
      except - Group by all but these tag key Cannot be used.
      Returns:
      this
    • withExcept

      @Nonnull public GroupFlux withExcept(@Nonnull String[] except)
      Parameters:
      except - Group by all but these tag keys Cannot be used.
      Returns:
      this
    • withExcept

      @Nonnull public GroupFlux withExcept(@Nonnull Collection<String> except)
      Parameters:
      except - Group by all but these tag keys Cannot be used.
      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