@Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); scanning = IteratorScope.scan.equals(env.getIteratorScope()); if (scanning) { String auths = options.get(AUTH_OPT); if (auths != null && !auths.isEmpty()) { ve = new VisibilityEvaluator(new Authorizations(auths.getBytes(UTF_8))); visibleCache = new LRUMap(100); } } if (options.containsKey(MAX_BUFFER_SIZE_OPT)) { maxBufferSize = ConfigurationTypeHelper .getFixedMemoryAsBytes(options.get(MAX_BUFFER_SIZE_OPT)); } else { maxBufferSize = DEFAULT_MAX_BUFFER_SIZE; } parsedVisibilitiesCache = new LRUMap(100); }
@Override public IteratorEnvironment cloneWithSamplingEnabled() { if (!scope.equals(IteratorScope.scan)) { throw new UnsupportedOperationException(); } SamplerConfigurationImpl sci = SamplerConfigurationImpl.newSamplerConfig(config); if (sci == null) { throw new SampleNotPresentException(); } return new TabletIteratorEnvironment(context, scope, config, trm, files, authorizations, sci, topLevelIterators); }
@Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { if (env != null && !IteratorScope.scan.equals(env.getIteratorScope())) { throw new IOException("This is a scan time only iterator.");
@Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); scanning = IteratorScope.scan.equals(env.getIteratorScope()); if (scanning) { String auths = options.get(AUTH_OPT); if (auths != null && !auths.isEmpty()) { ve = new VisibilityEvaluator(new Authorizations(auths.getBytes(UTF_8))); visibleCache = new LRUMap(100); } } if (options.containsKey(MAX_BUFFER_SIZE_OPT)) { maxBufferSize = AccumuloConfiguration.getMemoryInBytes(options.get(MAX_BUFFER_SIZE_OPT)); } else { maxBufferSize = DEFAULT_MAX_BUFFER_SIZE; } parsedVisibilitiesCache = new LRUMap(100); }
@Override public void init(Map<String, String> options, IteratorEnvironment env) throws IOException { // only run on scan or full major compaction if (!env.getIteratorScope().equals(IteratorUtil.IteratorScope.scan) && !(env.getIteratorScope().equals(IteratorUtil.IteratorScope.majc) && env.isFullMajorCompaction())) { remoteDegTable = null; degMap = null; return; } remoteDegTable = new RemoteSourceIterator(); remoteDegTable.init(null, options, env); degMap = new HashMap<>(); scanDegreeTable(); }
@Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); // MockAccumulo seems to throw in a null env, so this check is here if (env == null) { bypass = false; } else { IteratorScope scope = env.getIteratorScope(); bypass = scope.equals(IteratorScope.minc) || (scope.equals(IteratorScope.majc) && !env.isFullMajorCompaction()); } if (bypass) log.info(this.getClass().getSimpleName() + " only works for scans and full major compactions;" + " Note that full major compactions only work if the entire row is contained in a single locality group."); }
@Override public void init(Map<String, String> options, IteratorEnvironment env) throws IOException { // only run on scan or full major compaction if (!env.getIteratorScope().equals(IteratorUtil.IteratorScope.scan) && !(env.getIteratorScope().equals(IteratorUtil.IteratorScope.majc) && env.isFullMajorCompaction())) { remoteDegTable = null; degMap = null; return; } remoteDegTable = new RemoteSourceIterator(); remoteDegTable.init(null, options, env); degMap = new HashMap<>(); scanDegreeTable(); }
@Override public IteratorEnvironment cloneWithSamplingEnabled() { if (!scope.equals(IteratorScope.scan)) { throw new UnsupportedOperationException(); } SamplerConfigurationImpl sci = SamplerConfigurationImpl.newSamplerConfig(config); if (sci == null) { throw new SampleNotPresentException(); } TabletIteratorEnvironment te = new TabletIteratorEnvironment(scope, config, trm, files, authorizations, sci, topLevelIterators); return te; } }
/** * return true if this is a system initiated majc (a majc that is not a full major compaction) * * @param env */ private boolean isSystemInitiatedMajC(IteratorEnvironment env) { return (env != null && env.getIteratorScope().equals(IteratorUtil.IteratorScope.majc) && !env.isFullMajorCompaction()); }