public class BaseIteratorEnvironment extends Object implements IteratorEnvironment
IteratorEnvironment
that throws
UnsupportedOperationException
for each operation. This is useful for situations that need
to extend IteratorEnvironment
and implement a subset of the methods.Constructor and Description |
---|
BaseIteratorEnvironment() |
Modifier and Type | Method and Description |
---|---|
IteratorEnvironment |
cloneWithSamplingEnabled()
Returns a new iterator environment object that can be used to create deep copies over sample
data.
|
Authorizations |
getAuthorizations() |
AccumuloConfiguration |
getConfig() |
IteratorUtil.IteratorScope |
getIteratorScope() |
SamplerConfiguration |
getSamplerConfiguration() |
boolean |
isFullMajorCompaction() |
boolean |
isSamplingEnabled()
There are at least two conditions under which sampling will be enabled for an environment.
|
void |
registerSideChannel(SortedKeyValueIterator<Key,Value> iter) |
SortedKeyValueIterator<Key,Value> |
reserveMapFileReader(String mapFileName) |
public SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) throws IOException
reserveMapFileReader
in interface IteratorEnvironment
IOException
public AccumuloConfiguration getConfig()
getConfig
in interface IteratorEnvironment
public IteratorUtil.IteratorScope getIteratorScope()
getIteratorScope
in interface IteratorEnvironment
public boolean isFullMajorCompaction()
isFullMajorCompaction
in interface IteratorEnvironment
public void registerSideChannel(SortedKeyValueIterator<Key,Value> iter)
registerSideChannel
in interface IteratorEnvironment
public Authorizations getAuthorizations()
getAuthorizations
in interface IteratorEnvironment
public boolean isSamplingEnabled()
IteratorEnvironment
IteratorEnvironment.cloneWithSamplingEnabled()
isSamplingEnabled
in interface IteratorEnvironment
public SamplerConfiguration getSamplerConfiguration()
getSamplerConfiguration
in interface IteratorEnvironment
public IteratorEnvironment cloneWithSamplingEnabled()
IteratorEnvironment
Since sample data could be created in many different ways, a good practice for an iterator is to verify the sampling configuration is as expected.
class MyIter implements SortedKeyValueIterator<Key,Value> {
SortedKeyValueIterator<Key,Value> source;
SortedKeyValueIterator<Key,Value> sampleIter;
@Override
void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
IteratorEnvironment env) {
IteratorEnvironment sampleEnv = env.cloneWithSamplingEnabled();
//do some sanity checks on sampling config
validateSamplingConfiguration(sampleEnv.getSamplerConfiguration());
sampleIter = source.deepCopy(sampleEnv);
this.source = source;
}
}
cloneWithSamplingEnabled
in interface IteratorEnvironment
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.