Class CoreKeyGroupByCombiner
- java.lang.Object
-
- org.apache.accumulo.core.iterators.WrappingIterator
-
- uk.gov.gchq.gaffer.accumulostore.key.core.impl.CoreKeyGroupByCombiner
-
- All Implemented Interfaces:
org.apache.accumulo.core.iterators.OptionDescriber
,org.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
,org.apache.accumulo.core.iterators.YieldingKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Direct Known Subclasses:
CoreKeyGroupByAggregatorIterator
public abstract class CoreKeyGroupByCombiner extends org.apache.accumulo.core.iterators.WrappingIterator implements org.apache.accumulo.core.iterators.OptionDescriber
A copy of Accumulo
Users extending this class must specify a reduce() method.Combiner
but combining values with identical rowKey and column family.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CoreKeyGroupByCombiner.KeyValueIterator
A Java Iterator that iterates over the properties for a given row Key and column family from a sourceSortedKeyValueIterator
.
-
Constructor Summary
Constructors Constructor Description CoreKeyGroupByCombiner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
deepCopy(org.apache.accumulo.core.iterators.IteratorEnvironment env)
org.apache.accumulo.core.iterators.OptionDescriber.IteratorOptions
describeOptions()
org.apache.accumulo.core.data.Key
getTopKey()
org.apache.accumulo.core.data.Value
getTopValue()
boolean
hasTop()
void
init(org.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value> source, Map<String,String> options, org.apache.accumulo.core.iterators.IteratorEnvironment env)
void
next()
abstract Properties
reduce(String group, org.apache.accumulo.core.data.Key key, Iterator<Properties> iter, Set<String> groupBy, ElementAggregator viewAggregator)
Reduces an iterator ofProperties
into a single Properties object.void
seek(org.apache.accumulo.core.data.Range range, Collection<org.apache.accumulo.core.data.ByteSequence> columnFamilies, boolean inclusive)
boolean
validateOptions(Map<String,String> options)
-
-
-
Method Detail
-
getTopKey
public org.apache.accumulo.core.data.Key getTopKey()
- Specified by:
getTopKey
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
getTopKey
in classorg.apache.accumulo.core.iterators.WrappingIterator
-
getTopValue
public org.apache.accumulo.core.data.Value getTopValue()
- Specified by:
getTopValue
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
getTopValue
in classorg.apache.accumulo.core.iterators.WrappingIterator
-
hasTop
public boolean hasTop()
- Specified by:
hasTop
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
hasTop
in classorg.apache.accumulo.core.iterators.WrappingIterator
-
next
public void next() throws IOException
- Specified by:
next
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
next
in classorg.apache.accumulo.core.iterators.WrappingIterator
- Throws:
IOException
-
seek
public void seek(org.apache.accumulo.core.data.Range range, Collection<org.apache.accumulo.core.data.ByteSequence> columnFamilies, boolean inclusive) throws IOException
- Specified by:
seek
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
seek
in classorg.apache.accumulo.core.iterators.WrappingIterator
- Throws:
IOException
-
reduce
public abstract Properties reduce(String group, org.apache.accumulo.core.data.Key key, Iterator<Properties> iter, Set<String> groupBy, ElementAggregator viewAggregator)
Reduces an iterator ofProperties
into a single Properties object.- Parameters:
group
- the schema group taken from the keykey
- The most recent version of the Key being reduced.iter
- An iterator over allProperties
for different versions of the key.groupBy
- the groupBy propertiesviewAggregator
- an optional view aggregator- Returns:
- The combined
Properties
.
-
deepCopy
public org.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value> deepCopy(org.apache.accumulo.core.iterators.IteratorEnvironment env)
- Specified by:
deepCopy
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
deepCopy
in classorg.apache.accumulo.core.iterators.WrappingIterator
-
init
public void init(org.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value> source, Map<String,String> options, org.apache.accumulo.core.iterators.IteratorEnvironment env) throws IOException
- Specified by:
init
in interfaceorg.apache.accumulo.core.iterators.SortedKeyValueIterator<org.apache.accumulo.core.data.Key,org.apache.accumulo.core.data.Value>
- Overrides:
init
in classorg.apache.accumulo.core.iterators.WrappingIterator
- Throws:
IOException
-
validateOptions
public boolean validateOptions(Map<String,String> options)
- Specified by:
validateOptions
in interfaceorg.apache.accumulo.core.iterators.OptionDescriber
-
describeOptions
public org.apache.accumulo.core.iterators.OptionDescriber.IteratorOptions describeOptions()
- Specified by:
describeOptions
in interfaceorg.apache.accumulo.core.iterators.OptionDescriber
-
-