Interface IteratorEnvironment
public interface IteratorEnvironment
-
Method Summary
Modifier and TypeMethodDescriptiondefault IteratorEnvironment
Returns a new iterator environment object that can be used to create deep copies over sample data.default Authorizations
Return the Scan Authorizations used in this Iterator.default org.apache.accumulo.core.conf.AccumuloConfiguration
Deprecated.since 2.0.0.default IteratorUtil.IteratorScope
Return the executed scope of the Iterator.default PluginEnvironment
Returns an object containing information about the server where this iterator was run.default SamplerConfiguration
default ServiceEnvironment
Deprecated.since 2.1.0.default TableId
Return the table Id associated with this iterator.default boolean
Return true if the compaction is a full major compaction.default boolean
There are at least two conditions under which sampling will be enabled for an environment.default boolean
True if compaction was user initiated.default void
Deprecated.since 2.0.0.default SortedKeyValueIterator<Key,
Value> reserveMapFileReader
(String mapFileName) Deprecated.since 2.0.0.
-
Method Details
-
reserveMapFileReader
@Deprecated(since="2.0.0") default SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) throws IOException Deprecated.since 2.0.0. This is a legacy method used for internal backwards compatibility.- Throws:
IOException
-
getConfig
Deprecated.since 2.0.0. This method was using an unstable non public type. UsegetPluginEnv()
-
getIteratorScope
Return the executed scope of the Iterator. Value will be one of the following:IteratorUtil.IteratorScope.scan
,IteratorUtil.IteratorScope.minc
,IteratorUtil.IteratorScope.majc
-
isFullMajorCompaction
default boolean isFullMajorCompaction()Return true if the compaction is a full major compaction. Will throw IllegalStateException ifgetIteratorScope()
!=IteratorUtil.IteratorScope.majc
. -
registerSideChannel
Deprecated.since 2.0.0. This was an experimental feature and was never tested or documented. -
getAuthorizations
Return the Scan Authorizations used in this Iterator. Will throw UnsupportedOperationException ifgetIteratorScope()
!=IteratorUtil.IteratorScope.scan
. -
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
default 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
- Returns:
- sampling configuration is sampling is enabled for environment, otherwise returns null.
- Since:
- 1.8.0
-
isUserCompaction
default boolean isUserCompaction()True if compaction was user initiated.- Since:
- 2.0.0
-
getServiceEnv
Deprecated.since 2.1.0. This method was using a non public API type. UsegetPluginEnv()
instead because it has better stability guarantees.Returns an object containing information about the server where this iterator was run. To obtain a table configuration, use the following methods:iterEnv.getServiceEnv().getConfiguration(env.getTableId())
- Since:
- 2.0.0
-
getPluginEnv
Returns an object containing information about the server where this iterator was run. To obtain a table configuration, use the following methods:iterEnv.getPluginEnv().getConfiguration(env.getTableId())
- Since:
- 2.1.0
-
getTableId
Return the table Id associated with this iterator.- Since:
- 2.0.0
-