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

How to use
compact
method
in
org.apache.beam.sdk.transforms.Combine$CombineFn

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

origin: org.apache.beam/beam-runners-direct-java

 @FinishBundle
 public void outputAccumulators(FinishBundleContext context) {
  for (Map.Entry<WindowedStructuralKey<K>, AccumT> preCombineEntry : accumulators.entrySet()) {
   context.output(
     KV.of(preCombineEntry.getKey().getKey(), combineFn.compact(preCombineEntry.getValue())),
     timestamps.get(preCombineEntry.getKey()),
     preCombineEntry.getKey().getWindow());
  }
  accumulators = null;
  timestamps = null;
 }
}
origin: org.apache.beam/beam-sdks-java-core

@Override
public Object[] compact(Object[] accumulator) {
 for (int i = 0; i < combineFnCount; ++i) {
  accumulator[i] = combineFns.get(i).compact(accumulator[i]);
 }
 return accumulator;
}
origin: org.apache.beam/beam-sdks-java-core

private static <InputT, AccumT, OutputT> List<AccumT> combineInputs(
  CombineFn<InputT, AccumT, OutputT> fn, Iterable<? extends Iterable<InputT>> shards) {
 List<AccumT> accumulators = new ArrayList<>();
 int maybeCompact = 0;
 for (Iterable<InputT> shard : shards) {
  AccumT accumulator = fn.createAccumulator();
  for (InputT elem : shard) {
   accumulator = fn.addInput(accumulator, elem);
  }
  if (maybeCompact++ % 2 == 0) {
   accumulator = fn.compact(accumulator);
  }
  accumulators.add(accumulator);
 }
 return accumulators;
}
origin: org.apache.beam/beam-sdks-java-core

@Override
public AccumT compact(AccumT accumulator) {
 return fn.compact(accumulator);
}
origin: org.apache.beam/beam-sdks-java-core

@Override
public AccumT compact(AccumT accumulator) {
 return fn.compact(accumulator);
}
origin: org.apache.beam/beam-runners-core-java

 @Override
 public AccumT compact(
   AccumT accumulator,
   PipelineOptions options,
   SideInputReader sideInputReader,
   Collection<? extends BoundedWindow> windows) {
  return combineFn.compact(accumulator);
 }
}
origin: org.apache.beam/beam-sdks-java-core

@Override
public AccumT compact(AccumT accumulator, Context c) {
 return combineFn.compact(accumulator);
}
org.apache.beam.sdk.transformsCombine$CombineFncompact

Javadoc

Returns an accumulator that represents the same logical value as the input accumulator, but may have a more compact representation.

For most CombineFns this would be a no-op, but should be overridden by CombineFns that (for example) buffer up elements and combine them in batches.

For efficiency, the input accumulator may be modified and returned.

By default returns the original accumulator.

Popular methods of Combine$CombineFn

  • getAccumulatorCoder
  • addInput
    Adds the given input value to the given accumulator, returning the new accumulator value.For efficie
  • createAccumulator
    Returns a new, mutable accumulator value, representing the accumulation of zero input values.
  • extractOutput
    Returns the output value that is the result of combining all the input values represented by the giv
  • mergeAccumulators
    Returns an accumulator representing the accumulation of all the input values accumulated in the merg
  • getOutputType
    Returns a TypeDescriptor capturing what is known statically about the output type of this CombineFn
  • apply
    Applies this CombineFn to a collection of input values to produce a combined output value.Useful whe
  • defaultValue
    By default returns the extract output of an empty accumulator.
  • getDefaultOutputCoder
  • getIncompatibleGlobalWindowErrorMessage
  • populateDisplayData
  • populateDisplayData

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JComboBox (javax.swing)
  • Top 12 Jupyter Notebook Extensions
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