This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit e29b58d561b0d0ae5bc032e87f0aa5474a161f61 Merge: 85796e59b9 74009a5056 Author: Christopher Tubbs <ctubb...@apache.org> AuthorDate: Wed Apr 26 12:23:08 2023 -0400 Merge branch '2.1' .../java/org/apache/accumulo/core/data/Range.java | 22 ++++++------ .../blockfile/cache/tinylfu/TinyLfuBlockCache.java | 2 +- .../system/SourceSwitchingIterator.java | 12 +++---- .../apache/accumulo/core/logging/TabletLogger.java | 2 +- .../core/metadata/schema/TabletMetadata.java | 2 +- .../accumulo/core/spi/crypto/AESCryptoService.java | 4 +-- .../spi/crypto/PerTableCryptoServiceFactory.java | 2 +- .../accumulo/core/spi/fs/DelegatingChooser.java | 4 +-- .../core/spi/fs/PreferredVolumeChooser.java | 2 +- .../core/util/compaction/CompactionJobImpl.java | 2 +- .../org/apache/accumulo/core/WithTestNames.java | 2 +- .../core/conf/AccumuloConfigurationTest.java | 32 ++++++++--------- .../system/SourceSwitchingIteratorTest.java | 7 ++-- .../mapreduce/FileOutputFormatBuilderImpl.java | 12 +++---- .../mapreduce/InputFormatBuilderImpl.java | 6 ++-- .../mapreduce/OutputFormatBuilderImpl.java | 2 +- .../apache/accumulo/hadoop/its/WithTestNames.java | 2 +- .../mapreduce/InputFormatBuilderTest.java | 2 +- .../MiniAccumuloClusterControl.java | 2 +- .../apache/accumulo/minicluster/WithTestNames.java | 2 +- pom.xml | 40 +++++++++++++++------- .../server/client/ClientServiceHandler.java | 9 +++-- .../org/apache/accumulo/server/util/ECAdmin.java | 2 +- .../accumulo/server/util/ManagerMetadataUtil.java | 4 +-- .../org/apache/accumulo/server/WithTestNames.java | 2 +- .../accumulo/server/util/TableDiskUsageTest.java | 15 +++++--- .../org/apache/accumulo/compactor/Compactor.java | 5 +-- .../org/apache/accumulo/manager/WithTestNames.java | 2 +- .../java/org/apache/accumulo/monitor/Monitor.java | 4 +-- .../tserver/TabletServerResourceManager.java | 2 +- .../tserver/compactions/CompactionService.java | 6 ++-- .../org/apache/accumulo/tserver/log/DfsLogger.java | 2 +- .../accumulo/tserver/tablet/CompactableImpl.java | 32 +++++++++-------- .../accumulo/tserver/tablet/DatafileManager.java | 6 ++-- .../org/apache/accumulo/tserver/tablet/Tablet.java | 4 +-- .../org/apache/accumulo/tserver/WithTestNames.java | 2 +- .../tserver/tablet/CompactableImplTest.java | 2 +- .../org/apache/accumulo/harness/WithTestNames.java | 2 +- .../compaction/ExternalCompactionTestUtils.java | 4 +-- .../accumulo/test/functional/MetadataIT.java | 4 +-- .../accumulo/test/functional/YieldingIterator.java | 9 ++--- .../org/apache/accumulo/test/shell/ShellIT.java | 2 +- 42 files changed, 157 insertions(+), 126 deletions(-) diff --cc core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java index 6bf853292a,dc7a600910..51c4930a95 --- a/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java +++ b/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java @@@ -308,10 -310,19 +308,10 @@@ public class AccumuloConfigurationTest assertEquals(Integer.parseInt(Property.TSERV_SCAN_EXECUTORS_DEFAULT_THREADS.getDefaultValue()), sec.maxThreads); assertFalse(sec.priority.isPresent()); - assertTrue(sec.prioritizerClass.get().isEmpty()); + assertTrue(sec.prioritizerClass.orElseThrow().isEmpty()); assertTrue(sec.prioritizerOpts.isEmpty()); - // ensure deprecated props is read if nothing else is set - tc.set("tserver.readahead.concurrent.max", "6"); - assertEquals(6, sec.getCurrentMaxThreads()); - assertEquals(Integer.parseInt(Property.TSERV_SCAN_EXECUTORS_DEFAULT_THREADS.getDefaultValue()), - sec.maxThreads); - ScanExecutorConfig sec2 = tc.getScanExecutors(false).stream() - .filter(c -> c.name.equals(defName)).findFirst().orElseThrow(); - assertEquals(6, sec2.maxThreads); - - // ensure new prop overrides deprecated prop + // ensure new props override default props tc.set(Property.TSERV_SCAN_EXECUTORS_DEFAULT_THREADS.getKey(), "9"); assertEquals(9, sec.getCurrentMaxThreads()); assertEquals(Integer.parseInt(Property.TSERV_SCAN_EXECUTORS_DEFAULT_THREADS.getDefaultValue()), @@@ -328,10 -339,10 +328,10 @@@ assertFalse(sec4.prioritizerClass.isPresent()); assertTrue(sec4.prioritizerOpts.isEmpty()); - tc.set("tserver.metadata.readahead.concurrent.max", "2"); + tc.set(Property.TSERV_SCAN_EXECUTORS_META_THREADS.getKey(), "2"); assertEquals(2, sec4.getCurrentMaxThreads()); - ScanExecutorConfig sec5 = - tc.getScanExecutors(false).stream().filter(c -> c.name.equals("meta")).findFirst().get(); + ScanExecutorConfig sec5 = tc.getScanExecutors(false).stream().filter(c -> c.name.equals("meta")) + .findFirst().orElseThrow(); assertEquals(2, sec5.maxThreads); tc.set(Property.TSERV_SCAN_EXECUTORS_META_THREADS.getKey(), "3"); @@@ -369,11 -379,11 +369,11 @@@ Collection<ScanExecutorConfig> scanServExecutors = tc.getScanExecutors(true); assertEquals(2, scanServExecutors.size()); ScanExecutorConfig sec9 = - scanServExecutors.stream().filter(c -> c.name.equals(defName)).findFirst().get(); + scanServExecutors.stream().filter(c -> c.name.equals(defName)).findFirst().orElseThrow(); - // earlier in the test tserver.readahead.concurrent.max was set to 6 + // verify set to 6 assertEquals(6, sec9.maxThreads); assertFalse(sec9.priority.isPresent()); - assertTrue(sec9.prioritizerClass.get().isEmpty()); + assertTrue(sec9.prioritizerClass.orElseThrow().isEmpty()); assertTrue(sec9.prioritizerOpts.isEmpty()); tc.set(Property.SSERV_SCAN_EXECUTORS_DEFAULT_THREADS.getKey(), "17"); diff --cc server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java index d5f5514c36,76f0692eb8..80504d9895 --- a/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java +++ b/server/base/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java @@@ -397,9 -400,35 +398,10 @@@ public class ClientServiceHandler imple final TableId tableId = checkTableId(context, tableName, null); checkTablePermission(credentials, tableId, TablePermission.ALTER_TABLE); return Optional.of(context.getPropStore().get(TablePropKey.of(context, tableId))) - .map(vProps -> new TVersionedProperties(vProps.getDataVersion(), vProps.asMap())).get(); + .map(vProps -> new TVersionedProperties(vProps.getDataVersion(), vProps.asMap())) + .orElseThrow(); } - @Override - public List<String> bulkImportFiles(TInfo tinfo, final TCredentials credentials, final long tid, - final String tableId, final List<String> files, final String errorDir, final boolean setTime) - throws ThriftSecurityException, ThriftTableOperationException, TException { - try { - if (!security.canPerformSystemActions(credentials)) { - throw new AccumuloSecurityException(credentials.getPrincipal(), - SecurityErrorCode.PERMISSION_DENIED); - } - bulkImportStatus.updateBulkImportStatus(files, BulkImportState.INITIAL); - log.debug("Got request to bulk import files to table({}): {}", tableId, files); - - bulkImportStatus.updateBulkImportStatus(files, BulkImportState.PROCESSING); - try { - return BulkImporter.bulkLoad(context, tid, tableId, files, setTime); - } finally { - bulkImportStatus.removeBulkImportStatus(files); - } - } catch (AccumuloSecurityException e) { - throw e.asThriftException(); - } catch (Exception ex) { - throw new TException(ex); - } - } - @Override public boolean isActive(TInfo tinfo, long tid) { return transactionWatcher.isActive(tid);