Class FilterFlux

All Implemented Interfaces:
Expression, HasImports

public final class FilterFlux extends AbstractParametrizedFlux
Filters the results using an expression. See SPEC.

Options

  • fn - Function to when filtering the records. The function must accept a single parameter which will be the records and return a boolean value. Records which evaluate to true, will be included in the results. [function(record) bool]

Example

  Restrictions restriction = Restrictions.and(
          Restrictions.measurement().equal("mem"),
          Restrictions.field().equal("usage_system"),
          Restrictions.tag("service").equal("app-server")
 );

 Flux flux = Flux
          .from("telegraf")
          .filter(restriction)
          .range(-4L, ChronoUnit.HOURS)
          .count();
 
Author:
Jakub Bednar (bednar@github) (28/06/2018 14:12)
  • Constructor Details

    • FilterFlux

      public FilterFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

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

      @Nonnull public FilterFlux withRestrictions(@Nonnull Restrictions restrictions)
      Parameters:
      restrictions - filter restrictions
      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