public class DeduplicateMergeFunction extends Object implements MergeFunction<KeyValue>
MergeFunction
where key is primary key (unique) and value is the full record, only keep
the latest one.Modifier and Type | Method and Description |
---|---|
void |
add(KeyValue kv)
Add the given
KeyValue to the merge function. |
static MergeFunctionFactory<KeyValue> |
factory() |
static MergeFunctionFactory<KeyValue> |
factory(Options options) |
KeyValue |
getResult()
Get current merged value.
|
boolean |
requireCopy() |
void |
reset()
Reset the merge function to its default state, call this before calling
MergeFunction.add(KeyValue) for the first time or after MergeFunction.getResult() . |
public void reset()
MergeFunction
MergeFunction.add(KeyValue)
for the first time or after MergeFunction.getResult()
.reset
in interface MergeFunction<KeyValue>
public void add(KeyValue kv)
MergeFunction
KeyValue
to the merge function.add
in interface MergeFunction<KeyValue>
public KeyValue getResult()
MergeFunction
getResult
in interface MergeFunction<KeyValue>
public boolean requireCopy()
requireCopy
in interface MergeFunction<KeyValue>
public static MergeFunctionFactory<KeyValue> factory()
public static MergeFunctionFactory<KeyValue> factory(Options options)
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.