public interface IteratorEnvironment
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) |
SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) throws IOException
IOException
AccumuloConfiguration getConfig()
IteratorUtil.IteratorScope getIteratorScope()
boolean isFullMajorCompaction()
void registerSideChannel(SortedKeyValueIterator<Key,Value> iter)
Authorizations getAuthorizations()
IteratorEnvironment cloneWithSamplingEnabled()
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;
}
}
SampleNotPresentException
- when sampling is not configured for table.boolean isSamplingEnabled()
cloneWithSamplingEnabled()
SamplerConfiguration getSamplerConfiguration()
Copyright © 2011–2017 The Apache Software Foundation. All rights reserved.