Class SketchFrequencies.CountMinSketchFn<InputT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
- org.apache.beam.sdk.extensions.sketching.SketchFrequencies.CountMinSketchFn<InputT>
-
- Type Parameters:
InputT- the type of the elements in the inputPCollection
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- SketchFrequencies
public static class SketchFrequencies.CountMinSketchFn<InputT> extends org.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
Implements theCombine.CombineFnofSketchFrequenciestransforms.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SketchFrequencies.Sketch<InputT>addInput(SketchFrequencies.Sketch<InputT> accumulator, InputT element)static <InputT> SketchFrequencies.CountMinSketchFn<InputT>create(org.apache.beam.sdk.coders.Coder<InputT> coder)Returns aSketchFrequencies.CountMinSketchFncombiner with the given input coder.SketchFrequencies.Sketch<InputT>createAccumulator()SketchFrequencies.Sketch<InputT>extractOutput(SketchFrequencies.Sketch<InputT> accumulator)Output the whole structure so it can be queried, reused or stored easily.java.lang.reflect.TypeVariable<?>getAccumTVariable()org.apache.beam.sdk.coders.Coder<SketchFrequencies.Sketch<InputT>>getAccumulatorCoder(org.apache.beam.sdk.coders.CoderRegistry registry, org.apache.beam.sdk.coders.Coder inputCoder)org.apache.beam.sdk.coders.Coder<OutputT>getDefaultOutputCoder(org.apache.beam.sdk.coders.CoderRegistry arg0, org.apache.beam.sdk.coders.Coder<@UnknownKeyFor @NonNull @Initialized InputT> arg1)java.lang.StringgetIncompatibleGlobalWindowErrorMessage()java.lang.reflect.TypeVariable<?>getInputTVariable()java.lang.reflect.TypeVariable<?>getOutputTVariable()SketchFrequencies.Sketch<InputT>mergeAccumulators(java.lang.Iterable<SketchFrequencies.Sketch<InputT>> accumulators)voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)SketchFrequencies.CountMinSketchFn<InputT>withAccuracy(double epsilon, double confidence)Returns a newSketchFrequencies.CountMinSketchFncombiner with new precision accuracy parametersepsilonandconfidence.
-
-
-
Method Detail
-
create
public static <InputT> SketchFrequencies.CountMinSketchFn<InputT> create(org.apache.beam.sdk.coders.Coder<InputT> coder)
Returns aSketchFrequencies.CountMinSketchFncombiner with the given input coder.
Warning : the coder must be deterministic.- Parameters:
coder- the coder that encodes the elements' type
-
withAccuracy
public SketchFrequencies.CountMinSketchFn<InputT> withAccuracy(double epsilon, double confidence)
Returns a newSketchFrequencies.CountMinSketchFncombiner with new precision accuracy parametersepsilonandconfidence.Keep in mind that the lower the
epsilonvalue, the greater the width, and the greater the confidence, the greater the depth.- Parameters:
epsilon- the error relative to the total number of distinct elementsconfidence- the confidence in the result to not exceed the relative error
-
createAccumulator
public SketchFrequencies.Sketch<InputT> createAccumulator()
- Specified by:
createAccumulatorin classorg.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
addInput
public SketchFrequencies.Sketch<InputT> addInput(SketchFrequencies.Sketch<InputT> accumulator, InputT element)
- Specified by:
addInputin classorg.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
mergeAccumulators
public SketchFrequencies.Sketch<InputT> mergeAccumulators(java.lang.Iterable<SketchFrequencies.Sketch<InputT>> accumulators)
- Specified by:
mergeAccumulatorsin classorg.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
extractOutput
public SketchFrequencies.Sketch<InputT> extractOutput(SketchFrequencies.Sketch<InputT> accumulator)
Output the whole structure so it can be queried, reused or stored easily.- Specified by:
extractOutputin classorg.apache.beam.sdk.transforms.Combine.CombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
getAccumulatorCoder
public org.apache.beam.sdk.coders.Coder<SketchFrequencies.Sketch<InputT>> getAccumulatorCoder(org.apache.beam.sdk.coders.CoderRegistry registry, org.apache.beam.sdk.coders.Coder inputCoder)
- Specified by:
getAccumulatorCoderin interfaceorg.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT,SketchFrequencies.Sketch<InputT>,SketchFrequencies.Sketch<InputT>>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData
-
getDefaultOutputCoder
public org.apache.beam.sdk.coders.Coder<OutputT> getDefaultOutputCoder(org.apache.beam.sdk.coders.CoderRegistry arg0, org.apache.beam.sdk.coders.Coder<@UnknownKeyFor @NonNull @Initialized InputT> arg1) throws org.apache.beam.sdk.coders.CannotProvideCoderException- Specified by:
getDefaultOutputCoderin interfaceorg.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT extends java.lang.Object,AccumT extends java.lang.Object,OutputT extends java.lang.Object>- Throws:
org.apache.beam.sdk.coders.CannotProvideCoderException
-
getIncompatibleGlobalWindowErrorMessage
public java.lang.String getIncompatibleGlobalWindowErrorMessage()
- Specified by:
getIncompatibleGlobalWindowErrorMessagein interfaceorg.apache.beam.sdk.transforms.CombineFnBase.GlobalCombineFn<InputT extends java.lang.Object,AccumT extends java.lang.Object,OutputT extends java.lang.Object>
-
getInputTVariable
public java.lang.reflect.TypeVariable<?> getInputTVariable()
-
getAccumTVariable
public java.lang.reflect.TypeVariable<?> getAccumTVariable()
-
getOutputTVariable
public java.lang.reflect.TypeVariable<?> getOutputTVariable()
-
-