Interface IteratorEnvironment
-
- All Known Implementing Classes:
BaseIteratorEnvironment
public interface IteratorEnvironment
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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)
-
-
-
Method Detail
-
reserveMapFileReader
SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) throws IOException
- Throws:
IOException
-
getConfig
AccumuloConfiguration getConfig()
-
getIteratorScope
IteratorUtil.IteratorScope getIteratorScope()
-
isFullMajorCompaction
boolean isFullMajorCompaction()
-
registerSideChannel
void registerSideChannel(SortedKeyValueIterator<Key,Value> iter)
-
getAuthorizations
Authorizations getAuthorizations()
-
cloneWithSamplingEnabled
IteratorEnvironment cloneWithSamplingEnabled()
Returns a new iterator environment object that can be used to create deep copies over sample data. The new object created will use the current sampling configuration for the table. The existing iterator environment object will not be modified.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; } }
- Throws:
SampleNotPresentException
- when sampling is not configured for table.- Since:
- 1.8.0
-
isSamplingEnabled
boolean isSamplingEnabled()
There are at least two conditions under which sampling will be enabled for an environment. One condition is when sampling is enabled for the scan that starts everything. Another possibility is for a deep copy created with an environment created by callingcloneWithSamplingEnabled()
- Returns:
- true if sampling is enabled for this environment.
- Since:
- 1.8.0
-
getSamplerConfiguration
SamplerConfiguration getSamplerConfiguration()
- Returns:
- sampling configuration is sampling is enabled for environment, otherwise returns null.
- Since:
- 1.8.0
-
-