Class ToFlux

All Implemented Interfaces:
Expression, HasImports

public final class ToFlux extends AbstractParametrizedFlux
The To operation takes data from a stream and writes it to a bucket. See SPEC.

Options

  • bucket - The bucket to which data will be written. [string]
  • bucketID - The bucket to which data will be written. [string]
  • org - The organization name of the above bucket. [string]
  • orgID - The organization ID of the above bucket. [string]
  • host - The remote host to write to. [string]
  • token - The authorization token to use when writing to a remote host. [string]
  • timeColumn - The time column of the output. [string]
  • tagColumns - The tag columns of the output.
  • fieldFn - Function that takes a record from the input table and returns an object.

Examples

 Flux flux = Flux
     .from("telegraf")
     .to("my-bucket");
 
 Flux flux = Flux
     .from("telegraf")
     .to("my-bucket", "my-org");
 
Author:
Jakub Bednar (10/10/2018 07:58)
  • Constructor Details

    • ToFlux

      public ToFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

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

      @Nonnull public ToFlux withBucket(@Nonnull String bucket)
      Parameters:
      bucket - The bucket to which data will be written.
      Returns:
      this
    • withBucketID

      @Nonnull public ToFlux withBucketID(@Nonnull String bucketID)
      Parameters:
      bucketID - The ID of the bucket to which data will be written.
      Returns:
      this
    • withOrg

      @Nonnull public ToFlux withOrg(@Nonnull String org)
      Parameters:
      org - The organization name of the above bucket.
      Returns:
      this
    • withOrgID

      @Nonnull public ToFlux withOrgID(@Nonnull String orgID)
      Parameters:
      orgID - The organization name of the above bucket.
      Returns:
      this
    • withHost

      @Nonnull public ToFlux withHost(@Nonnull String host)
      Parameters:
      host - The remote host to write to.
      Returns:
      this
    • withToken

      @Nonnull public ToFlux withToken(@Nonnull String token)
      Parameters:
      token - The authorization token to use when writing to a remote host.
      Returns:
      this
    • withTimeColumn

      @Nonnull public ToFlux withTimeColumn(@Nonnull String timeColumn)
      Parameters:
      timeColumn - The time column of the output.
      Returns:
      this
    • withTagColumns

      @Nonnull public ToFlux withTagColumns(@Nonnull String[] tagColumns)
      Parameters:
      tagColumns - The tag columns of the output.
      Returns:
      this
    • withTagColumns

      @Nonnull public ToFlux withTagColumns(@Nonnull Collection<String> tagColumns)
      Parameters:
      tagColumns - The tag columns of the output.
      Returns:
      this
    • withFieldFunction

      @Nonnull public ToFlux withFieldFunction(@Nonnull String fieldFn)
      Parameters:
      fieldFn - Function that takes a record from the input table and returns an object.
      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