congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Combine$GloballyAsSingletonView
Code IndexAdd Tabnine to your IDE (free)

How to use
Combine$GloballyAsSingletonView
in
org.apache.beam.sdk.transforms

Best Java code snippets using org.apache.beam.sdk.transforms.Combine$GloballyAsSingletonView (Showing top 3 results out of 315)

origin: org.apache.beam/beam-sdks-java-core

/**
 * Returns a {@link PTransform} that produces a {@code PCollectionView} whose elements are the
 * result of combining elements per-window in the input {@code PCollection}. If a value is
 * requested from the view for a window that is not present, the result of applying the {@code
 * CombineFn} to an empty input set will be returned.
 */
public GloballyAsSingletonView<InputT, OutputT> asSingletonView() {
 return new GloballyAsSingletonView<>(fn, fnDisplayData, insertDefault, fanout);
}
origin: org.apache.beam/beam-runners-google-cloud-dataflow-java

 @Override
 public PTransformReplacement<PCollection<InputT>, PValue> getReplacementTransform(
   AppliedPTransform<PCollection<InputT>, PValue, PTransform<PCollection<InputT>, PValue>>
     transform) {
  Combine.GloballyAsSingletonView<?, ?> combineTransform =
    (Combine.GloballyAsSingletonView) transform.getTransform();
  return PTransformReplacement.of(
    PTransformReplacements.getSingletonMainInput(transform),
    new BatchViewOverrides.BatchViewAsSingleton(
      runner,
      findCreatePCollectionView(transform),
      (CombineFn) combineTransform.getCombineFn(),
      combineTransform.getFanout()));
 }
}
origin: org.apache.beam/beam-sdks-java-core

@Test
public void testCombineGetName() {
 assertEquals("Combine.globally(SumInts)", Combine.globally(new SumInts()).getName());
 assertEquals(
   "Combine.GloballyAsSingletonView",
   Combine.globally(new SumInts()).asSingletonView().getName());
 assertEquals("Combine.perKey(Test)", Combine.perKey(new TestCombineFn()).getName());
 assertEquals(
   "Combine.perKeyWithFanout(Test)",
   Combine.perKey(new TestCombineFn()).withHotKeyFanout(10).getName());
}
org.apache.beam.sdk.transformsCombine$GloballyAsSingletonView

Javadoc

Combine.GloballyAsSingletonView takes a PCollectionand returns a PCollectionView whose elements are the result of combining all the elements in each window of the input PCollection, using a specified CombineFn. It is common for InputT ==, but not required. Common combining functions include sums, mins, maxes, and averages of numbers, conjunctions and disjunctions of booleans, statistical aggregations, etc.

Example of use:

 
PCollection pc = ...;

Combining can happen in parallel, with different subsets of the input PCollectionbeing combined separately, and their intermediate results combined further, in an arbitrary tree reduction pattern, until a single result value is produced.

If a value is requested from the view for a window that is not present and insertDefault is true, the result of calling the CombineFn on empty input will returned. If insertDefault is false, an exception will be thrown instead.

By default, the Coder of the output PValue is inferred from the concrete type of the CombineFn's output type OutputT.

See also #perKey/ PerKey and #groupedValues/ GroupedValues, which are useful for combining values associated with each key in a PCollection of KVs.

Most used methods

  • <init>
  • getCombineFn
  • getFanout
  • getName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now