diff --git a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/DataTypeAgeOffFilter.java b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/DataTypeAgeOffFilter.java index a9d7ee7f54b..61fad75f063 100644 --- a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/DataTypeAgeOffFilter.java +++ b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/DataTypeAgeOffFilter.java @@ -269,8 +269,8 @@ protected void init(FilterOptions options, final long scanStart, IteratorEnviron isIndextable = false; if (options.getOption(AgeOffConfigParams.IS_INDEX_TABLE) == null) { - if (iterEnv != null && iterEnv.getConfig() != null) { - isIndextable = Boolean.parseBoolean(iterEnv.getConfig().get("table.custom." + AgeOffConfigParams.IS_INDEX_TABLE)); + if (iterEnv != null && iterEnv.getPluginEnv().getConfiguration() != null) { + isIndextable = Boolean.parseBoolean(iterEnv.getPluginEnv().getConfiguration().get("table.custom." + AgeOffConfigParams.IS_INDEX_TABLE)); } } else { // legacy isIndextable = Boolean.valueOf(options.getOption(AgeOffConfigParams.IS_INDEX_TABLE)); @@ -298,7 +298,7 @@ protected void init(FilterOptions options, final long scanStart, IteratorEnviron final String dataTypeHasScanTime = options.getOption(dataType + ".hasScanTime"); if (Boolean.parseBoolean(dataTypeHasScanTime)) { if (iterEnv != null) { - final String scanTime = iterEnv.getConfig().get("table.custom.timestamp.current." + dataType); + final String scanTime = iterEnv.getPluginEnv().getConfiguration().get("table.custom.timestamp.current." + dataType); try { dataTypeScanTimes.put(dataType, Long.parseLong(scanTime, 10)); } catch (final NumberFormatException e) { diff --git a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/FieldAgeOffFilter.java b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/FieldAgeOffFilter.java index 53d230868e8..9888f06dabe 100644 --- a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/FieldAgeOffFilter.java +++ b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/FieldAgeOffFilter.java @@ -8,6 +8,7 @@ import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; +import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.hadoop.io.Text; @@ -266,8 +267,8 @@ protected void init(FilterOptions options, final long startScan, IteratorEnviron isIndextable = false; if (options.getOption(AgeOffConfigParams.IS_INDEX_TABLE) == null) { - if (iterEnv != null && iterEnv.getConfig() != null) { - isIndextable = Boolean.parseBoolean(iterEnv.getConfig().get("table.custom." + AgeOffConfigParams.IS_INDEX_TABLE)); + if (iterEnv != null && iterEnv.getPluginEnv().getConfiguration() != null) { + isIndextable = Boolean.parseBoolean(iterEnv.getPluginEnv().getConfiguration().get("table.custom." + AgeOffConfigParams.IS_INDEX_TABLE)); } } else { // legacy isIndextable = Boolean.parseBoolean(options.getOption(AgeOffConfigParams.IS_INDEX_TABLE)); diff --git a/warehouse/age-off/src/test/java/datawave/iterators/filter/ageoff/ConfigurableIteratorEnvironment.java b/warehouse/age-off/src/test/java/datawave/iterators/filter/ageoff/ConfigurableIteratorEnvironment.java index ac1841d9ea7..4e6197e5377 100644 --- a/warehouse/age-off/src/test/java/datawave/iterators/filter/ageoff/ConfigurableIteratorEnvironment.java +++ b/warehouse/age-off/src/test/java/datawave/iterators/filter/ageoff/ConfigurableIteratorEnvironment.java @@ -65,11 +65,6 @@ public boolean isUserCompaction() { throw new UnsupportedOperationException(); } - @Override - public void registerSideChannel(SortedKeyValueIterator sortedKeyValueIterator) { - throw new UnsupportedOperationException(); - } - @Override public Authorizations getAuthorizations() { throw new UnsupportedOperationException(); @@ -96,7 +91,11 @@ public PluginEnvironment getPluginEnv() { @Override public Configuration getConfiguration() { - return null; + if (conf != null) { + return new ConfigurationImpl(conf); + } else { + return null; + } } @Override diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java index e053efc798a..f8e72cbe937 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java @@ -5,29 +5,16 @@ import org.apache.accumulo.core.client.PluginEnvironment; import org.apache.accumulo.core.client.SampleNotPresentException; import org.apache.accumulo.core.client.sample.SamplerConfiguration; -import org.apache.accumulo.core.conf.AccumuloConfiguration; -import org.apache.accumulo.core.conf.DefaultConfiguration; -import org.apache.accumulo.core.data.Key; -import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope; -import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.security.Authorizations; -import org.apache.accumulo.core.spi.common.ServiceEnvironment; public class BulkIteratorEnvironment implements IteratorEnvironment { private IteratorScope scope; - private AccumuloConfiguration conf; public BulkIteratorEnvironment(IteratorScope scope) { this.scope = scope; - this.conf = DefaultConfiguration.getInstance(); - } - - @Override - public AccumuloConfiguration getConfig() { - return conf; } @Override @@ -45,11 +32,6 @@ public boolean isUserCompaction() { throw new UnsupportedOperationException(); } - @Override - public void registerSideChannel(SortedKeyValueIterator iter) { - throw new UnsupportedOperationException(); - } - @Override public Authorizations getAuthorizations() { throw new UnsupportedOperationException(); @@ -70,17 +52,6 @@ public SamplerConfiguration getSamplerConfiguration() { return null; } - @Override - public SortedKeyValueIterator reserveMapFileReader(String mapFileName) throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public ServiceEnvironment getServiceEnv() { - return null; - } - @Override public PluginEnvironment getPluginEnv() { return null; diff --git a/warehouse/ingest-core/src/test/java/datawave/iterators/PropogatingIteratorTest.java b/warehouse/ingest-core/src/test/java/datawave/iterators/PropogatingIteratorTest.java index f4ca220a6dd..f55590a0a37 100644 --- a/warehouse/ingest-core/src/test/java/datawave/iterators/PropogatingIteratorTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/iterators/PropogatingIteratorTest.java @@ -123,11 +123,6 @@ public boolean isUserCompaction() { return isUser; } - @Override - public void registerSideChannel(SortedKeyValueIterator iter) { - throw new UnsupportedOperationException(); - } - @Override public Authorizations getAuthorizations() { throw new UnsupportedOperationException(); diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/IteratorThreadPoolManager.java b/warehouse/query-core/src/main/java/datawave/core/iterators/IteratorThreadPoolManager.java index 88a97e31919..a1b543104bc 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/IteratorThreadPoolManager.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/IteratorThreadPoolManager.java @@ -11,8 +11,6 @@ import java.util.concurrent.TimeUnit; import org.apache.accumulo.core.client.PluginEnvironment; -import org.apache.accumulo.core.conf.AccumuloConfiguration; -import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.log4j.Logger; @@ -42,14 +40,11 @@ private IteratorThreadPoolManager(IteratorEnvironment env) { } private ThreadPoolExecutor createExecutorService(final String prop, final String name, final IteratorEnvironment env) { - final AccumuloConfiguration accumuloConfiguration; final PluginEnvironment pluginEnv; if (env != null) { pluginEnv = env.getPluginEnv(); - accumuloConfiguration = env.getConfig(); } else { pluginEnv = null; - accumuloConfiguration = DefaultConfiguration.getInstance(); } final ThreadPoolExecutor service = createExecutorService(getMaxThreads(prop, pluginEnv), name + " (" + instanceId + ')'); threadPools.put(name, service); diff --git a/warehouse/query-core/src/main/java/datawave/mr/bulk/RecordIterator.java b/warehouse/query-core/src/main/java/datawave/mr/bulk/RecordIterator.java index 11315035581..ef96f25a5c0 100644 --- a/warehouse/query-core/src/main/java/datawave/mr/bulk/RecordIterator.java +++ b/warehouse/query-core/src/main/java/datawave/mr/bulk/RecordIterator.java @@ -175,11 +175,6 @@ public RFileEnvironment() { this.conf = DefaultConfiguration.getInstance(); } - @Override - public AccumuloConfiguration getConfig() { - return conf; - } - @Override public IteratorScope getIteratorScope() { return IteratorScope.scan; @@ -215,11 +210,6 @@ public SamplerConfiguration getSamplerConfiguration() { return null; } - @Override - public ServiceEnvironment getServiceEnv() { - return null; - } - @Override public PluginEnvironment getPluginEnv() { return null; diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java index cc184abbe26..af2640b196f 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryIterator.java @@ -266,7 +266,7 @@ public void init(SortedKeyValueIterator source, Map op // update ActiveQueryLog with (potentially) updated config if (env != null) { - ActiveQueryLog.setConfig(env.getConfig()); + ActiveQueryLog.setConfig(env.getPluginEnv().getConfiguration()); } DatawaveFieldIndexListIteratorJexl.FSTManager.setHdfsFileSystem(this.getFileSystemCache()); diff --git a/warehouse/query-core/src/main/java/datawave/query/metrics/AccumuloRecordWriter.java b/warehouse/query-core/src/main/java/datawave/query/metrics/AccumuloRecordWriter.java index 2e051bf33a6..f2db8afed9c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/metrics/AccumuloRecordWriter.java +++ b/warehouse/query-core/src/main/java/datawave/query/metrics/AccumuloRecordWriter.java @@ -227,7 +227,7 @@ public void close(TaskAttemptContext attempt) throws IOException, InterruptedExc if (e.getSecurityErrorCodes().size() >= 0) { HashSet tables = new HashSet<>(); for (TabletId tabletId : e.getSecurityErrorCodes().keySet()) { - tables.add(tabletId.getTableId().toString()); + tables.add(tabletId.getTable().toString()); } log.error("Not authorized to write to tables : " + tables); diff --git a/warehouse/query-core/src/main/java/datawave/query/tracking/ActiveQueryLog.java b/warehouse/query-core/src/main/java/datawave/query/tracking/ActiveQueryLog.java index 0c4fc79ed6b..3c00a0b05aa 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tracking/ActiveQueryLog.java +++ b/warehouse/query-core/src/main/java/datawave/query/tracking/ActiveQueryLog.java @@ -10,7 +10,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.ReentrantReadWriteLock; -import org.apache.accumulo.core.conf.AccumuloConfiguration; +import org.apache.accumulo.core.client.PluginEnvironment; import org.apache.accumulo.core.data.Range; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; @@ -25,7 +25,7 @@ public class ActiveQueryLog { private static final Logger log = Logger.getLogger(ActiveQueryLog.class); private static Cache logCache = null; private static final Object logCacheLock = new Object(); - private static AccumuloConfiguration conf = null; + private static PluginEnvironment.Configuration conf = null; // Accumulo properties public static final String MAX_IDLE = "datawave.query.active.maxIdleMs"; @@ -50,9 +50,9 @@ public class ActiveQueryLog { private final String name; - synchronized public static void setConfig(final AccumuloConfiguration conf) { + synchronized public static void setConfig(final PluginEnvironment.Configuration conf) { if (conf != null) { - if (ActiveQueryLog.conf == null || conf.getUpdateCount() > ActiveQueryLog.conf.getUpdateCount()) { + if (ActiveQueryLog.conf == null) { ActiveQueryLog.conf = conf; } // Do not allow access to the cache while updating each log's settings. @@ -126,7 +126,7 @@ private ActiveQueryLog() { this(null, null); } - private ActiveQueryLog(AccumuloConfiguration conf, String name) { + private ActiveQueryLog(PluginEnvironment.Configuration conf, String name) { if (conf != null) { checkSettings(conf, true); } else { @@ -217,7 +217,7 @@ public void setMaxIdle(long maxIdle) { } } - private void checkSettings(AccumuloConfiguration conf, boolean useDefaults) { + private void checkSettings(PluginEnvironment.Configuration conf, boolean useDefaults) { String maxIdleStr = conf.get(MAX_IDLE); if (maxIdleStr != null) { diff --git a/warehouse/query-core/src/main/java/datawave/query/util/cache/AccumuloLoader.java b/warehouse/query-core/src/main/java/datawave/query/util/cache/AccumuloLoader.java index 3ef98387a2e..1b0336c0262 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/cache/AccumuloLoader.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/cache/AccumuloLoader.java @@ -142,7 +142,7 @@ protected void build(K key, String myTableName) throws TableNotFoundException { public boolean equals(Object obj) { if (obj instanceof AccumuloLoader) { AccumuloLoader loaderObj = AccumuloLoader.class.cast(obj); - if (client.instanceOperations().getInstanceID().equals(loaderObj.client.instanceOperations().getInstanceID())) { + if (client.instanceOperations().getInstanceId().equals(loaderObj.client.instanceOperations().getInstanceId())) { if (tableName.equals(loaderObj.tableName)) return true; } @@ -152,7 +152,7 @@ public boolean equals(Object obj) { @Override public int hashCode() { - return tableName.hashCode() + 31 + client.instanceOperations().getInstanceID().hashCode(); + return tableName.hashCode() + 31 + client.instanceOperations().getInstanceId().hashCode(); } } diff --git a/warehouse/query-core/src/main/java/datawave/query/util/metadata/LoaderKey.java b/warehouse/query-core/src/main/java/datawave/query/util/metadata/LoaderKey.java index 75e1d6f6735..9ad35dd5b1e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/metadata/LoaderKey.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/metadata/LoaderKey.java @@ -17,13 +17,13 @@ public LoaderKey(AccumuloClient client, String table, String user) { } public int hashCode() { - return client.instanceOperations().getInstanceID().hashCode() + table.hashCode() + user.hashCode(); + return client.instanceOperations().getInstanceId().hashCode() + table.hashCode() + user.hashCode(); } public boolean equals(Object other) { if (other instanceof LoaderKey) { LoaderKey otherLoader = (LoaderKey) other; - return otherLoader.client.instanceOperations().getInstanceID().equals(client.instanceOperations().getInstanceID()) + return otherLoader.client.instanceOperations().getInstanceId().equals(client.instanceOperations().getInstanceId()) && otherLoader.table.equals(table) && otherLoader.user.equals(user); } return false; @@ -31,7 +31,7 @@ public boolean equals(Object other) { @Override public String toString() { - return client.instanceOperations().getInstanceID() + "/" + "/" + table + "/" + user; + return client.instanceOperations().getInstanceId() + "/" + "/" + table + "/" + user; } } diff --git a/warehouse/query-core/src/test/java/datawave/query/discovery/DiscoveryIteratorTest.java b/warehouse/query-core/src/test/java/datawave/query/discovery/DiscoveryIteratorTest.java index 1ac3c24e829..a2c2d3f32a9 100644 --- a/warehouse/query-core/src/test/java/datawave/query/discovery/DiscoveryIteratorTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/discovery/DiscoveryIteratorTest.java @@ -19,7 +19,6 @@ import org.apache.accumulo.core.client.IteratorSetting; import org.apache.accumulo.core.client.MutationsRejectedException; import org.apache.accumulo.core.client.Scanner; -import org.apache.accumulo.core.client.security.tokens.PasswordToken; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Range; @@ -27,7 +26,6 @@ import org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator; import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.ColumnVisibility; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.ArrayWritable; import org.apache.hadoop.io.DataInputBuffer; import org.apache.hadoop.io.Writable; @@ -39,9 +37,7 @@ import datawave.accumulo.inmemory.InMemoryAccumuloClient; import datawave.accumulo.inmemory.InMemoryInstance; -import datawave.ingest.data.config.ingest.AccumuloHelper; import datawave.ingest.protobuf.Uid; -import datawave.query.iterator.SourceManagerTest; public class DiscoveryIteratorTest { diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/ParentQueryIteratorTest.java b/warehouse/query-core/src/test/java/datawave/query/iterator/ParentQueryIteratorTest.java index e58922346a0..e0a47eb0ac4 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/ParentQueryIteratorTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/ParentQueryIteratorTest.java @@ -12,6 +12,7 @@ import java.util.Set; import java.util.SortedMap; +import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.Value; diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/SourceManagerTest.java b/warehouse/query-core/src/test/java/datawave/query/iterator/SourceManagerTest.java index 3a1eaee6241..f6078474479 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/SourceManagerTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/SourceManagerTest.java @@ -363,26 +363,11 @@ public MockIteratorEnvironment() { this.conf = DefaultConfiguration.getInstance(); } - @Override - public SortedKeyValueIterator reserveMapFileReader(String mapFileName) throws IOException { - Configuration conf = new Configuration(); - FileSystem fs = FileSystem.get(conf); - CryptoService cs = CryptoFactoryLoader.getServiceForClient(CryptoEnvironment.Scope.TABLE, - DefaultConfiguration.getInstance().getAllCryptoProperties()); - return RFileOperations.getInstance().newReaderBuilder().forFile(mapFileName, fs, conf, cs) - .withTableConfiguration(DefaultConfiguration.getInstance()).seekToBeginning().build(); - } - @Override public PluginEnvironment getPluginEnv() { return new MockPluginEnvironment(); } - @Override - public AccumuloConfiguration getConfig() { - return conf; - } - @Override public IteratorScope getIteratorScope() { return IteratorScope.scan; @@ -418,11 +403,6 @@ public SamplerConfiguration getSamplerConfiguration() { return null; } - @Override - public void registerSideChannel(SortedKeyValueIterator iter) { - throw new UnsupportedOperationException(); - } - public class MockPluginEnvironment implements PluginEnvironment { @Override public Configuration getConfiguration() {