You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2018/09/20 17:48:05 UTC
[accumulo] 03/09: Replaced uses of Connector with AccumuloClient
#636
This is an automated email from the ASF dual-hosted git repository.
mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 3a6e76d54c91f8eb37ae1e4f8b2982f30db9fb81
Author: Mike Miller <mm...@apache.org>
AuthorDate: Thu Sep 6 16:38:29 2018 -0400
Replaced uses of Connector with AccumuloClient #636
---
.../core/client/mapred/AbstractInputFormat.java | 8 +-
.../core/client/mapred/AccumuloOutputFormat.java | 8 +-
.../core/client/mapreduce/AbstractInputFormat.java | 8 +-
.../client/mapreduce/AccumuloOutputFormat.java | 8 +-
.../mapreduce/lib/impl/ConfiguratorBase.java | 16 +-
.../mapreduce/lib/impl/InputConfigurator.java | 4 +-
.../mapreduce/lib/impl/MapReduceClientOpts.java | 4 +-
.../mapreduce/lib/impl/ConfiguratorBaseTest.java | 4 +-
.../org/apache/accumulo/core/cli/ClientOpts.java | 14 +-
.../accumulo/core/client/ClientConfiguration.java | 2 +-
.../apache/accumulo/core/client/ClientInfo.java | 2 +-
.../org/apache/accumulo/core/client/Instance.java | 2 +-
.../accumulo/core/client/ZooKeeperInstance.java | 8 +-
.../accumulo/core/client/impl/ClientContext.java | 10 +-
.../core/client/impl/ClientInfoFactory.java | 6 +-
.../accumulo/core/client/impl/ConnectorImpl.java | 448 ---------------------
.../accumulo/core/client/impl/Credentials.java | 6 +-
.../accumulo/core/client/impl/OfflineIterator.java | 4 +-
.../client/impl/ReplicationOperationsImpl.java | 6 +-
.../core/metadata/schema/MetadataScanner.java | 8 +-
.../core/replication/ReplicationTable.java | 14 +-
.../java/org/apache/accumulo/core/util/Merge.java | 16 +-
.../core/client/impl/TableOperationsImplTest.java | 13 +-
.../core/metadata/MetadataServicerTest.java | 4 +-
.../org/apache/accumulo/core/util/MergeTest.java | 8 +-
.../apache/accumulo/cluster/AccumuloCluster.java | 11 +
.../standalone/StandaloneAccumuloCluster.java | 10 +-
.../accumulo/minicluster/MiniAccumuloCluster.java | 20 +-
.../minicluster/impl/MiniAccumuloClusterImpl.java | 13 +-
.../MiniAccumuloClusterExistingZooKeepersTest.java | 4 +-
.../MiniAccumuloClusterStartStopTest.java | 4 +-
.../minicluster/MiniAccumuloClusterTest.java | 8 +-
.../impl/MiniAccumuloClusterImplTest.java | 4 +-
.../org/apache/accumulo/proxy/ProxyServer.java | 26 +-
.../org/apache/accumulo/server/ServerContext.java | 13 +-
.../server/master/state/MetaDataTableScanner.java | 6 +-
.../accumulo/server/problems/ProblemReports.java | 11 +-
.../replication/PrintReplicationRecords.java | 6 +-
.../server/replication/ReplicationUtil.java | 6 +-
.../accumulo/server/replication/WorkAssigner.java | 4 +-
.../org/apache/accumulo/server/util/Admin.java | 55 +--
.../apache/accumulo/server/util/LocalityCheck.java | 6 +-
.../accumulo/server/util/MetadataTableUtil.java | 16 +-
.../apache/accumulo/server/util/RandomWriter.java | 6 +-
.../accumulo/server/util/RandomizeVolumes.java | 6 +-
.../server/util/RemoveEntriesForMissingFiles.java | 8 +-
.../accumulo/server/util/ReplicationTableUtil.java | 6 +-
.../accumulo/server/util/TableDiskUsage.java | 15 +-
.../server/util/VerifyTabletAssignments.java | 4 +-
.../server/security/SystemCredentialsTest.java | 6 +-
.../server/util/ReplicationTableUtilTest.java | 4 +-
.../accumulo/gc/GarbageCollectWriteAheadLogs.java | 4 +-
.../apache/accumulo/gc/SimpleGarbageCollector.java | 14 +-
.../replication/CloseWriteAheadLogReferences.java | 6 +-
.../gc/GarbageCollectWriteAheadLogsTest.java | 8 +-
.../java/org/apache/accumulo/master/Master.java | 8 +-
.../master/MasterClientServiceHandler.java | 6 +-
.../apache/accumulo/master/TabletGroupWatcher.java | 10 +-
.../DistributedWorkQueueWorkAssigner.java | 10 +-
.../master/replication/FinishedWorkUpdater.java | 6 +-
.../RemoveCompleteReplicationRecords.java | 8 +-
.../master/replication/ReplicationDriver.java | 4 +-
.../master/replication/SequentialWorkAssigner.java | 4 +-
.../accumulo/master/replication/StatusMaker.java | 6 +-
.../master/replication/UnorderedWorkAssigner.java | 4 +-
.../accumulo/master/replication/WorkDriver.java | 8 +-
.../accumulo/master/replication/WorkMaker.java | 6 +-
.../apache/accumulo/master/state/MergeStats.java | 15 +-
.../apache/accumulo/master/tableOps/CleanUp.java | 4 +-
.../accumulo/master/tableOps/CompactionDriver.java | 4 +-
.../accumulo/master/tableOps/WriteExportFiles.java | 6 +-
.../tableOps/bulkVer1/CleanUpBulkImport.java | 4 +-
.../master/tableOps/bulkVer1/CopyFailed.java | 4 +-
.../tableOps/bulkVer2/CleanUpBulkImport.java | 4 +-
.../replication/SequentialWorkAssignerTest.java | 6 +-
.../replication/UnorderedWorkAssignerTest.java | 6 +-
.../java/org/apache/accumulo/monitor/Monitor.java | 4 +-
.../rest/replication/ReplicationResource.java | 4 +-
.../monitor/rest/trace/TracesResource.java | 4 +-
.../java/org/apache/accumulo/tracer/TraceDump.java | 6 +-
.../org/apache/accumulo/tracer/TraceServer.java | 30 +-
.../apache/accumulo/tracer/TraceTableStats.java | 4 +-
.../BatchWriterReplicationReplayerTest.java | 6 +-
.../main/java/org/apache/accumulo/shell/Shell.java | 53 +--
.../accumulo/shell/commands/AddAuthsCommand.java | 7 +-
.../accumulo/shell/commands/AddSplitsCommand.java | 4 +-
.../shell/commands/AuthenticateCommand.java | 2 +-
.../accumulo/shell/commands/CloneTableCommand.java | 2 +-
.../accumulo/shell/commands/CompactCommand.java | 4 +-
.../accumulo/shell/commands/ConfigCommand.java | 31 +-
.../accumulo/shell/commands/ConstraintCommand.java | 19 +-
.../shell/commands/CreateNamespaceCommand.java | 10 +-
.../shell/commands/CreateTableCommand.java | 22 +-
.../accumulo/shell/commands/CreateUserCommand.java | 4 +-
.../apache/accumulo/shell/commands/DUCommand.java | 7 +-
.../shell/commands/DeleteAuthsCommand.java | 12 +-
.../accumulo/shell/commands/DeleteCommand.java | 3 +-
.../accumulo/shell/commands/DeleteIterCommand.java | 8 +-
.../accumulo/shell/commands/DeleteManyCommand.java | 4 +-
.../shell/commands/DeleteNamespaceCommand.java | 6 +-
.../accumulo/shell/commands/DeleteRowsCommand.java | 2 +-
.../shell/commands/DeleteTableCommand.java | 2 +-
.../accumulo/shell/commands/DropUserCommand.java | 4 +-
.../shell/commands/ExportTableCommand.java | 2 +-
.../accumulo/shell/commands/FlushCommand.java | 2 +-
.../accumulo/shell/commands/FormatterCommand.java | 4 +-
.../accumulo/shell/commands/GetAuthsCommand.java | 5 +-
.../accumulo/shell/commands/GetGroupsCommand.java | 2 +-
.../accumulo/shell/commands/GetSplitsCommand.java | 8 +-
.../accumulo/shell/commands/GrantCommand.java | 8 +-
.../accumulo/shell/commands/GrepCommand.java | 4 +-
.../shell/commands/ImportDirectoryCommand.java | 6 +-
.../shell/commands/ImportTableCommand.java | 2 +-
.../accumulo/shell/commands/InsertCommand.java | 4 +-
.../shell/commands/ListCompactionsCommand.java | 2 +-
.../accumulo/shell/commands/ListIterCommand.java | 8 +-
.../accumulo/shell/commands/ListScansCommand.java | 2 +-
.../accumulo/shell/commands/MaxRowCommand.java | 2 +-
.../accumulo/shell/commands/MergeCommand.java | 4 +-
.../accumulo/shell/commands/NamespacesCommand.java | 2 +-
.../accumulo/shell/commands/OfflineCommand.java | 2 +-
.../accumulo/shell/commands/OnlineCommand.java | 2 +-
.../apache/accumulo/shell/commands/OptUtil.java | 4 +-
.../accumulo/shell/commands/PasswdCommand.java | 8 +-
.../accumulo/shell/commands/PingCommand.java | 2 +-
.../shell/commands/RenameNamespaceCommand.java | 2 +-
.../shell/commands/RenameTableCommand.java | 2 +-
.../accumulo/shell/commands/RevokeCommand.java | 8 +-
.../accumulo/shell/commands/ScanCommand.java | 10 +-
.../accumulo/shell/commands/ScriptCommand.java | 2 +-
.../accumulo/shell/commands/SetAuthsCommand.java | 5 +-
.../accumulo/shell/commands/SetGroupsCommand.java | 2 +-
.../accumulo/shell/commands/SetIterCommand.java | 10 +-
.../shell/commands/SetScanIterCommand.java | 6 +-
.../commands/ShellPluginConfigurationCommand.java | 9 +-
.../accumulo/shell/commands/SummariesCommand.java | 4 +-
.../accumulo/shell/commands/TableCommand.java | 2 +-
.../accumulo/shell/commands/TableOperation.java | 4 +-
.../accumulo/shell/commands/TablesCommand.java | 2 +-
.../accumulo/shell/commands/TraceCommand.java | 12 +-
.../shell/commands/UserPermissionsCommand.java | 15 +-
.../accumulo/shell/commands/UsersCommand.java | 2 +-
.../accumulo/shell/commands/WhoAmICommand.java | 2 +-
.../shell/commands/DeleteAuthsCommandTest.java | 14 +-
.../shell/commands/DropUserCommandTest.java | 8 +-
.../shell/commands/SetIterCommandTest.java | 10 +-
.../accumulo/harness/AccumuloClusterHarness.java | 25 +-
.../accumulo/harness/SharedMiniClusterBase.java | 11 +-
.../StandaloneAccumuloClusterConfiguration.java | 4 +-
.../accumulo/test/ArbitraryTablePropertiesIT.java | 12 +-
.../org/apache/accumulo/test/AuditMessageIT.java | 87 ++--
.../accumulo/test/BadDeleteMarkersCreatedIT.java | 10 +-
.../org/apache/accumulo/test/BalanceFasterIT.java | 4 +-
.../java/org/apache/accumulo/test/BalanceIT.java | 4 +-
.../accumulo/test/BalanceWithOfflineTableIT.java | 4 +-
.../org/apache/accumulo/test/BatchWriterIT.java | 4 +-
.../accumulo/test/BatchWriterInTabletServerIT.java | 8 +-
.../apache/accumulo/test/BatchWriterIterator.java | 19 +-
.../accumulo/test/BulkImportMonitoringIT.java | 4 +-
.../accumulo/test/BulkImportSequentialRowsIT.java | 4 +-
.../apache/accumulo/test/BulkImportVolumeIT.java | 2 +-
.../java/org/apache/accumulo/test/CleanWalIT.java | 12 +-
.../apache/accumulo/test/ClientSideIteratorIT.java | 6 +-
.../java/org/apache/accumulo/test/CloneIT.java | 16 +-
.../accumulo/test/CompactionRateLimitingIT.java | 4 +-
.../apache/accumulo/test/ConditionalWriterIT.java | 46 +--
.../test/ConfigurableMajorCompactionIT.java | 8 +-
.../accumulo/test/DetectDeadTabletServersIT.java | 6 +-
.../org/apache/accumulo/test/ExistingMacIT.java | 8 +-
.../java/org/apache/accumulo/test/FindMaxIT.java | 4 +-
.../apache/accumulo/test/GarbageCollectWALIT.java | 4 +-
.../apache/accumulo/test/GetFileInfoBulkIT.java | 4 +-
.../org/apache/accumulo/test/IMMLGBenchmark.java | 12 +-
.../org/apache/accumulo/test/ImportExportIT.java | 6 +-
.../accumulo/test/InterruptibleScannersIT.java | 4 +-
.../accumulo/test/IsolationAndDeepCopyIT.java | 4 +-
.../apache/accumulo/test/KeyValueEqualityIT.java | 4 +-
.../org/apache/accumulo/test/LargeSplitRowIT.java | 10 +-
.../java/org/apache/accumulo/test/LocatorIT.java | 4 +-
.../java/org/apache/accumulo/test/ManySplitIT.java | 2 +-
.../test/MasterRepairsDualAssignmentIT.java | 4 +-
.../accumulo/test/MetaConstraintRetryIT.java | 2 +-
.../apache/accumulo/test/MetaGetsReadersIT.java | 6 +-
.../org/apache/accumulo/test/MetaRecoveryIT.java | 4 +-
.../java/org/apache/accumulo/test/MetaSplitIT.java | 12 +-
.../test/MissingWalHeaderCompletesRecoveryIT.java | 10 +-
.../accumulo/test/MultiTableBatchWriterIT.java | 26 +-
.../apache/accumulo/test/MultiTableRecoveryIT.java | 6 +-
.../org/apache/accumulo/test/NamespacesIT.java | 8 +-
.../accumulo/test/NewTableConfigurationIT.java | 113 +++---
.../org/apache/accumulo/test/OrIteratorIT.java | 14 +-
.../apache/accumulo/test/QueryMetadataTable.java | 12 +-
.../test/RecoveryCompactionsAreFlushesIT.java | 4 +-
.../accumulo/test/RewriteTabletDirectoriesIT.java | 6 +-
.../java/org/apache/accumulo/test/SampleIT.java | 12 +-
.../apache/accumulo/test/ScanFlushWithTimeIT.java | 4 +-
.../org/apache/accumulo/test/ShellConfigIT.java | 6 +-
.../org/apache/accumulo/test/ShellServerIT.java | 33 +-
.../apache/accumulo/test/SplitCancelsMajCIT.java | 4 +-
.../org/apache/accumulo/test/SplitRecoveryIT.java | 35 +-
.../accumulo/test/TableConfigurationUpdateIT.java | 4 +-
.../apache/accumulo/test/TableOperationsIT.java | 104 ++---
.../accumulo/test/TabletServerGivesUpIT.java | 4 +-
.../accumulo/test/TabletServerHdfsRestartIT.java | 4 +-
.../org/apache/accumulo/test/TestBinaryRows.java | 16 +-
.../java/org/apache/accumulo/test/TestIngest.java | 18 +-
.../apache/accumulo/test/TestMultiTableIngest.java | 14 +-
.../apache/accumulo/test/TestRandomDeletes.java | 9 +-
.../ThriftServerBindsBeforeZooKeeperLockIT.java | 4 +-
.../org/apache/accumulo/test/TotalQueuedIT.java | 6 +-
.../test/TracerRecoversAfterOfflineTableIT.java | 4 +-
.../java/org/apache/accumulo/test/UnusedWALIT.java | 12 +-
.../accumulo/test/UserCompactionStrategyIT.java | 20 +-
.../java/org/apache/accumulo/test/UsersIT.java | 4 +-
.../org/apache/accumulo/test/VerifyIngest.java | 10 +-
.../accumulo/test/VerifySerialRecoveryIT.java | 4 +-
.../accumulo/test/VolumeChooserFailureIT.java | 24 +-
.../org/apache/accumulo/test/VolumeChooserIT.java | 137 ++++---
.../java/org/apache/accumulo/test/VolumeIT.java | 80 ++--
.../org/apache/accumulo/test/WaitForBalanceIT.java | 6 +-
.../org/apache/accumulo/test/YieldScannersIT.java | 6 +-
.../accumulo/test/ZooKeeperPropertiesIT.java | 4 +-
.../accumulo/test/functional/AddSplitIT.java | 8 +-
.../accumulo/test/functional/BackupMasterIT.java | 4 +-
.../test/functional/BadIteratorMincIT.java | 4 +-
.../functional/BalanceAfterCommsFailureIT.java | 6 +-
.../BalanceInPresenceOfOfflineTableIT.java | 28 +-
.../accumulo/test/functional/BatchScanSplitIT.java | 22 +-
.../test/functional/BatchWriterFlushIT.java | 18 +-
.../accumulo/test/functional/BigRootTabletIT.java | 4 +-
.../apache/accumulo/test/functional/BinaryIT.java | 8 +-
.../accumulo/test/functional/BinaryStressIT.java | 8 +-
.../accumulo/test/functional/BloomFilterIT.java | 10 +-
.../accumulo/test/functional/BulkFileIT.java | 6 +-
.../apache/accumulo/test/functional/BulkIT.java | 12 +-
.../accumulo/test/functional/BulkLoadIT.java | 24 +-
.../test/functional/BulkSplitOptimizationIT.java | 14 +-
.../test/functional/ChaoticBalancerIT.java | 4 +-
.../accumulo/test/functional/ClassLoaderIT.java | 6 +-
.../accumulo/test/functional/CleanTmpIT.java | 4 +-
.../apache/accumulo/test/functional/CleanUpIT.java | 6 +-
.../accumulo/test/functional/CloneTestIT.java | 14 +-
.../accumulo/test/functional/CombinerIT.java | 6 +-
.../accumulo/test/functional/CompactionIT.java | 10 +-
.../accumulo/test/functional/ConcurrencyIT.java | 8 +-
.../test/functional/ConcurrentDeleteTableIT.java | 8 +-
.../test/functional/ConfigurableCompactionIT.java | 15 +-
.../test/functional/ConfigurableMacBase.java | 8 +-
.../accumulo/test/functional/ConnectorIT.java | 97 -----
.../accumulo/test/functional/ConstraintIT.java | 28 +-
.../accumulo/test/functional/CreateAndUseIT.java | 21 +-
.../test/functional/CreateManyScannersIT.java | 4 +-
.../accumulo/test/functional/CredentialsIT.java | 13 +-
.../test/functional/DeleteEverythingIT.java | 20 +-
.../accumulo/test/functional/DeleteFailIT.java | 4 +-
.../apache/accumulo/test/functional/DeleteIT.java | 8 +-
.../accumulo/test/functional/DeleteRowsIT.java | 6 +-
.../test/functional/DeleteRowsSplitIT.java | 6 +-
.../test/functional/DeleteTableDuringSplitIT.java | 8 +-
.../test/functional/DeletedTablesDontFlushIT.java | 4 +-
.../accumulo/test/functional/DurabilityIT.java | 18 +-
.../test/functional/DynamicThreadPoolsIT.java | 8 +-
.../accumulo/test/functional/FateStarvationIT.java | 4 +-
.../test/functional/FunctionalTestUtils.java | 13 +-
.../test/functional/GarbageCollectorIT.java | 26 +-
.../test/functional/HalfDeadTServerIT.java | 4 +-
.../accumulo/test/functional/KerberosIT.java | 51 +--
.../accumulo/test/functional/KerberosProxyIT.java | 12 +-
.../test/functional/KerberosRenewalIT.java | 6 +-
.../accumulo/test/functional/LargeRowIT.java | 16 +-
.../accumulo/test/functional/LogicalTimeIT.java | 6 +-
.../accumulo/test/functional/MapReduceIT.java | 6 +-
.../test/functional/MasterAssignmentIT.java | 6 +-
.../accumulo/test/functional/MasterFailoverIT.java | 4 +-
.../apache/accumulo/test/functional/MaxOpenIT.java | 10 +-
.../apache/accumulo/test/functional/MergeIT.java | 16 +-
.../accumulo/test/functional/MetadataIT.java | 8 +-
.../test/functional/MetadataMaxFilesIT.java | 4 +-
.../accumulo/test/functional/MetadataSplitIT.java | 4 +-
.../accumulo/test/functional/PermissionsIT.java | 40 +-
.../accumulo/test/functional/ReadWriteIT.java | 122 +++---
.../test/functional/RecoveryWithEmptyRFileIT.java | 22 +-
.../test/functional/RegexGroupBalanceIT.java | 6 +-
.../apache/accumulo/test/functional/RenameIT.java | 4 +-
.../apache/accumulo/test/functional/RestartIT.java | 16 +-
.../accumulo/test/functional/RestartStressIT.java | 4 +-
.../accumulo/test/functional/RowDeleteIT.java | 4 +-
.../apache/accumulo/test/functional/ScanIdIT.java | 28 +-
.../accumulo/test/functional/ScanIteratorIT.java | 30 +-
.../accumulo/test/functional/ScanRangeIT.java | 12 +-
.../test/functional/ScanSessionTimeOutIT.java | 8 +-
.../accumulo/test/functional/ScannerContextIT.java | 14 +-
.../apache/accumulo/test/functional/ScannerIT.java | 4 +-
.../test/functional/ServerSideErrorIT.java | 4 +-
.../test/functional/SessionBlockVerifyIT.java | 4 +-
.../test/functional/SessionDurabilityIT.java | 16 +-
.../accumulo/test/functional/ShutdownIT.java | 8 +-
.../test/functional/SimpleBalancerFairnessIT.java | 4 +-
.../test/functional/SparseColumnFamilyIT.java | 4 +-
.../apache/accumulo/test/functional/SplitIT.java | 15 +-
.../org/apache/accumulo/test/functional/SslIT.java | 12 +-
.../apache/accumulo/test/functional/SummaryIT.java | 32 +-
.../test/functional/TableChangeStateIT.java | 38 +-
.../apache/accumulo/test/functional/TableIT.java | 4 +-
.../apache/accumulo/test/functional/TabletIT.java | 16 +-
.../functional/TabletStateChangeIteratorIT.java | 36 +-
.../apache/accumulo/test/functional/TimeoutIT.java | 15 +-
.../accumulo/test/functional/TooManyDeletesIT.java | 4 +-
.../accumulo/test/functional/VisibilityIT.java | 37 +-
.../accumulo/test/functional/WALSunnyDayIT.java | 11 +-
.../test/functional/WatchTheWatchCountIT.java | 4 +-
.../test/functional/WriteAheadLogEncryptedIT.java | 4 +-
.../accumulo/test/functional/WriteAheadLogIT.java | 4 +-
.../accumulo/test/functional/WriteLotsIT.java | 4 +-
.../accumulo/test/functional/ZooCacheIT.java | 2 +-
.../test/functional/ZookeeperRestartIT.java | 4 +-
.../CloseWriteAheadLogReferencesIT.java | 8 +-
.../test/mapred/AccumuloFileOutputFormatIT.java | 8 +-
.../test/mapred/AccumuloInputFormatIT.java | 10 +-
.../mapred/AccumuloMultiTableInputFormatIT.java | 4 +-
.../test/mapred/AccumuloOutputFormatIT.java | 12 +-
.../test/mapred/AccumuloRowInputFormatIT.java | 4 +-
.../apache/accumulo/test/mapred/TokenFileIT.java | 4 +-
.../test/mapreduce/AccumuloFileOutputFormatIT.java | 4 +-
.../test/mapreduce/AccumuloInputFormatIT.java | 18 +-
.../mapreduce/AccumuloMultiTableInputFormatIT.java | 4 +-
.../test/mapreduce/AccumuloOutputFormatIT.java | 4 +-
.../test/mapreduce/AccumuloRowInputFormatIT.java | 4 +-
.../accumulo/test/mapreduce/TokenFileIT.java | 4 +-
.../apache/accumulo/test/master/MergeStateIT.java | 37 +-
.../accumulo/test/master/SuspendedTabletsIT.java | 4 +-
.../test/performance/ContinuousIngest.java | 4 +-
.../test/performance/RollWALPerformanceIT.java | 6 +-
.../performance/metadata/FastBulkImportIT.java | 4 +-
.../test/performance/scan/CollectTabletStats.java | 12 +-
.../accumulo/test/proxy/ProxyDurabilityIT.java | 7 +-
.../accumulo/test/proxy/SimpleProxyBase.java | 6 +-
.../test/replication/CyclicReplicationIT.java | 7 +-
.../test/replication/FinishedWorkUpdaterIT.java | 6 +-
...GarbageCollectorCommunicatesWithTServersIT.java | 12 +-
.../test/replication/KerberosReplicationIT.java | 6 +-
.../replication/MultiInstanceReplicationIT.java | 22 +-
.../replication/MultiTserverReplicationIT.java | 6 +-
.../RemoveCompleteReplicationRecordsIT.java | 10 +-
.../accumulo/test/replication/ReplicationIT.java | 39 +-
.../replication/ReplicationOperationsImplIT.java | 6 +-
.../ReplicationTablesPrinterThread.java | 4 +-
.../test/replication/SequentialWorkAssignerIT.java | 10 +-
.../test/replication/StatusCombinerMacIT.java | 6 +-
.../accumulo/test/replication/StatusMakerIT.java | 6 +-
.../test/replication/UnorderedWorkAssignerIT.java | 10 +-
.../UnorderedWorkAssignerReplicationIT.java | 22 +-
.../UnusedWalDoesntCloseReplicationStatusIT.java | 4 +-
.../accumulo/test/replication/WorkMakerIT.java | 8 +-
.../test/server/security/SystemCredentialsIT.java | 4 +-
.../test/util/metadata/MetadataBatchScan.java | 20 +-
356 files changed, 1999 insertions(+), 2414 deletions(-)
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index c5997b0..83377b4 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -31,12 +31,12 @@ import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.ClientInfo;
import org.apache.accumulo.core.client.ClientSideIteratorScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
@@ -180,7 +180,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
if (token instanceof KerberosToken) {
log.info("Received KerberosToken, attempting to fetch DelegationToken");
try {
- Connector conn = Connector.builder().usingClientInfo(getClientInfo(job))
+ AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job))
.usingToken(principal, token).build();
token = conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
@@ -380,7 +380,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
* @since 1.5.0
*/
protected static void validateOptions(JobConf job) throws IOException {
- Connector conn = InputConfigurator.getConnector(CLASS, job);
+ AccumuloClient conn = InputConfigurator.getConnector(CLASS, job);
InputConfigurator.validatePermissions(CLASS, job, conn);
}
@@ -481,7 +481,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
log.debug("Initializing input split: " + baseSplit);
ClientContext context = new ClientContext(getClientInfo(job));
- Connector conn;
+ AccumuloClient conn;
try {
conn = context.getConnector();
} catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
index 39d787d..e58d790 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
@@ -22,12 +22,12 @@ import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableExistsException;
@@ -407,7 +407,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
private long mutCount = 0;
private long valCount = 0;
- private Connector conn;
+ private AccumuloClient conn;
protected AccumuloRecordWriter(JobConf job)
throws AccumuloException, AccumuloSecurityException, IOException {
@@ -426,7 +426,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
this.defaultTableName = (tname == null) ? null : new Text(tname);
if (!simulate) {
- this.conn = Connector.builder().usingClientInfo(getClientInfo(job)).build();
+ this.conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
mtbw = conn.createMultiTableBatchWriter(getBatchWriterOptions(job));
}
}
@@ -563,7 +563,7 @@ public class AccumuloOutputFormat implements OutputFormat<Text,Mutation> {
throw new IOException("Connector info has not been set.");
try {
// if the instance isn't configured, it will complain here
- Connector c = Connector.builder().usingClientInfo(getClientInfo(job)).build();
+ AccumuloClient c = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
String principal = getPrincipal(job);
AuthenticationToken token = getAuthenticationToken(job);
if (!c.securityOperations().authenticateUser(principal, token))
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 084c3f3..ae4dede 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -31,12 +31,12 @@ import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.ClientInfo;
import org.apache.accumulo.core.client.ClientSideIteratorScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
@@ -182,7 +182,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
if (token instanceof KerberosToken) {
log.info("Received KerberosToken, attempting to fetch DelegationToken");
try {
- Connector conn = Connector.builder().usingClientInfo(getClientInfo(job))
+ AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo(job))
.usingToken(principal, token).build();
token = conn.securityOperations().getDelegationToken(new DelegationTokenConfig());
} catch (Exception e) {
@@ -397,7 +397,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
* @since 1.5.0
*/
protected static void validateOptions(JobContext context) throws IOException {
- Connector conn = InputConfigurator.getConnector(CLASS, context.getConfiguration());
+ AccumuloClient conn = InputConfigurator.getConnector(CLASS, context.getConfiguration());
InputConfigurator.validatePermissions(CLASS, context.getConfiguration(), conn);
}
@@ -488,7 +488,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
ClientInfo info = getClientInfo(attempt);
ClientContext context = new ClientContext(info);
- Connector conn;
+ AccumuloClient conn;
try {
conn = context.getConnector();
} catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
index acb46d1..c91382b 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
@@ -22,12 +22,12 @@ import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableExistsException;
@@ -410,7 +410,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
private long mutCount = 0;
private long valCount = 0;
- private Connector conn;
+ private AccumuloClient conn;
protected AccumuloRecordWriter(TaskAttemptContext context)
throws AccumuloException, AccumuloSecurityException, IOException {
@@ -429,7 +429,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
this.defaultTableName = (tname == null) ? null : new Text(tname);
if (!simulate) {
- this.conn = Connector.builder().usingClientInfo(getClientInfo(context)).build();
+ this.conn = AccumuloClient.builder().usingClientInfo(getClientInfo(context)).build();
mtbw = conn.createMultiTableBatchWriter(getBatchWriterOptions(context));
}
}
@@ -568,7 +568,7 @@ public class AccumuloOutputFormat extends OutputFormat<Text,Mutation> {
// if the instance isn't configured, it will complain here
String principal = getPrincipal(job);
AuthenticationToken token = getAuthenticationToken(job);
- Connector c = Connector.builder().usingClientInfo(getClientInfo(job)).build();
+ AccumuloClient c = AccumuloClient.builder().usingClientInfo(getClientInfo(job)).build();
if (!c.securityOperations().authenticateUser(principal, token))
throw new IOException("Unable to authenticate user");
} catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
index 17b52b0..df380a6 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBase.java
@@ -30,6 +30,7 @@ import java.util.Properties;
import java.util.Scanner;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
@@ -118,11 +119,11 @@ public class ConfiguratorBase {
if (info.getAuthenticationToken() instanceof KerberosToken) {
log.info("Received KerberosToken, attempting to fetch DelegationToken");
try {
- Connector conn = Connector.builder().usingClientInfo(info).build();
+ AccumuloClient conn = AccumuloClient.builder().usingClientInfo(info).build();
AuthenticationToken token = conn.securityOperations()
.getDelegationToken(new DelegationTokenConfig());
- result = Connector.builder().usingClientInfo(info).usingToken(info.getPrincipal(), token)
- .info();
+ result = AccumuloClient.builder().usingClientInfo(info)
+ .usingToken(info.getPrincipal(), token).info();
} catch (Exception e) {
log.warn("Failed to automatically obtain DelegationToken, "
+ "Mappers/Reducers will likely fail to communicate with Accumulo", e);
@@ -335,11 +336,11 @@ public class ConfiguratorBase {
@Deprecated
public static org.apache.accumulo.core.client.Instance getInstance(Class<?> implementingClass,
Configuration conf) {
- return getConnector(implementingClass, conf).getInstance();
+ return Connector.from(getConnector(implementingClass, conf)).getInstance();
}
/**
- * Creates an Accumulo {@link Connector} based on the configuration
+ * Creates an Accumulo {@link AccumuloClient} based on the configuration
*
* @param implementingClass
* class whose name will be used as a prefix for the property configuration
@@ -348,9 +349,10 @@ public class ConfiguratorBase {
* @return Accumulo connector
* @since 2.0.0
*/
- public static Connector getConnector(Class<?> implementingClass, Configuration conf) {
+ public static AccumuloClient getConnector(Class<?> implementingClass, Configuration conf) {
try {
- return Connector.builder().usingClientInfo(getClientInfo(implementingClass, conf)).build();
+ return AccumuloClient.builder().usingClientInfo(getClientInfo(implementingClass, conf))
+ .build();
} catch (AccumuloException | AccumuloSecurityException e) {
throw new IllegalStateException(e);
}
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
index 7361c00..530c7f6 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
@@ -37,12 +37,12 @@ import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.ClientInfo;
import org.apache.accumulo.core.client.ClientSideIteratorScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.RowIterator;
@@ -739,7 +739,7 @@ public class InputConfigurator extends ConfiguratorBase {
* @since 1.7.0
*/
public static void validatePermissions(Class<?> implementingClass, Configuration conf,
- Connector conn) throws IOException {
+ AccumuloClient conn) throws IOException {
Map<String,InputTableConfig> inputTableConfigs = getInputTableConfigs(implementingClass, conf);
try {
if (getInputTableConfigs(implementingClass, conf).size() == 0)
diff --git a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
index 84e7023..0cb8fae 100644
--- a/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
+++ b/client/mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/MapReduceClientOpts.java
@@ -17,8 +17,8 @@
package org.apache.accumulo.core.client.mapreduce.lib.impl;
import org.apache.accumulo.core.cli.ClientOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.admin.DelegationTokenConfig;
import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
@@ -60,7 +60,7 @@ public class MapReduceClientOpts extends ClientOpts {
log.info("Obtaining delegation token for {}", newPrincipal);
setPrincipal(newPrincipal);
- Connector conn = Connector.builder().usingClientInfo(getClientInfo())
+ AccumuloClient conn = AccumuloClient.builder().usingClientInfo(getClientInfo())
.usingToken(newPrincipal, krbToken).build();
// Do the explicit check to see if the user has the permission to get a delegation token
diff --git a/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java b/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
index e9b9896..f5fa9d3 100644
--- a/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
+++ b/client/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/lib/impl/ConfiguratorBaseTest.java
@@ -24,9 +24,9 @@ import static org.junit.Assert.assertTrue;
import java.util.Properties;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -79,7 +79,7 @@ public class ConfiguratorBaseTest {
@Test
public void testSetClientInfo() {
Configuration conf = new Configuration();
- ClientInfo info = Connector.builder().forInstance("myinstance", "myzookeepers")
+ ClientInfo info = AccumuloClient.builder().forInstance("myinstance", "myzookeepers")
.usingPassword("user", "pass").info();
ConfiguratorBase.setClientInfo(this.getClass(), conf, info);
ClientInfo info2 = ConfiguratorBase.getClientInfo(this.getClass(), conf);
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
index 2511b99..85b39f3 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
@@ -25,10 +25,10 @@ import java.net.URL;
import java.util.Properties;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.conf.ClientProperty;
import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
@@ -158,7 +158,7 @@ public class ClientOpts extends Help {
}
private ClientInfo cachedInfo = null;
- private Connector cachedConnector = null;
+ private AccumuloClient cachedAccumuloClient = null;
private Properties cachedProps = null;
public String getPrincipal() {
@@ -175,16 +175,16 @@ public class ClientOpts extends Help {
public ClientInfo getClientInfo() {
if (cachedInfo == null) {
- cachedInfo = Connector.builder().usingProperties(getClientProperties()).info();
+ cachedInfo = AccumuloClient.builder().usingProperties(getClientProperties()).info();
}
return cachedInfo;
}
- public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
- if (cachedConnector == null) {
- cachedConnector = Connector.builder().usingClientInfo(getClientInfo()).build();
+ public AccumuloClient getConnector() throws AccumuloException, AccumuloSecurityException {
+ if (cachedAccumuloClient == null) {
+ cachedAccumuloClient = AccumuloClient.builder().usingClientInfo(getClientInfo()).build();
}
- return cachedConnector;
+ return cachedAccumuloClient;
}
public String getClientConfigFile() {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
index 6ada3cb..bf68155 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
* setting them.
*
* @since 1.6.0
- * @deprecated since 2.0.0, replaced {@link Connector#builder()}
+ * @deprecated since 2.0.0, replaced {@link AccumuloClient#builder()}
*/
@Deprecated
public class ClientConfiguration {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java b/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
index d8612ae..c865518 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientInfo.java
@@ -22,7 +22,7 @@ import org.apache.accumulo.core.client.impl.ClientInfoImpl;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
/**
- * Accumulo client information. Can be built using {@link Connector#builder()}
+ * Accumulo client information. Can be built using {@link AccumuloClient#builder()}
*
* @since 2.0.0
*/
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Instance.java b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
index 80155e4..fde6a66 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Instance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
@@ -26,7 +26,7 @@ import org.apache.accumulo.core.client.security.tokens.PasswordToken;
* This class represents the information a client needs to know to connect to an instance of
* accumulo.
*
- * @deprecated since 2.0.0, use {@link Connector#builder()} and {@link ClientInfo} instead
+ * @deprecated since 2.0.0, use {@link AccumuloClient#builder()} and {@link ClientInfo} instead
*/
@Deprecated
public interface Instance {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
index 1402571..5ae6e85 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
@@ -26,10 +26,10 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
import org.apache.accumulo.core.client.impl.ClientConfConverter;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.ClientInfoImpl;
-import org.apache.accumulo.core.client.impl.ConnectorImpl;
import org.apache.accumulo.core.client.impl.InstanceOperationsImpl;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -57,7 +57,7 @@ import org.slf4j.LoggerFactory;
* If you do not know the instance names then run accumulo
* org.apache.accumulo.server.util.ListInstances on an accumulo server.
*
- * @deprecated since 2.0.0, Use {@link Connector#builder()} instead
+ * @deprecated since 2.0.0, Use {@link AccumuloClient#builder()} instead
*/
@Deprecated
public class ZooKeeperInstance implements Instance {
@@ -112,7 +112,7 @@ public class ZooKeeperInstance implements Instance {
* {@link ClientConfiguration} which extends Configuration with convenience methods
* specific to Accumulo.
* @since 1.9.0
- * @deprecated since 2.0.0; use {@link Connector#builder()} instead
+ * @deprecated since 2.0.0; use {@link AccumuloClient#builder()} instead
*/
@Deprecated
public ZooKeeperInstance(ClientConfiguration config) {
@@ -224,7 +224,7 @@ public class ZooKeeperInstance implements Instance {
Properties properties = ClientConfConverter.toProperties(clientConf);
properties.setProperty(ClientProperty.AUTH_PRINCIPAL.getKey(), principal);
properties.setProperty(ClientProperty.INSTANCE_NAME.getKey(), getInstanceName());
- return new ConnectorImpl(new ClientContext(new ClientInfoImpl(properties, token)));
+ return new AccumuloClientImpl(new ClientContext(new ClientInfoImpl(properties, token)));
}
@Override
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
index 07986fd..418358e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -67,7 +68,7 @@ public class ClientContext {
private Credentials creds;
private BatchWriterConfig batchWriterConfig;
private AccumuloConfiguration serverConf;
- protected Connector conn;
+ protected AccumuloClient conn;
// These fields are very frequently accessed (each time a connection is created) and expensive to
// compute, so cache them.
@@ -139,7 +140,7 @@ public class ClientContext {
@Override
public Connector getConnector(String principal, AuthenticationToken token)
throws AccumuloException, AccumuloSecurityException {
- return context.getConnector().changeUser(principal, token);
+ return Connector.from(context.getConnector().changeUser(principal, token));
}
};
}
@@ -211,9 +212,10 @@ public class ClientContext {
/**
* Retrieve a connector
*/
- public synchronized Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+ public synchronized AccumuloClient getConnector()
+ throws AccumuloException, AccumuloSecurityException {
if (conn == null) {
- conn = new ConnectorImpl(this);
+ conn = new AccumuloClientImpl(this);
}
return conn;
}
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoFactory.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoFactory.java
index cfcb192..060298e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientInfoFactory.java
@@ -18,11 +18,11 @@ package org.apache.accumulo.core.client.impl;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Durability;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -39,9 +39,9 @@ public class ClientInfoFactory {
return property.getLong(info.getProperties());
}
- public static Connector getConnector(ClientInfo info)
+ public static AccumuloClient getConnector(ClientInfo info)
throws AccumuloSecurityException, AccumuloException {
- return new ConnectorImpl(new ClientContext(info));
+ return new AccumuloClientImpl(new ClientContext(info));
}
public static Credentials getCredentials(ClientInfo info) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
deleted file mode 100644
index d6ebfcb..0000000
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.core.client.impl;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Objects;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.BatchDeleter;
-import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.ConditionalWriter;
-import org.apache.accumulo.core.client.ConditionalWriterConfig;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.MultiTableBatchWriter;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.TableOfflineException;
-import org.apache.accumulo.core.client.admin.InstanceOperations;
-import org.apache.accumulo.core.client.admin.NamespaceOperations;
-import org.apache.accumulo.core.client.admin.ReplicationOperations;
-import org.apache.accumulo.core.client.admin.SecurityOperations;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
-import org.apache.accumulo.core.conf.ClientProperty;
-import org.apache.accumulo.core.master.state.tables.TableState;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.trace.Tracer;
-
-public class ConnectorImpl extends Connector {
- private static final String SYSTEM_TOKEN_NAME = "org.apache.accumulo.server.security."
- + "SystemCredentials$SystemToken";
- private final ClientContext context;
- private final String instanceID;
- private SecurityOperations secops = null;
- private TableOperationsImpl tableops = null;
- private NamespaceOperations namespaceops = null;
- private InstanceOperations instanceops = null;
- private ReplicationOperations replicationops = null;
-
- public ConnectorImpl(final ClientContext context)
- throws AccumuloSecurityException, AccumuloException {
- checkArgument(context != null, "Context is null");
- checkArgument(context.getCredentials() != null, "Credentials are null");
- checkArgument(context.getCredentials().getToken() != null, "Authentication token is null");
- if (context.getCredentials().getToken().isDestroyed())
- throw new AccumuloSecurityException(context.getCredentials().getPrincipal(),
- SecurityErrorCode.TOKEN_EXPIRED);
-
- this.context = context;
- instanceID = context.getInstanceID();
-
- // Skip fail fast for system services; string literal for class name, to avoid dependency on
- // server jar
- final String tokenClassName = context.getCredentials().getToken().getClass().getName();
- if (!SYSTEM_TOKEN_NAME.equals(tokenClassName)) {
- ServerClient.executeVoid(context, iface -> {
- if (!iface.authenticate(Tracer.traceInfo(), context.rpcCreds()))
- throw new AccumuloSecurityException("Authentication failed, access denied",
- SecurityErrorCode.BAD_CREDENTIALS);
- });
- }
-
- this.tableops = new TableOperationsImpl(context);
- this.namespaceops = new NamespaceOperationsImpl(context, tableops);
- }
-
- private Table.ID getTableId(String tableName) throws TableNotFoundException {
- Table.ID tableId = Tables.getTableId(context, tableName);
- if (Tables.getTableState(context, tableId) == TableState.OFFLINE)
- throw new TableOfflineException(Tables.getTableOfflineMsg(context, tableId));
- return tableId;
- }
-
- @Override
- @Deprecated
- public org.apache.accumulo.core.client.Instance getInstance() {
- return context.getDeprecatedInstance();
- }
-
- @Override
- public BatchScanner createBatchScanner(String tableName, Authorizations authorizations,
- int numQueryThreads) throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- checkArgument(authorizations != null, "authorizations is null");
- return new TabletServerBatchReader(context, getTableId(tableName), authorizations,
- numQueryThreads);
- }
-
- @Override
- public BatchScanner createBatchScanner(String tableName, Authorizations authorizations)
- throws TableNotFoundException {
- Integer numQueryThreads = ClientProperty.BATCH_SCANNER_NUM_QUERY_THREADS
- .getInteger(context.getClientInfo().getProperties());
- Objects.requireNonNull(numQueryThreads);
- return createBatchScanner(tableName, authorizations, numQueryThreads);
- }
-
- @Deprecated
- @Override
- public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations,
- int numQueryThreads, long maxMemory, long maxLatency, int maxWriteThreads)
- throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- checkArgument(authorizations != null, "authorizations is null");
- return new TabletServerBatchDeleter(context, getTableId(tableName), authorizations,
- numQueryThreads, new BatchWriterConfig().setMaxMemory(maxMemory)
- .setMaxLatency(maxLatency, TimeUnit.MILLISECONDS).setMaxWriteThreads(maxWriteThreads));
- }
-
- @Override
- public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations,
- int numQueryThreads, BatchWriterConfig config) throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- checkArgument(authorizations != null, "authorizations is null");
- return new TabletServerBatchDeleter(context, getTableId(tableName), authorizations,
- numQueryThreads, config.merge(context.getBatchWriterConfig()));
- }
-
- @Override
- public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations,
- int numQueryThreads) throws TableNotFoundException {
- return createBatchDeleter(tableName, authorizations, numQueryThreads, new BatchWriterConfig());
- }
-
- @Deprecated
- @Override
- public BatchWriter createBatchWriter(String tableName, long maxMemory, long maxLatency,
- int maxWriteThreads) throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- return new BatchWriterImpl(context, getTableId(tableName),
- new BatchWriterConfig().setMaxMemory(maxMemory)
- .setMaxLatency(maxLatency, TimeUnit.MILLISECONDS).setMaxWriteThreads(maxWriteThreads));
- }
-
- @Override
- public BatchWriter createBatchWriter(String tableName, BatchWriterConfig config)
- throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- // we used to allow null inputs for bw config
- if (config == null) {
- config = new BatchWriterConfig();
- }
- return new BatchWriterImpl(context, getTableId(tableName),
- config.merge(context.getBatchWriterConfig()));
- }
-
- @Override
- public BatchWriter createBatchWriter(String tableName) throws TableNotFoundException {
- return createBatchWriter(tableName, new BatchWriterConfig());
- }
-
- @Deprecated
- @Override
- public MultiTableBatchWriter createMultiTableBatchWriter(long maxMemory, long maxLatency,
- int maxWriteThreads) {
- return new MultiTableBatchWriterImpl(context, new BatchWriterConfig().setMaxMemory(maxMemory)
- .setMaxLatency(maxLatency, TimeUnit.MILLISECONDS).setMaxWriteThreads(maxWriteThreads));
- }
-
- @Override
- public MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config) {
- return new MultiTableBatchWriterImpl(context, config.merge(context.getBatchWriterConfig()));
- }
-
- @Override
- public MultiTableBatchWriter createMultiTableBatchWriter() {
- return createMultiTableBatchWriter(new BatchWriterConfig());
- }
-
- @Override
- public ConditionalWriter createConditionalWriter(String tableName, ConditionalWriterConfig config)
- throws TableNotFoundException {
- return new ConditionalWriterImpl(context, getTableId(tableName), config);
- }
-
- @Override
- public Scanner createScanner(String tableName, Authorizations authorizations)
- throws TableNotFoundException {
- checkArgument(tableName != null, "tableName is null");
- checkArgument(authorizations != null, "authorizations is null");
- Scanner scanner = new ScannerImpl(context, getTableId(tableName), authorizations);
- Integer batchSize = ClientProperty.SCANNER_BATCH_SIZE
- .getInteger(context.getClientInfo().getProperties());
- if (batchSize != null) {
- scanner.setBatchSize(batchSize);
- }
- return scanner;
- }
-
- @Override
- public String whoami() {
- return context.getCredentials().getPrincipal();
- }
-
- @Override
- public String getInstanceID() {
- return instanceID;
- }
-
- @Override
- public synchronized TableOperations tableOperations() {
- return tableops;
- }
-
- @Override
- public synchronized NamespaceOperations namespaceOperations() {
- return namespaceops;
- }
-
- @Override
- public synchronized SecurityOperations securityOperations() {
- if (secops == null)
- secops = new SecurityOperationsImpl(context);
-
- return secops;
- }
-
- @Override
- public synchronized InstanceOperations instanceOperations() {
- if (instanceops == null)
- instanceops = new InstanceOperationsImpl(context);
-
- return instanceops;
- }
-
- @Override
- public synchronized ReplicationOperations replicationOperations() {
- if (null == replicationops) {
- replicationops = new ReplicationOperationsImpl(context);
- }
-
- return replicationops;
- }
-
- @Override
- public ClientInfo info() {
- return this.context.getClientInfo();
- }
-
- @Override
- public Connector changeUser(String principal, AuthenticationToken token)
- throws AccumuloSecurityException, AccumuloException {
- return Connector.builder().usingClientInfo(info()).usingToken(principal, token).build();
- }
-
- public static class ConnectorBuilderImpl
- implements InstanceArgs, PropertyOptions, ClientInfoOptions, AuthenticationArgs,
- ConnectionOptions, SslOptions, SaslOptions, ConnectorFactory, FromOptions {
-
- private Properties properties = new Properties();
- private AuthenticationToken token = null;
-
- private ClientInfo getClientInfo() {
- if (token != null) {
- return new ClientInfoImpl(properties, token);
- }
- return new ClientInfoImpl(properties);
- }
-
- @Override
- public Connector build() throws AccumuloException, AccumuloSecurityException {
- return org.apache.accumulo.core.client.impl.ClientInfoFactory.getConnector(getClientInfo());
- }
-
- @Override
- public ClientInfo info() {
- return getClientInfo();
- }
-
- @Override
- public AuthenticationArgs forInstance(String instanceName, String zookeepers) {
- setProperty(ClientProperty.INSTANCE_NAME, instanceName);
- setProperty(ClientProperty.INSTANCE_ZOOKEEPERS, zookeepers);
- return this;
- }
-
- @Override
- public SslOptions withTruststore(String path) {
- setProperty(ClientProperty.SSL_TRUSTSTORE_PATH, path);
- return this;
- }
-
- @Override
- public SslOptions withTruststore(String path, String password, String type) {
- setProperty(ClientProperty.SSL_TRUSTSTORE_PATH, path);
- setProperty(ClientProperty.SSL_TRUSTSTORE_PASSWORD, password);
- setProperty(ClientProperty.SSL_TRUSTSTORE_TYPE, type);
- return this;
- }
-
- @Override
- public SslOptions withKeystore(String path) {
- setProperty(ClientProperty.SSL_KEYSTORE_PATH, path);
- return this;
- }
-
- @Override
- public SslOptions withKeystore(String path, String password, String type) {
- setProperty(ClientProperty.SSL_KEYSTORE_PATH, path);
- setProperty(ClientProperty.SSL_KEYSTORE_PASSWORD, password);
- setProperty(ClientProperty.SSL_KEYSTORE_TYPE, type);
- return this;
- }
-
- @Override
- public SslOptions useJsse() {
- setProperty(ClientProperty.SSL_USE_JSSE, "true");
- return this;
- }
-
- @Override
- public ConnectionOptions withZkTimeout(int timeout) {
- setProperty(ClientProperty.INSTANCE_ZOOKEEPERS_TIMEOUT, Integer.toString(timeout) + "ms");
- return this;
- }
-
- @Override
- public SslOptions withSsl() {
- setProperty(ClientProperty.SSL_ENABLED, "true");
- return this;
- }
-
- @Override
- public SaslOptions withSasl() {
- setProperty(ClientProperty.SASL_ENABLED, "true");
- return this;
- }
-
- @Override
- public ConnectionOptions withBatchWriterConfig(BatchWriterConfig batchWriterConfig) {
- setProperty(ClientProperty.BATCH_WRITER_MAX_MEMORY_BYTES, batchWriterConfig.getMaxMemory());
- setProperty(ClientProperty.BATCH_WRITER_MAX_LATENCY_SEC,
- batchWriterConfig.getMaxLatency(TimeUnit.SECONDS));
- setProperty(ClientProperty.BATCH_WRITER_MAX_TIMEOUT_SEC,
- batchWriterConfig.getTimeout(TimeUnit.SECONDS));
- setProperty(ClientProperty.BATCH_WRITER_MAX_WRITE_THREADS,
- batchWriterConfig.getMaxWriteThreads());
- setProperty(ClientProperty.BATCH_WRITER_DURABILITY,
- batchWriterConfig.getDurability().toString());
- return this;
- }
-
- @Override
- public ConnectionOptions withBatchScannerQueryThreads(int numQueryThreads) {
- setProperty(ClientProperty.BATCH_SCANNER_NUM_QUERY_THREADS, numQueryThreads);
- return this;
- }
-
- @Override
- public ConnectionOptions withScannerBatchSize(int batchSize) {
- setProperty(ClientProperty.SCANNER_BATCH_SIZE, batchSize);
- return this;
- }
-
- @Override
- public SaslOptions withPrimary(String kerberosServerPrimary) {
- setProperty(ClientProperty.SASL_KERBEROS_SERVER_PRIMARY, kerberosServerPrimary);
- return this;
- }
-
- @Override
- public SaslOptions withQop(String qualityOfProtection) {
- setProperty(ClientProperty.SASL_QOP, qualityOfProtection);
- return this;
- }
-
- @Override
- public ConnectorFactory usingProperties(String configFile) {
- Properties properties = new Properties();
- try (InputStream is = new FileInputStream(configFile)) {
- properties.load(is);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- return usingProperties(properties);
- }
-
- @Override
- public ConnectorFactory usingProperties(Properties properties) {
- this.properties = properties;
- return this;
- }
-
- @Override
- public ConnectionOptions usingPassword(String principal, CharSequence password) {
- setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
- ClientProperty.setPassword(properties, password.toString());
- return this;
- }
-
- @Override
- public ConnectionOptions usingKerberos(String principal, String keyTabFile) {
- setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
- ClientProperty.setKerberosKeytab(properties, keyTabFile);
- return this;
- }
-
- @Override
- public ConnectionOptions usingToken(String principal, AuthenticationToken token) {
- setProperty(ClientProperty.AUTH_PRINCIPAL, principal);
- this.token = token;
- return this;
- }
-
- @Override
- public FromOptions usingClientInfo(ClientInfo clientInfo) {
- this.properties = clientInfo.getProperties();
- return this;
- }
-
- public void setProperty(ClientProperty property, String value) {
- properties.setProperty(property.getKey(), value);
- }
-
- public void setProperty(ClientProperty property, Long value) {
- setProperty(property, Long.toString(value));
- }
-
- public void setProperty(ClientProperty property, Integer value) {
- setProperty(property, Integer.toString(value));
- }
- }
-}
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
index 4e46cbb..653ec26 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
@@ -21,8 +21,8 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.nio.ByteBuffer;
import java.util.Base64;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer;
@@ -31,8 +31,8 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
/**
* A wrapper for internal use. This class carries the instance, principal, and authentication token
* for use in the public API, in a non-serialized form. This is important, so that the
- * authentication token carried in a {@link Connector} can be destroyed, invalidating future RPC
- * operations from that {@link Connector}.
+ * authentication token carried in a {@link AccumuloClient} can be destroyed, invalidating future
+ * RPC operations from that {@link AccumuloClient}.
* <p>
* See ACCUMULO-1312
*
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
index ce51605..b608a70 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
@@ -28,8 +28,8 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.RowIterator;
import org.apache.accumulo.core.client.SampleNotPresentException;
import org.apache.accumulo.core.client.Scanner;
@@ -151,7 +151,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
private SortedKeyValueIterator<Key,Value> iter;
private Range range;
private KeyExtent currentExtent;
- private Connector conn;
+ private AccumuloClient conn;
private Table.ID tableId;
private Authorizations authorizations;
private ClientContext context;
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
index d576494..0a3a3ff 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
@@ -25,10 +25,10 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.ReplicationOperations;
import org.apache.accumulo.core.client.admin.TableOperations;
@@ -120,7 +120,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
client -> client.drainReplicationTable(tinfo, rpcCreds, tableName, wals));
}
- protected Table.ID getTableId(Connector conn, String tableName)
+ protected Table.ID getTableId(AccumuloClient conn, String tableName)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
TableOperations tops = conn.tableOperations();
@@ -146,7 +146,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
log.debug("Collecting referenced files for replication of table {}", tableName);
- Connector conn = context.getConnector();
+ AccumuloClient conn = context.getConnector();
Table.ID tableId = getTableId(conn, tableName);
log.debug("Found id of {} for name {}", tableId, tableName);
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataScanner.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataScanner.java
index 573d3c4..e871cae 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataScanner.java
@@ -29,9 +29,9 @@ import java.util.NoSuchElementException;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -60,7 +60,7 @@ public class MetadataScanner implements Iterable<TabletMetadata>, AutoCloseable
public interface SourceOptions {
TableOptions from(ClientContext ctx);
- TableOptions from(Connector conn);
+ TableOptions from(AccumuloClient conn);
}
public interface TableOptions {
@@ -147,7 +147,7 @@ public class MetadataScanner implements Iterable<TabletMetadata>, AutoCloseable
private List<Text> families = new ArrayList<>();
private List<ColumnFQ> qualifiers = new ArrayList<>();
- private Connector conn;
+ private AccumuloClient conn;
private String table = MetadataTable.NAME;
private Range range;
private EnumSet<FetchedColumns> fetchedCols = EnumSet.noneOf(FetchedColumns.class);
@@ -265,7 +265,7 @@ public class MetadataScanner implements Iterable<TabletMetadata>, AutoCloseable
}
@Override
- public TableOptions from(Connector conn) {
+ public TableOptions from(AccumuloClient conn) {
this.conn = conn;
return this;
}
diff --git a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTable.java b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTable.java
index 1b1536a..2a35b36 100644
--- a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTable.java
@@ -20,12 +20,12 @@ import java.util.Collections;
import java.util.Map;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.TableOfflineException;
@@ -58,7 +58,7 @@ public class ReplicationTable {
public static final Map<String,Set<Text>> LOCALITY_GROUPS = ImmutableMap.of(STATUS_LG_NAME,
STATUS_LG_COLFAMS, WORK_LG_NAME, WORK_LG_COLFAMS);
- public static Scanner getScanner(Connector conn) throws ReplicationTableOfflineException {
+ public static Scanner getScanner(AccumuloClient conn) throws ReplicationTableOfflineException {
try {
return conn.createScanner(NAME, Authorizations.EMPTY);
} catch (TableNotFoundException e) {
@@ -68,7 +68,8 @@ public class ReplicationTable {
}
}
- public static BatchWriter getBatchWriter(Connector conn) throws ReplicationTableOfflineException {
+ public static BatchWriter getBatchWriter(AccumuloClient conn)
+ throws ReplicationTableOfflineException {
try {
return conn.createBatchWriter(NAME, new BatchWriterConfig());
} catch (TableNotFoundException e) {
@@ -78,7 +79,7 @@ public class ReplicationTable {
}
}
- public static BatchScanner getBatchScanner(Connector conn, int queryThreads)
+ public static BatchScanner getBatchScanner(AccumuloClient conn, int queryThreads)
throws ReplicationTableOfflineException {
try {
return conn.createBatchScanner(NAME, Authorizations.EMPTY, queryThreads);
@@ -89,11 +90,12 @@ public class ReplicationTable {
}
}
- public static boolean isOnline(Connector conn) {
+ public static boolean isOnline(AccumuloClient conn) {
return TableState.ONLINE == Tables.getTableState(new ClientContext(conn.info()), ID);
}
- public static void setOnline(Connector conn) throws AccumuloSecurityException, AccumuloException {
+ public static void setOnline(AccumuloClient conn)
+ throws AccumuloSecurityException, AccumuloException {
try {
log.info("Bringing replication table online");
conn.tableOperations().online(NAME, true);
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Merge.java b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
index 28f48d5..45c95c9 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Merge.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
@@ -22,7 +22,7 @@ import java.util.List;
import java.util.Map.Entry;
import org.apache.accumulo.core.cli.ClientOnRequiredTable;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.Table;
@@ -88,7 +88,7 @@ public class Merge {
opts.parseArgs(Merge.class.getName(), args);
try {
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
if (!conn.tableOperations().exists(opts.getTableName())) {
System.err.println("table " + opts.getTableName() + " does not exist");
@@ -122,7 +122,7 @@ public class Merge {
long size;
}
- public void mergomatic(Connector conn, String table, Text start, Text end, long goalSize,
+ public void mergomatic(AccumuloClient conn, String table, Text start, Text end, long goalSize,
boolean force) throws MergeException {
try {
if (table.equals(MetadataTable.NAME)) {
@@ -147,7 +147,7 @@ public class Merge {
}
}
- protected long mergeMany(Connector conn, String table, List<Size> sizes, long goalSize,
+ protected long mergeMany(AccumuloClient conn, String table, List<Size> sizes, long goalSize,
boolean force, boolean last) throws MergeException {
// skip the big tablets, which will be the typical case
while (!sizes.isEmpty()) {
@@ -194,7 +194,7 @@ public class Merge {
return result;
}
- protected void mergeSome(Connector conn, String table, List<Size> sizes, int numToMerge)
+ protected void mergeSome(AccumuloClient conn, String table, List<Size> sizes, int numToMerge)
throws MergeException {
merge(conn, table, sizes, numToMerge);
for (int i = 0; i < numToMerge; i++) {
@@ -202,7 +202,7 @@ public class Merge {
}
}
- protected void merge(Connector conn, String table, List<Size> sizes, int numToMerge)
+ protected void merge(AccumuloClient conn, String table, List<Size> sizes, int numToMerge)
throws MergeException {
try {
Text start = sizes.get(0).extent.getPrevEndRow();
@@ -215,8 +215,8 @@ public class Merge {
}
}
- protected Iterator<Size> getSizeIterator(Connector conn, String tablename, Text start, Text end)
- throws MergeException {
+ protected Iterator<Size> getSizeIterator(AccumuloClient conn, String tablename, Text start,
+ Text end) throws MergeException {
// open up metadata, walk through the tablets.
Table.ID tableId;
Scanner scanner;
diff --git a/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsImplTest.java b/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsImplTest.java
index 8ae302a..23a4e97 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/impl/TableOperationsImplTest.java
@@ -18,7 +18,7 @@ package org.apache.accumulo.core.client.impl;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.impl.KeyExtent;
@@ -36,13 +36,14 @@ public class TableOperationsImplTest {
TableOperationsImpl topsImpl = new TableOperationsImpl(context);
- Connector connector = EasyMock.createMock(Connector.class);
+ AccumuloClient accumuloClient = EasyMock.createMock(AccumuloClient.class);
Scanner scanner = EasyMock.createMock(Scanner.class);
Range range = new KeyExtent(Table.ID.of("1"), null, null).toMetadataRange();
- EasyMock.expect(context.getConnector()).andReturn(connector);
- EasyMock.expect(connector.createScanner(tableName, Authorizations.EMPTY)).andReturn(scanner);
+ EasyMock.expect(context.getConnector()).andReturn(accumuloClient);
+ EasyMock.expect(accumuloClient.createScanner(tableName, Authorizations.EMPTY))
+ .andReturn(scanner);
// Fetch the columns on the scanner
scanner.fetchColumnFamily(MetadataSchema.TabletsSection.FutureLocationColumnFamily.NAME);
@@ -65,11 +66,11 @@ public class TableOperationsImplTest {
EasyMock.expect(scanner.getBatchSize()).andReturn(1000);
EasyMock.expect(scanner.getReadaheadThreshold()).andReturn(100L);
- EasyMock.replay(context, connector, scanner);
+ EasyMock.replay(context, accumuloClient, scanner);
topsImpl.createMetadataScanner(tableName, range);
- EasyMock.verify(context, connector, scanner);
+ EasyMock.verify(context, accumuloClient, scanner);
}
}
diff --git a/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java b/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
index 03828e4..876a721 100644
--- a/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
@@ -23,9 +23,9 @@ import static org.junit.Assert.assertTrue;
import java.util.HashMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.TableOperations;
@@ -51,7 +51,7 @@ public class MetadataServicerTest {
tableNameToIdMap.put(userTableName, userTableId.canonicalID());
context = EasyMock.createMock(ClientContext.class);
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
TableOperations tableOps = EasyMock.createMock(TableOperations.class);
EasyMock.expect(tableOps.tableIdMap()).andReturn(tableNameToIdMap).anyTimes();
EasyMock.expect(conn.tableOperations()).andReturn(tableOps).anyTimes();
diff --git a/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java b/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java
index 70f713d..060a3fe 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.util.Merge.Size;
@@ -54,8 +54,8 @@ public class MergeTest {
protected void message(String format, Object... args) {}
@Override
- protected Iterator<Size> getSizeIterator(Connector conn, String tablename, final Text start,
- final Text end) throws MergeException {
+ protected Iterator<Size> getSizeIterator(AccumuloClient conn, String tablename,
+ final Text start, final Text end) throws MergeException {
final Iterator<Size> impl = tablets.iterator();
return new Iterator<Size>() {
Size next = skip();
@@ -98,7 +98,7 @@ public class MergeTest {
}
@Override
- protected void merge(Connector conn, String table, List<Size> sizes, int numToMerge)
+ protected void merge(AccumuloClient conn, String table, List<Size> sizes, int numToMerge)
throws MergeException {
List<Size> merge = new ArrayList<>();
for (int i = 0; i < numToMerge; i++) {
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/AccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/AccumuloCluster.java
index 285f051..4f660e2 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/AccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/AccumuloCluster.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.cluster;
import java.io.IOException;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
@@ -54,11 +55,21 @@ public interface AccumuloCluster {
/**
* Utility method to get a connector to the cluster.
+ *
+ * @deprecated since 2.0.0, replaced by {{@link #getAccumuloClient()}}
*/
Connector getConnector(String user, AuthenticationToken token)
throws AccumuloException, AccumuloSecurityException;
/**
+ * Utility method to get a client connection to the cluster.
+ *
+ * @since 2.0
+ */
+ AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
+ throws AccumuloException, AccumuloSecurityException;
+
+ /**
* Get the client configuration for the cluster
*
* @deprecated since 2.0.0, replaced by {{@link #getClientInfo()}}
diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
index a309f81..91baff4 100644
--- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java
@@ -26,6 +26,7 @@ import java.util.List;
import org.apache.accumulo.cluster.AccumuloCluster;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
@@ -137,7 +138,14 @@ public class StandaloneAccumuloCluster implements AccumuloCluster {
@Override
public Connector getConnector(String user, AuthenticationToken token)
throws AccumuloException, AccumuloSecurityException {
- return Connector.builder().forInstance(getInstanceName(), getZooKeepers())
+ return Connector.from(AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
+ .usingToken(user, token).build());
+ }
+
+ @Override
+ public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
+ throws AccumuloException, AccumuloSecurityException {
+ return AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
.usingToken(user, token).build();
}
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 2fb5560..b07dab8 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -20,10 +20,11 @@ import java.io.File;
import java.io.IOException;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
@@ -116,10 +117,21 @@ public class MiniAccumuloCluster {
* Utility method to get a connector to the MAC.
*
* @since 1.6.0
+ * @deprecated since 2.0.0, replaced by {@link #getAccumuloClient(String, AuthenticationToken)}
*/
- public Connector getConnector(String user, String passwd)
+ public AccumuloClient getConnector(String user, String passwd)
throws AccumuloException, AccumuloSecurityException {
- return impl.getConnector(user, new PasswordToken(passwd));
+ return impl.getAccumuloClient(user, new PasswordToken(passwd));
+ }
+
+ /**
+ * Utility method to get a client connection to the MAC.
+ *
+ * @since 2.0.0
+ */
+ public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
+ throws AccumuloException, AccumuloSecurityException {
+ return impl.getAccumuloClient(user, token);
}
/**
@@ -150,6 +162,6 @@ public class MiniAccumuloCluster {
public static ClientInfo getClientInfo(File directory) {
File clientProps = new File(new File(directory, "conf"), "accumulo-client.properties");
Preconditions.checkArgument(clientProps.exists());
- return Connector.builder().usingProperties(clientProps.getAbsolutePath()).info();
+ return AccumuloClient.builder().usingProperties(clientProps.getAbsolutePath()).info();
}
}
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 31d0213..4e1210e 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -54,6 +54,7 @@ import java.util.concurrent.TimeoutException;
import org.apache.accumulo.cluster.AccumuloCluster;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
@@ -774,7 +775,15 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
@Override
public Connector getConnector(String user, AuthenticationToken token)
throws AccumuloException, AccumuloSecurityException {
- return Connector.builder().usingClientInfo(getClientInfo()).usingToken(user, token).build();
+ return Connector.from(
+ AccumuloClient.builder().usingClientInfo(getClientInfo()).usingToken(user, token).build());
+ }
+
+ @Override
+ public AccumuloClient getAccumuloClient(String user, AuthenticationToken token)
+ throws AccumuloException, AccumuloSecurityException {
+ return AccumuloClient.builder().usingClientInfo(getClientInfo()).usingToken(user, token)
+ .build();
}
@SuppressWarnings("deprecation")
@@ -787,7 +796,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
@Override
public ClientInfo getClientInfo() {
if (clientInfo == null) {
- clientInfo = Connector.builder()
+ clientInfo = AccumuloClient.builder()
.usingProperties(config.getClientPropsFile().getAbsolutePath()).info();
}
return clientInfo;
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
index 711023b..8ab8027 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
@@ -24,7 +24,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Map;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.commons.io.FileUtils;
import org.apache.curator.framework.CuratorFramework;
@@ -89,7 +89,7 @@ public class MiniAccumuloClusterExistingZooKeepersTest {
@Test
public void canConnectViaExistingZooKeeper() throws Exception {
- Connector conn = accumulo.getConnector("root", SECRET);
+ AccumuloClient conn = accumulo.getConnector("root", SECRET);
ClientContext context = new ClientContext(accumulo.getClientInfo());
assertEquals(zooKeeper.getConnectString(), context.getZooKeepers());
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
index ed87ab3..df7d869 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
@@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
@@ -76,7 +76,7 @@ public class MiniAccumuloClusterStartStopTest {
public void multipleStopsIsAllowed() throws Exception {
accumulo.start();
- Connector conn = accumulo.getConnector("root", "superSecret");
+ AccumuloClient conn = accumulo.getConnector("root", "superSecret");
conn.tableOperations().create("foo");
accumulo.stop();
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
index 366294a..b842538 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
@@ -29,9 +29,9 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.admin.NewTableConfiguration;
@@ -89,7 +89,7 @@ public class MiniAccumuloClusterTest {
@Test(timeout = 30000)
public void test() throws Exception {
- Connector conn = accumulo.getConnector("root", "superSecret");
+ AccumuloClient conn = accumulo.getConnector("root", "superSecret");
conn.tableOperations().create("table1", new NewTableConfiguration());
@@ -105,7 +105,7 @@ public class MiniAccumuloClusterTest {
conn.tableOperations().attachIterator("table1", is);
- Connector uconn = accumulo.getConnector("user1", "pass1");
+ AccumuloClient uconn = accumulo.getConnector("user1", "pass1");
BatchWriter bw = uconn.createBatchWriter("table1", new BatchWriterConfig());
@@ -165,7 +165,7 @@ public class MiniAccumuloClusterTest {
@Test(timeout = 60000)
public void testPerTableClasspath() throws Exception {
- Connector conn = accumulo.getConnector("root", "superSecret");
+ AccumuloClient conn = accumulo.getConnector("root", "superSecret");
conn.tableOperations().create("table2");
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
index e179ebb..7676401 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImplTest.java
@@ -26,7 +26,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -73,7 +73,7 @@ public class MiniAccumuloClusterImplTest {
accumulo = new MiniAccumuloClusterImpl(config);
accumulo.start();
// create a table to ensure there are some entries in the !0 table
- Connector conn = accumulo.getConnector("root", new PasswordToken("superSecret"));
+ AccumuloClient conn = accumulo.getAccumuloClient("root", new PasswordToken("superSecret"));
TableOperations tableops = conn.tableOperations();
tableops.create(TEST_TABLE);
testTableID = tableops.tableIdMap().get(TEST_TABLE);
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
index 7f964cb..2d6b9bb 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
@@ -37,6 +37,7 @@ import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
@@ -45,7 +46,6 @@ import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ConditionalWriter;
import org.apache.accumulo.core.client.ConditionalWriter.Result;
import org.apache.accumulo.core.client.ConditionalWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.NamespaceExistsException;
@@ -221,11 +221,11 @@ public class ProxyServer implements AccumuloProxy.Iface {
}
@SuppressWarnings("deprecation")
- protected Connector getConnector(ByteBuffer login) throws Exception {
+ protected AccumuloClient getConnector(ByteBuffer login) throws Exception {
String[] pair = ByteBufferUtil.toString(login).split(",", 2);
if (instance.getInstanceID().equals(pair[0])) {
Credentials creds = Credentials.deserialize(pair[1]);
- return instance.getConnector(creds.getPrincipal(), creds.getToken());
+ return (AccumuloClient) instance.getConnector(creds.getPrincipal(), creds.getToken());
} else {
throw new org.apache.accumulo.core.client.AccumuloSecurityException(pair[0],
org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.INVALID_INSTANCEID);
@@ -543,17 +543,17 @@ public class ProxyServer implements AccumuloProxy.Iface {
org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
try {
- Connector connector = getConnector(login);
+ AccumuloClient accumuloClient = getConnector(login);
Text startText = ByteBufferUtil.toText(startRow);
Text endText = ByteBufferUtil.toText(endRow);
Authorizations auth;
if (auths != null) {
auth = getAuthorizations(auths);
} else {
- auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
+ auth = accumuloClient.securityOperations().getUserAuthorizations(accumuloClient.whoami());
}
- Text max = connector.tableOperations().getMaxRow(tableName, auth, startText, startInclusive,
- endText, endInclusive);
+ Text max = accumuloClient.tableOperations().getMaxRow(tableName, auth, startText,
+ startInclusive, endText, endInclusive);
return TextUtil.getByteBuffer(max);
} catch (Exception e) {
handleExceptionTNF(e);
@@ -1167,15 +1167,15 @@ public class ProxyServer implements AccumuloProxy.Iface {
org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
try {
- Connector connector = getConnector(login);
+ AccumuloClient accumuloClient = getConnector(login);
Authorizations auth;
if (opts != null && opts.isSetAuthorizations()) {
auth = getAuthorizations(opts.authorizations);
} else {
- auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
+ auth = accumuloClient.securityOperations().getUserAuthorizations(accumuloClient.whoami());
}
- Scanner scanner = connector.createScanner(tableName, auth);
+ Scanner scanner = accumuloClient.createScanner(tableName, auth);
if (opts != null) {
if (opts.iterators != null) {
@@ -1221,19 +1221,19 @@ public class ProxyServer implements AccumuloProxy.Iface {
org.apache.accumulo.proxy.thrift.AccumuloSecurityException,
org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
try {
- Connector connector = getConnector(login);
+ AccumuloClient accumuloClient = getConnector(login);
int threads = 10;
Authorizations auth;
if (opts != null && opts.isSetAuthorizations()) {
auth = getAuthorizations(opts.authorizations);
} else {
- auth = connector.securityOperations().getUserAuthorizations(connector.whoami());
+ auth = accumuloClient.securityOperations().getUserAuthorizations(accumuloClient.whoami());
}
if (opts != null && opts.threads > 0)
threads = opts.threads;
- BatchScanner scanner = connector.createBatchScanner(tableName, auth, threads);
+ BatchScanner scanner = accumuloClient.createBatchScanner(tableName, auth, threads);
if (opts != null) {
if (opts.iterators != null) {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java b/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
index 7246e7e..8c54a59 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
@@ -22,12 +22,12 @@ import java.io.IOException;
import java.util.Objects;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
import org.apache.accumulo.core.client.impl.ClientContext;
-import org.apache.accumulo.core.client.impl.ConnectorImpl;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
@@ -238,16 +238,17 @@ public class ServerContext extends ClientContext {
}
@Override
- public synchronized Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+ public synchronized AccumuloClient getConnector()
+ throws AccumuloException, AccumuloSecurityException {
if (conn == null) {
- conn = new ConnectorImpl(this);
+ conn = new AccumuloClientImpl(this);
}
return conn;
}
- public Connector getConnector(String principal, AuthenticationToken token)
+ public AccumuloClient getConnector(String principal, AuthenticationToken token)
throws AccumuloSecurityException, AccumuloException {
- return Connector.builder().usingClientInfo(info).usingToken(principal, token).build();
+ return AccumuloClient.builder().usingClientInfo(info).usingToken(principal, token).build();
}
public synchronized TableManager getTableManager() {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
index 10ee092..39cdeba 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
@@ -26,8 +26,8 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.SortedMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.ScannerBase;
import org.apache.accumulo.core.client.impl.ClientContext;
@@ -60,8 +60,8 @@ public class MetaDataTableScanner implements ClosableIterator<TabletLocationStat
// scan over metadata table, looking for tablets in the wrong state based on the live servers
// and online tables
try {
- Connector connector = context.getConnector();
- mdScanner = connector.createBatchScanner(tableName, Authorizations.EMPTY, 8);
+ AccumuloClient accumuloClient = context.getConnector();
+ mdScanner = accumuloClient.createBatchScanner(tableName, Authorizations.EMPTY, 8);
configureScanner(mdScanner, state);
mdScanner.setRanges(Collections.singletonList(range));
iter = mdScanner.iterator();
diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
index 4e2fd75..6c5ce85 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
@@ -31,7 +31,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
@@ -168,8 +168,8 @@ public class ProblemReports implements Iterable<ProblemReport> {
return;
}
- Connector connector = context.getConnector();
- Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ AccumuloClient accumuloClient = context.getConnector();
+ Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
scanner.addScanIterator(new IteratorSetting(1, "keys-only", SortedKeyIterator.class));
scanner.setRange(new Range(new Text("~err_" + table)));
@@ -223,8 +223,9 @@ public class ProblemReports implements Iterable<ProblemReport> {
if (iter2 == null) {
try {
if ((table == null || !isMeta(table)) && iter1Count == 0) {
- Connector connector = context.getConnector();
- Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ AccumuloClient accumuloClient = context.getConnector();
+ Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME,
+ Authorizations.EMPTY);
scanner.setTimeout(3, TimeUnit.SECONDS);
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/PrintReplicationRecords.java b/server/base/src/main/java/org/apache/accumulo/server/replication/PrintReplicationRecords.java
index 0e7914e..4487975 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/PrintReplicationRecords.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/PrintReplicationRecords.java
@@ -21,7 +21,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map.Entry;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -40,11 +40,11 @@ import com.google.protobuf.InvalidProtocolBufferException;
public class PrintReplicationRecords implements Runnable {
private static final Logger log = LoggerFactory.getLogger(PrintReplicationRecords.class);
- private Connector conn;
+ private AccumuloClient conn;
private PrintStream out;
private SimpleDateFormat sdf;
- public PrintReplicationRecords(Connector conn, PrintStream out) {
+ public PrintReplicationRecords(AccumuloClient conn, PrintStream out) {
this.conn = conn;
this.out = out;
this.sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
index dd32543..1271a4c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
@@ -26,10 +26,10 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Table;
@@ -235,7 +235,7 @@ public class ReplicationUtil {
* The Replication work queue key
* @return The absolute path for the file, or null if the key is no longer in ZooKeeper
*/
- public String getAbsolutePath(Connector conn, String workQueuePath, String queueKey) {
+ public String getAbsolutePath(AccumuloClient conn, String workQueuePath, String queueKey) {
byte[] data = zooCache.get(workQueuePath + "/" + queueKey);
if (null != data) {
return new String(data, UTF_8);
@@ -255,7 +255,7 @@ public class ReplicationUtil {
* ReplicationTarget the WAL is being replicated to
* @return A status message for a file being replicated
*/
- public String getProgress(Connector conn, String path, ReplicationTarget target) {
+ public String getProgress(AccumuloClient conn, String path, ReplicationTarget target) {
// We could try to grep over the table, but without knowing the full file path, we
// can't find the status quickly
String status = "Unknown";
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/WorkAssigner.java b/server/base/src/main/java/org/apache/accumulo/server/replication/WorkAssigner.java
index f8a89b7..1f5fd0f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/WorkAssigner.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/WorkAssigner.java
@@ -16,7 +16,7 @@
*/
package org.apache.accumulo.server.replication;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
/**
@@ -32,7 +32,7 @@ public interface WorkAssigner {
/**
* Configure the WorkAssigner implementation
*/
- void configure(AccumuloConfiguration conf, Connector conn);
+ void configure(AccumuloConfiguration conf, AccumuloClient conn);
/**
* Assign work for replication
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
index 7231b8f..c9ee53d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
@@ -33,9 +33,9 @@ import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.NamespaceNotFoundException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.InstanceOperations;
@@ -309,7 +309,7 @@ public class Admin implements KeywordExecutable {
@Override
public void run() {
try {
- Connector conn = context.getConnector();
+ AccumuloClient conn = context.getConnector();
Set<String> tables = conn.tableOperations().tableIdMap().keySet();
for (String table : tables) {
if (table.equals(MetadataTable.NAME))
@@ -447,12 +447,12 @@ public class Admin implements KeywordExecutable {
throw new IllegalArgumentException(opts.directory + " is not writable");
}
}
- Connector connector = context.getConnector();
+ AccumuloClient accumuloClient = context.getConnector();
defaultConfig = DefaultConfiguration.getInstance();
- siteConfig = connector.instanceOperations().getSiteConfiguration();
- systemConfig = connector.instanceOperations().getSystemConfiguration();
+ siteConfig = accumuloClient.instanceOperations().getSiteConfiguration();
+ systemConfig = accumuloClient.instanceOperations().getSystemConfiguration();
if (opts.allConfiguration || opts.users) {
- localUsers = Lists.newArrayList(connector.securityOperations().listLocalUsers());
+ localUsers = Lists.newArrayList(accumuloClient.securityOperations().listLocalUsers());
Collections.sort(localUsers);
}
@@ -460,35 +460,35 @@ public class Admin implements KeywordExecutable {
// print accumulo site
printSystemConfiguration(outputDirectory);
// print namespaces
- for (String namespace : connector.namespaceOperations().list()) {
- printNameSpaceConfiguration(connector, namespace, outputDirectory);
+ for (String namespace : accumuloClient.namespaceOperations().list()) {
+ printNameSpaceConfiguration(accumuloClient, namespace, outputDirectory);
}
// print tables
- SortedSet<String> tableNames = connector.tableOperations().list();
+ SortedSet<String> tableNames = accumuloClient.tableOperations().list();
for (String tableName : tableNames) {
- printTableConfiguration(connector, tableName, outputDirectory);
+ printTableConfiguration(accumuloClient, tableName, outputDirectory);
}
// print users
for (String user : localUsers) {
- printUserConfiguration(connector, user, outputDirectory);
+ printUserConfiguration(accumuloClient, user, outputDirectory);
}
} else {
if (opts.systemConfiguration) {
printSystemConfiguration(outputDirectory);
}
if (opts.namespaceConfiguration) {
- for (String namespace : connector.namespaceOperations().list()) {
- printNameSpaceConfiguration(connector, namespace, outputDirectory);
+ for (String namespace : accumuloClient.namespaceOperations().list()) {
+ printNameSpaceConfiguration(accumuloClient, namespace, outputDirectory);
}
}
if (opts.tables.size() > 0) {
for (String tableName : opts.tables) {
- printTableConfiguration(connector, tableName, outputDirectory);
+ printTableConfiguration(accumuloClient, tableName, outputDirectory);
}
}
if (opts.users) {
for (String user : localUsers) {
- printUserConfiguration(connector, user, outputDirectory);
+ printUserConfiguration(accumuloClient, user, outputDirectory);
}
}
}
@@ -510,14 +510,14 @@ public class Admin implements KeywordExecutable {
return defaultValue;
}
- private void printNameSpaceConfiguration(Connector connector, String namespace,
+ private void printNameSpaceConfiguration(AccumuloClient accumuloClient, String namespace,
File outputDirectory)
throws IOException, AccumuloException, AccumuloSecurityException, NamespaceNotFoundException {
File namespaceScript = new File(outputDirectory, namespace + NS_FILE_SUFFIX);
FileWriter nsWriter = new FileWriter(namespaceScript);
nsWriter.write(createNsFormat.format(new String[] {namespace}));
TreeMap<String,String> props = new TreeMap<>();
- for (Entry<String,String> p : connector.namespaceOperations().getProperties(namespace)) {
+ for (Entry<String,String> p : accumuloClient.namespaceOperations().getProperties(namespace)) {
props.put(p.getKey(), p.getValue());
}
for (Entry<String,String> entry : props.entrySet()) {
@@ -533,28 +533,28 @@ public class Admin implements KeywordExecutable {
nsWriter.close();
}
- private static void printUserConfiguration(Connector connector, String user, File outputDirectory)
- throws IOException, AccumuloException, AccumuloSecurityException {
+ private static void printUserConfiguration(AccumuloClient accumuloClient, String user,
+ File outputDirectory) throws IOException, AccumuloException, AccumuloSecurityException {
File userScript = new File(outputDirectory, user + USER_FILE_SUFFIX);
FileWriter userWriter = new FileWriter(userScript);
userWriter.write(createUserFormat.format(new String[] {user}));
- Authorizations auths = connector.securityOperations().getUserAuthorizations(user);
+ Authorizations auths = accumuloClient.securityOperations().getUserAuthorizations(user);
userWriter.write(userAuthsFormat.format(new String[] {user, auths.toString()}));
for (SystemPermission sp : SystemPermission.values()) {
- if (connector.securityOperations().hasSystemPermission(user, sp)) {
+ if (accumuloClient.securityOperations().hasSystemPermission(user, sp)) {
userWriter.write(sysPermFormat.format(new String[] {sp.name(), user}));
}
}
- for (String namespace : connector.namespaceOperations().list()) {
+ for (String namespace : accumuloClient.namespaceOperations().list()) {
for (NamespacePermission np : NamespacePermission.values()) {
- if (connector.securityOperations().hasNamespacePermission(user, namespace, np)) {
+ if (accumuloClient.securityOperations().hasNamespacePermission(user, namespace, np)) {
userWriter.write(nsPermFormat.format(new String[] {np.name(), namespace, user}));
}
}
}
- for (String tableName : connector.tableOperations().list()) {
+ for (String tableName : accumuloClient.tableOperations().list()) {
for (TablePermission perm : TablePermission.values()) {
- if (connector.securityOperations().hasTablePermission(user, tableName, perm)) {
+ if (accumuloClient.securityOperations().hasTablePermission(user, tableName, perm)) {
userWriter.write(tablePermFormat.format(new String[] {perm.name(), tableName, user}));
}
}
@@ -588,13 +588,14 @@ public class Admin implements KeywordExecutable {
}
}
- private void printTableConfiguration(Connector connector, String tableName, File outputDirectory)
+ private void printTableConfiguration(AccumuloClient accumuloClient, String tableName,
+ File outputDirectory)
throws AccumuloException, TableNotFoundException, IOException, AccumuloSecurityException {
File tableBackup = new File(outputDirectory, tableName + ".cfg");
FileWriter writer = new FileWriter(tableBackup);
writer.write(createTableFormat.format(new String[] {tableName}));
TreeMap<String,String> props = new TreeMap<>();
- for (Entry<String,String> p : connector.tableOperations().getProperties(tableName)) {
+ for (Entry<String,String> p : accumuloClient.tableOperations().getProperties(tableName)) {
props.put(p.getKey(), p.getValue());
}
for (Entry<String,String> prop : props.entrySet()) {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java b/server/base/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java
index 5281485..03ade88 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/LocalityCheck.java
@@ -21,7 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
@@ -45,8 +45,8 @@ public class LocalityCheck {
opts.parseArgs(LocalityCheck.class.getName(), args);
VolumeManager fs = opts.getServerContext().getVolumeManager();
- Connector connector = opts.getConnector();
- Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ AccumuloClient accumuloClient = opts.getConnector();
+ Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
scanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
scanner.setRange(MetadataSchema.TabletsSection.getRange());
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 4082017..63c0b0b 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -38,11 +38,11 @@ import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
@@ -750,7 +750,7 @@ public class MetadataTableUtil {
}
private static Iterable<TabletMetadata> createCloneScanner(String testTableName, Table.ID tableId,
- Connector conn) throws TableNotFoundException {
+ AccumuloClient conn) throws TableNotFoundException {
String tableName;
Range range;
@@ -777,7 +777,8 @@ public class MetadataTableUtil {
@VisibleForTesting
public static void initializeClone(String testTableName, Table.ID srcTableId, Table.ID tableId,
- Connector conn, BatchWriter bw) throws TableNotFoundException, MutationsRejectedException {
+ AccumuloClient conn, BatchWriter bw)
+ throws TableNotFoundException, MutationsRejectedException {
Iterator<TabletMetadata> ti = createCloneScanner(testTableName, srcTableId, conn).iterator();
@@ -797,7 +798,8 @@ public class MetadataTableUtil {
@VisibleForTesting
public static int checkClone(String testTableName, Table.ID srcTableId, Table.ID tableId,
- Connector conn, BatchWriter bw) throws TableNotFoundException, MutationsRejectedException {
+ AccumuloClient conn, BatchWriter bw)
+ throws TableNotFoundException, MutationsRejectedException {
Iterator<TabletMetadata> srcIter = createCloneScanner(testTableName, srcTableId, conn)
.iterator();
@@ -880,7 +882,7 @@ public class MetadataTableUtil {
public static void cloneTable(ServerContext context, Table.ID srcTableId, Table.ID tableId,
VolumeManager volumeManager) throws Exception {
- Connector conn = context.getConnector();
+ AccumuloClient conn = context.getConnector();
try (BatchWriter bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig())) {
while (true) {
@@ -944,7 +946,7 @@ public class MetadataTableUtil {
update(context, zooLock, m, extent);
}
- public static void removeBulkLoadEntries(Connector conn, Table.ID tableId, long tid)
+ public static void removeBulkLoadEntries(AccumuloClient conn, Table.ID tableId, long tid)
throws Exception {
try (
Scanner mscanner = new IsolatedScanner(
@@ -966,7 +968,7 @@ public class MetadataTableUtil {
}
}
- public static List<FileRef> getBulkFilesLoaded(ServerContext context, Connector conn,
+ public static List<FileRef> getBulkFilesLoaded(ServerContext context, AccumuloClient conn,
KeyExtent extent, long tid) throws IOException {
List<FileRef> result = new ArrayList<>();
try (Scanner mscanner = new IsolatedScanner(conn.createScanner(
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
index cc0c567..a1e8847 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java
@@ -21,8 +21,8 @@ import java.util.Iterator;
import java.util.Random;
import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.server.cli.ClientOnDefaultTable;
@@ -100,8 +100,8 @@ public class RandomWriter {
long start = System.currentTimeMillis();
log.info("starting at {} for user {}", start, opts.getPrincipal());
try {
- Connector connector = opts.getConnector();
- BatchWriter bw = connector.createBatchWriter(opts.getTableName(),
+ AccumuloClient accumuloClient = opts.getConnector();
+ BatchWriter bw = accumuloClient.createBatchWriter(opts.getTableName(),
bwOpts.getBatchWriterConfig());
log.info("Writing {} mutations...", opts.count);
bw.addMutations(new RandomMutationGenerator(opts.count));
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RandomizeVolumes.java b/server/base/src/main/java/org/apache/accumulo/server/util/RandomizeVolumes.java
index 8d81fe0..7978252 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RandomizeVolumes.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RandomizeVolumes.java
@@ -23,10 +23,10 @@ import java.io.IOException;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Table;
@@ -54,7 +54,7 @@ public class RandomizeVolumes {
ClientOnRequiredTable opts = new ClientOnRequiredTable();
opts.parseArgs(RandomizeVolumes.class.getName(), args);
ServerContext context = opts.getServerContext();
- Connector c;
+ AccumuloClient c;
if (opts.getToken() == null) {
c = context.getConnector();
} else {
@@ -69,7 +69,7 @@ public class RandomizeVolumes {
}
}
- public static int randomize(ServerContext context, Connector c, String tableName)
+ public static int randomize(ServerContext context, AccumuloClient c, String tableName)
throws IOException, AccumuloSecurityException, AccumuloException, TableNotFoundException {
final VolumeManager vm = context.getVolumeManager();
if (vm.getVolumes().size() < 2) {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java b/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
index 5c9d6f3..164fcea 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/RemoveEntriesForMissingFiles.java
@@ -27,10 +27,10 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.client.impl.Tables;
@@ -128,8 +128,8 @@ public class RemoveEntriesForMissingFiles {
System.out.printf("Scanning : %s %s\n", tableName, range);
VolumeManager fs = context.getVolumeManager();
- Connector connector = context.getConnector();
- Scanner metadata = connector.createScanner(tableName, Authorizations.EMPTY);
+ AccumuloClient accumuloClient = context.getConnector();
+ Scanner metadata = accumuloClient.createScanner(tableName, Authorizations.EMPTY);
metadata.setRange(range);
metadata.fetchColumnFamily(DataFileColumnFamily.NAME);
int count = 0;
@@ -138,7 +138,7 @@ public class RemoveEntriesForMissingFiles {
BatchWriter writer = null;
if (fix)
- writer = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
+ writer = accumuloClient.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
for (Entry<Key,Value> entry : metadata) {
if (exceptionRef.get() != null)
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
index 9ad2d7a..8a3313c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
@@ -25,9 +25,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.IteratorSetting.Column;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -84,7 +84,7 @@ public class ReplicationTableUtil {
synchronized static Writer getWriter(ClientContext context) {
Writer replicationTable = writers.get(context.getCredentials());
if (replicationTable == null) {
- Connector conn;
+ AccumuloClient conn;
try {
conn = context.getConnector();
} catch (AccumuloException | AccumuloSecurityException e) {
@@ -99,7 +99,7 @@ public class ReplicationTableUtil {
return replicationTable;
}
- public synchronized static void configureMetadataTable(Connector conn, String tableName) {
+ public synchronized static void configureMetadataTable(AccumuloClient conn, String tableName) {
TableOperations tops = conn.tableOperations();
Map<String,EnumSet<IteratorScope>> iterators = null;
try {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
index 8c62040..d7aea77 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java
@@ -30,7 +30,7 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.ClientContext;
@@ -146,13 +146,13 @@ public class TableDiskUsage {
void print(String line);
}
- public static void printDiskUsage(Collection<String> tableNames, VolumeManager fs, Connector conn,
- boolean humanReadable) throws TableNotFoundException, IOException {
+ public static void printDiskUsage(Collection<String> tableNames, VolumeManager fs,
+ AccumuloClient conn, boolean humanReadable) throws TableNotFoundException, IOException {
printDiskUsage(tableNames, fs, conn, line -> System.out.println(line), humanReadable);
}
public static Map<TreeSet<String>,Long> getDiskUsage(Set<Table.ID> tableIds, VolumeManager fs,
- Connector conn) throws IOException {
+ AccumuloClient conn) throws IOException {
TableDiskUsage tdu = new TableDiskUsage();
// Add each tableID
@@ -266,8 +266,9 @@ public class TableDiskUsage {
return usage;
}
- public static void printDiskUsage(Collection<String> tableNames, VolumeManager fs, Connector conn,
- Printer printer, boolean humanReadable) throws TableNotFoundException, IOException {
+ public static void printDiskUsage(Collection<String> tableNames, VolumeManager fs,
+ AccumuloClient conn, Printer printer, boolean humanReadable)
+ throws TableNotFoundException, IOException {
HashSet<Table.ID> tableIds = new HashSet<>();
ClientContext context = new ClientContext(conn.info());
@@ -298,7 +299,7 @@ public class TableDiskUsage {
public static void main(String[] args) throws Exception {
Opts opts = new Opts();
opts.parseArgs(TableDiskUsage.class.getName(), args);
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
VolumeManager fs = opts.getServerContext().getVolumeManager();
org.apache.accumulo.server.util.TableDiskUsage.printDiskUsage(opts.tables, fs, conn, false);
}
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
index 5e5b41a..3aa3a78 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
@@ -27,9 +27,9 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.Table;
@@ -73,7 +73,7 @@ public class VerifyTabletAssignments {
Opts opts = new Opts();
opts.parseArgs(VerifyTabletAssignments.class.getName(), args);
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
ClientContext context = new ClientContext(conn.info());
for (String table : conn.tableOperations().list())
checkTable(context, opts, table, null);
diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/SystemCredentialsTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/SystemCredentialsTest.java
index 958061e..a00120b 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/security/SystemCredentialsTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/security/SystemCredentialsTest.java
@@ -23,7 +23,7 @@ import java.io.File;
import java.io.IOException;
import java.util.UUID;
-import org.apache.accumulo.core.client.impl.ConnectorImpl;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
import org.apache.accumulo.core.client.impl.Credentials;
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.server.ServerConstants;
@@ -65,8 +65,8 @@ public class SystemCredentialsTest {
/**
* This is a test to ensure the string literal in
- * {@link ConnectorImpl#ConnectorImpl(org.apache.accumulo.core.client.impl.ClientContext)} is kept
- * up-to-date if we move the {@link SystemToken}<br>
+ * {@link AccumuloClientImpl#AccumuloClientImpl(org.apache.accumulo.core.client.impl.ClientContext)}
+ * is kept up-to-date if we move the {@link SystemToken}<br>
* This check will not be needed after ACCUMULO-1578
*/
@Test
diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/ReplicationTableUtilTest.java b/server/base/src/test/java/org/apache/accumulo/server/util/ReplicationTableUtilTest.java
index 5624a2e..7fb39d5 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/util/ReplicationTableUtilTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/util/ReplicationTableUtilTest.java
@@ -32,7 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.IteratorSetting.Column;
import org.apache.accumulo.core.client.admin.TableOperations;
@@ -134,7 +134,7 @@ public class ReplicationTableUtilTest {
@Test
public void setsCombinerOnMetadataCorrectly() throws Exception {
- Connector conn = createMock(Connector.class);
+ AccumuloClient conn = createMock(AccumuloClient.class);
TableOperations tops = createMock(TableOperations.class);
String myMetadataTable = "mymetadata";
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
index c086d7f..1b856d9 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
@@ -28,9 +28,9 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -350,7 +350,7 @@ public class GarbageCollectWriteAheadLogs {
protected int removeReplicationEntries(Map<UUID,TServerInstance> candidates)
throws IOException, KeeperException, InterruptedException {
- Connector conn;
+ AccumuloClient conn;
try {
conn = context.getConnector();
try {
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index c455a82..56fddfb 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -33,11 +33,11 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
@@ -174,7 +174,7 @@ public class SimpleGarbageCollector implements Iface {
return context.getConfiguration();
}
- Connector getConnector() throws AccumuloSecurityException, AccumuloException {
+ AccumuloClient getConnector() throws AccumuloSecurityException, AccumuloException {
return context.getConnector();
}
@@ -314,7 +314,7 @@ public class SimpleGarbageCollector implements Iface {
return;
}
- Connector c = getConnector();
+ AccumuloClient c = getConnector();
BatchWriter writer = c.createBatchWriter(tableName, new BatchWriterConfig());
// when deleting a dir and all files in that dir, only need to delete the dir
@@ -482,7 +482,7 @@ public class SimpleGarbageCollector implements Iface {
@Override
public Iterator<Entry<String,Status>> getReplicationNeededIterator()
throws AccumuloException, AccumuloSecurityException {
- Connector conn = getConnector();
+ AccumuloClient conn = getConnector();
try {
Scanner s = ReplicationTable.getScanner(conn);
StatusSection.limit(s);
@@ -588,9 +588,9 @@ public class SimpleGarbageCollector implements Iface {
// we just made a lot of metadata changes: flush them out
try {
- Connector connector = getConnector();
- connector.tableOperations().compact(MetadataTable.NAME, null, null, true, true);
- connector.tableOperations().compact(RootTable.NAME, null, null, true, true);
+ AccumuloClient accumuloClient = getConnector();
+ accumuloClient.tableOperations().compact(MetadataTable.NAME, null, null, true, true);
+ accumuloClient.tableOperations().compact(RootTable.NAME, null, null, true, true);
} catch (Exception e) {
log.warn("{}", e.getMessage(), e);
}
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java b/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
index 059a56b..e1b0c56 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/replication/CloseWriteAheadLogReferences.java
@@ -22,10 +22,10 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -86,7 +86,7 @@ public class CloseWriteAheadLogReferences implements Runnable {
// what the version they bundle uses.
Stopwatch sw = Stopwatch.createUnstarted();
- Connector conn;
+ AccumuloClient conn;
try {
conn = context.getConnector();
} catch (Exception e) {
@@ -157,7 +157,7 @@ public class CloseWriteAheadLogReferences implements Runnable {
* @param closedWals
* {@link Set} of paths to WALs that marked as closed or unreferenced in zookeeper
*/
- protected long updateReplicationEntries(Connector conn, Set<String> closedWals) {
+ protected long updateReplicationEntries(AccumuloClient conn, Set<String> closedWals) {
BatchScanner bs = null;
BatchWriter bw = null;
long recordsClosed = 0;
diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
index a5765e8..1b59e87 100644
--- a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
+++ b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
@@ -152,7 +152,7 @@ public class GarbageCollectWriteAheadLogsTest {
VolumeManager fs = EasyMock.createMock(VolumeManager.class);
WalStateManager marker = EasyMock.createMock(WalStateManager.class);
LiveTServerSet tserverSet = EasyMock.createMock(LiveTServerSet.class);
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
Scanner mscanner = EasyMock.createMock(Scanner.class);
Scanner rscanner = EasyMock.createMock(Scanner.class);
@@ -198,7 +198,7 @@ public class GarbageCollectWriteAheadLogsTest {
VolumeManager fs = EasyMock.createMock(VolumeManager.class);
WalStateManager marker = EasyMock.createMock(WalStateManager.class);
LiveTServerSet tserverSet = EasyMock.createMock(LiveTServerSet.class);
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
Scanner mscanner = EasyMock.createMock(Scanner.class);
Scanner rscanner = EasyMock.createMock(Scanner.class);
@@ -239,7 +239,7 @@ public class GarbageCollectWriteAheadLogsTest {
VolumeManager fs = EasyMock.createMock(VolumeManager.class);
WalStateManager marker = EasyMock.createMock(WalStateManager.class);
LiveTServerSet tserverSet = EasyMock.createMock(LiveTServerSet.class);
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
Scanner mscanner = EasyMock.createMock(Scanner.class);
Scanner rscanner = EasyMock.createMock(Scanner.class);
String row = MetadataSchema.ReplicationSection.getRowPrefix() + path;
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index d422a31..277dd5a 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -41,9 +41,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Namespace;
@@ -638,7 +638,7 @@ public class Master
return context.getTableManager();
}
- public Connector getConnector() throws AccumuloSecurityException, AccumuloException {
+ public AccumuloClient getConnector() throws AccumuloSecurityException, AccumuloException {
return context.getConnector();
}
@@ -942,9 +942,9 @@ public class Master
* migration will refer to a non-existing tablet, so it can never complete. Periodically scan
* the metadata table and remove any migrating tablets that no longer exist.
*/
- private void cleanupNonexistentMigrations(final Connector connector)
+ private void cleanupNonexistentMigrations(final AccumuloClient accumuloClient)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
- Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
Set<KeyExtent> found = new HashSet<>();
for (Entry<Key,Value> entry : scanner) {
diff --git a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
index 8358286..cc14c66 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
@@ -29,10 +29,10 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.RowIterator;
import org.apache.accumulo.core.client.Scanner;
@@ -182,7 +182,7 @@ public class MasterClientServiceHandler extends FateServiceHandler
serversToFlush.clear();
try {
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
Scanner scanner;
if (tableId.equals(MetadataTable.ID)) {
scanner = new IsolatedScanner(conn.createScanner(RootTable.NAME, Authorizations.EMPTY));
@@ -552,7 +552,7 @@ public class MasterClientServiceHandler extends FateServiceHandler
@Override
public boolean drainReplicationTable(TInfo tfino, TCredentials credentials, String tableName,
Set<String> logsToWatch) throws TException {
- Connector conn;
+ AccumuloClient conn;
try {
conn = master.getConnector();
} catch (AccumuloException | AccumuloSecurityException e) {
diff --git a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
index 3ca5cc5..71a741a 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
@@ -35,11 +35,11 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.RowIterator;
import org.apache.accumulo.core.client.Scanner;
@@ -598,7 +598,7 @@ abstract class TabletGroupWatcher extends Daemon {
Master.log.debug("Found following tablet {}", followingTablet);
}
try {
- Connector conn = this.master.getConnector();
+ AccumuloClient conn = this.master.getConnector();
Text start = extent.getPrevEndRow();
if (start == null) {
start = new Text();
@@ -704,7 +704,7 @@ abstract class TabletGroupWatcher extends Daemon {
BatchWriter bw = null;
try {
long fileCount = 0;
- Connector conn = this.master.getConnector();
+ AccumuloClient conn = this.master.getConnector();
// Make file entries in highest tablet
bw = conn.createBatchWriter(targetSystemTable, new BatchWriterConfig());
Scanner scanner = conn.createScanner(targetSystemTable, Authorizations.EMPTY);
@@ -786,7 +786,7 @@ abstract class TabletGroupWatcher extends Daemon {
}
}
- private void deleteTablets(MergeInfo info, Range scanRange, BatchWriter bw, Connector conn)
+ private void deleteTablets(MergeInfo info, Range scanRange, BatchWriter bw, AccumuloClient conn)
throws TableNotFoundException, MutationsRejectedException {
Scanner scanner;
Mutation m;
@@ -820,7 +820,7 @@ abstract class TabletGroupWatcher extends Daemon {
private KeyExtent getHighTablet(KeyExtent range) throws AccumuloException {
try {
- Connector conn = this.master.getConnector();
+ AccumuloClient conn = this.master.getConnector();
Scanner scanner = conn.createScanner(range.isMeta() ? RootTable.NAME : MetadataTable.NAME,
Authorizations.EMPTY);
TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
index c3dade4..bafc986 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
@@ -23,7 +23,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
@@ -61,7 +61,7 @@ public abstract class DistributedWorkQueueWorkAssigner implements WorkAssigner {
return StatusUtil.isWorkRequired(status);
}
- protected Connector conn;
+ protected AccumuloClient conn;
protected AccumuloConfiguration conf;
protected DistributedWorkQueue workQueue;
protected int maxQueueSize;
@@ -70,11 +70,11 @@ public abstract class DistributedWorkQueueWorkAssigner implements WorkAssigner {
/*
* Getters/setters for testing purposes
*/
- protected Connector getConnector() {
+ protected AccumuloClient getConnector() {
return conn;
}
- protected void setConnector(Connector conn) {
+ protected void setConnector(AccumuloClient conn) {
this.conn = conn;
}
@@ -119,7 +119,7 @@ public abstract class DistributedWorkQueueWorkAssigner implements WorkAssigner {
}
@Override
- public void configure(AccumuloConfiguration conf, Connector conn) {
+ public void configure(AccumuloConfiguration conf, AccumuloClient conn) {
this.conf = conf;
this.conn = conn;
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/FinishedWorkUpdater.java b/server/master/src/main/java/org/apache/accumulo/master/replication/FinishedWorkUpdater.java
index 0c3b374..4aaa66c 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/FinishedWorkUpdater.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/FinishedWorkUpdater.java
@@ -23,9 +23,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.impl.Table;
@@ -55,9 +55,9 @@ import com.google.protobuf.InvalidProtocolBufferException;
public class FinishedWorkUpdater implements Runnable {
private static final Logger log = LoggerFactory.getLogger(FinishedWorkUpdater.class);
- private final Connector conn;
+ private final AccumuloClient conn;
- public FinishedWorkUpdater(Connector conn) {
+ public FinishedWorkUpdater(AccumuloClient conn) {
this.conn = conn;
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/RemoveCompleteReplicationRecords.java b/server/master/src/main/java/org/apache/accumulo/master/replication/RemoveCompleteReplicationRecords.java
index d0127f4..efd615f 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/RemoveCompleteReplicationRecords.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/RemoveCompleteReplicationRecords.java
@@ -25,9 +25,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.impl.Table;
@@ -57,9 +57,9 @@ import com.google.protobuf.InvalidProtocolBufferException;
public class RemoveCompleteReplicationRecords implements Runnable {
private static final Logger log = LoggerFactory.getLogger(RemoveCompleteReplicationRecords.class);
- private Connector conn;
+ private AccumuloClient conn;
- public RemoveCompleteReplicationRecords(Connector conn) {
+ public RemoveCompleteReplicationRecords(AccumuloClient conn) {
this.conn = conn;
}
@@ -123,7 +123,7 @@ public class RemoveCompleteReplicationRecords implements Runnable {
* A BatchWriter to write deletes to
* @return Number of records removed
*/
- protected long removeCompleteRecords(Connector conn, BatchScanner bs, BatchWriter bw) {
+ protected long removeCompleteRecords(AccumuloClient conn, BatchScanner bs, BatchWriter bw) {
Text row = new Text(), colf = new Text(), colq = new Text();
long recordsRemoved = 0;
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java b/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
index d603783..2261d83 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/ReplicationDriver.java
@@ -16,9 +16,9 @@
*/
package org.apache.accumulo.master.replication;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.trace.ProbabilitySampler;
@@ -42,7 +42,7 @@ public class ReplicationDriver extends Daemon {
private StatusMaker statusMaker;
private FinishedWorkUpdater finishedWorkUpdater;
private RemoveCompleteReplicationRecords rcrr;
- private Connector conn;
+ private AccumuloClient conn;
public ReplicationDriver(Master master) {
super("Replication Driver");
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java b/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
index f04ac24..7865779 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/SequentialWorkAssigner.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.replication.ReplicationConstants;
@@ -60,7 +60,7 @@ public class SequentialWorkAssigner extends DistributedWorkQueueWorkAssigner {
public SequentialWorkAssigner() {}
- public SequentialWorkAssigner(AccumuloConfiguration conf, Connector conn) {
+ public SequentialWorkAssigner(AccumuloConfiguration conf, AccumuloClient conn) {
configure(conf, conn);
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/StatusMaker.java b/server/master/src/main/java/org/apache/accumulo/master/replication/StatusMaker.java
index 1873ee7..3122995 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/StatusMaker.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/StatusMaker.java
@@ -19,11 +19,11 @@ package org.apache.accumulo.master.replication;
import java.io.IOException;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -58,13 +58,13 @@ import com.google.protobuf.InvalidProtocolBufferException;
public class StatusMaker {
private static final Logger log = LoggerFactory.getLogger(StatusMaker.class);
- private final Connector conn;
+ private final AccumuloClient conn;
private final VolumeManager fs;
private BatchWriter replicationWriter, metadataWriter;
private String sourceTableName = MetadataTable.NAME;
- public StatusMaker(Connector conn, VolumeManager fs) {
+ public StatusMaker(AccumuloClient conn, VolumeManager fs) {
this.conn = conn;
this.fs = fs;
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
index 5dece79..56611a6 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
@@ -23,7 +23,7 @@ import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.replication.ReplicationConstants;
import org.apache.accumulo.core.replication.ReplicationTarget;
@@ -54,7 +54,7 @@ public class UnorderedWorkAssigner extends DistributedWorkQueueWorkAssigner {
public UnorderedWorkAssigner() {}
- public UnorderedWorkAssigner(AccumuloConfiguration conf, Connector conn) {
+ public UnorderedWorkAssigner(AccumuloConfiguration conf, AccumuloClient conn) {
configure(conf, conn);
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
index dabfc79..884877b 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
@@ -20,9 +20,9 @@ import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.Daemon;
@@ -38,7 +38,7 @@ public class WorkDriver extends Daemon {
private static final Logger log = LoggerFactory.getLogger(WorkDriver.class);
private Master master;
- private Connector conn;
+ private AccumuloClient conn;
private AccumuloConfiguration conf;
private WorkAssigner assigner;
@@ -76,11 +76,11 @@ public class WorkDriver extends Daemon {
/*
* Getters/setters for testing purposes
*/
- protected Connector getConnector() {
+ protected AccumuloClient getConnector() {
return conn;
}
- protected void setConnector(Connector conn) {
+ protected void setConnector(AccumuloClient conn) {
this.conn = conn;
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
index a7bed7f..b2a521f 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkMaker.java
@@ -21,8 +21,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
@@ -57,11 +57,11 @@ public class WorkMaker {
private static final Logger log = LoggerFactory.getLogger(WorkMaker.class);
private final ServerContext context;
- private Connector conn;
+ private AccumuloClient conn;
private BatchWriter writer;
- public WorkMaker(ServerContext context, Connector conn) {
+ public WorkMaker(ServerContext context, AccumuloClient conn) {
this.context = context;
this.conn = conn;
}
diff --git a/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java b/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
index 4ec37ed..0fd2bbb 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/state/MergeStats.java
@@ -21,7 +21,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Table;
@@ -104,7 +104,8 @@ public class MergeStats {
this.unassigned++;
}
- public MergeState nextMergeState(Connector connector, CurrentState master) throws Exception {
+ public MergeState nextMergeState(AccumuloClient accumuloClient, CurrentState master)
+ throws Exception {
MergeState state = info.getState();
if (state == MergeState.NONE)
return state;
@@ -156,7 +157,7 @@ public class MergeStats {
log.info("{} tablets are chopped, {} are offline {}", chopped, unassigned,
info.getExtent());
if (unassigned == total && chopped == needsToBeChopped) {
- if (verifyMergeConsistency(connector, master))
+ if (verifyMergeConsistency(accumuloClient, master))
state = MergeState.MERGING;
else
log.info("Merge consistency check failed {}", info.getExtent());
@@ -184,12 +185,12 @@ public class MergeStats {
return state;
}
- private boolean verifyMergeConsistency(Connector connector, CurrentState master)
+ private boolean verifyMergeConsistency(AccumuloClient accumuloClient, CurrentState master)
throws TableNotFoundException, IOException {
MergeStats verify = new MergeStats(info);
KeyExtent extent = info.getExtent();
- Scanner scanner = connector.createScanner(extent.isMeta() ? RootTable.NAME : MetadataTable.NAME,
- Authorizations.EMPTY);
+ Scanner scanner = accumuloClient
+ .createScanner(extent.isMeta() ? RootTable.NAME : MetadataTable.NAME, Authorizations.EMPTY);
MetaDataTableScanner.configureScanner(scanner, master);
Text start = extent.getPrevEndRow();
if (start == null) {
@@ -260,7 +261,7 @@ public class MergeStats {
ClientOpts opts = new ClientOpts();
opts.parseArgs(MergeStats.class.getName(), args);
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
Map<String,String> tableIdMap = conn.tableOperations().tableIdMap();
ZooReaderWriter zooReaderWriter = opts.getServerContext().getZooReaderWriter();
for (Entry<String,String> entry : tableIdMap.entrySet()) {
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
index 41fab91..3d2ebb4 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CleanUp.java
@@ -21,8 +21,8 @@ import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Namespace;
@@ -121,7 +121,7 @@ class CleanUp extends MasterRepo {
try {
// look for other tables that references this table's files
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
try (BatchScanner bs = conn.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 8)) {
Range allTables = MetadataSchema.TabletsSection.getRange();
Range tableRange = MetadataSchema.TabletsSection.getRange(tableId);
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
index 61ba17b..79d3972 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactionDriver.java
@@ -21,7 +21,7 @@ import java.util.Iterator;
import java.util.Map.Entry;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.RowIterator;
import org.apache.accumulo.core.client.Scanner;
@@ -85,7 +85,7 @@ class CompactionDriver extends MasterRepo {
}
MapCounter<TServerInstance> serversToFlush = new MapCounter<>();
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
Scanner scanner;
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/WriteExportFiles.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/WriteExportFiles.java
index 696f3f1..dfad6fb 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/WriteExportFiles.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/WriteExportFiles.java
@@ -30,9 +30,9 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.AcceptableThriftTableOperationException;
@@ -90,7 +90,7 @@ class WriteExportFiles extends MasterRepo {
if (reserved > 0)
return reserved;
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
checkOffline(master.getContext());
@@ -254,7 +254,7 @@ class WriteExportFiles extends MasterRepo {
private static void exportConfig(ServerContext context, Table.ID tableID, ZipOutputStream zipOut,
DataOutputStream dataOut)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException, IOException {
- Connector conn = context.getConnector();
+ AccumuloClient conn = context.getConnector();
DefaultConfiguration defaultConfig = DefaultConfiguration.getInstance();
Map<String,String> siteConfig = conn.instanceOperations().getSiteConfiguration();
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CleanUpBulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CleanUpBulkImport.java
index e2b1cb4..18470e4 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CleanUpBulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CleanUpBulkImport.java
@@ -17,7 +17,7 @@
package org.apache.accumulo.master.tableOps.bulkVer1;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.master.thrift.BulkImportState;
import org.apache.accumulo.fate.Repo;
@@ -57,7 +57,7 @@ public class CleanUpBulkImport extends MasterRepo {
"/" + bulkDir.getParent().getName() + "/" + bulkDir.getName());
MetadataTableUtil.addDeleteEntry(master.getContext(), tableId, bulkDir.toString());
log.debug("removing the metadata table markers for loaded files");
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
MetadataTableUtil.removeBulkLoadEntries(conn, tableId, tid);
log.debug("releasing HDFS reservations for " + source + " and " + error);
Utils.unreserveHdfsDirectory(master, source, tid);
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CopyFailed.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CopyFailed.java
index 2d0748e..1ce2cfd 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CopyFailed.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer1/CopyFailed.java
@@ -26,7 +26,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
@@ -114,7 +114,7 @@ class CopyFailed extends MasterRepo {
*/
// determine which failed files were loaded
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
try (Scanner mscanner = new IsolatedScanner(
conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY))) {
mscanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange());
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/CleanUpBulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/CleanUpBulkImport.java
index 31db07b..66caae4 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/CleanUpBulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/bulkVer2/CleanUpBulkImport.java
@@ -19,7 +19,7 @@ package org.apache.accumulo.master.tableOps.bulkVer2;
import java.io.IOException;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.fate.Repo;
import org.apache.accumulo.master.Master;
@@ -52,7 +52,7 @@ public class CleanUpBulkImport extends MasterRepo {
MetadataTableUtil.addDeleteEntry(master.getContext(), info.tableId, bulkDir.toString());
if (info.tableState == TableState.ONLINE) {
log.debug("removing the metadata table markers for loaded files");
- Connector conn = master.getConnector();
+ AccumuloClient conn = master.getConnector();
MetadataTableUtil.removeBulkLoadEntries(conn, info.tableId, tid);
}
Utils.unreserveHdfsDirectory(master, info.sourceDir, tid);
diff --git a/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java b/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
index 30bbfdb..366bf61 100644
--- a/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
+++ b/server/master/src/test/java/org/apache/accumulo/master/replication/SequentialWorkAssignerTest.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertEquals;
import java.util.Map;
import java.util.TreeMap;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.replication.ReplicationConstants;
@@ -39,13 +39,13 @@ import org.junit.Test;
public class SequentialWorkAssignerTest {
- private Connector conn;
+ private AccumuloClient conn;
private SequentialWorkAssigner assigner;
@Before
public void init() throws Exception {
AccumuloConfiguration conf = createMock(AccumuloConfiguration.class);
- conn = createMock(Connector.class);
+ conn = createMock(AccumuloClient.class);
assigner = new SequentialWorkAssigner(conf, conn);
}
diff --git a/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java b/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
index 6d9c765..6249190 100644
--- a/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
+++ b/server/master/src/test/java/org/apache/accumulo/master/replication/UnorderedWorkAssignerTest.java
@@ -32,7 +32,7 @@ import java.util.Set;
import java.util.UUID;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.replication.ReplicationConstants;
@@ -46,13 +46,13 @@ import org.junit.Test;
public class UnorderedWorkAssignerTest {
- private Connector conn;
+ private AccumuloClient conn;
private UnorderedWorkAssigner assigner;
@Before
public void init() throws Exception {
AccumuloConfiguration conf = createMock(AccumuloConfiguration.class);
- conn = createMock(Connector.class);
+ conn = createMock(AccumuloClient.class);
assigner = new UnorderedWorkAssigner(conf, conn);
}
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index acb3254..8ddeb01 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@ -39,7 +39,7 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.MasterClient;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.Property;
@@ -595,7 +595,7 @@ public class Monitor implements HighlyAvailableService {
public static void fetchScans() throws Exception {
if (context == null)
return;
- Connector c = context.getConnector();
+ AccumuloClient c = context.getConnector();
for (String server : c.instanceOperations().getTabletServers()) {
final HostAndPort parsedServer = HostAndPort.fromString(server);
Client tserver = ThriftUtil.getTServerClient(parsedServer, context);
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/replication/ReplicationResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/replication/ReplicationResource.java
index 80c31c1..73d0324 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/replication/ReplicationResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/replication/ReplicationResource.java
@@ -30,10 +30,10 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.TableOfflineException;
import org.apache.accumulo.core.client.admin.TableOperations;
@@ -74,7 +74,7 @@ public class ReplicationResource {
@GET
public List<ReplicationInformation> getReplicationInformation()
throws AccumuloException, AccumuloSecurityException {
- final Connector conn = Monitor.getContext().getConnector();
+ final AccumuloClient conn = Monitor.getContext().getConnector();
final TableOperations tops = conn.tableOperations();
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
index 4e20dd1..a009d18 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/trace/TracesResource.java
@@ -40,9 +40,9 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
@@ -358,7 +358,7 @@ public class TracesResource {
private Scanner getScanner(String table, String principal, AuthenticationToken at)
throws AccumuloException, AccumuloSecurityException {
try {
- Connector conn = Monitor.getContext().getConnector(principal, at);
+ AccumuloClient conn = Monitor.getContext().getConnector(principal, at);
if (!conn.tableOperations().exists(table)) {
return null;
}
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
index 69377ad..61b4064 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceDump.java
@@ -29,7 +29,7 @@ import java.util.Set;
import org.apache.accumulo.core.cli.ClientOnDefaultTable;
import org.apache.accumulo.core.cli.ScannerOpts;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
@@ -82,7 +82,7 @@ public class TraceDump {
PrintStream out = System.out;
long endTime = System.currentTimeMillis();
long startTime = endTime - opts.length;
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
Scanner scanner = conn.createScanner(opts.getTableName(), opts.auths);
scanner.setBatchSize(scanOpts.scanBatchSize);
Range range = new Range(new Text("start:" + Long.toHexString(startTime)),
@@ -104,7 +104,7 @@ public class TraceDump {
private static int dumpTrace(Opts opts, ScannerOpts scanOpts) throws Exception {
final PrintStream out = System.out;
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
int count = 0;
for (String traceId : opts.traceIds) {
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
index 228532a..c0e4a26 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@ -30,11 +30,11 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableExistsException;
@@ -86,7 +86,7 @@ public class TraceServer implements Watcher {
final private ServerContext context;
final private TServer server;
final private AtomicReference<BatchWriter> writer;
- final private Connector connector;
+ final private AccumuloClient accumuloClient;
final String tableName;
final private static int BATCH_WRITER_MAX_LATENCY = 5;
final private static long SCHEDULE_PERIOD = 1000;
@@ -193,7 +193,7 @@ public class TraceServer implements Watcher {
log.info("Instance {}", context.getInstanceID());
AccumuloConfiguration conf = serverConfiguration.getSystemConfiguration();
tableName = conf.get(Property.TRACE_TABLE);
- connector = ensureTraceTableExists(conf);
+ accumuloClient = ensureTraceTableExists(conf);
int ports[] = conf.getPort(Property.TRACE_PORT);
ServerSocket sock = null;
@@ -218,7 +218,7 @@ public class TraceServer implements Watcher {
server = new TThreadPoolServer(options);
registerInZooKeeper(sock.getInetAddress().getHostAddress() + ":" + sock.getLocalPort(),
conf.get(Property.TRACE_ZK_PATH));
- writer = new AtomicReference<>(this.connector.createBatchWriter(tableName,
+ writer = new AtomicReference<>(this.accumuloClient.createBatchWriter(tableName,
new BatchWriterConfig().setMaxLatency(BATCH_WRITER_MAX_LATENCY, TimeUnit.SECONDS)));
}
@@ -236,10 +236,10 @@ public class TraceServer implements Watcher {
* @throws AccumuloSecurityException
* if the trace user has the wrong permissions
*/
- private Connector ensureTraceTableExists(final AccumuloConfiguration conf)
+ private AccumuloClient ensureTraceTableExists(final AccumuloConfiguration conf)
throws AccumuloSecurityException, ClassNotFoundException, InstantiationException,
IllegalAccessException {
- Connector connector = null;
+ AccumuloClient accumuloClient = null;
while (true) {
try {
final boolean isDefaultTokenType = conf.get(Property.TRACE_TOKEN_TYPE)
@@ -272,16 +272,16 @@ public class TraceServer implements Watcher {
at = token;
}
- connector = Connector.builder().usingClientInfo(context.getClientInfo())
+ accumuloClient = AccumuloClient.builder().usingClientInfo(context.getClientInfo())
.usingToken(principal, at).build();
- if (!connector.tableOperations().exists(tableName)) {
- connector.tableOperations().create(tableName);
+ if (!accumuloClient.tableOperations().exists(tableName)) {
+ accumuloClient.tableOperations().create(tableName);
IteratorSetting setting = new IteratorSetting(10, "ageoff", AgeOffFilter.class.getName());
AgeOffFilter.setTTL(setting, 7 * 24 * 60 * 60 * 1000L);
- connector.tableOperations().attachIterator(tableName, setting);
+ accumuloClient.tableOperations().attachIterator(tableName, setting);
}
- connector.tableOperations().setProperty(tableName, Property.TABLE_FORMATTER_CLASS.getKey(),
- TraceFormatter.class.getName());
+ accumuloClient.tableOperations().setProperty(tableName,
+ Property.TABLE_FORMATTER_CLASS.getKey(), TraceFormatter.class.getName());
break;
} catch (AccumuloException | TableExistsException | TableNotFoundException | IOException
| RuntimeException ex) {
@@ -289,7 +289,7 @@ public class TraceServer implements Watcher {
sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
- return connector;
+ return accumuloClient;
}
public void run() throws Exception {
@@ -309,7 +309,7 @@ public class TraceServer implements Watcher {
writer.flush();
} else {
// We don't have a writer. If the table exists, try to make a new writer.
- if (connector.tableOperations().exists(tableName)) {
+ if (accumuloClient.tableOperations().exists(tableName)) {
resetWriter();
}
}
@@ -325,7 +325,7 @@ public class TraceServer implements Watcher {
private void resetWriter() {
BatchWriter writer = null;
try {
- writer = connector.createBatchWriter(tableName,
+ writer = accumuloClient.createBatchWriter(tableName,
new BatchWriterConfig().setMaxLatency(BATCH_WRITER_MAX_LATENCY, TimeUnit.SECONDS));
} catch (Exception ex) {
log.warn("Unable to create a batch writer, will retry. Set log level to"
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceTableStats.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceTableStats.java
index bd8d4f0..fd8766c 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceTableStats.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceTableStats.java
@@ -24,9 +24,9 @@ import java.util.Set;
import java.util.TreeMap;
import org.apache.accumulo.core.cli.ClientOnDefaultTable;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -74,7 +74,7 @@ public class TraceTableStats {
public void count(Opts opts)
throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
Scanner scanner = conn.createScanner(opts.getTableName(), Authorizations.EMPTY);
scanner.setRange(new Range(null, true, "idx:", false));
Map<String,SpanTypeCount> counts = new TreeMap<>();
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
index 40570fb..44cd5b0 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/replication/BatchWriterReplicationReplayerTest.java
@@ -26,11 +26,11 @@ import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.nio.ByteBuffer;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
@@ -52,13 +52,13 @@ import com.google.common.collect.Lists;
public class BatchWriterReplicationReplayerTest {
private ClientContext context;
- private Connector conn;
+ private AccumuloClient conn;
private AccumuloConfiguration conf;
private BatchWriter bw;
@Before
public void setUpContext() throws AccumuloException, AccumuloSecurityException {
- conn = createMock(Connector.class);
+ conn = createMock(AccumuloClient.class);
conf = createMock(AccumuloConfiguration.class);
bw = createMock(BatchWriter.class);
context = createMock(ClientContext.class);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 2871674..ba35e0e 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -44,10 +44,10 @@ import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.NamespaceNotFoundException;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -196,7 +196,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
protected int exitCode = 0;
private String tableName;
- private Connector connector;
+ private AccumuloClient accumuloClient;
private ClientContext context;
protected ConsoleReader reader;
private final Class<? extends Formatter> defaultFormatterClass = DefaultFormatter.class;
@@ -297,7 +297,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
tabCompletion = !options.isTabCompletionDisabled();
this.setTableName("");
- if (connector == null) {
+ if (accumuloClient == null) {
Properties props = options.getClientProperties();
if (ClientProperty.INSTANCE_ZOOKEEPERS.isEmpty(props)) {
throw new IllegalArgumentException("ZooKeepers must be set using -z or -zh on command line"
@@ -339,8 +339,9 @@ public class Shell extends ShellOptions implements KeywordExecutable {
try {
DistributedTrace.enable(InetAddress.getLocalHost().getHostName(), "shell", properties);
this.setTableName("");
- connector = Connector.builder().usingClientInfo(info).usingToken(principal, token).build();
- context = new ClientContext(connector.info());
+ accumuloClient = AccumuloClient.builder().usingClientInfo(info).usingToken(principal, token)
+ .build();
+ context = new ClientContext(accumuloClient.info());
} catch (Exception e) {
printException(e);
exitCode = 1;
@@ -418,8 +419,8 @@ public class Shell extends ShellOptions implements KeywordExecutable {
return true;
}
- public Connector getConnector() {
- return connector;
+ public AccumuloClient getAccumuloClient() {
+ return accumuloClient;
}
public ClassLoader getClassLoader(final CommandLine cl, final Shell shellState)
@@ -435,13 +436,13 @@ public class Shell extends ShellOptions implements KeywordExecutable {
if (namespaces) {
try {
- tableProps = shellState.getConnector().namespaceOperations()
+ tableProps = shellState.getAccumuloClient().namespaceOperations()
.getProperties(OptUtil.getNamespaceOpt(cl, shellState));
} catch (NamespaceNotFoundException e) {
throw new IllegalArgumentException(e);
}
} else if (tables) {
- tableProps = shellState.getConnector().tableOperations()
+ tableProps = shellState.getAccumuloClient().tableOperations()
.getProperties(OptUtil.getTableOpt(cl, shellState));
} else {
throw new IllegalArgumentException("No table or namespace specified");
@@ -455,12 +456,12 @@ public class Shell extends ShellOptions implements KeywordExecutable {
ClassLoader classloader;
if (classpath != null && !classpath.equals("")) {
- shellState.getConnector().instanceOperations().getSystemConfiguration()
+ shellState.getAccumuloClient().instanceOperations().getSystemConfiguration()
.get(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.getKey() + classpath);
try {
- final Map<String,String> systemConfig = shellState.getConnector().instanceOperations()
+ final Map<String,String> systemConfig = shellState.getAccumuloClient().instanceOperations()
.getSystemConfiguration();
AccumuloVFSClassLoader.getContextManager()
@@ -612,15 +613,15 @@ public class Shell extends ShellOptions implements KeywordExecutable {
public void printInfo() throws IOException {
reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION + "\n"
- + "- instance name: " + connector.info().getInstanceName() + "\n" + "- instance id: "
- + connector.getInstanceID() + "\n" + "- \n"
+ + "- instance name: " + accumuloClient.info().getInstanceName() + "\n" + "- instance id: "
+ + accumuloClient.getInstanceID() + "\n" + "- \n"
+ "- type 'help' for a list of available commands\n" + "- \n");
reader.flush();
}
public void printVerboseInfo() throws IOException {
StringBuilder sb = new StringBuilder("-\n");
- sb.append("- Current user: ").append(connector.whoami()).append("\n");
+ sb.append("- Current user: ").append(accumuloClient.whoami()).append("\n");
if (execFile != null)
sb.append("- Executing commands from: ").append(execFile).append("\n");
if (disableAuthTimeout)
@@ -650,9 +651,9 @@ public class Shell extends ShellOptions implements KeywordExecutable {
}
public String getDefaultPrompt() {
- Objects.nonNull(connector);
- Objects.nonNull(connector.info());
- return connector.whoami() + "@" + connector.info().getInstanceName()
+ Objects.nonNull(accumuloClient);
+ Objects.nonNull(accumuloClient.info());
+ return accumuloClient.whoami() + "@" + accumuloClient.info().getInstanceName()
+ (getTableName().isEmpty() ? "" : " ") + getTableName() + "> ";
}
@@ -708,16 +709,16 @@ public class Shell extends ShellOptions implements KeywordExecutable {
reader.println("Shell has been idle for too long. Please re-authenticate.");
boolean authFailed = true;
do {
- String pwd = readMaskedLine("Enter current password for '" + connector.whoami() + "': ",
- '*');
+ String pwd = readMaskedLine(
+ "Enter current password for '" + accumuloClient.whoami() + "': ", '*');
if (pwd == null) {
reader.println();
return;
} // user canceled
try {
- authFailed = !connector.securityOperations().authenticateUser(connector.whoami(),
- new PasswordToken(pwd));
+ authFailed = !accumuloClient.securityOperations()
+ .authenticateUser(accumuloClient.whoami(), new PasswordToken(pwd));
} catch (Exception e) {
++exitCode;
printException(e);
@@ -796,7 +797,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
Set<String> tableNames = null;
try {
- tableNames = connector.tableOperations().list();
+ tableNames = accumuloClient.tableOperations().list();
} catch (Exception e) {
log.debug("Unable to obtain list of tables", e);
tableNames = Collections.emptySet();
@@ -804,7 +805,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
Set<String> userlist = null;
try {
- userlist = connector.securityOperations().listLocalUsers();
+ userlist = accumuloClient.securityOperations().listLocalUsers();
} catch (Exception e) {
log.debug("Unable to obtain list of users", e);
userlist = Collections.emptySet();
@@ -812,7 +813,7 @@ public class Shell extends ShellOptions implements KeywordExecutable {
Set<String> namespaces = null;
try {
- namespaces = connector.namespaceOperations().list();
+ namespaces = accumuloClient.namespaceOperations().list();
} catch (Exception e) {
log.debug("Unable to obtain list of namespaces", e);
namespaces = Collections.emptySet();
@@ -1164,8 +1165,8 @@ public class Shell extends ShellOptions implements KeywordExecutable {
public void updateUser(String principal, AuthenticationToken token)
throws AccumuloException, AccumuloSecurityException {
- connector = connector.changeUser(principal, token);
- context = new ClientContext(connector.info());
+ accumuloClient = accumuloClient.changeUser(principal, token);
+ context = new ClientContext(accumuloClient.info());
}
public ClientContext getContext() {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/AddAuthsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/AddAuthsCommand.java
index 173a4d1..ba8a575 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/AddAuthsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/AddAuthsCommand.java
@@ -38,9 +38,10 @@ public class AddAuthsCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException {
- final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami());
+ final String user = cl.getOptionValue(userOpt.getOpt(),
+ shellState.getAccumuloClient().whoami());
final String scanOpts = cl.getOptionValue(scanOptAuths.getOpt());
- Authorizations auths = shellState.getConnector().securityOperations()
+ Authorizations auths = shellState.getAccumuloClient().securityOperations()
.getUserAuthorizations(user);
StringBuilder userAuths = new StringBuilder();
if (!auths.isEmpty()) {
@@ -48,7 +49,7 @@ public class AddAuthsCommand extends Command {
userAuths.append(",");
}
userAuths.append(scanOpts);
- shellState.getConnector().securityOperations().changeUserAuthorizations(user,
+ shellState.getAccumuloClient().securityOperations().changeUserAuthorizations(user,
ScanCommand.parseAuthorizations(userAuths.toString()));
Shell.log.debug("Changed record-level authorizations for user " + user);
return 0;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java
index 11e9489..48b0f52 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java
@@ -50,10 +50,10 @@ public class AddSplitsCommand extends Command {
}
}
- if (!shellState.getConnector().tableOperations().exists(tableName)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(null, tableName, null);
}
- shellState.getConnector().tableOperations().addSplits(tableName, splits);
+ shellState.getAccumuloClient().tableOperations().addSplits(tableName, splits);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/AuthenticateCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/AuthenticateCommand.java
index 2856706..2fd9dc1 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/AuthenticateCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/AuthenticateCommand.java
@@ -41,7 +41,7 @@ public class AuthenticateCommand extends Command {
return 0;
} // user canceled
final byte[] password = p.getBytes(UTF_8);
- final boolean valid = shellState.getConnector().securityOperations().authenticateUser(user,
+ final boolean valid = shellState.getAccumuloClient().securityOperations().authenticateUser(user,
new PasswordToken(password));
shellState.getReader().println((valid ? "V" : "Not v") + "alid");
return 0;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CloneTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CloneTableCommand.java
index 1c6441d..082e00a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CloneTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CloneTableCommand.java
@@ -58,7 +58,7 @@ public class CloneTableCommand extends Command {
flush = false;
}
- shellState.getConnector().tableOperations().clone(cl.getArgs()[0], cl.getArgs()[1], flush,
+ shellState.getAccumuloClient().tableOperations().clone(cl.getArgs()[0], cl.getArgs()[1], flush,
props, exclude);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java
index d3b41a3..07208b6 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java
@@ -63,7 +63,7 @@ public class CompactCommand extends TableOperation {
if (cancel) {
try {
- shellState.getConnector().tableOperations().cancelCompaction(tableName);
+ shellState.getAccumuloClient().tableOperations().cancelCompaction(tableName);
Shell.log.info("Compaction canceled for table " + tableName);
} catch (TableNotFoundException e) {
throw new AccumuloException(e);
@@ -79,7 +79,7 @@ public class CompactCommand extends TableOperation {
iteratorSetting.getIteratorClass());
}
- shellState.getConnector().tableOperations().compact(tableName, compactionConfig);
+ shellState.getAccumuloClient().tableOperations().compact(tableName, compactionConfig);
Shell.log.info("Compaction of table " + tableName + " "
+ (compactionConfig.getWait() ? "completed" : "started") + " for given range");
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
index 9c09da8..02a9f72 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
@@ -74,11 +74,12 @@ public class ConfigCommand extends Command {
reader = shellState.getReader();
final String tableName = cl.getOptionValue(tableOpt.getOpt());
- if (tableName != null && !shellState.getConnector().tableOperations().exists(tableName)) {
+ if (tableName != null && !shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(null, tableName, null);
}
final String namespace = cl.getOptionValue(namespaceOpt.getOpt());
- if (namespace != null && !shellState.getConnector().namespaceOperations().exists(namespace)) {
+ if (namespace != null
+ && !shellState.getAccumuloClient().namespaceOperations().exists(namespace)) {
throw new NamespaceNotFoundException(null, namespace, null);
}
if (cl.hasOption(deleteOpt.getOpt())) {
@@ -93,21 +94,21 @@ public class ConfigCommand extends Command {
Shell.log.warn("Invalid per-table property : " + property
+ ", still removing from zookeeper if it's there.");
}
- shellState.getConnector().tableOperations().removeProperty(tableName, property);
+ shellState.getAccumuloClient().tableOperations().removeProperty(tableName, property);
Shell.log.debug("Successfully deleted table configuration option.");
} else if (namespace != null) {
if (!Property.isValidTablePropertyKey(property)) {
Shell.log.warn("Invalid per-table property : " + property
+ ", still removing from zookeeper if it's there.");
}
- shellState.getConnector().namespaceOperations().removeProperty(namespace, property);
+ shellState.getAccumuloClient().namespaceOperations().removeProperty(namespace, property);
Shell.log.debug("Successfully deleted namespace configuration option.");
} else {
if (!Property.isValidZooPropertyKey(property)) {
Shell.log.warn("Invalid per-table property : " + property
+ ", still removing from zookeeper if it's there.");
}
- shellState.getConnector().instanceOperations().removeProperty(property);
+ shellState.getAccumuloClient().instanceOperations().removeProperty(property);
Shell.log.debug("Successfully deleted system configuration option");
}
} else if (cl.hasOption(setOpt.getOpt())) {
@@ -129,7 +130,7 @@ public class ConfigCommand extends Command {
if (property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey())) {
new ColumnVisibility(value); // validate that it is a valid expression
}
- shellState.getConnector().tableOperations().setProperty(tableName, property, value);
+ shellState.getAccumuloClient().tableOperations().setProperty(tableName, property, value);
Shell.log.debug("Successfully set table configuration option.");
} else if (namespace != null) {
if (!Property.isValidTablePropertyKey(property)) {
@@ -139,26 +140,28 @@ public class ConfigCommand extends Command {
if (property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey())) {
new ColumnVisibility(value); // validate that it is a valid expression
}
- shellState.getConnector().namespaceOperations().setProperty(namespace, property, value);
+ shellState.getAccumuloClient().namespaceOperations().setProperty(namespace, property,
+ value);
Shell.log.debug("Successfully set table configuration option.");
} else {
if (!Property.isValidZooPropertyKey(property)) {
throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand,
fullCommand.indexOf(property));
}
- shellState.getConnector().instanceOperations().setProperty(property, value);
+ shellState.getAccumuloClient().instanceOperations().setProperty(property, value);
Shell.log.debug("Successfully set system configuration option");
}
} else {
// display properties
final TreeMap<String,String> systemConfig = new TreeMap<>();
- systemConfig.putAll(shellState.getConnector().instanceOperations().getSystemConfiguration());
+ systemConfig
+ .putAll(shellState.getAccumuloClient().instanceOperations().getSystemConfiguration());
final String outputFile = cl.getOptionValue(outputFileOpt.getOpt());
final PrintFile printFile = outputFile == null ? null : new PrintFile(outputFile);
final TreeMap<String,String> siteConfig = new TreeMap<>();
- siteConfig.putAll(shellState.getConnector().instanceOperations().getSiteConfiguration());
+ siteConfig.putAll(shellState.getAccumuloClient().instanceOperations().getSiteConfiguration());
final TreeMap<String,String> defaults = new TreeMap<>();
for (Entry<String,String> defaultEntry : DefaultConfiguration.getInstance()) {
@@ -169,18 +172,18 @@ public class ConfigCommand extends Command {
if (tableName != null) {
String n = Namespaces.getNamespaceName(shellState.getContext(), Tables.getNamespaceId(
shellState.getContext(), Tables.getTableId(shellState.getContext(), tableName)));
- for (Entry<String,String> e : shellState.getConnector().namespaceOperations()
+ for (Entry<String,String> e : shellState.getAccumuloClient().namespaceOperations()
.getProperties(n)) {
namespaceConfig.put(e.getKey(), e.getValue());
}
}
- Iterable<Entry<String,String>> acuconf = shellState.getConnector().instanceOperations()
+ Iterable<Entry<String,String>> acuconf = shellState.getAccumuloClient().instanceOperations()
.getSystemConfiguration().entrySet();
if (tableName != null) {
- acuconf = shellState.getConnector().tableOperations().getProperties(tableName);
+ acuconf = shellState.getAccumuloClient().tableOperations().getProperties(tableName);
} else if (namespace != null) {
- acuconf = shellState.getConnector().namespaceOperations().getProperties(namespace);
+ acuconf = shellState.getAccumuloClient().namespaceOperations().getProperties(namespace);
}
final TreeMap<String,String> sortedConf = new TreeMap<>();
for (Entry<String,String> propEntry : acuconf) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ConstraintCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ConstraintCommand.java
index ce5668c..89f4bcf 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ConstraintCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ConstraintCommand.java
@@ -55,24 +55,25 @@ public class ConstraintCommand extends Command {
case ADD:
for (String constraint : cl.getArgs()) {
if (namespace != null) {
- if (!shellState.getConnector().namespaceOperations().testClassLoad(namespace,
+ if (!shellState.getAccumuloClient().namespaceOperations().testClassLoad(namespace,
constraint, Constraint.class.getName())) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + constraint + " as type "
+ Constraint.class.getName());
}
- i = shellState.getConnector().namespaceOperations().addConstraint(namespace,
+ i = shellState.getAccumuloClient().namespaceOperations().addConstraint(namespace,
constraint);
shellState.getReader().println("Added constraint " + constraint + " to namespace "
+ namespace + " with number " + i);
} else if (tableName != null && !tableName.isEmpty()) {
- if (!shellState.getConnector().tableOperations().testClassLoad(tableName, constraint,
- Constraint.class.getName())) {
+ if (!shellState.getAccumuloClient().tableOperations().testClassLoad(tableName,
+ constraint, Constraint.class.getName())) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + constraint + " as type "
+ Constraint.class.getName());
}
- i = shellState.getConnector().tableOperations().addConstraint(tableName, constraint);
+ i = shellState.getAccumuloClient().tableOperations().addConstraint(tableName,
+ constraint);
shellState.getReader().println(
"Added constraint " + constraint + " to table " + tableName + " with number " + i);
} else {
@@ -84,11 +85,11 @@ public class ConstraintCommand extends Command {
for (String constraint : cl.getArgs()) {
i = Integer.parseInt(constraint);
if (namespace != null) {
- shellState.getConnector().namespaceOperations().removeConstraint(namespace, i);
+ shellState.getAccumuloClient().namespaceOperations().removeConstraint(namespace, i);
shellState.getReader()
.println("Removed constraint " + i + " from namespace " + namespace);
} else if (tableName != null) {
- shellState.getConnector().tableOperations().removeConstraint(tableName, i);
+ shellState.getAccumuloClient().tableOperations().removeConstraint(tableName, i);
shellState.getReader().println("Removed constraint " + i + " from table " + tableName);
} else {
throw new IllegalArgumentException("Please specify either a table or a namespace");
@@ -97,12 +98,12 @@ public class ConstraintCommand extends Command {
break;
case LIST:
if (namespace != null) {
- for (Entry<String,Integer> property : shellState.getConnector().namespaceOperations()
+ for (Entry<String,Integer> property : shellState.getAccumuloClient().namespaceOperations()
.listConstraints(namespace).entrySet()) {
shellState.getReader().println(property.toString());
}
} else if (tableName != null) {
- for (Entry<String,Integer> property : shellState.getConnector().tableOperations()
+ for (Entry<String,Integer> property : shellState.getAccumuloClient().tableOperations()
.listConstraints(tableName).entrySet()) {
shellState.getReader().println(property.toString());
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateNamespaceCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateNamespaceCommand.java
index 3157b16..6bf22fb 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateNamespaceCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateNamespaceCommand.java
@@ -48,21 +48,21 @@ public class CreateNamespaceCommand extends Command {
String namespace = cl.getArgs()[0];
- shellState.getConnector().namespaceOperations().create(namespace);
+ shellState.getAccumuloClient().namespaceOperations().create(namespace);
// Copy options if flag was set
Iterable<Entry<String,String>> configuration = null;
if (cl.hasOption(createNamespaceOptCopyConfig.getOpt())) {
String copy = cl.getOptionValue(createNamespaceOptCopyConfig.getOpt());
- if (shellState.getConnector().namespaceOperations().exists(namespace)) {
- configuration = shellState.getConnector().namespaceOperations().getProperties(copy);
+ if (shellState.getAccumuloClient().namespaceOperations().exists(namespace)) {
+ configuration = shellState.getAccumuloClient().namespaceOperations().getProperties(copy);
}
}
if (configuration != null) {
for (Entry<String,String> entry : configuration) {
if (Property.isValidTablePropertyKey(entry.getKey())) {
- shellState.getConnector().namespaceOperations().setProperty(namespace, entry.getKey(),
- entry.getValue());
+ shellState.getAccumuloClient().namespaceOperations().setProperty(namespace,
+ entry.getKey(), entry.getValue());
}
}
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java
index 4ccead4..af0a6db 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java
@@ -79,7 +79,7 @@ public class CreateTableCommand extends Command {
}
final String tableName = cl.getArgs()[0];
- if (shellState.getConnector().tableOperations().exists(tableName)) {
+ if (shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableExistsException(null, tableName, null);
}
@@ -93,16 +93,16 @@ public class CreateTableCommand extends Command {
ShellUtil.scanFile(cl.getOptionValue(createTableOptSplit.getOpt()), decode)));
} else if (cl.hasOption(createTableOptCopySplits.getOpt())) {
final String oldTable = cl.getOptionValue(createTableOptCopySplits.getOpt());
- if (!shellState.getConnector().tableOperations().exists(oldTable)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(oldTable)) {
throw new TableNotFoundException(null, oldTable, null);
}
ntc = ntc.withSplits(
- new TreeSet<>(shellState.getConnector().tableOperations().listSplits(oldTable)));
+ new TreeSet<>(shellState.getAccumuloClient().tableOperations().listSplits(oldTable)));
}
if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
final String oldTable = cl.getOptionValue(createTableOptCopyConfig.getOpt());
- if (!shellState.getConnector().tableOperations().exists(oldTable)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(oldTable)) {
throw new TableNotFoundException(null, oldTable, null);
}
}
@@ -130,25 +130,25 @@ public class CreateTableCommand extends Command {
}
// create table.
- shellState.getConnector().tableOperations().create(tableName,
+ shellState.getAccumuloClient().tableOperations().create(tableName,
ntc.setTimeType(timeType).setProperties(props));
shellState.setTableName(tableName); // switch shell to new table context
if (cl.hasOption(createTableNoDefaultIters.getOpt())) {
for (String key : IteratorUtil.generateInitialTableProperties(true).keySet()) {
- shellState.getConnector().tableOperations().removeProperty(tableName, key);
+ shellState.getAccumuloClient().tableOperations().removeProperty(tableName, key);
}
}
// Copy options if flag was set
if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
- if (shellState.getConnector().tableOperations().exists(tableName)) {
- final Iterable<Entry<String,String>> configuration = shellState.getConnector()
+ if (shellState.getAccumuloClient().tableOperations().exists(tableName)) {
+ final Iterable<Entry<String,String>> configuration = shellState.getAccumuloClient()
.tableOperations().getProperties(cl.getOptionValue(createTableOptCopyConfig.getOpt()));
for (Entry<String,String> entry : configuration) {
if (Property.isValidTablePropertyKey(entry.getKey())) {
- shellState.getConnector().tableOperations().setProperty(tableName, entry.getKey(),
+ shellState.getAccumuloClient().tableOperations().setProperty(tableName, entry.getKey(),
entry.getValue());
}
}
@@ -157,7 +157,7 @@ public class CreateTableCommand extends Command {
if (cl.hasOption(createTableOptEVC.getOpt())) {
try {
- shellState.getConnector().tableOperations().addConstraint(tableName,
+ shellState.getAccumuloClient().tableOperations().addConstraint(tableName,
VisibilityConstraint.class.getName());
} catch (AccumuloException e) {
Shell.log
@@ -169,7 +169,7 @@ public class CreateTableCommand extends Command {
if (cl.hasOption(createTableOptFormatter.getOpt())) {
final String formatterClass = cl.getOptionValue(createTableOptFormatter.getOpt());
- shellState.getConnector().tableOperations().setProperty(tableName,
+ shellState.getAccumuloClient().tableOperations().setProperty(tableName,
Property.TABLE_FORMATTER_CLASS.toString(), formatterClass);
}
return 0;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
index 991dbc6..182ebfe 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
@@ -37,7 +37,7 @@ public class CreateUserCommand extends Command {
TableExistsException, IOException {
final String user = cl.getArgs()[0];
- AuthenticationToken userToken = shellState.getConnector().info().getAuthenticationToken();
+ AuthenticationToken userToken = shellState.getAccumuloClient().info().getAuthenticationToken();
PasswordToken passwordToken;
if (userToken instanceof KerberosToken) {
passwordToken = new PasswordToken();
@@ -61,7 +61,7 @@ public class CreateUserCommand extends Command {
passwordToken = new PasswordToken(password);
}
- shellState.getConnector().securityOperations().createLocalUser(user, passwordToken);
+ shellState.getAccumuloClient().securityOperations().createLocalUser(user, passwordToken);
Shell.log.debug("Created user " + user);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
index 3f83eca..1ea08b4 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java
@@ -58,7 +58,7 @@ public class DUCommand extends Command {
// Add any patterns
if (cl.hasOption(optTablePattern.getOpt())) {
- for (String table : shellState.getConnector().tableOperations().list()) {
+ for (String table : shellState.getAccumuloClient().tableOperations().list()) {
if (table.matches(cl.getOptionValue(optTablePattern.getOpt()))) {
tables.add(table);
}
@@ -72,7 +72,7 @@ public class DUCommand extends Command {
// sanity check...make sure the user-specified tables exist
for (String tableName : tables) {
- if (!shellState.getConnector().tableOperations().exists(tableName)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(tableName, tableName,
"specified table that doesn't exist");
}
@@ -80,7 +80,8 @@ public class DUCommand extends Command {
try {
String valueFormat = prettyPrint ? "%9s" : "%,24d";
- for (DiskUsage usage : shellState.getConnector().tableOperations().getDiskUsage(tables)) {
+ for (DiskUsage usage : shellState.getAccumuloClient().tableOperations()
+ .getDiskUsage(tables)) {
Object value = prettyPrint ? NumUtil.bigNumberForSize(usage.getUsage()) : usage.getUsage();
shellState.getReader()
.println(String.format(valueFormat + " %s", value, usage.getTables()));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteAuthsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteAuthsCommand.java
index aabac75..8f56bed 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteAuthsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteAuthsCommand.java
@@ -20,9 +20,9 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.shell.Shell;
import org.apache.accumulo.shell.Shell.Command;
@@ -40,11 +40,11 @@ public class DeleteAuthsCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException {
- final Connector connector = shellState.getConnector();
- final String user = cl.getOptionValue(userOpt.getOpt(), connector.whoami());
+ final AccumuloClient accumuloClient = shellState.getAccumuloClient();
+ final String user = cl.getOptionValue(userOpt.getOpt(), accumuloClient.whoami());
final String scanOpts = cl.getOptionValue(scanOptAuths.getOpt());
- final Authorizations auths = connector.securityOperations().getUserAuthorizations(user);
+ final Authorizations auths = accumuloClient.securityOperations().getUserAuthorizations(user);
final StringBuilder userAuths = new StringBuilder();
final String[] toBeRemovedAuths = scanOpts.split(",");
final Set<String> toBeRemovedSet = new HashSet<>();
@@ -59,10 +59,10 @@ public class DeleteAuthsCommand extends Command {
}
}
if (userAuths.length() > 0) {
- connector.securityOperations().changeUserAuthorizations(user,
+ accumuloClient.securityOperations().changeUserAuthorizations(user,
ScanCommand.parseAuthorizations(userAuths.substring(0, userAuths.length() - 1)));
} else {
- connector.securityOperations().changeUserAuthorizations(user, new Authorizations());
+ accumuloClient.securityOperations().changeUserAuthorizations(user, new Authorizations());
}
Shell.log.debug("Changed record-level authorizations for user " + user);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java
index bf86fee..312ad83 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java
@@ -69,7 +69,8 @@ public class DeleteCommand extends Command {
} else {
m.putDelete(colf, colq);
}
- final BatchWriter bw = shellState.getConnector().createBatchWriter(shellState.getTableName(),
+ final BatchWriter bw = shellState.getAccumuloClient().createBatchWriter(
+ shellState.getTableName(),
new BatchWriterConfig().setMaxMemory(Math.max(m.estimatedMemoryUsed(), 1024))
.setMaxWriteThreads(1).setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS));
bw.addMutation(m);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java
index af6dc56..7c950c6 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java
@@ -40,13 +40,13 @@ public class DeleteIterCommand extends Command {
final String name = cl.getOptionValue(nameOpt.getOpt());
if (namespaces) {
- if (!shellState.getConnector().namespaceOperations()
+ if (!shellState.getAccumuloClient().namespaceOperations()
.listIterators(OptUtil.getNamespaceOpt(cl, shellState)).containsKey(name)) {
Shell.log.warn("no iterators found that match your criteria");
return 0;
}
} else if (tables) {
- if (!shellState.getConnector().tableOperations()
+ if (!shellState.getAccumuloClient().tableOperations()
.listIterators(OptUtil.getTableOpt(cl, shellState)).containsKey(name)) {
Shell.log.warn("no iterators found that match your criteria");
return 0;
@@ -70,10 +70,10 @@ public class DeleteIterCommand extends Command {
}
if (namespaces) {
- shellState.getConnector().namespaceOperations()
+ shellState.getAccumuloClient().namespaceOperations()
.removeIterator(OptUtil.getNamespaceOpt(cl, shellState), name, scopes);
} else if (tables) {
- shellState.getConnector().tableOperations()
+ shellState.getAccumuloClient().tableOperations()
.removeIterator(OptUtil.getTableOpt(cl, shellState), name, scopes);
} else {
throw new IllegalArgumentException("No table or namespace specified");
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
index 04bcf75..2232113 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
@@ -45,7 +45,7 @@ public class DeleteManyCommand extends ScanCommand {
// handle first argument, if present, the authorizations list to
// scan with
final Authorizations auths = getAuths(cl, shellState);
- final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
+ final Scanner scanner = shellState.getAccumuloClient().createScanner(tableName, auths);
scanner.addScanIterator(
new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class));
@@ -62,7 +62,7 @@ public class DeleteManyCommand extends ScanCommand {
fetchColumns(cl, scanner, interpeter);
// output / delete the records
- final BatchWriter writer = shellState.getConnector().createBatchWriter(tableName,
+ final BatchWriter writer = shellState.getAccumuloClient().createBatchWriter(tableName,
new BatchWriterConfig().setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS));
FormatterConfig config = new FormatterConfig();
config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt()));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteNamespaceCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteNamespaceCommand.java
index ac5a6a6..3dcab8c 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteNamespaceCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteNamespaceCommand.java
@@ -69,11 +69,11 @@ public class DeleteNamespaceCommand extends Command {
resetContext = tables.contains(currentTable);
if (force)
- for (String table : shellState.getConnector().tableOperations().list())
+ for (String table : shellState.getAccumuloClient().tableOperations().list())
if (table.startsWith(namespace + "."))
- shellState.getConnector().tableOperations().delete(table);
+ shellState.getAccumuloClient().tableOperations().delete(table);
- shellState.getConnector().namespaceOperations().delete(namespace);
+ shellState.getAccumuloClient().namespaceOperations().delete(namespace);
if (resetContext) {
shellState.setTableName("");
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
index e9e1655..ee0b3b1 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteRowsCommand.java
@@ -37,7 +37,7 @@ public class DeleteRowsCommand extends Command {
.println("Not deleting unbounded range. Specify both ends, or use --force");
return 1;
}
- shellState.getConnector().tableOperations().deleteRows(tableName, startRow, endRow);
+ shellState.getAccumuloClient().tableOperations().deleteRows(tableName, startRow, endRow);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteTableCommand.java
index d3431c6..7f1c4a8 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteTableCommand.java
@@ -52,7 +52,7 @@ public class DeleteTableCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName) throws Exception {
- shellState.getConnector().tableOperations().delete(tableName);
+ shellState.getAccumuloClient().tableOperations().delete(tableName);
shellState.getReader().println("Table: [" + tableName + "] has been deleted.");
if (shellState.getTableName().equals(tableName)) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DropUserCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DropUserCommand.java
index 426fbf2..23efa3b 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DropUserCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DropUserCommand.java
@@ -37,7 +37,7 @@ public class DropUserCommand extends Command {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException {
final String user = cl.getArgs()[0];
- if (shellState.getConnector().whoami().equals(user)) {
+ if (shellState.getAccumuloClient().whoami().equals(user)) {
throw new BadArgumentException("You cannot delete yourself", fullCommand,
fullCommand.indexOf(user));
}
@@ -56,7 +56,7 @@ public class DropUserCommand extends Command {
operate = line != null && (line.equalsIgnoreCase("y") || line.equalsIgnoreCase("yes"));
}
if (operate) {
- shellState.getConnector().securityOperations().dropLocalUser(user);
+ shellState.getAccumuloClient().securityOperations().dropLocalUser(user);
Shell.log.debug("Deleted user " + user);
}
} catch (IOException e) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ExportTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ExportTableCommand.java
index e5a17f8..855136e 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ExportTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ExportTableCommand.java
@@ -42,7 +42,7 @@ public class ExportTableCommand extends Command {
final String tableName = OptUtil.getTableOpt(cl, shellState);
- shellState.getConnector().tableOperations().exportTable(tableName, cl.getArgs()[0]);
+ shellState.getAccumuloClient().tableOperations().exportTable(tableName, cl.getArgs()[0]);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/FlushCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/FlushCommand.java
index a74cda1..2c4db91 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/FlushCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/FlushCommand.java
@@ -40,7 +40,7 @@ public class FlushCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
- shellState.getConnector().tableOperations().flush(tableName, startRow, endRow, wait);
+ shellState.getAccumuloClient().tableOperations().flush(tableName, startRow, endRow, wait);
Shell.log.info("Flush of table " + tableName + (wait ? " completed." : " initiated..."));
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
index 86731e0..ca3f3f2 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
@@ -60,7 +60,7 @@ public class FormatterCommand extends ShellPluginConfigurationCommand {
final String className) throws AccumuloException, AccumuloSecurityException {
super.setPlugin(cl, shellState, tableName, className);
if (cl.hasOption(interpeterOption.getOpt())) {
- shellState.getConnector().tableOperations().setProperty(tableName,
+ shellState.getAccumuloClient().tableOperations().setProperty(tableName,
Property.TABLE_INTERPRETER_CLASS.toString(), className);
}
}
@@ -70,7 +70,7 @@ public class FormatterCommand extends ShellPluginConfigurationCommand {
throws AccumuloException, AccumuloSecurityException {
super.removePlugin(cl, shellState, tableName);
if (cl.hasOption(interpeterOption.getOpt())) {
- shellState.getConnector().tableOperations().removeProperty(tableName,
+ shellState.getAccumuloClient().tableOperations().removeProperty(tableName,
Property.TABLE_INTERPRETER_CLASS.toString());
}
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GetAuthsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GetAuthsCommand.java
index b4bded9..b6ba7e3 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GetAuthsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GetAuthsCommand.java
@@ -38,9 +38,10 @@ public class GetAuthsCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException {
- final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami());
+ final String user = cl.getOptionValue(userOpt.getOpt(),
+ shellState.getAccumuloClient().whoami());
// Sort authorizations
- Authorizations auths = shellState.getConnector().securityOperations()
+ Authorizations auths = shellState.getAccumuloClient().securityOperations()
.getUserAuthorizations(user);
List<String> set = sortAuthorizations(auths);
shellState.getReader().println(StringUtils.join(set, ','));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GetGroupsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GetGroupsCommand.java
index 945341d..2d02c00 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GetGroupsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GetGroupsCommand.java
@@ -34,7 +34,7 @@ public class GetGroupsCommand extends Command {
throws Exception {
final String tableName = OptUtil.getTableOpt(cl, shellState);
- final Map<String,Set<Text>> groups = shellState.getConnector().tableOperations()
+ final Map<String,Set<Text>> groups = shellState.getAccumuloClient().tableOperations()
.getLocalityGroups(tableName);
for (Entry<String,Set<Text>> entry : groups.entrySet()) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java
index 18e069f..55fdfe2 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java
@@ -67,18 +67,18 @@ public class GetSplitsCommand extends Command {
: new PrintFile(outputFile)) {
if (!verbose) {
for (Text row : maxSplits > 0
- ? shellState.getConnector().tableOperations().listSplits(tableName, maxSplits)
- : shellState.getConnector().tableOperations().listSplits(tableName)) {
+ ? shellState.getAccumuloClient().tableOperations().listSplits(tableName, maxSplits)
+ : shellState.getAccumuloClient().tableOperations().listSplits(tableName)) {
p.print(encode(encode, row));
}
} else {
String systemTableToCheck = MetadataTable.NAME.equals(tableName) ? RootTable.NAME
: MetadataTable.NAME;
- final Scanner scanner = shellState.getConnector().createScanner(systemTableToCheck,
+ final Scanner scanner = shellState.getAccumuloClient().createScanner(systemTableToCheck,
Authorizations.EMPTY);
TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
final Text start = new Text(
- shellState.getConnector().tableOperations().tableIdMap().get(tableName));
+ shellState.getAccumuloClient().tableOperations().tableIdMap().get(tableName));
final Text end = new Text(start);
end.append(new byte[] {'<'}, 0, 1);
scanner.setRange(new Range(start, end));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java
index c9a9763..1156502 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java
@@ -45,12 +45,12 @@ public class GrantCommand extends TableOperation {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
user = cl.hasOption(userOpt.getOpt()) ? cl.getOptionValue(userOpt.getOpt())
- : shellState.getConnector().whoami();
+ : shellState.getAccumuloClient().whoami();
permission = cl.getArgs()[0].split("\\.", 2);
if (cl.hasOption(systemOpt.getOpt()) && permission[0].equalsIgnoreCase("System")) {
try {
- shellState.getConnector().securityOperations().grantSystemPermission(user,
+ shellState.getAccumuloClient().securityOperations().grantSystemPermission(user,
SystemPermission.valueOf(permission[1]));
Shell.log.debug("Granted " + user + " the " + permission[1] + " permission");
} catch (IllegalArgumentException e) {
@@ -62,7 +62,7 @@ public class GrantCommand extends TableOperation {
} else if (permission[0].equalsIgnoreCase("Namespace")) {
if (cl.hasOption(optNamespace.getOpt())) {
try {
- shellState.getConnector().securityOperations().grantNamespacePermission(user,
+ shellState.getAccumuloClient().securityOperations().grantNamespacePermission(user,
cl.getOptionValue(optNamespace.getOpt()), NamespacePermission.valueOf(permission[1]));
} catch (IllegalArgumentException e) {
throw new BadArgumentException("No such namespace permission", fullCommand,
@@ -82,7 +82,7 @@ public class GrantCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName) throws Exception {
try {
- shellState.getConnector().securityOperations().grantTablePermission(user, tableName,
+ shellState.getAccumuloClient().securityOperations().grantTablePermission(user, tableName,
TablePermission.valueOf(permission[1]));
Shell.log
.debug("Granted " + user + " the " + permission[1] + " permission on table " + tableName);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
index 1ec8ca1..0f7c25a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
@@ -64,8 +64,8 @@ public class GrepCommand extends ScanCommand {
negate = true;
}
final Authorizations auths = getAuths(cl, shellState);
- final BatchScanner scanner = shellState.getConnector().createBatchScanner(tableName, auths,
- numThreads);
+ final BatchScanner scanner = shellState.getAccumuloClient().createBatchScanner(tableName,
+ auths, numThreads);
scanner.setRanges(Collections.singletonList(getRange(cl, interpeter)));
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
index 6727c28..5bec2bc 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
@@ -49,7 +49,7 @@ public class ImportDirectoryCommand extends Command {
// new bulk import only takes 2 args
if (args.length == 2) {
setTime = Boolean.parseBoolean(cl.getArgs()[1]);
- TableOperations.ImportMappingOptions bulk = shellState.getConnector().tableOperations()
+ TableOperations.ImportMappingOptions bulk = shellState.getAccumuloClient().tableOperations()
.importDirectory(dir).to(shellState.getTableName());
if (setTime)
bulk.tableTime().load();
@@ -62,8 +62,8 @@ public class ImportDirectoryCommand extends Command {
+ "as an argument.");
String failureDir = args[1];
setTime = Boolean.parseBoolean(cl.getArgs()[2]);
- shellState.getConnector().tableOperations().importDirectory(shellState.getTableName(), dir,
- failureDir, setTime);
+ shellState.getAccumuloClient().tableOperations().importDirectory(shellState.getTableName(),
+ dir, failureDir, setTime);
return 0;
} else {
shellState.printException(
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportTableCommand.java
index eadea8e..f4c930c 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportTableCommand.java
@@ -31,7 +31,7 @@ public class ImportTableCommand extends Command {
throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
TableExistsException {
- shellState.getConnector().tableOperations().importTable(cl.getArgs()[0], cl.getArgs()[1]);
+ shellState.getAccumuloClient().tableOperations().importTable(cl.getArgs()[0], cl.getArgs()[1]);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java
index aa6a84f..f089f23 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java
@@ -103,8 +103,8 @@ public class InsertCommand extends Command {
throw new IllegalArgumentException("Unknown durability: " + userDurability);
}
}
- final BatchWriter bw = shellState.getConnector().createBatchWriter(shellState.getTableName(),
- cfg);
+ final BatchWriter bw = shellState.getAccumuloClient()
+ .createBatchWriter(shellState.getTableName(), cfg);
bw.addMutation(m);
try {
bw.close();
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java
index 7f87878..e76d53d 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java
@@ -47,7 +47,7 @@ public class ListCompactionsCommand extends Command {
List<String> tservers;
String filterText = null;
- final InstanceOperations instanceOps = shellState.getConnector().instanceOperations();
+ final InstanceOperations instanceOps = shellState.getAccumuloClient().instanceOperations();
final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java
index fd9533c..6c0cec5 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java
@@ -46,10 +46,10 @@ public class ListIterCommand extends Command {
final Map<String,EnumSet<IteratorScope>> iterators;
if (namespaces) {
- iterators = shellState.getConnector().namespaceOperations()
+ iterators = shellState.getAccumuloClient().namespaceOperations()
.listIterators(OptUtil.getNamespaceOpt(cl, shellState));
} else if (tables) {
- iterators = shellState.getConnector().tableOperations()
+ iterators = shellState.getAccumuloClient().tableOperations()
.listIterators(OptUtil.getTableOpt(cl, shellState));
} else {
throw new IllegalArgumentException("No table or namespace specified");
@@ -83,10 +83,10 @@ public class ListIterCommand extends Command {
if (desiredScopes.contains(scope)) {
IteratorSetting setting;
if (namespaces) {
- setting = shellState.getConnector().namespaceOperations()
+ setting = shellState.getAccumuloClient().namespaceOperations()
.getIteratorSetting(OptUtil.getNamespaceOpt(cl, shellState), name, scope);
} else if (tables) {
- setting = shellState.getConnector().tableOperations()
+ setting = shellState.getAccumuloClient().tableOperations()
.getIteratorSetting(OptUtil.getTableOpt(cl, shellState), name, scope);
} else {
throw new IllegalArgumentException("No table or namespace specified");
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java
index 54e57d0..ac63dfd 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java
@@ -42,7 +42,7 @@ public class ListScansCommand extends Command {
List<String> tservers;
- final InstanceOperations instanceOps = shellState.getConnector().instanceOperations();
+ final InstanceOperations instanceOps = shellState.getAccumuloClient().instanceOperations();
final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
index 091274d..e822c6a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
@@ -42,7 +42,7 @@ public class MaxRowCommand extends ScanCommand {
final Text endRow = range.getEndKey() == null ? null : range.getEndKey().getRow();
try {
- final Text max = shellState.getConnector().tableOperations().getMaxRow(tableName, auths,
+ final Text max = shellState.getAccumuloClient().tableOperations().getMaxRow(tableName, auths,
startRow, range.isStartKeyInclusive(), endRow, range.isEndKeyInclusive());
if (max != null) {
shellState.getReader().println(max.toString());
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java
index b04ac2f..a51dbf9 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java
@@ -62,7 +62,7 @@ public class MergeCommand extends Command {
return 0;
}
if (size < 0) {
- shellState.getConnector().tableOperations().merge(tableName, startRow, endRow);
+ shellState.getAccumuloClient().tableOperations().merge(tableName, startRow, endRow);
} else {
final boolean finalVerbose = verbose;
final Merge merge = new Merge() {
@@ -77,7 +77,7 @@ public class MergeCommand extends Command {
}
}
};
- merge.mergomatic(shellState.getConnector(), tableName, startRow, endRow, size, force);
+ merge.mergomatic(shellState.getAccumuloClient(), tableName, startRow, endRow, size, force);
}
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java
index 3e84146..3513844 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java
@@ -41,7 +41,7 @@ public class NamespacesCommand extends Command {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException {
Map<String,String> namespaces = new TreeMap<>(
- shellState.getConnector().namespaceOperations().namespaceIdMap());
+ shellState.getAccumuloClient().namespaceOperations().namespaceIdMap());
Iterator<String> it = Iterators.transform(namespaces.entrySet().iterator(), entry -> {
String name = entry.getKey();
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/OfflineCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/OfflineCommand.java
index 984d0db..022982d 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/OfflineCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/OfflineCommand.java
@@ -41,7 +41,7 @@ public class OfflineCommand extends TableOperation {
if (tableName.equals(MetadataTable.NAME)) {
Shell.log.info(" You cannot take the " + MetadataTable.NAME + " offline.");
} else {
- shellState.getConnector().tableOperations().offline(tableName, wait);
+ shellState.getAccumuloClient().tableOperations().offline(tableName, wait);
Shell.log.info("Offline of table " + tableName + (wait ? " completed." : " initiated..."));
}
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/OnlineCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/OnlineCommand.java
index 7673f00..46d8711 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/OnlineCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/OnlineCommand.java
@@ -41,7 +41,7 @@ public class OnlineCommand extends TableOperation {
if (tableName.equals(RootTable.NAME)) {
Shell.log.info(" The " + RootTable.NAME + " is always online.");
} else {
- shellState.getConnector().tableOperations().online(tableName, wait);
+ shellState.getAccumuloClient().tableOperations().online(tableName, wait);
Shell.log.info("Online of table " + tableName + (wait ? " completed." : " initiated..."));
}
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/OptUtil.java b/shell/src/main/java/org/apache/accumulo/shell/commands/OptUtil.java
index 06a8821..50815f8 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/OptUtil.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/OptUtil.java
@@ -39,7 +39,7 @@ public abstract class OptUtil {
if (cl.hasOption(ShellOptions.tableOption)) {
tableName = cl.getOptionValue(ShellOptions.tableOption);
- if (!shellState.getConnector().tableOperations().exists(tableName)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(tableName, tableName,
"specified table that doesn't exist");
}
@@ -56,7 +56,7 @@ public abstract class OptUtil {
String namespace = null;
if (cl.hasOption(ShellOptions.namespaceOption)) {
namespace = cl.getOptionValue(ShellOptions.namespaceOption);
- if (!shellState.getConnector().namespaceOperations().exists(namespace)) {
+ if (!shellState.getAccumuloClient().namespaceOperations().exists(namespace)) {
throw new NamespaceNotFoundException(namespace, namespace,
"specified namespace that doesn't exist");
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/PasswdCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/PasswdCommand.java
index 9ee8d95..345792c 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/PasswdCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/PasswdCommand.java
@@ -37,7 +37,7 @@ public class PasswdCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException {
- final String currentUser = shellState.getConnector().whoami();
+ final String currentUser = shellState.getAccumuloClient().whoami();
final String user = cl.getOptionValue(userOpt.getOpt(), currentUser);
String password = null;
@@ -51,7 +51,7 @@ public class PasswdCommand extends Command {
return 0;
} // user canceled
- if (!shellState.getConnector().securityOperations().authenticateUser(currentUser,
+ if (!shellState.getAccumuloClient().securityOperations().authenticateUser(currentUser,
new PasswordToken(oldPassword)))
throw new AccumuloSecurityException(user, SecurityErrorCode.BAD_CREDENTIALS);
@@ -71,11 +71,11 @@ public class PasswdCommand extends Command {
throw new IllegalArgumentException("Passwords do not match");
}
byte[] pass = password.getBytes(UTF_8);
- shellState.getConnector().securityOperations().changeLocalUserPassword(user,
+ shellState.getAccumuloClient().securityOperations().changeLocalUserPassword(user,
new PasswordToken(pass));
// update the current credentials if the password changed was for
// the current user
- if (shellState.getConnector().whoami().equals(user)) {
+ if (shellState.getAccumuloClient().whoami().equals(user)) {
shellState.updateUser(user, new PasswordToken(pass));
}
Shell.log.debug("Changed password for user " + user);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java
index 6406ab8..c388c2d 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java
@@ -41,7 +41,7 @@ public class PingCommand extends Command {
List<String> tservers;
- final InstanceOperations instanceOps = shellState.getConnector().instanceOperations();
+ final InstanceOperations instanceOps = shellState.getAccumuloClient().instanceOperations();
final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/RenameNamespaceCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/RenameNamespaceCommand.java
index c8df11c..05b2c27 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/RenameNamespaceCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/RenameNamespaceCommand.java
@@ -51,7 +51,7 @@ public class RenameNamespaceCommand extends Command {
resetContext = tableIds.contains(currentTableId);
}
- shellState.getConnector().namespaceOperations().rename(old, newer);
+ shellState.getAccumuloClient().namespaceOperations().rename(old, newer);
if (resetContext) {
shellState.setTableName(Tables.getTableName(shellState.getContext(), currentTableId));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/RenameTableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/RenameTableCommand.java
index 8e27649..9748d9b 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/RenameTableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/RenameTableCommand.java
@@ -34,7 +34,7 @@ public class RenameTableCommand extends Command {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
TableExistsException {
- shellState.getConnector().tableOperations().rename(cl.getArgs()[0], cl.getArgs()[1]);
+ shellState.getAccumuloClient().tableOperations().rename(cl.getArgs()[0], cl.getArgs()[1]);
if (shellState.getTableName().equals(Tables.qualified(cl.getArgs()[0]))) {
shellState.setTableName(cl.getArgs()[1]);
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java
index b678259..9cbde2a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java
@@ -45,12 +45,12 @@ public class RevokeCommand extends TableOperation {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws Exception {
user = cl.hasOption(userOpt.getOpt()) ? cl.getOptionValue(userOpt.getOpt())
- : shellState.getConnector().whoami();
+ : shellState.getAccumuloClient().whoami();
permission = cl.getArgs()[0].split("\\.", 2);
if (cl.hasOption(systemOpt.getOpt()) && permission[0].equalsIgnoreCase("System")) {
try {
- shellState.getConnector().securityOperations().revokeSystemPermission(user,
+ shellState.getAccumuloClient().securityOperations().revokeSystemPermission(user,
SystemPermission.valueOf(permission[1]));
Shell.log.debug("Revoked from " + user + " the " + permission[1] + " permission");
} catch (IllegalArgumentException e) {
@@ -62,7 +62,7 @@ public class RevokeCommand extends TableOperation {
} else if (permission[0].equalsIgnoreCase("Namespace")) {
if (cl.hasOption(optNamespace.getOpt())) {
try {
- shellState.getConnector().securityOperations().revokeNamespacePermission(user,
+ shellState.getAccumuloClient().securityOperations().revokeNamespacePermission(user,
cl.getOptionValue(optNamespace.getOpt()), NamespacePermission.valueOf(permission[1]));
} catch (IllegalArgumentException e) {
throw new BadArgumentException("No such namespace permission", fullCommand,
@@ -82,7 +82,7 @@ public class RevokeCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName) throws Exception {
try {
- shellState.getConnector().securityOperations().revokeTablePermission(user, tableName,
+ shellState.getAccumuloClient().securityOperations().revokeTablePermission(user, tableName,
TablePermission.valueOf(permission[1]));
Shell.log.debug(
"Revoked from " + user + " the " + permission[1] + " permission on table " + tableName);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
index a986147..3e1d15d 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
@@ -73,7 +73,7 @@ public class ScanCommand extends Command {
ScannerBase scanner)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
if (getUseSample(cl)) {
- SamplerConfiguration samplerConfig = shellState.getConnector().tableOperations()
+ SamplerConfiguration samplerConfig = shellState.getAccumuloClient().tableOperations()
.getSamplerConfiguration(tableName);
if (samplerConfig == null) {
throw new SampleNotPresentException(
@@ -100,7 +100,7 @@ public class ScanCommand extends Command {
// handle first argument, if present, the authorizations list to
// scan with
final Authorizations auths = getAuths(cl, shellState);
- final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
+ final Scanner scanner = shellState.getAccumuloClient().createScanner(tableName, auths);
if (null != classLoaderContext) {
scanner.setClassLoaderContext(classLoaderContext);
}
@@ -156,7 +156,7 @@ public class ScanCommand extends Command {
static void ensureTserversCanLoadIterator(final Shell shellState, String tableName,
String classname) throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
ShellCommandException {
- if (!shellState.getConnector().tableOperations().testClassLoad(tableName, classname,
+ if (!shellState.getAccumuloClient().tableOperations().testClassLoad(tableName, classname,
SortedKeyValueIterator.class.getName())) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + classname + " as type "
@@ -301,8 +301,8 @@ public class ScanCommand extends Command {
protected Authorizations getAuths(final CommandLine cl, final Shell shellState)
throws AccumuloSecurityException, AccumuloException {
- final String user = shellState.getConnector().whoami();
- Authorizations auths = shellState.getConnector().securityOperations()
+ final String user = shellState.getAccumuloClient().whoami();
+ Authorizations auths = shellState.getAccumuloClient().securityOperations()
.getUserAuthorizations(user);
if (cl.hasOption(scanOptAuths.getOpt())) {
auths = ScanCommand.parseAuthorizations(cl.getOptionValue(scanOptAuths.getOpt()));
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
index 86b23b6..31767a2 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScriptCommand.java
@@ -87,7 +87,7 @@ public class ScriptCommand extends Command {
// are available to the scripts
// TODO: What else should go in here?
Bindings b = engine.getBindings(ScriptContext.ENGINE_SCOPE);
- b.put("connection", shellState.getConnector());
+ b.put("connection", shellState.getAccumuloClient());
List<Object> argValues = new ArrayList<>();
if (cl.hasOption(args.getOpt())) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SetAuthsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SetAuthsCommand.java
index e9df7c6..5176d90 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/SetAuthsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SetAuthsCommand.java
@@ -38,10 +38,11 @@ public class SetAuthsCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException {
- final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami());
+ final String user = cl.getOptionValue(userOpt.getOpt(),
+ shellState.getAccumuloClient().whoami());
final String scanOpts = cl.hasOption(clearOptAuths.getOpt()) ? null
: cl.getOptionValue(scanOptAuths.getOpt());
- shellState.getConnector().securityOperations().changeUserAuthorizations(user,
+ shellState.getAccumuloClient().securityOperations().changeUserAuthorizations(user,
ScanCommand.parseAuthorizations(scanOpts));
Shell.log.debug("Changed record-level authorizations for user " + user);
return 0;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SetGroupsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SetGroupsCommand.java
index 8e639d0..5aefd13 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/SetGroupsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SetGroupsCommand.java
@@ -54,7 +54,7 @@ public class SetGroupsCommand extends Command {
groups.put(group, colFams);
}
- shellState.getConnector().tableOperations().setLocalityGroups(tableName, groups);
+ shellState.getAccumuloClient().tableOperations().setLocalityGroups(tableName, groups);
return 0;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java
index 9a5778e..33fa798 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java
@@ -155,7 +155,7 @@ public class SetIterCommand extends Command {
String deprecatedAggregatorClassName =
org.apache.accumulo.core.iterators.aggregation.Aggregator.class.getName();
// @formatter:on
- if (aggregatorClass != null && !shellState.getConnector().tableOperations()
+ if (aggregatorClass != null && !shellState.getAccumuloClient().tableOperations()
.testClassLoad(tableName, aggregatorClass, deprecatedAggregatorClassName)) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + aggregatorClass + " as type "
@@ -182,7 +182,7 @@ public class SetIterCommand extends Command {
throw new IllegalArgumentException("You must select at least one scope to configure");
}
final IteratorSetting setting = new IteratorSetting(priority, name, classname, options);
- shellState.getConnector().tableOperations().attachIterator(tableName, setting, scopes);
+ shellState.getAccumuloClient().tableOperations().attachIterator(tableName, setting, scopes);
}
protected void setNamespaceProperties(final CommandLine cl, final Shell shellState,
@@ -193,7 +193,7 @@ public class SetIterCommand extends Command {
final String namespace = OptUtil.getNamespaceOpt(cl, shellState);
- if (!shellState.getConnector().namespaceOperations().testClassLoad(namespace, classname,
+ if (!shellState.getAccumuloClient().namespaceOperations().testClassLoad(namespace, classname,
SortedKeyValueIterator.class.getName())) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + classname + " as type "
@@ -206,7 +206,7 @@ public class SetIterCommand extends Command {
String deprecatedAggregatorClassName =
org.apache.accumulo.core.iterators.aggregation.Aggregator.class.getName();
// @formatter:on
- if (aggregatorClass != null && !shellState.getConnector().namespaceOperations()
+ if (aggregatorClass != null && !shellState.getAccumuloClient().namespaceOperations()
.testClassLoad(namespace, aggregatorClass, deprecatedAggregatorClassName)) {
throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE,
"Servers are unable to load " + aggregatorClass + " as type "
@@ -233,7 +233,7 @@ public class SetIterCommand extends Command {
throw new IllegalArgumentException("You must select at least one scope to configure");
}
final IteratorSetting setting = new IteratorSetting(priority, name, classname, options);
- shellState.getConnector().namespaceOperations().attachIterator(namespace, setting, scopes);
+ shellState.getAccumuloClient().namespaceOperations().attachIterator(namespace, setting, scopes);
}
private static String setUpOptions(ClassLoader classloader, final ConsoleReader reader,
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SetScanIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SetScanIterCommand.java
index 7d458ed..0fa83e1 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/SetScanIterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SetScanIterCommand.java
@@ -73,10 +73,10 @@ public class SetScanIterCommand extends SetIterCommand {
setting.addOptions(options);
// initialize a scanner to ensure the new setting does not conflict with existing settings
- final String user = shellState.getConnector().whoami();
- final Authorizations auths = shellState.getConnector().securityOperations()
+ final String user = shellState.getAccumuloClient().whoami();
+ final Authorizations auths = shellState.getAccumuloClient().securityOperations()
.getUserAuthorizations(user);
- final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
+ final Scanner scanner = shellState.getAccumuloClient().createScanner(tableName, auths);
for (IteratorSetting s : tableScanIterators) {
scanner.addScanIterator(s);
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
index 00f0302..fcd95bd 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
@@ -62,7 +62,7 @@ public abstract class ShellPluginConfigurationCommand extends Command {
shellState.getReader().println("Removed " + pluginType + " on " + tableName);
} else if (cl.hasOption(listPluginOption.getOpt())) {
// Get the options for this table
- final Iterator<Entry<String,String>> iter = shellState.getConnector().tableOperations()
+ final Iterator<Entry<String,String>> iter = shellState.getAccumuloClient().tableOperations()
.getProperties(tableName).iterator();
while (iter.hasNext()) {
@@ -86,20 +86,21 @@ public abstract class ShellPluginConfigurationCommand extends Command {
protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName,
final String className) throws AccumuloException, AccumuloSecurityException {
- shellState.getConnector().tableOperations().setProperty(tableName, tableProp.toString(),
+ shellState.getAccumuloClient().tableOperations().setProperty(tableName, tableProp.toString(),
className);
}
protected void removePlugin(final CommandLine cl, final Shell shellState, final String tableName)
throws AccumuloException, AccumuloSecurityException {
- shellState.getConnector().tableOperations().removeProperty(tableName, tableProp.toString());
+ shellState.getAccumuloClient().tableOperations().removeProperty(tableName,
+ tableProp.toString());
}
public static <T> Class<? extends T> getPluginClass(final String tableName,
final Shell shellState, final Class<T> clazz, final Property pluginProp) {
Iterator<Entry<String,String>> props;
try {
- props = shellState.getConnector().tableOperations().getProperties(tableName).iterator();
+ props = shellState.getAccumuloClient().tableOperations().getProperties(tableName).iterator();
} catch (AccumuloException | TableNotFoundException e) {
return null;
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SummariesCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SummariesCommand.java
index 4935f7e..7094c5e 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/SummariesCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SummariesCommand.java
@@ -22,9 +22,9 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Map;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.SummaryRetriever;
import org.apache.accumulo.core.client.summary.Summary;
@@ -52,7 +52,7 @@ public class SummariesCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException, IOException {
- Connector conn = shellState.getConnector();
+ AccumuloClient conn = shellState.getAccumuloClient();
SummaryRetriever retriever = conn.tableOperations().summaries(tableName)
.withMatchingConfiguration(selectionRegex);
if (startRow != null) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TableCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TableCommand.java
index 5b23653..1db9111 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/TableCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TableCommand.java
@@ -32,7 +32,7 @@ public class TableCommand extends Command {
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
final String tableName = cl.getArgs()[0];
- if (!shellState.getConnector().tableOperations().exists(tableName)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(null, tableName, null);
}
shellState.setTableName(tableName);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java
index 0249ba0..a41c259 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java
@@ -48,7 +48,7 @@ public abstract class TableOperation extends Command {
final SortedSet<String> tableSet = new TreeSet<>();
if (cl.hasOption(optTablePattern.getOpt())) {
String tablePattern = cl.getOptionValue(optTablePattern.getOpt());
- for (String table : shellState.getConnector().tableOperations().list())
+ for (String table : shellState.getAccumuloClient().tableOperations().list())
if (table.matches(tablePattern)) {
tableSet.add(table);
}
@@ -79,7 +79,7 @@ public abstract class TableOperation extends Command {
if (!more) {
break;
}
- if (!shellState.getConnector().tableOperations().exists(tableName)) {
+ if (!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
throw new TableNotFoundException(null, tableName, null);
}
boolean operate = true;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java
index 919e174..8744b76 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TablesCommand.java
@@ -50,7 +50,7 @@ public class TablesCommand extends Command {
final String namespace = cl.hasOption(OptUtil.namespaceOpt().getOpt())
? OptUtil.getNamespaceOpt(cl, shellState)
: null;
- Map<String,String> tables = shellState.getConnector().tableOperations().tableIdMap();
+ Map<String,String> tables = shellState.getAccumuloClient().tableOperations().tableIdMap();
// filter only specified namespace
tables = Maps.filterKeys(tables,
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
index 1b85530..75e3a8f 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
@@ -41,7 +41,7 @@ public class TraceCommand extends DebugCommand {
throws IOException {
if (cl.getArgs().length == 1) {
if (cl.getArgs()[0].equalsIgnoreCase("on")) {
- Trace.on("shell:" + shellState.getConnector().whoami());
+ Trace.on("shell:" + shellState.getAccumuloClient().whoami());
} else if (cl.getArgs()[0].equalsIgnoreCase("off")) {
if (Trace.isTracing()) {
final long trace = Trace.currentTraceId();
@@ -51,13 +51,13 @@ public class TraceCommand extends DebugCommand {
for (int i = 0; i < 30; i++) {
sb = new StringBuilder();
try {
- final Map<String,String> properties = shellState.getConnector().instanceOperations()
- .getSystemConfiguration();
+ final Map<String,String> properties = shellState.getAccumuloClient()
+ .instanceOperations().getSystemConfiguration();
final String table = properties.get(Property.TRACE_TABLE.getKey());
- final String user = shellState.getConnector().whoami();
- final Authorizations auths = shellState.getConnector().securityOperations()
+ final String user = shellState.getAccumuloClient().whoami();
+ final Authorizations auths = shellState.getAccumuloClient().securityOperations()
.getUserAuthorizations(user);
- final Scanner scanner = shellState.getConnector().createScanner(table, auths);
+ final Scanner scanner = shellState.getAccumuloClient().createScanner(table, auths);
scanner.setRange(new Range(new Text(Long.toHexString(trace))));
final StringBuilder finalSB = sb;
traceCount = TraceDump.printTrace(scanner, new Printer() {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/UserPermissionsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/UserPermissionsCommand.java
index 6b239c6..442a974 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/UserPermissionsCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/UserPermissionsCommand.java
@@ -36,13 +36,14 @@ public class UserPermissionsCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException {
- final String user = cl.getOptionValue(userOpt.getOpt(), shellState.getConnector().whoami());
+ final String user = cl.getOptionValue(userOpt.getOpt(),
+ shellState.getAccumuloClient().whoami());
String delim = "";
shellState.getReader().print("System permissions: ");
for (SystemPermission p : SystemPermission.values()) {
if (p != null
- && shellState.getConnector().securityOperations().hasSystemPermission(user, p)) {
+ && shellState.getAccumuloClient().securityOperations().hasSystemPermission(user, p)) {
shellState.getReader().print(delim + "System." + p.name());
delim = ", ";
}
@@ -50,11 +51,11 @@ public class UserPermissionsCommand extends Command {
shellState.getReader().println();
boolean runOnce = true;
- for (String n : shellState.getConnector().namespaceOperations().list()) {
+ for (String n : shellState.getAccumuloClient().namespaceOperations().list()) {
delim = "";
for (NamespacePermission p : NamespacePermission.values()) {
- if (p != null
- && shellState.getConnector().securityOperations().hasNamespacePermission(user, n, p)) {
+ if (p != null && shellState.getAccumuloClient().securityOperations()
+ .hasNamespacePermission(user, n, p)) {
if (runOnce) {
shellState.getReader().print("\nNamespace permissions (" + n + "): ");
runOnce = false;
@@ -68,10 +69,10 @@ public class UserPermissionsCommand extends Command {
shellState.getReader().println();
runOnce = true;
- for (String t : shellState.getConnector().tableOperations().list()) {
+ for (String t : shellState.getAccumuloClient().tableOperations().list()) {
delim = "";
for (TablePermission p : TablePermission.values()) {
- if (shellState.getConnector().securityOperations().hasTablePermission(user, t, p)
+ if (shellState.getAccumuloClient().securityOperations().hasTablePermission(user, t, p)
&& p != null) {
if (runOnce) {
shellState.getReader().print("\nTable permissions (" + t + "): ");
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/UsersCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/UsersCommand.java
index a31ff52..d6e770c 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/UsersCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/UsersCommand.java
@@ -28,7 +28,7 @@ public class UsersCommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException {
- for (String user : shellState.getConnector().securityOperations().listLocalUsers()) {
+ for (String user : shellState.getAccumuloClient().securityOperations().listLocalUsers()) {
shellState.getReader().println(user);
}
return 0;
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/WhoAmICommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/WhoAmICommand.java
index 34b302a..8655e43 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/WhoAmICommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/WhoAmICommand.java
@@ -26,7 +26,7 @@ public class WhoAmICommand extends Command {
@Override
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws IOException {
- shellState.getReader().println(shellState.getConnector().whoami());
+ shellState.getReader().println(shellState.getAccumuloClient().whoami());
return 0;
}
diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/DeleteAuthsCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/DeleteAuthsCommandTest.java
index b88ccc1..300e2df 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/commands/DeleteAuthsCommandTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/commands/DeleteAuthsCommandTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.accumulo.shell.commands;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.shell.Shell;
@@ -41,13 +41,13 @@ public class DeleteAuthsCommandTest {
@Test
public void deleteExistingAuth() throws Exception {
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
CommandLine cli = EasyMock.createMock(CommandLine.class);
Shell shellState = EasyMock.createMock(Shell.class);
ConsoleReader reader = EasyMock.createMock(ConsoleReader.class);
SecurityOperations secOps = EasyMock.createMock(SecurityOperations.class);
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
// We're the root user
EasyMock.expect(conn.whoami()).andReturn("root");
@@ -70,13 +70,13 @@ public class DeleteAuthsCommandTest {
@Test
public void deleteNonExistingAuth() throws Exception {
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
CommandLine cli = EasyMock.createMock(CommandLine.class);
Shell shellState = EasyMock.createMock(Shell.class);
ConsoleReader reader = EasyMock.createMock(ConsoleReader.class);
SecurityOperations secOps = EasyMock.createMock(SecurityOperations.class);
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
// We're the root user
EasyMock.expect(conn.whoami()).andReturn("root");
@@ -99,13 +99,13 @@ public class DeleteAuthsCommandTest {
@Test
public void deleteAllAuth() throws Exception {
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
CommandLine cli = EasyMock.createMock(CommandLine.class);
Shell shellState = EasyMock.createMock(Shell.class);
ConsoleReader reader = EasyMock.createMock(ConsoleReader.class);
SecurityOperations secOps = EasyMock.createMock(SecurityOperations.class);
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
// We're the root user
EasyMock.expect(conn.whoami()).andReturn("root");
diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/DropUserCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/DropUserCommandTest.java
index 9f79259..2fc0c57 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/commands/DropUserCommandTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/commands/DropUserCommandTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.accumulo.shell.commands;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.shell.Shell;
import org.apache.commons.cli.CommandLine;
@@ -40,13 +40,13 @@ public class DropUserCommandTest {
@Test
public void dropUserWithoutForcePrompts() throws Exception {
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
CommandLine cli = EasyMock.createMock(CommandLine.class);
Shell shellState = EasyMock.createMock(Shell.class);
ConsoleReader reader = EasyMock.createMock(ConsoleReader.class);
SecurityOperations secOps = EasyMock.createMock(SecurityOperations.class);
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
// The user we want to remove
EasyMock.expect(cli.getArgs()).andReturn(new String[] {"user"});
@@ -63,7 +63,7 @@ public class DropUserCommandTest {
// Fake a "yes" response
EasyMock.expect(shellState.getReader()).andReturn(reader);
EasyMock.expect(reader.readLine(EasyMock.anyObject(String.class))).andReturn("yes");
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
EasyMock.expect(conn.securityOperations()).andReturn(secOps);
secOps.dropLocalUser("user");
diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
index 91324c2..2cf7a6c 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
@@ -21,7 +21,7 @@ import java.io.Writer;
import java.lang.reflect.Field;
import java.util.EnumSet;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
@@ -48,7 +48,7 @@ public class SetIterCommandTest {
@Test
public void addColumnAgeOffFilter() throws Exception {
- Connector conn = EasyMock.createMock(Connector.class);
+ AccumuloClient conn = EasyMock.createMock(AccumuloClient.class);
CommandLine cli = EasyMock.createMock(CommandLine.class);
Shell shellState = EasyMock.createMock(Shell.class);
ConsoleReader reader = EasyMock.createMock(ConsoleReader.class);
@@ -98,21 +98,21 @@ public class SetIterCommandTest {
// Shell asking for another unnamed option; we pass in an empty string to signal that we are
// done adding options
EasyMock.expect(reader.readLine(EasyMock.anyObject(String.class))).andReturn("");
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
// Table exists
EasyMock.expect(conn.tableOperations()).andReturn(tableOperations);
EasyMock.expect(tableOperations.exists("foo")).andReturn(true);
// Testing class load
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
EasyMock.expect(conn.tableOperations()).andReturn(tableOperations);
EasyMock.expect(tableOperations.testClassLoad("foo",
"org.apache.accumulo.core.iterators.user.ColumnAgeOffFilter",
SortedKeyValueIterator.class.getName())).andReturn(true);
// Attach iterator
- EasyMock.expect(shellState.getConnector()).andReturn(conn);
+ EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
EasyMock.expect(conn.tableOperations()).andReturn(tableOperations);
tableOperations.attachIterator(EasyMock.eq("foo"), EasyMock.anyObject(IteratorSetting.class),
EasyMock.eq(EnumSet.allOf(IteratorScope.class)));
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
index 2fc5b84..16ffedb 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
@@ -27,6 +27,7 @@ import org.apache.accumulo.cluster.ClusterControl;
import org.apache.accumulo.cluster.ClusterUser;
import org.apache.accumulo.cluster.ClusterUsers;
import org.apache.accumulo.cluster.standalone.StandaloneAccumuloCluster;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.ClientInfo;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.admin.SecurityOperations;
@@ -185,12 +186,13 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase
// permissions to)
UserGroupInformation.loginUserFromKeytab(systemUser.getPrincipal(),
systemUser.getKeytab().getAbsolutePath());
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken());
+ AccumuloClient conn = cluster.getAccumuloClient(systemUser.getPrincipal(),
+ new KerberosToken());
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(),
rootUser.getKeytab().getAbsolutePath());
- conn = getConnector();
+ conn = getAccumuloClient();
// Create the trace table
conn.tableOperations().create(traceTable);
@@ -213,7 +215,7 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase
public void cleanupTables() throws Exception {
final String tablePrefix = this.getClass().getSimpleName() + "_";
- final TableOperations tops = getConnector().tableOperations();
+ final TableOperations tops = getAccumuloClient().tableOperations();
for (String table : tops.list()) {
if (table.startsWith(tablePrefix)) {
log.debug("Removing table {}", table);
@@ -224,7 +226,7 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase
public void cleanupUsers() throws Exception {
final String userPrefix = this.getClass().getSimpleName();
- final SecurityOperations secOps = getConnector().securityOperations();
+ final SecurityOperations secOps = getAccumuloClient().securityOperations();
for (String user : secOps.listLocalUsers()) {
if (user.startsWith(userPrefix)) {
log.info("Dropping local user {}", user);
@@ -343,8 +345,23 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase
return clusterConf;
}
+ public AccumuloClient getAccumuloClient() {
+ try {
+ String princ = getAdminPrincipal();
+ AuthenticationToken token = getAdminToken();
+ log.debug("Creating client connection as {} with {}", princ, token);
+ return cluster.getAccumuloClient(princ, token);
+ } catch (Exception e) {
+ log.error("Could not connect to Accumulo", e);
+ fail("Could not connect to Accumulo: " + e.getMessage());
+
+ throw new RuntimeException("Could not connect to Accumulo", e);
+ }
+ }
+
public Connector getConnector() {
try {
+ log.warn("No longer used since version 2.0, please call getAccumuloClient() instead.");
String princ = getAdminPrincipal();
AuthenticationToken token = getAdminToken();
log.debug("Creating connector as {} with {}", princ, token);
diff --git a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
index 0f931ca..fac39d1 100644
--- a/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
+++ b/test/src/main/java/org/apache/accumulo/harness/SharedMiniClusterBase.java
@@ -24,7 +24,7 @@ import java.security.SecureRandom;
import org.apache.accumulo.cluster.ClusterUser;
import org.apache.accumulo.cluster.ClusterUsers;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -117,12 +117,13 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
// permissions to)
UserGroupInformation.loginUserFromKeytab(systemUser.getPrincipal(),
systemUser.getKeytab().getAbsolutePath());
- Connector conn = cluster.getConnector(systemUser.getPrincipal(), new KerberosToken());
+ AccumuloClient conn = cluster.getAccumuloClient(systemUser.getPrincipal(),
+ new KerberosToken());
// Then, log back in as the "root" user and do the grant
UserGroupInformation.loginUserFromKeytab(rootUser.getPrincipal(),
rootUser.getKeytab().getAbsolutePath());
- conn = cluster.getConnector(principal, token);
+ conn = cluster.getAccumuloClient(principal, token);
// Create the trace table
conn.tableOperations().create(traceTable);
@@ -187,9 +188,9 @@ public abstract class SharedMiniClusterBase extends AccumuloITBase implements Cl
return cluster.getConfig().getDir();
}
- public static Connector getConnector() {
+ public static AccumuloClient getClient() {
try {
- return getCluster().getConnector(principal, getToken());
+ return getCluster().getAccumuloClient(principal, getToken());
} catch (Exception e) {
throw new RuntimeException(e);
}
diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
index 06ed9a4..d30b96b 100644
--- a/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
+++ b/test/src/main/java/org/apache/accumulo/harness/conf/StandaloneAccumuloClusterConfiguration.java
@@ -27,8 +27,8 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -101,7 +101,7 @@ public class StandaloneAccumuloClusterConfiguration extends AccumuloClusterPrope
this.conf = getConfiguration(type);
this.clientPropsFile = clientPropsFile;
- clientInfo = Connector.builder().forInstance(getInstanceName(), getZooKeepers())
+ clientInfo = AccumuloClient.builder().forInstance(getInstanceName(), getZooKeepers())
.usingToken(getAdminPrincipal(), getAdminToken()).info();
// The user Accumulo is running as
diff --git a/test/src/main/java/org/apache/accumulo/test/ArbitraryTablePropertiesIT.java b/test/src/main/java/org/apache/accumulo/test/ArbitraryTablePropertiesIT.java
index 7db65de..6d596d9 100644
--- a/test/src/main/java/org/apache/accumulo/test/ArbitraryTablePropertiesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ArbitraryTablePropertiesIT.java
@@ -23,8 +23,8 @@ import static org.junit.Assert.fail;
import java.util.Map.Entry;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
@@ -61,7 +61,7 @@ public class ArbitraryTablePropertiesIT extends SharedMiniClusterBase {
// make a table
final String tableName = getUniqueNames(1)[0];
- final Connector conn = getConnector();
+ final AccumuloClient conn = getClient();
conn.tableOperations().create(tableName);
// Set variables for the property name to use and the initial value
@@ -119,7 +119,7 @@ public class ArbitraryTablePropertiesIT extends SharedMiniClusterBase {
// Create a root user and create the table
// Create a test user and grant that user permission to alter the table
final String tableName = getUniqueNames(1)[0];
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
c.securityOperations().createLocalUser(testUser,
(testToken instanceof PasswordToken ? (PasswordToken) testToken : null));
c.tableOperations().create(tableName);
@@ -133,7 +133,7 @@ public class ArbitraryTablePropertiesIT extends SharedMiniClusterBase {
assertTrue(Property.isValidPropertyKey(propertyName));
// Getting a fresh token will ensure we're logged in as this user (if necessary)
- Connector testConn = c.changeUser(testUser, user.getToken());
+ AccumuloClient testConn = c.changeUser(testUser, user.getToken());
// Set the property to the desired value
testConn.tableOperations().setProperty(tableName, propertyName, description1);
@@ -184,7 +184,7 @@ public class ArbitraryTablePropertiesIT extends SharedMiniClusterBase {
// Create a root user and create the table
// Create a test user and grant that user permission to alter the table
final String tableName = getUniqueNames(1)[0];
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
c.securityOperations().createLocalUser(testUser,
(testToken instanceof PasswordToken ? (PasswordToken) testToken : null));
c.tableOperations().create(tableName);
@@ -197,7 +197,7 @@ public class ArbitraryTablePropertiesIT extends SharedMiniClusterBase {
assertTrue(Property.isValidPropertyKey(propertyName));
// Getting a fresh token will ensure we're logged in as this user (if necessary)
- Connector testConn = c.changeUser(testUser, user.getToken());
+ AccumuloClient testConn = c.changeUser(testUser, user.getToken());
// Try to set the property to the desired value.
// If able to set it, the test fails, since permission was never granted
diff --git a/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java b/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
index 12b7259..a3c2cad 100644
--- a/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/AuditMessageIT.java
@@ -29,12 +29,12 @@ import java.util.Collections;
import java.util.Map;
import java.util.Set;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -87,8 +87,8 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Must be static to survive Junit re-initialising the class every time.
private static String lastAuditTimestamp;
- private Connector auditConnector;
- private Connector conn;
+ private AccumuloClient auditAccumuloClient;
+ private AccumuloClient conn;
private static long findAuditMessage(ArrayList<String> input, String pattern) {
return input.stream().filter(s -> s.matches(".*" + pattern + ".*")).count();
@@ -153,7 +153,7 @@ public class AuditMessageIT extends ConfigurableMacBase {
return result;
}
- private void grantEverySystemPriv(Connector conn, String user)
+ private void grantEverySystemPriv(AccumuloClient conn, String user)
throws AccumuloSecurityException, AccumuloException {
SystemPermission[] arrayOfP = {SystemPermission.SYSTEM, SystemPermission.ALTER_TABLE,
SystemPermission.ALTER_USER, SystemPermission.CREATE_TABLE, SystemPermission.CREATE_USER,
@@ -165,7 +165,7 @@ public class AuditMessageIT extends ConfigurableMacBase {
@Before
public void resetInstance() throws Exception {
- conn = getConnector();
+ conn = getClient();
removeUsersAndTables();
@@ -200,16 +200,16 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Connect as Audit User and do a bunch of stuff.
// Testing activity begins here
- auditConnector = getCluster().getConnector(AUDIT_USER_1, new PasswordToken(PASSWORD));
- auditConnector.tableOperations().create(OLD_TEST_TABLE_NAME);
- auditConnector.tableOperations().rename(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME);
+ auditAccumuloClient = getCluster().getAccumuloClient(AUDIT_USER_1, new PasswordToken(PASSWORD));
+ auditAccumuloClient.tableOperations().create(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().rename(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME);
Map<String,String> emptyMap = Collections.emptyMap();
Set<String> emptySet = Collections.emptySet();
- auditConnector.tableOperations().clone(NEW_TEST_TABLE_NAME, OLD_TEST_TABLE_NAME, true, emptyMap,
- emptySet);
- auditConnector.tableOperations().delete(OLD_TEST_TABLE_NAME);
- auditConnector.tableOperations().offline(NEW_TEST_TABLE_NAME);
- auditConnector.tableOperations().delete(NEW_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().clone(NEW_TEST_TABLE_NAME, OLD_TEST_TABLE_NAME, true,
+ emptyMap, emptySet);
+ auditAccumuloClient.tableOperations().delete(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().offline(NEW_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().delete(NEW_TEST_TABLE_NAME);
// Testing activity ends here
ArrayList<String> auditMessages = getAuditMessages("testTableOperationsAudits");
@@ -240,21 +240,22 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Connect as Audit User and do a bunch of stuff.
// Start testing activities here
- auditConnector = getCluster().getConnector(AUDIT_USER_1, new PasswordToken(PASSWORD));
- auditConnector.securityOperations().createLocalUser(AUDIT_USER_2, new PasswordToken(PASSWORD));
+ auditAccumuloClient = getCluster().getAccumuloClient(AUDIT_USER_1, new PasswordToken(PASSWORD));
+ auditAccumuloClient.securityOperations().createLocalUser(AUDIT_USER_2,
+ new PasswordToken(PASSWORD));
// It seems only root can grant stuff.
conn.securityOperations().grantSystemPermission(AUDIT_USER_2, SystemPermission.ALTER_TABLE);
conn.securityOperations().revokeSystemPermission(AUDIT_USER_2, SystemPermission.ALTER_TABLE);
- auditConnector.tableOperations().create(NEW_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().create(NEW_TEST_TABLE_NAME);
conn.securityOperations().grantTablePermission(AUDIT_USER_2, NEW_TEST_TABLE_NAME,
TablePermission.READ);
conn.securityOperations().revokeTablePermission(AUDIT_USER_2, NEW_TEST_TABLE_NAME,
TablePermission.READ);
- auditConnector.securityOperations().changeLocalUserPassword(AUDIT_USER_2,
+ auditAccumuloClient.securityOperations().changeLocalUserPassword(AUDIT_USER_2,
new PasswordToken("anything"));
- auditConnector.securityOperations().changeUserAuthorizations(AUDIT_USER_2, auths);
- auditConnector.securityOperations().dropLocalUser(AUDIT_USER_2);
+ auditAccumuloClient.securityOperations().changeUserAuthorizations(AUDIT_USER_2, auths);
+ auditAccumuloClient.securityOperations().dropLocalUser(AUDIT_USER_2);
// Stop testing activities here
ArrayList<String> auditMessages = getAuditMessages("testUserOperationsAudits");
@@ -293,11 +294,12 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Connect as Audit User and do a bunch of stuff.
// Start testing activities here
- auditConnector = getCluster().getConnector(AUDIT_USER_1, new PasswordToken(PASSWORD));
- auditConnector.tableOperations().create(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient = getCluster().getAccumuloClient(AUDIT_USER_1, new PasswordToken(PASSWORD));
+ auditAccumuloClient.tableOperations().create(OLD_TEST_TABLE_NAME);
// Insert some play data
- BatchWriter bw = auditConnector.createBatchWriter(OLD_TEST_TABLE_NAME, new BatchWriterConfig());
+ BatchWriter bw = auditAccumuloClient.createBatchWriter(OLD_TEST_TABLE_NAME,
+ new BatchWriterConfig());
Mutation m = new Mutation("myRow");
m.put("cf1", "cq1", "v1");
m.put("cf1", "cq2", "v3");
@@ -309,8 +311,8 @@ public class AuditMessageIT extends ConfigurableMacBase {
File exportDirBulk = new File(getCluster().getConfig().getDir() + "/export_bulk");
assertTrue(exportDirBulk.mkdir() || exportDirBulk.isDirectory());
- auditConnector.tableOperations().offline(OLD_TEST_TABLE_NAME, true);
- auditConnector.tableOperations().exportTable(OLD_TEST_TABLE_NAME, exportDir.toString());
+ auditAccumuloClient.tableOperations().offline(OLD_TEST_TABLE_NAME, true);
+ auditAccumuloClient.tableOperations().exportTable(OLD_TEST_TABLE_NAME, exportDir.toString());
// We've exported the table metadata to the MiniAccumuloCluster root dir. Grab the .rf file path
// to re-import it
@@ -330,13 +332,13 @@ public class AuditMessageIT extends ConfigurableMacBase {
}
FileUtils.copyFileToDirectory(importFile, exportDir);
FileUtils.copyFileToDirectory(importFile, exportDirBulk);
- auditConnector.tableOperations().importTable(NEW_TEST_TABLE_NAME, exportDir.toString());
+ auditAccumuloClient.tableOperations().importTable(NEW_TEST_TABLE_NAME, exportDir.toString());
// Now do a Directory (bulk) import of the same data.
- auditConnector.tableOperations().create(THIRD_TEST_TABLE_NAME);
- auditConnector.tableOperations().importDirectory(exportDirBulk.toString())
+ auditAccumuloClient.tableOperations().create(THIRD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().importDirectory(exportDirBulk.toString())
.to(THIRD_TEST_TABLE_NAME).load();
- auditConnector.tableOperations().online(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().online(OLD_TEST_TABLE_NAME);
// Stop testing activities here
@@ -380,11 +382,12 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Connect as Audit User and do a bunch of stuff.
// Start testing activities here
- auditConnector = getCluster().getConnector(AUDIT_USER_1, new PasswordToken(PASSWORD));
- auditConnector.tableOperations().create(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient = getCluster().getAccumuloClient(AUDIT_USER_1, new PasswordToken(PASSWORD));
+ auditAccumuloClient.tableOperations().create(OLD_TEST_TABLE_NAME);
// Insert some play data
- BatchWriter bw = auditConnector.createBatchWriter(OLD_TEST_TABLE_NAME, new BatchWriterConfig());
+ BatchWriter bw = auditAccumuloClient.createBatchWriter(OLD_TEST_TABLE_NAME,
+ new BatchWriterConfig());
Mutation m = new Mutation("myRow");
m.put("cf1", "cq1", "v1");
m.put("cf1", "cq2", "v3");
@@ -393,14 +396,14 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Start testing activities here
// A regular scan
- try (Scanner scanner = auditConnector.createScanner(OLD_TEST_TABLE_NAME, auths)) {
+ try (Scanner scanner = auditAccumuloClient.createScanner(OLD_TEST_TABLE_NAME, auths)) {
for (Map.Entry<Key,Value> entry : scanner) {
System.out.println("Scanner row: " + entry.getKey() + " " + entry.getValue());
}
}
// A batch scan
- try (BatchScanner bs = auditConnector.createBatchScanner(OLD_TEST_TABLE_NAME, auths, 1)) {
+ try (BatchScanner bs = auditAccumuloClient.createBatchScanner(OLD_TEST_TABLE_NAME, auths, 1)) {
bs.fetchColumn(new Text("cf1"), new Text("cq1"));
bs.setRanges(Arrays.asList(new Range("myRow", "myRow~")));
for (Map.Entry<Key,Value> entry : bs) {
@@ -409,7 +412,7 @@ public class AuditMessageIT extends ConfigurableMacBase {
}
// Delete some data.
- auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"),
+ auditAccumuloClient.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"),
new Text("myRow~"));
// End of testing activities
@@ -433,7 +436,7 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Create our user with no privs
conn.securityOperations().createLocalUser(AUDIT_USER_1, new PasswordToken(PASSWORD));
conn.tableOperations().create(OLD_TEST_TABLE_NAME);
- auditConnector = getCluster().getConnector(AUDIT_USER_1, new PasswordToken(PASSWORD));
+ auditAccumuloClient = getCluster().getAccumuloClient(AUDIT_USER_1, new PasswordToken(PASSWORD));
// Start testing activities
// We should get denied or / failed audit messages here.
@@ -441,26 +444,26 @@ public class AuditMessageIT extends ConfigurableMacBase {
// Exceptions are thrown.
try {
- auditConnector.tableOperations().create(NEW_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().create(NEW_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
try {
- auditConnector.tableOperations().rename(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().rename(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
try {
- auditConnector.tableOperations().clone(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME, true,
+ auditAccumuloClient.tableOperations().clone(OLD_TEST_TABLE_NAME, NEW_TEST_TABLE_NAME, true,
Collections.emptyMap(), Collections.emptySet());
} catch (AccumuloSecurityException ex) {}
try {
- auditConnector.tableOperations().delete(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().delete(OLD_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
try {
- auditConnector.tableOperations().offline(OLD_TEST_TABLE_NAME);
+ auditAccumuloClient.tableOperations().offline(OLD_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
- try (Scanner scanner = auditConnector.createScanner(OLD_TEST_TABLE_NAME, auths)) {
+ try (Scanner scanner = auditAccumuloClient.createScanner(OLD_TEST_TABLE_NAME, auths)) {
scanner.iterator().next().getKey();
} catch (RuntimeException ex) {}
try {
- auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"),
+ auditAccumuloClient.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"),
new Text("myRow~"));
} catch (AccumuloSecurityException ex) {}
diff --git a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
index 8f0b040..47a02ed 100644
--- a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
@@ -28,8 +28,8 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.admin.InstanceOperations;
import org.apache.accumulo.core.conf.Property;
@@ -85,7 +85,7 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
@Before
public void alterConfig() throws Exception {
- InstanceOperations iops = getConnector().instanceOperations();
+ InstanceOperations iops = getAccumuloClient().instanceOperations();
Map<String,String> config = iops.getSystemConfiguration();
gcCycleDelay = config.get(Property.GC_CYCLE_DELAY.getKey());
gcCycleStart = config.get(Property.GC_CYCLE_START.getKey());
@@ -95,7 +95,7 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
getCluster().getClusterControl().stopAllServers(ServerType.GARBAGE_COLLECTOR);
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
ClientInfo info = conn.info();
ZooCache zcache = new ZooCache(info.getZooKeepers(), info.getZooKeepersSessionTimeOut());
zcache.clear();
@@ -128,7 +128,7 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
@After
public void restoreConfig() throws Exception {
- InstanceOperations iops = getConnector().instanceOperations();
+ InstanceOperations iops = getAccumuloClient().instanceOperations();
if (null != gcCycleDelay) {
iops.setProperty(Property.GC_CYCLE_DELAY.getKey(), gcCycleDelay);
}
@@ -145,7 +145,7 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
public void test() throws Exception {
// make a table
String tableName = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
log.info("Creating table to be deleted");
c.tableOperations().create(tableName);
final String tableId = c.tableOperations().tableIdMap().get(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
index 66418ed..92897e2 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
@@ -29,7 +29,7 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
@@ -65,7 +65,7 @@ public class BalanceFasterIT extends ConfigurableMacBase {
public void test() throws Exception {
// create a table, add a bunch of splits
String tableName = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
conn.tableOperations().create(tableName);
SortedSet<Text> splits = new TreeSet<>();
for (int i = 0; i < 1000; i++) {
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceIT.java
index fa1d857..01ae578 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceIT.java
@@ -19,7 +19,7 @@ package org.apache.accumulo.test;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
@@ -37,7 +37,7 @@ public class BalanceIT extends AccumuloClusterHarness {
@Test
public void testBalance() throws Exception {
String tableName = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
log.info("Creating table");
c.tableOperations().create(tableName);
SortedSet<Text> splits = new TreeSet<>();
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
index b4147df..f29c49b 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceWithOfflineTableIT.java
@@ -21,7 +21,7 @@ import java.util.TreeSet;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.util.SimpleThreadPool;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
@@ -46,7 +46,7 @@ public class BalanceWithOfflineTableIT extends ConfigurableMacBase {
final String tableName = tableNames[0];
// create a table with a bunch of splits
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
log.info("Creating table {}", tableName);
c.tableOperations().create(tableName);
final SortedSet<Text> splits = new TreeSet<>();
diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterIT.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterIT.java
index 11fc595..75fd939 100644
--- a/test/src/main/java/org/apache/accumulo/test/BatchWriterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterIT.java
@@ -16,9 +16,9 @@
*/
package org.apache.accumulo.test;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.harness.AccumuloClusterHarness;
@@ -35,7 +35,7 @@ public class BatchWriterIT extends AccumuloClusterHarness {
public void test() throws Exception {
// call the batchwriter with buffer of size zero
String table = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
c.tableOperations().create(table);
BatchWriterConfig config = new BatchWriterConfig();
config.setMaxMemory(0);
diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java
index 55f1570..c7bebf9 100644
--- a/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java
@@ -21,9 +21,9 @@ import static org.junit.Assert.assertTrue;
import java.util.Map;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
@@ -60,7 +60,7 @@ public class BatchWriterInTabletServerIT extends AccumuloClusterHarness {
public void testNormalWrite() throws Exception {
String[] uniqueNames = getUniqueNames(2);
String t1 = uniqueNames[0], t2 = uniqueNames[1];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
int numEntriesToWritePerEntry = 50;
IteratorSetting itset = BatchWriterIterator.iteratorSetting(6, 0, 15, 1000,
numEntriesToWritePerEntry, t2, c, getAdminToken(), false, false);
@@ -79,14 +79,14 @@ public class BatchWriterInTabletServerIT extends AccumuloClusterHarness {
public void testClearLocatorAndSplitWrite() throws Exception {
String[] uniqueNames = getUniqueNames(2);
String t1 = uniqueNames[0], t2 = uniqueNames[1];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
int numEntriesToWritePerEntry = 50;
IteratorSetting itset = BatchWriterIterator.iteratorSetting(6, 0, 15, 1000,
numEntriesToWritePerEntry, t2, c, getAdminToken(), true, true);
test(t1, t2, c, itset, numEntriesToWritePerEntry);
}
- private void test(String t1, String t2, Connector c, IteratorSetting itset,
+ private void test(String t1, String t2, AccumuloClient c, IteratorSetting itset,
int numEntriesToWritePerEntry) throws Exception {
// Write an entry to t1
c.tableOperations().create(t1);
diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
index e5af058..efc2853 100644
--- a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
+++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java
@@ -24,9 +24,9 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -90,19 +90,20 @@ public class BatchWriterIterator extends WrappingIterator {
private BatchWriter batchWriter;
private boolean firstWrite = true;
private Value topValue = null;
- private Connector connector;
+ private AccumuloClient accumuloClient;
public static final String SUCCESS_STRING = "success";
public static final Value SUCCESS_VALUE = new Value(SUCCESS_STRING.getBytes());
public static IteratorSetting iteratorSetting(int priority, int sleepAfterFirstWrite,
long batchWriterTimeout, long batchWriterMaxMemory, int numEntriesToWrite, String tableName,
- Connector connector, AuthenticationToken token, boolean clearCacheAfterFirstWrite,
+ AccumuloClient accumuloClient, AuthenticationToken token, boolean clearCacheAfterFirstWrite,
boolean splitAfterFirstWrite) {
return iteratorSetting(priority, sleepAfterFirstWrite, batchWriterTimeout, batchWriterMaxMemory,
- numEntriesToWrite, tableName, connector.info().getZooKeepers(),
- connector.info().getInstanceName(), connector.info().getZooKeepersSessionTimeOut(),
- connector.whoami(), token, clearCacheAfterFirstWrite, splitAfterFirstWrite);
+ numEntriesToWrite, tableName, accumuloClient.info().getZooKeepers(),
+ accumuloClient.info().getInstanceName(),
+ accumuloClient.info().getZooKeepersSessionTimeOut(), accumuloClient.whoami(), token,
+ clearCacheAfterFirstWrite, splitAfterFirstWrite);
}
public static IteratorSetting iteratorSetting(int priority, int sleepAfterFirstWrite,
@@ -165,7 +166,7 @@ public class BatchWriterIterator extends WrappingIterator {
private void initBatchWriter() {
try {
- connector = Connector.builder().forInstance(instanceName, zookeeperHost)
+ accumuloClient = AccumuloClient.builder().forInstance(instanceName, zookeeperHost)
.usingToken(username, auth).withZkTimeout(zookeeperTimeout).build();
} catch (Exception e) {
log.error("failed to connect to Accumulo instance " + instanceName, e);
@@ -177,7 +178,7 @@ public class BatchWriterIterator extends WrappingIterator {
bwc.setTimeout(batchWriterTimeout, TimeUnit.SECONDS);
try {
- batchWriter = connector.createBatchWriter(tableName, bwc);
+ batchWriter = accumuloClient.createBatchWriter(tableName, bwc);
} catch (TableNotFoundException e) {
log.error(tableName + " does not exist in instance " + instanceName, e);
throw new RuntimeException(e);
@@ -206,7 +207,7 @@ public class BatchWriterIterator extends WrappingIterator {
if (splitAfterFirstWrite) {
SortedSet<Text> splits = new TreeSet<>();
splits.add(new Text(row));
- connector.tableOperations().addSplits(tableName, splits);
+ accumuloClient.tableOperations().addSplits(tableName, splits);
}
if (sleepAfterFirstWrite > 0)
try {
diff --git a/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java b/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
index 4a59bf4..bfb0bb9 100644
--- a/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BulkImportMonitoringIT.java
@@ -28,7 +28,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -59,7 +59,7 @@ public class BulkImportMonitoringIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
getCluster().getClusterControl().start(ServerType.MONITOR);
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
final String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "1");
diff --git a/test/src/main/java/org/apache/accumulo/test/BulkImportSequentialRowsIT.java b/test/src/main/java/org/apache/accumulo/test/BulkImportSequentialRowsIT.java
index dc30609..377e89a 100644
--- a/test/src/main/java/org/apache/accumulo/test/BulkImportSequentialRowsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BulkImportSequentialRowsIT.java
@@ -61,7 +61,7 @@ public class BulkImportSequentialRowsIT extends AccumuloClusterHarness {
@Test
public void testBulkImportFailure() throws Exception {
String tableName = getUniqueNames(1)[0];
- TableOperations to = getConnector().tableOperations();
+ TableOperations to = getAccumuloClient().tableOperations();
to.create(tableName);
FileSystem fs = getFileSystem();
Path rootPath = new Path(fs.makeQualified(getUsableDir()), getClass().getSimpleName());
@@ -100,7 +100,7 @@ public class BulkImportSequentialRowsIT extends AccumuloClusterHarness {
// The bug is that some tablets don't get imported into.
assertEquals(NR * NV,
- Iterables.size(getConnector().createScanner(tableName, Authorizations.EMPTY)));
+ Iterables.size(getAccumuloClient().createScanner(tableName, Authorizations.EMPTY)));
}
private TreeSet<Text> getSplits() {
diff --git a/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java b/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
index 9f8d745..bceb39a 100644
--- a/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BulkImportVolumeIT.java
@@ -64,7 +64,7 @@ public class BulkImportVolumeIT extends AccumuloClusterHarness {
@Test
public void testBulkImportFailure() throws Exception {
String tableName = getUniqueNames(1)[0];
- TableOperations to = getConnector().tableOperations();
+ TableOperations to = getAccumuloClient().tableOperations();
to.create(tableName);
FileSystem fs = getFileSystem();
Path rootPath = new Path(cluster.getTemporaryPath(), getClass().getName());
diff --git a/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java b/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
index 1a888ea..a4437a5 100644
--- a/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
@@ -22,9 +22,9 @@ import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -68,7 +68,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
@Before
public void offlineTraceTable() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String traceTable = conn.instanceOperations().getSystemConfiguration()
.get(Property.TRACE_TABLE.getKey());
if (conn.tableOperations().exists(traceTable)) {
@@ -79,7 +79,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
@After
public void onlineTraceTable() throws Exception {
if (null != cluster) {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String traceTable = conn.instanceOperations().getSystemConfiguration()
.get(Property.TRACE_TABLE.getKey());
if (conn.tableOperations().exists(traceTable)) {
@@ -91,7 +91,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
// test for ACCUMULO-1830
@Test
public void test() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
@@ -131,7 +131,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
assertEquals(0, count(tableName, conn));
}
- private int countLogs(String tableName, Connector conn) throws TableNotFoundException {
+ private int countLogs(String tableName, AccumuloClient conn) throws TableNotFoundException {
int count = 0;
try (Scanner scanner = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.fetchColumnFamily(MetadataSchema.TabletsSection.LogColumnFamily.NAME);
@@ -144,7 +144,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
return count;
}
- int count(String tableName, Connector conn) throws Exception {
+ int count(String tableName, AccumuloClient conn) throws Exception {
try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) {
return Iterators.size(s.iterator());
}
diff --git a/test/src/main/java/org/apache/accumulo/test/ClientSideIteratorIT.java b/test/src/main/java/org/apache/accumulo/test/ClientSideIteratorIT.java
index ad67a35..6b383b3 100644
--- a/test/src/main/java/org/apache/accumulo/test/ClientSideIteratorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ClientSideIteratorIT.java
@@ -24,10 +24,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ClientSideIteratorScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
@@ -71,12 +71,12 @@ public class ClientSideIteratorIT extends AccumuloClusterHarness {
assertEquals(i, results.size());
}
- private Connector conn;
+ private AccumuloClient conn;
private String tableName;
@Before
public void setupInstance() throws Exception {
- conn = getConnector();
+ conn = getAccumuloClient();
tableName = getUniqueNames(1)[0];
}
diff --git a/test/src/main/java/org/apache/accumulo/test/CloneIT.java b/test/src/main/java/org/apache/accumulo/test/CloneIT.java
index aa1b9b3..06b824b 100644
--- a/test/src/main/java/org/apache/accumulo/test/CloneIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/CloneIT.java
@@ -23,9 +23,9 @@ import static org.junit.Assert.fail;
import java.util.HashSet;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.data.Key;
@@ -46,7 +46,7 @@ public class CloneIT extends AccumuloClusterHarness {
@Test
public void testNoFiles() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -77,7 +77,7 @@ public class CloneIT extends AccumuloClusterHarness {
@Test
public void testFilesChange() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -132,7 +132,7 @@ public class CloneIT extends AccumuloClusterHarness {
// test split where files of children are the same
@Test
public void testSplit1() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -175,7 +175,7 @@ public class CloneIT extends AccumuloClusterHarness {
// test split where files of children differ... like majc and split occurred
@Test
public void testSplit2() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -251,7 +251,7 @@ public class CloneIT extends AccumuloClusterHarness {
// test two tablets splitting into four
@Test
public void testSplit3() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -298,7 +298,7 @@ public class CloneIT extends AccumuloClusterHarness {
// test cloned marker
@Test
public void testClonedMarker() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -363,7 +363,7 @@ public class CloneIT extends AccumuloClusterHarness {
// test two tablets splitting into four
@Test
public void testMerge() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/CompactionRateLimitingIT.java b/test/src/main/java/org/apache/accumulo/test/CompactionRateLimitingIT.java
index 9fa9547..6095bfa 100644
--- a/test/src/main/java/org/apache/accumulo/test/CompactionRateLimitingIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/CompactionRateLimitingIT.java
@@ -21,9 +21,9 @@ import static org.junit.Assert.assertTrue;
import java.security.SecureRandom;
import java.util.Random;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
@@ -47,7 +47,7 @@ public class CompactionRateLimitingIT extends ConfigurableMacBase {
public void majorCompactionsAreRateLimited() throws Exception {
long bytesWritten = 0;
String tableName = getUniqueNames(1)[0];
- Connector conn = getCluster().getConnector("root", new PasswordToken(ROOT_PASSWORD));
+ AccumuloClient conn = getCluster().getAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
conn.tableOperations().create(tableName);
try (BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig())) {
Random r = new SecureRandom();
diff --git a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
index e61dc31..161189f 100644
--- a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -47,6 +47,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.cluster.AccumuloCluster;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
@@ -55,7 +56,6 @@ import org.apache.accumulo.core.client.ConditionalWriter;
import org.apache.accumulo.core.client.ConditionalWriter.Result;
import org.apache.accumulo.core.client.ConditionalWriter.Status;
import org.apache.accumulo.core.client.ConditionalWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.RowIterator;
@@ -135,7 +135,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Before
public void deleteUsers() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
Set<String> users = conn.securityOperations().listLocalUsers();
ClusterUser user = getUser(0);
if (users.contains(user.getPrincipal())) {
@@ -146,7 +146,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testBasic() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -237,7 +237,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testFields() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
String user = null;
@@ -342,7 +342,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
public void testBadColVis() throws Exception {
// test when a user sets a col vis in a condition that can never be seen
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -453,7 +453,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
public void testConstraints() throws Exception {
// ensure constraint violations are properly reported
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -485,7 +485,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testIterators() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName, new NewTableConfiguration().withoutDefaultIterators());
@@ -633,7 +633,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
public void testTableAndConditionIterators() throws Exception {
// test w/ table that has iterators configured
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
IteratorSetting aiConfig1 = new IteratorSetting(30, "AI1", AddingIterator.class);
@@ -731,7 +731,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testBatch() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -848,7 +848,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testBigBatch() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -922,7 +922,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testBatchErrors() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -1008,7 +1008,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
public void testSameRow() throws Exception {
// test multiple mutations for same row in same batch
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -1137,10 +1137,10 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
String tableName;
ArrayList<ByteSequence> rows;
ConditionalWriter cw;
- Connector conn;
+ AccumuloClient conn;
AtomicBoolean failed;
- public MutatorTask(String tableName, Connector conn, ArrayList<ByteSequence> rows,
+ public MutatorTask(String tableName, AccumuloClient conn, ArrayList<ByteSequence> rows,
ConditionalWriter cw, AtomicBoolean failed) {
this.tableName = tableName;
this.rows = rows;
@@ -1195,7 +1195,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
// test multiple threads using a single conditional writer
String tableName = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(tableName);
@@ -1275,7 +1275,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testSecurity() throws Exception {
// test against table user does not have read and/or write permissions for
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String user = null;
// Create a new user
@@ -1302,7 +1302,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
conn.securityOperations().grantTablePermission(user, table3, TablePermission.WRITE);
// Login as the user
- Connector conn2 = conn.changeUser(user, user1.getToken());
+ AccumuloClient conn2 = conn.changeUser(user, user1.getToken());
ConditionalMutation cm1 = new ConditionalMutation("r1", new Condition("tx", "seq"));
cm1.put("tx", "seq", "1");
@@ -1341,7 +1341,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testTimeout() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String table = getUniqueNames(1)[0];
@@ -1393,7 +1393,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testDeleteTable() throws Exception {
String table = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
try {
conn.createConditionalWriter(table, new ConditionalWriterConfig());
@@ -1426,7 +1426,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testOffline() throws Exception {
String table = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(table);
@@ -1459,7 +1459,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
@Test
public void testError() throws Exception {
String table = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(table);
@@ -1489,7 +1489,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
public void testNoConditions() throws AccumuloException, AccumuloSecurityException,
TableExistsException, TableNotFoundException {
String table = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(table);
@@ -1509,7 +1509,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
// Need to add a getClientConfig() to AccumuloCluster
Assume.assumeTrue(getClusterType() == ClusterType.MINI);
Process tracer = null;
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
AccumuloCluster cluster = getCluster();
MiniAccumuloClusterImpl mac = (MiniAccumuloClusterImpl) cluster;
if (!conn.tableOperations().exists("trace")) {
diff --git a/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java b/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
index 94d0ce6..4e17a70 100644
--- a/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ConfigurableMajorCompactionIT.java
@@ -23,9 +23,9 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
@@ -81,7 +81,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
conn.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(),
@@ -101,7 +101,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacBase {
}
}
- private int countFiles(Connector conn) throws Exception {
+ private int countFiles(AccumuloClient conn) throws Exception {
try (Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
s.setRange(MetadataSchema.TabletsSection.getRange());
s.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME);
@@ -109,7 +109,7 @@ public class ConfigurableMajorCompactionIT extends ConfigurableMacBase {
}
}
- private void writeFile(Connector conn, String tableName) throws Exception {
+ private void writeFile(AccumuloClient conn, String tableName) throws Exception {
BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
Mutation m = new Mutation("row");
m.put("cf", "cq", "value");
diff --git a/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
index 9134779..1000b41 100644
--- a/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/DetectDeadTabletServersIT.java
@@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.MasterClient;
import org.apache.accumulo.core.client.impl.thrift.ThriftNotActiveServiceException;
@@ -51,7 +51,7 @@ public class DetectDeadTabletServersIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getClient();
log.info("verifying that everything is up");
Iterators.size(c.createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
@@ -84,7 +84,7 @@ public class DetectDeadTabletServersIT extends ConfigurableMacBase {
assertEquals(1, stats.deadTabletServers.size());
}
- private MasterMonitorInfo getStats(Connector c) throws Exception {
+ private MasterMonitorInfo getStats(AccumuloClient c) throws Exception {
ClientContext context = getClientContext();
Client client = null;
while (true) {
diff --git a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
index cb957f6..606c61d 100644
--- a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
@@ -29,9 +29,9 @@ import java.util.Map.Entry;
import java.util.Set;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.ClientProperty;
@@ -87,7 +87,7 @@ public class ExistingMacIT extends ConfigurableMacBase {
@Test
public void testExistingInstance() throws Exception {
- Connector conn = getCluster().getConnector("root", new PasswordToken(ROOT_PASSWORD));
+ AccumuloClient conn = getCluster().getAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
conn.tableOperations().create("table1");
@@ -141,7 +141,7 @@ public class ExistingMacIT extends ConfigurableMacBase {
MiniAccumuloClusterImpl accumulo2 = new MiniAccumuloClusterImpl(macConfig2);
accumulo2.start();
- conn = accumulo2.getConnector("root", new PasswordToken(ROOT_PASSWORD));
+ conn = accumulo2.getAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
try (Scanner scanner = conn.createScanner("table1", Authorizations.EMPTY)) {
int sum = 0;
@@ -157,7 +157,7 @@ public class ExistingMacIT extends ConfigurableMacBase {
@Test
public void testExistingRunningInstance() throws Exception {
final String table = getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
// Ensure that a master and tserver are up so the existing instance check won't fail.
conn.tableOperations().create(table);
BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
diff --git a/test/src/main/java/org/apache/accumulo/test/FindMaxIT.java b/test/src/main/java/org/apache/accumulo/test/FindMaxIT.java
index 3574c60..9c3d271 100644
--- a/test/src/main/java/org/apache/accumulo/test/FindMaxIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/FindMaxIT.java
@@ -22,9 +22,9 @@ import static org.junit.Assert.assertNull;
import java.util.ArrayList;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
@@ -50,7 +50,7 @@ public class FindMaxIT extends AccumuloClusterHarness {
@Test
public void test1() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java b/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
index 10c514e..9b8b0c9 100644
--- a/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/GarbageCollectWALIT.java
@@ -18,7 +18,7 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.security.Authorizations;
@@ -53,7 +53,7 @@ public class GarbageCollectWALIT extends ConfigurableMacBase {
// not yet, please
String tableName = getUniqueNames(1)[0];
cluster.getClusterControl().stop(ServerType.GARBAGE_COLLECTOR);
- Connector c = getConnector();
+ AccumuloClient c = getClient();
c.tableOperations().create(tableName);
// count the number of WALs in the filesystem
assertEquals(2, countWALsInFS(cluster));
diff --git a/test/src/main/java/org/apache/accumulo/test/GetFileInfoBulkIT.java b/test/src/main/java/org/apache/accumulo/test/GetFileInfoBulkIT.java
index 1363646..5575775 100644
--- a/test/src/main/java/org/apache/accumulo/test/GetFileInfoBulkIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/GetFileInfoBulkIT.java
@@ -31,7 +31,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -83,7 +83,7 @@ public class GetFileInfoBulkIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
getCluster().getClusterControl().kill(ServerType.GARBAGE_COLLECTOR, "localhost");
final String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
index 6c5501b..1677744 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -30,11 +30,11 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -50,7 +50,7 @@ import com.google.common.collect.Iterators;
public class IMMLGBenchmark {
public static void main(String[] args) throws Exception {
- Connector conn = Connector.builder().forInstance("test16", "localhost")
+ AccumuloClient conn = AccumuloClient.builder().forInstance("test16", "localhost")
.usingPassword("root", "secret").build();
int numlg = Integer.parseInt(args[0]);
@@ -74,7 +74,7 @@ public class IMMLGBenchmark {
}
- private static void runTest(Connector conn, int numlg, ArrayList<byte[]> cfset,
+ private static void runTest(AccumuloClient conn, int numlg, ArrayList<byte[]> cfset,
Map<String,Stat> stats) throws Exception {
String table = "immlgb";
@@ -114,7 +114,7 @@ public class IMMLGBenchmark {
stat.addStat(wt);
}
- private static long scan(Connector conn, ArrayList<byte[]> cfset, String table, boolean cq)
+ private static long scan(AccumuloClient conn, ArrayList<byte[]> cfset, String table, boolean cq)
throws TableNotFoundException {
try (Scanner scanner = conn.createScanner(table, Authorizations.EMPTY)) {
@@ -133,7 +133,7 @@ public class IMMLGBenchmark {
}
}
- private static long write(Connector conn, ArrayList<byte[]> cfset, String table)
+ private static long write(AccumuloClient conn, ArrayList<byte[]> cfset, String table)
throws TableNotFoundException, MutationsRejectedException {
Random rand = new SecureRandom();
@@ -163,7 +163,7 @@ public class IMMLGBenchmark {
return t2 - t1;
}
- private static void setupLocalityGroups(Connector conn, int numlg, ArrayList<byte[]> cfset,
+ private static void setupLocalityGroups(AccumuloClient conn, int numlg, ArrayList<byte[]> cfset,
String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
if (numlg > 1) {
int numCF = cfset.size() / numlg;
diff --git a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
index ec491d5..d198583 100644
--- a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
@@ -29,9 +29,9 @@ import java.util.Iterator;
import java.util.Map.Entry;
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
@@ -68,7 +68,7 @@ public class ImportExportIT extends AccumuloClusterHarness {
@Test
public void testExportImportThenScan() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String[] tableNames = getUniqueNames(2);
String srcTable = tableNames[0], destTable = tableNames[1];
@@ -176,7 +176,7 @@ public class ImportExportIT extends AccumuloClusterHarness {
verifyTableEquality(conn, srcTable, destTable);
}
- private void verifyTableEquality(Connector conn, String srcTable, String destTable)
+ private void verifyTableEquality(AccumuloClient conn, String srcTable, String destTable)
throws Exception {
Iterator<Entry<Key,Value>> src = conn.createScanner(srcTable, Authorizations.EMPTY).iterator(),
dest = conn.createScanner(destTable, Authorizations.EMPTY).iterator();
diff --git a/test/src/main/java/org/apache/accumulo/test/InterruptibleScannersIT.java b/test/src/main/java/org/apache/accumulo/test/InterruptibleScannersIT.java
index af5708f..f48ae21 100644
--- a/test/src/main/java/org/apache/accumulo/test/InterruptibleScannersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/InterruptibleScannersIT.java
@@ -21,7 +21,7 @@ import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Iterator;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.admin.ActiveScan;
@@ -51,7 +51,7 @@ public class InterruptibleScannersIT extends AccumuloClusterHarness {
public void test() throws Exception {
// make a table
final String tableName = getUniqueNames(1)[0];
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(tableName);
// make the world's slowest scanner
diff --git a/test/src/main/java/org/apache/accumulo/test/IsolationAndDeepCopyIT.java b/test/src/main/java/org/apache/accumulo/test/IsolationAndDeepCopyIT.java
index 39c1ea9..1006bab 100644
--- a/test/src/main/java/org/apache/accumulo/test/IsolationAndDeepCopyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/IsolationAndDeepCopyIT.java
@@ -24,9 +24,9 @@ import static org.junit.Assert.assertTrue;
import java.util.Iterator;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
@@ -46,7 +46,7 @@ public class IsolationAndDeepCopyIT extends AccumuloClusterHarness {
// test bug fox for ACCUMULO-3977
String table = super.getUniqueNames(1)[0];
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().create(table);
diff --git a/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java b/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java
index d8e64f6..19b6fc5 100644
--- a/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java
@@ -22,9 +22,9 @@ import static org.junit.Assert.assertFalse;
import java.util.Iterator;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
@@ -42,7 +42,7 @@ public class KeyValueEqualityIT extends AccumuloClusterHarness {
@Test
public void testEquality() throws Exception {
- Connector conn = this.getConnector();
+ AccumuloClient conn = this.getAccumuloClient();
final BatchWriterConfig config = new BatchWriterConfig();
final String[] tables = getUniqueNames(2);
diff --git a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
index 86b27ea..44777c5 100644
--- a/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/LargeSplitRowIT.java
@@ -27,9 +27,9 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.AccumuloServerException;
import org.apache.accumulo.core.client.impl.Namespace;
@@ -67,7 +67,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
// make a table and lower the TABLE_END_ROW_MAX_SIZE property
final String tableName = getUniqueNames(1)[0];
- final Connector conn = getConnector();
+ final AccumuloClient conn = getClient();
conn.tableOperations().create(tableName);
conn.tableOperations().setProperty(tableName, Property.TABLE_MAX_END_ROW_SIZE.getKey(), "1000");
@@ -118,7 +118,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
// make a table and lower the configure properties
final String tableName = getUniqueNames(1)[0];
- final Connector conn = getConnector();
+ final AccumuloClient conn = getClient();
conn.tableOperations().create(tableName);
conn.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
conn.tableOperations().setProperty(tableName, Property.TABLE_FILE_COMPRESSION_TYPE.getKey(),
@@ -191,7 +191,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
log.info("Split later");
automaticSplit(15, 1);
- final Connector conn = getConnector();
+ final AccumuloClient conn = getClient();
String tableName = new String();
java.util.Iterator<String> iterator = conn.tableOperations().list().iterator();
@@ -238,7 +238,7 @@ public class LargeSplitRowIT extends ConfigurableMacBase {
private void automaticSplit(int max, int spacing) throws Exception {
// make a table and lower the configure properties
final String tableName = getUniqueNames(1)[0];
- final Connector conn = getConnector();
+ final AccumuloClient conn = getClient();
conn.tableOperations().create(tableName);
conn.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
conn.tableOperations().setProperty(tableName, Property.TABLE_FILE_COMPRESSION_TYPE.getKey(),
diff --git a/test/src/main/java/org/apache/accumulo/test/LocatorIT.java b/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
index 38e000c..b0408ab 100644
--- a/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
@@ -31,7 +31,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.TableOfflineException;
import org.apache.accumulo.core.client.admin.Locations;
@@ -86,7 +86,7 @@ public class LocatorIT extends AccumuloClusterHarness {
@Test
public void testBasic() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java b/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
index 6985d1d..1bc565f 100644
--- a/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ManySplitIT.java
@@ -60,7 +60,7 @@ public class ManySplitIT extends ConfigurableMacBase {
final String tableName = getUniqueNames(1)[0];
log.info("Creating table");
- final TableOperations tableOperations = getConnector().tableOperations();
+ final TableOperations tableOperations = getClient().tableOperations();
log.info("splitting metadata table");
tableOperations.create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java b/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
index 89d7a4e..1ad7a8a 100644
--- a/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MasterRepairsDualAssignmentIT.java
@@ -24,9 +24,9 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
@@ -69,7 +69,7 @@ public class MasterRepairsDualAssignmentIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
// make some tablets, spread 'em around
- Connector c = getConnector();
+ AccumuloClient c = getClient();
ClientContext context = getClientContext();
String table = this.getUniqueNames(1)[0];
c.securityOperations().grantTablePermission("root", MetadataTable.NAME, TablePermission.WRITE);
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaConstraintRetryIT.java b/test/src/main/java/org/apache/accumulo/test/MetaConstraintRetryIT.java
index 65f51ce..369af43 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaConstraintRetryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaConstraintRetryIT.java
@@ -40,7 +40,7 @@ public class MetaConstraintRetryIT extends AccumuloClusterHarness {
@Test(expected = ConstraintViolationException.class)
public void test() throws Exception {
- getConnector().securityOperations().grantTablePermission(getAdminPrincipal(),
+ getAccumuloClient().securityOperations().grantTablePermission(getAdminPrincipal(),
MetadataTable.NAME, TablePermission.WRITE);
ServerContext context = getServerContext();
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index e9c1f81..cd5ec80 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -28,8 +28,8 @@ import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
@@ -55,7 +55,7 @@ public class MetaGetsReadersIT extends ConfigurableMacBase {
cfg.setProperty(Property.TABLE_BLOCKCACHE_ENABLED, "false");
}
- private static Thread slowScan(final Connector c, final String tableName,
+ private static Thread slowScan(final AccumuloClient c, final String tableName,
final AtomicBoolean stop) {
return new Thread(() -> {
try {
@@ -80,7 +80,7 @@ public class MetaGetsReadersIT extends ConfigurableMacBase {
@Test(timeout = 2 * 60 * 1000)
public void test() throws Exception {
final String tableName = getUniqueNames(1)[0];
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
c.tableOperations().create(tableName);
Random random = new SecureRandom();
BatchWriter bw = c.createBatchWriter(tableName, null);
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
index e3178d7..cb5c35a 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaRecoveryIT.java
@@ -22,9 +22,9 @@ import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
@@ -56,7 +56,7 @@ public class MetaRecoveryIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void test() throws Exception {
String[] tables = getUniqueNames(10);
- Connector c = getConnector();
+ AccumuloClient c = getClient();
int i = 0;
for (String table : tables) {
log.info("Creating table {}", i);
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaSplitIT.java b/test/src/main/java/org/apache/accumulo/test/MetaSplitIT.java
index 3a247ed..b20239d 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaSplitIT.java
@@ -24,9 +24,9 @@ import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.metadata.MetadataTable;
@@ -52,7 +52,7 @@ public class MetaSplitIT extends AccumuloClusterHarness {
@Before
public void saveMetadataSplits() throws Exception {
if (ClusterType.STANDALONE == getClusterType()) {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
Collection<Text> splits = conn.tableOperations().listSplits(MetadataTable.NAME);
// We expect a single split
if (!splits.equals(Arrays.asList(new Text("~")))) {
@@ -70,7 +70,7 @@ public class MetaSplitIT extends AccumuloClusterHarness {
public void restoreMetadataSplits() throws Exception {
if (null != metadataSplits) {
log.info("Restoring split on metadata table");
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.tableOperations().merge(MetadataTable.NAME, null, null);
conn.tableOperations().addSplits(MetadataTable.NAME, new TreeSet<>(metadataSplits));
}
@@ -78,7 +78,7 @@ public class MetaSplitIT extends AccumuloClusterHarness {
@Test(expected = AccumuloException.class)
public void testRootTableSplit() throws Exception {
- TableOperations opts = getConnector().tableOperations();
+ TableOperations opts = getAccumuloClient().tableOperations();
SortedSet<Text> splits = new TreeSet<>();
splits.add(new Text("5"));
opts.addSplits(RootTable.NAME, splits);
@@ -86,7 +86,7 @@ public class MetaSplitIT extends AccumuloClusterHarness {
@Test
public void testRootTableMerge() throws Exception {
- TableOperations opts = getConnector().tableOperations();
+ TableOperations opts = getAccumuloClient().tableOperations();
opts.merge(RootTable.NAME, null, null);
}
@@ -100,7 +100,7 @@ public class MetaSplitIT extends AccumuloClusterHarness {
@Test
public void testMetadataTableSplit() throws Exception {
- TableOperations opts = getConnector().tableOperations();
+ TableOperations opts = getAccumuloClient().tableOperations();
for (int i = 1; i <= 10; i++) {
opts.create(Integer.toString(i));
}
diff --git a/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
index 265d5c0..f6e8216 100644
--- a/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MissingWalHeaderCompletesRecoveryIT.java
@@ -24,9 +24,9 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.UUID;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.Property;
@@ -78,7 +78,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Before
public void setupMetadataPermission() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
rootHasWritePermission = conn.securityOperations().hasTablePermission("root",
MetadataTable.NAME, TablePermission.WRITE);
if (!rootHasWritePermission) {
@@ -91,7 +91,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@After
public void resetMetadataPermission() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
// Final state doesn't match the original
if (rootHasWritePermission != conn.securityOperations().hasTablePermission("root",
MetadataTable.NAME, TablePermission.WRITE)) {
@@ -109,7 +109,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Test
public void testEmptyWalRecoveryCompletes() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
MiniAccumuloClusterImpl cluster = getCluster();
FileSystem fs = cluster.getFileSystem();
@@ -164,7 +164,7 @@ public class MissingWalHeaderCompletesRecoveryIT extends ConfigurableMacBase {
@Test
public void testPartialHeaderWalRecoveryCompletes() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
MiniAccumuloClusterImpl cluster = getCluster();
FileSystem fs = getCluster().getFileSystem();
diff --git a/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT.java b/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT.java
index 830c92f..1b33a4d 100644
--- a/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT.java
@@ -25,11 +25,11 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
@@ -50,7 +50,7 @@ import com.google.common.collect.Maps;
public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
- private Connector connector;
+ private AccumuloClient accumuloClient;
private MultiTableBatchWriter mtbw;
@Override
@@ -60,7 +60,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
@Before
public void setUpArgs() throws AccumuloException, AccumuloSecurityException {
- connector = getConnector();
+ accumuloClient = getAccumuloClient();
mtbw = getMultiTableBatchWriter();
}
@@ -76,7 +76,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String[] names = getUniqueNames(2);
final String table1 = names[0], table2 = names[1];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
BatchWriter bw1 = mtbw.getBatchWriter(table1);
@@ -108,7 +108,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
Map<Entry<String,String>,String> actual = new HashMap<>();
- try (Scanner s = connector.createScanner(table1, new Authorizations())) {
+ try (Scanner s = accumuloClient.createScanner(table1, new Authorizations())) {
s.setRange(new Range());
for (Entry<Key,Value> entry : s) {
actual.put(Maps.immutableEntry(entry.getKey().getRow().toString(),
@@ -117,7 +117,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
assertEquals("Differing results for " + table1, table1Expectations, actual);
}
- try (Scanner s = connector.createScanner(table2, new Authorizations())) {
+ try (Scanner s = accumuloClient.createScanner(table2, new Authorizations())) {
s.setRange(new Range());
actual = new HashMap<>();
for (Entry<Key,Value> entry : s) {
@@ -142,7 +142,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String table1 = names[0], table2 = names[1];
final String newTable1 = names[2], newTable2 = names[3];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
tops.create(table2);
@@ -174,7 +174,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
expectations.put(Maps.immutableEntry("bar", "col2"), "val2");
for (String table : Arrays.asList(newTable1, newTable2)) {
- try (Scanner s = connector.createScanner(table, new Authorizations())) {
+ try (Scanner s = accumuloClient.createScanner(table, new Authorizations())) {
s.setRange(new Range());
Map<Entry<String,String>,String> actual = new HashMap<>();
for (Entry<Key,Value> entry : s) {
@@ -199,7 +199,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String table1 = names[0], table2 = names[1];
final String newTable1 = names[2], newTable2 = names[3];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
tops.create(table2);
@@ -251,7 +251,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
expectations.put(Maps.immutableEntry("bar", "col2"), "val2");
for (String table : Arrays.asList(newTable1, newTable2)) {
- try (Scanner s = connector.createScanner(table, new Authorizations())) {
+ try (Scanner s = accumuloClient.createScanner(table, new Authorizations())) {
s.setRange(new Range());
Map<Entry<String,String>,String> actual = new HashMap<>();
for (Entry<Key,Value> entry : s) {
@@ -277,7 +277,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String table1 = names[0], table2 = names[1];
final String newTable1 = names[2], newTable2 = names[3];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
tops.create(table2);
@@ -320,7 +320,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String[] names = getUniqueNames(2);
final String table1 = names[0], table2 = names[1];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
tops.create(table2);
@@ -371,7 +371,7 @@ public class MultiTableBatchWriterIT extends AccumuloClusterHarness {
final String[] names = getUniqueNames(2);
final String table1 = names[0], table2 = names[1];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
tops.create(table1);
tops.create(table2);
diff --git a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
index fe4cec6..12763df 100644
--- a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
@@ -26,8 +26,8 @@ import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -57,7 +57,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void testRecoveryOverMultipleTables() throws Exception {
final int N = 3;
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
final String[] tables = getUniqueNames(N);
final BatchWriter[] writers = new BatchWriter[N];
final byte[][] values = new byte[N][];
@@ -124,7 +124,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacBase {
getCluster().start();
// read the metadata table to know everything is back up
Iterators.size(
- getConnector().createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
+ getClient().createScanner(MetadataTable.NAME, Authorizations.EMPTY).iterator());
i++;
}
System.out.println("Restarted " + i + " times");
diff --git a/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java b/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
index 6f59631..5420d2d 100644
--- a/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
@@ -37,11 +37,11 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.NamespaceExistsException;
@@ -92,7 +92,7 @@ import org.junit.experimental.categories.Category;
@Category(MiniClusterOnlyTests.class)
public class NamespacesIT extends AccumuloClusterHarness {
- private Connector c;
+ private AccumuloClient c;
private String namespace;
@Override
@@ -105,7 +105,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
Assume.assumeTrue(ClusterType.MINI == getClusterType());
// prepare a unique namespace and get a new root connector for each test
- c = getConnector();
+ c = getAccumuloClient();
namespace = "ns_" + getUniqueNames(1)[0];
}
@@ -677,7 +677,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
c.securityOperations().createLocalUser(u1, pass);
loginAs(user1);
- Connector user1Con = c.changeUser(u1, user1.getToken());
+ AccumuloClient user1Con = c.changeUser(u1, user1.getToken());
try {
user1Con.tableOperations().create(t2);
diff --git a/test/src/main/java/org/apache/accumulo/test/NewTableConfigurationIT.java b/test/src/main/java/org/apache/accumulo/test/NewTableConfigurationIT.java
index 0be77ad..3d0657a 100644
--- a/test/src/main/java/org/apache/accumulo/test/NewTableConfigurationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/NewTableConfigurationIT.java
@@ -29,9 +29,9 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableExistsException;
@@ -80,7 +80,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSetPropertiesOverwriteOlderProperties() throws AccumuloSecurityException,
AccumuloException, TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
Map<String,String> initialProps = new HashMap<>();
@@ -125,7 +125,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSimpleLocalityGroupCreation() throws AccumuloSecurityException, AccumuloException,
TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
// set locality groups map
@@ -151,7 +151,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testMulitpleCallsToSetLocalityGroups() throws AccumuloSecurityException,
AccumuloException, TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
// set first locality groups map
@@ -177,7 +177,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSetPropertiesAndGroups() throws AccumuloSecurityException, AccumuloException,
TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -243,7 +243,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSetGroupsWithoutDefaultIterators() throws AccumuloSecurityException,
AccumuloException, TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration().withoutDefaultIterators();
@@ -267,7 +267,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testPreconfigureIteratorWithDefaultIterator1() throws AccumuloException,
TableNotFoundException, AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -294,7 +294,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testPreconfiguredIteratorWithDefaultIterator2() throws AccumuloException,
TableNotFoundException, AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -323,7 +323,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testPreconfiguredIteratorWithDefaultIterator3() throws AccumuloException,
TableNotFoundException, AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -349,7 +349,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSettingInitialIteratorWithAdditionalIteratorOptions() throws AccumuloException,
TableNotFoundException, AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -370,7 +370,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSetIteratorWithoutDefaultIterators() throws AccumuloException,
TableNotFoundException, AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration().withoutDefaultIterators();
@@ -397,7 +397,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testSettingIteratorAndProperties() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -435,7 +435,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test(expected = IllegalArgumentException.class)
public void testIteratorConflictFound1() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -449,7 +449,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test(expected = IllegalArgumentException.class)
public void testIteratorConflictFound2() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -463,7 +463,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test(expected = IllegalArgumentException.class)
public void testIteratorConflictFound3() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -481,7 +481,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testMultipleIteratorValid() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -510,7 +510,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testGroupsIteratorAndPropsTogether() throws AccumuloException, TableNotFoundException,
AccumuloSecurityException, TableExistsException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
NewTableConfiguration ntc = new NewTableConfiguration();
@@ -550,7 +550,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
@Test
public void testNtcChaining() throws AccumuloException, AccumuloSecurityException,
TableExistsException, TableNotFoundException {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = getUniqueNames(2)[0];
IteratorSetting setting = new IteratorSetting(10, "anIterator", "it.class",
@@ -642,7 +642,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
/**
* Verify the expected iterator properties exist.
*/
- private void verifyIterators(Connector conn, String tablename, String[] values,
+ private void verifyIterators(AccumuloClient conn, String tablename, String[] values,
boolean withDefaultIts) throws AccumuloException, TableNotFoundException {
Map<String,String> expected = new TreeMap<>();
if (withDefaultIts) {
@@ -664,9 +664,9 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
assertEquals(expected, actual);
}
- private Map<String,String> getProperties(Connector connector, String tableName)
+ private Map<String,String> getProperties(AccumuloClient accumuloClient, String tableName)
throws AccumuloException, TableNotFoundException {
- Iterable<Entry<String,String>> properties = connector.tableOperations()
+ Iterable<Entry<String,String>> properties = accumuloClient.tableOperations()
.getProperties(tableName);
Map<String,String> propertyMap = new HashMap<>();
for (Entry<String,String> entry : properties) {
@@ -675,18 +675,19 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
return propertyMap;
}
- public int numProperties(Connector connector, String tableName)
+ public int numProperties(AccumuloClient accumuloClient, String tableName)
throws AccumuloException, TableNotFoundException {
- return Iterators.size(connector.tableOperations().getProperties(tableName).iterator());
+ return Iterators.size(accumuloClient.tableOperations().getProperties(tableName).iterator());
}
- public int compareProperties(Connector connector, String tableNameOrig, String tableName,
- String changedProp) throws AccumuloException, TableNotFoundException {
+ public int compareProperties(AccumuloClient accumuloClient, String tableNameOrig,
+ String tableName, String changedProp) throws AccumuloException, TableNotFoundException {
boolean inNew = false;
int countOrig = 0;
- for (Entry<String,String> orig : connector.tableOperations().getProperties(tableNameOrig)) {
+ for (Entry<String,String> orig : accumuloClient.tableOperations()
+ .getProperties(tableNameOrig)) {
countOrig++;
- for (Entry<String,String> entry : connector.tableOperations().getProperties(tableName)) {
+ for (Entry<String,String> entry : accumuloClient.tableOperations().getProperties(tableName)) {
if (entry.equals(orig)) {
inNew = true;
break;
@@ -699,10 +700,10 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
return countOrig;
}
- public boolean checkTimeType(Connector connector, String tableName, TimeType expectedTimeType)
- throws TableNotFoundException {
- final Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
- String tableID = connector.tableOperations().tableIdMap().get(tableName) + "<";
+ public boolean checkTimeType(AccumuloClient accumuloClient, String tableName,
+ TimeType expectedTimeType) throws TableNotFoundException {
+ final Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
+ String tableID = accumuloClient.tableOperations().tableIdMap().get(tableName) + "<";
for (Entry<Key,Value> entry : scanner) {
Key k = entry.getKey();
@@ -723,18 +724,18 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
log.info("Starting tableNameOnly");
// Create a table with the initial properties
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(2)[0];
- connector.tableOperations().create(tableName, new NewTableConfiguration());
+ accumuloClient.tableOperations().create(tableName, new NewTableConfiguration());
String tableNameOrig = "original";
- connector.tableOperations().create(tableNameOrig, true);
+ accumuloClient.tableOperations().create(tableNameOrig, true);
- int countNew = numProperties(connector, tableName);
- int countOrig = compareProperties(connector, tableNameOrig, tableName, null);
+ int countNew = numProperties(accumuloClient, tableName);
+ int countOrig = compareProperties(accumuloClient, tableNameOrig, tableName, null);
assertEquals("Extra properties using the new create method", countOrig, countNew);
- assertTrue("Wrong TimeType", checkTimeType(connector, tableName, TimeType.MILLIS));
+ assertTrue("Wrong TimeType", checkTimeType(accumuloClient, tableName, TimeType.MILLIS));
}
@SuppressWarnings("deprecation")
@@ -743,20 +744,20 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
log.info("Starting tableNameAndLimitVersion");
// Create a table with the initial properties
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(2)[0];
boolean limitVersion = false;
- connector.tableOperations().create(tableName,
+ accumuloClient.tableOperations().create(tableName,
new NewTableConfiguration().withoutDefaultIterators());
String tableNameOrig = "originalWithLimitVersion";
- connector.tableOperations().create(tableNameOrig, limitVersion);
+ accumuloClient.tableOperations().create(tableNameOrig, limitVersion);
- int countNew = numProperties(connector, tableName);
- int countOrig = compareProperties(connector, tableNameOrig, tableName, null);
+ int countNew = numProperties(accumuloClient, tableName);
+ int countOrig = compareProperties(accumuloClient, tableNameOrig, tableName, null);
assertEquals("Extra properties using the new create method", countOrig, countNew);
- assertTrue("Wrong TimeType", checkTimeType(connector, tableName, TimeType.MILLIS));
+ assertTrue("Wrong TimeType", checkTimeType(accumuloClient, tableName, TimeType.MILLIS));
}
@SuppressWarnings("deprecation")
@@ -765,21 +766,21 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
log.info("Starting tableNameLimitVersionAndTimeType");
// Create a table with the initial properties
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(2)[0];
boolean limitVersion = false;
TimeType tt = TimeType.LOGICAL;
- connector.tableOperations().create(tableName,
+ accumuloClient.tableOperations().create(tableName,
new NewTableConfiguration().withoutDefaultIterators().setTimeType(tt));
String tableNameOrig = "originalWithLimitVersionAndTimeType";
- connector.tableOperations().create(tableNameOrig, limitVersion, tt);
+ accumuloClient.tableOperations().create(tableNameOrig, limitVersion, tt);
- int countNew = numProperties(connector, tableName);
- int countOrig = compareProperties(connector, tableNameOrig, tableName, null);
+ int countNew = numProperties(accumuloClient, tableName);
+ int countOrig = compareProperties(accumuloClient, tableNameOrig, tableName, null);
assertEquals("Extra properties using the new create method", countOrig, countNew);
- assertTrue("Wrong TimeType", checkTimeType(connector, tableName, tt));
+ assertTrue("Wrong TimeType", checkTimeType(accumuloClient, tableName, tt));
}
@SuppressWarnings("deprecation")
@@ -798,18 +799,18 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
properties.put(propertyName2, volume2);
// Create a table with the initial properties
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(2)[0];
- connector.tableOperations().create(tableName,
+ accumuloClient.tableOperations().create(tableName,
new NewTableConfiguration().setProperties(properties));
String tableNameOrig = "originalWithTableName";
- connector.tableOperations().create(tableNameOrig, true);
+ accumuloClient.tableOperations().create(tableNameOrig, true);
- int countNew = numProperties(connector, tableName);
- int countOrig = compareProperties(connector, tableNameOrig, tableName, propertyName);
+ int countNew = numProperties(accumuloClient, tableName);
+ int countOrig = compareProperties(accumuloClient, tableNameOrig, tableName, propertyName);
- for (Entry<String,String> entry : connector.tableOperations().getProperties(tableName)) {
+ for (Entry<String,String> entry : accumuloClient.tableOperations().getProperties(tableName)) {
if (entry.getKey().equals(Property.TABLE_SPLIT_THRESHOLD.getKey()))
assertEquals("TABLE_SPLIT_THRESHOLD has been changed", "10K", entry.getValue());
if (entry.getKey().equals("table.custom.testProp"))
@@ -817,7 +818,7 @@ public class NewTableConfigurationIT extends SharedMiniClusterBase {
}
assertEquals("Extra properties using the new create method", countOrig + 1, countNew);
- assertTrue("Wrong TimeType", checkTimeType(connector, tableName, TimeType.MILLIS));
+ assertTrue("Wrong TimeType", checkTimeType(accumuloClient, tableName, TimeType.MILLIS));
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/OrIteratorIT.java b/test/src/main/java/org/apache/accumulo/test/OrIteratorIT.java
index a59375e..66a1325 100644
--- a/test/src/main/java/org/apache/accumulo/test/OrIteratorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/OrIteratorIT.java
@@ -31,10 +31,10 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
@@ -59,7 +59,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testMultipleRowsInTablet() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -100,7 +100,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testMultipleTablets() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -151,7 +151,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testSingleLargeRow() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
conn.tableOperations().setProperty(tableName, Property.TABLE_SCAN_MAXMEM.getKey(), "1");
@@ -198,7 +198,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testNoMatchesForTable() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -238,7 +238,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testNoMatchesInSingleTablet() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
@@ -292,7 +292,7 @@ public class OrIteratorIT extends AccumuloClusterHarness {
@Test
public void testResultOrder() throws Exception {
- final Connector conn = getConnector();
+ final AccumuloClient conn = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
conn.tableOperations().create(tableName);
diff --git a/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java b/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
index ae084b2..465eee0 100644
--- a/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
@@ -26,9 +26,9 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -52,10 +52,10 @@ public class QueryMetadataTable {
static class MDTQuery implements Runnable {
- private Connector conn;
+ private AccumuloClient conn;
private Text row;
- MDTQuery(Connector conn, Text row) {
+ MDTQuery(AccumuloClient conn, Text row) {
this.conn = conn;
this.row = row;
}
@@ -100,12 +100,12 @@ public class QueryMetadataTable {
ScannerOpts scanOpts = new ScannerOpts();
opts.parseArgs(QueryMetadataTable.class.getName(), args, scanOpts);
- Connector connector = opts.getConnector();
+ AccumuloClient accumuloClient = opts.getConnector();
HashSet<Text> rowSet = new HashSet<>();
int count = 0;
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, opts.auths)) {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, opts.auths)) {
scanner.setBatchSize(scanOpts.scanBatchSize);
Text mdrow = new Text(KeyExtent.getMetadataEntry(MetadataTable.ID, null));
@@ -138,7 +138,7 @@ public class QueryMetadataTable {
for (int i = 0; i < opts.numQueries; i++) {
int index = r.nextInt(rows.size());
- MDTQuery mdtq = new MDTQuery(connector, rows.get(index));
+ MDTQuery mdtq = new MDTQuery(accumuloClient, rows.get(index));
tp.submit(mdtq);
}
diff --git a/test/src/main/java/org/apache/accumulo/test/RecoveryCompactionsAreFlushesIT.java b/test/src/main/java/org/apache/accumulo/test/RecoveryCompactionsAreFlushesIT.java
index 17c69c4..077f285 100644
--- a/test/src/main/java/org/apache/accumulo/test/RecoveryCompactionsAreFlushesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/RecoveryCompactionsAreFlushesIT.java
@@ -21,9 +21,9 @@ import static org.junit.Assert.assertFalse;
import java.util.Map.Entry;
import org.apache.accumulo.cluster.ClusterControl;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -61,7 +61,7 @@ public class RecoveryCompactionsAreFlushesIT extends AccumuloClusterHarness {
public void test() throws Exception {
// create a table
String tableName = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "100");
c.tableOperations().setProperty(tableName, Property.TABLE_FILE_MAX.getKey(), "3");
diff --git a/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java b/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
index 3b4fd55..394a167 100644
--- a/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java
@@ -27,9 +27,9 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -80,7 +80,7 @@ public class RewriteTabletDirectoriesIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getClient();
c.securityOperations().grantTablePermission(c.whoami(), MetadataTable.NAME,
TablePermission.WRITE);
final String tableName = getUniqueNames(1)[0];
@@ -137,7 +137,7 @@ public class RewriteTabletDirectoriesIT extends ConfigurableMacBase {
// initialize volume
assertEquals(0, cluster.exec(Initialize.class, "--add-volumes").waitFor());
cluster.start();
- c = getConnector();
+ c = getClient();
// change the directory entries
assertEquals(0, cluster.exec(Admin.class, "randomizeVolumes", "-t", tableName).waitFor());
diff --git a/test/src/main/java/org/apache/accumulo/test/SampleIT.java b/test/src/main/java/org/apache/accumulo/test/SampleIT.java
index 11eb65a..43089d6 100644
--- a/test/src/main/java/org/apache/accumulo/test/SampleIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/SampleIT.java
@@ -32,13 +32,13 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.ClientSideIteratorScanner;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
@@ -124,7 +124,7 @@ public class SampleIT extends AccumuloClusterHarness {
@Test
public void testBasic() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
String clone = tableName + "_clone";
@@ -204,7 +204,7 @@ public class SampleIT extends AccumuloClusterHarness {
check(expected, scanner, bScanner, isoScanner, csiScanner, oScanner);
}
- private Scanner newOfflineScanner(Connector conn, String tableName, String clone,
+ private Scanner newOfflineScanner(AccumuloClient conn, String tableName, String clone,
SamplerConfiguration sc) throws Exception {
if (conn.tableOperations().exists(clone)) {
conn.tableOperations().delete(clone);
@@ -306,7 +306,7 @@ public class SampleIT extends AccumuloClusterHarness {
@Test
public void testIterator() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
String clone = tableName + "_clone";
@@ -418,7 +418,7 @@ public class SampleIT extends AccumuloClusterHarness {
@Test
public void testSampleNotPresent() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
String clone = tableName + "_clone";
@@ -482,7 +482,7 @@ public class SampleIT extends AccumuloClusterHarness {
check(expected, scanner, isoScanner, bScanner, csiScanner, oScanner);
}
- private void updateSamplingConfig(Connector conn, String tableName, SamplerConfiguration sc)
+ private void updateSamplingConfig(AccumuloClient conn, String tableName, SamplerConfiguration sc)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
conn.tableOperations().setSamplerConfiguration(tableName, sc);
// wait for for config change
diff --git a/test/src/main/java/org/apache/accumulo/test/ScanFlushWithTimeIT.java b/test/src/main/java/org/apache/accumulo/test/ScanFlushWithTimeIT.java
index 164993f..1e97576 100644
--- a/test/src/main/java/org/apache/accumulo/test/ScanFlushWithTimeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ScanFlushWithTimeIT.java
@@ -23,9 +23,9 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IsolatedScanner;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
@@ -49,7 +49,7 @@ public class ScanFlushWithTimeIT extends AccumuloClusterHarness {
public void test() throws Exception {
log.info("Creating table");
String tableName = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
c.tableOperations().create(tableName);
log.info("Adding slow iterator");
IteratorSetting setting = new IteratorSetting(50, SlowIterator.class);
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellConfigIT.java b/test/src/main/java/org/apache/accumulo/test/ShellConfigIT.java
index 607230e..72ab34b 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellConfigIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellConfigIT.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.fail;
import java.io.File;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -48,7 +48,7 @@ public class ShellConfigIT extends AccumuloClusterHarness {
@Before
public void checkProperty() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
// TABLE_VOLUME_CHOOSER is a valid property that can be updated in ZK, whereas the crypto
// properties are not.
// This lets us run this test more generically rather than forcibly needing to update some
@@ -62,7 +62,7 @@ public class ShellConfigIT extends AccumuloClusterHarness {
@After
public void resetProperty() throws Exception {
if (null != origPropValue) {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
conn.instanceOperations().setProperty(PerTableVolumeChooser.TABLE_VOLUME_CHOOSER,
origPropValue);
}
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index d196116..4bbe0ef 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -57,8 +57,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.ClientInfo;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -174,7 +174,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
TestShell(String user, String rootPass, String instanceName, String zookeepers, File configFile)
throws IOException {
- ClientInfo info = Connector.builder().usingProperties(configFile.getAbsolutePath()).info();
+ ClientInfo info = AccumuloClient.builder().usingProperties(configFile.getAbsolutePath())
+ .info();
// start the shell
output = new TestOutputStream();
input = new StringInputStream();
@@ -302,7 +303,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
traceProcess = getCluster().exec(TraceServer.class);
- Connector conn = getCluster().getConnector(getPrincipal(), getToken());
+ AccumuloClient conn = getCluster().getAccumuloClient(getPrincipal(), getToken());
TableOperations tops = conn.tableOperations();
// give the tracer some time to start
@@ -329,7 +330,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
@After
public void deleteTables() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getClient();
for (String table : c.tableOperations().list()) {
if (!table.startsWith(Namespace.ACCUMULO + ".") && !table.equals("trace"))
try {
@@ -606,7 +607,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
@Test
public void setIterOptionPrompt() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
String tableName = name.getMethodName();
ts.exec("createtable " + tableName);
@@ -730,7 +731,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
@Override
public String getErrorMessage() {
try {
- Connector c = getConnector();
+ AccumuloClient c = getClient();
return "Current auths for root are: "
+ c.securityOperations().getUserAuthorizations("root");
} catch (Exception e) {
@@ -867,8 +868,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("insert a b c value", true);
ts.exec("scan", true, "value", true);
- Connector connector = getConnector();
- for (Entry<String,String> entry : connector.tableOperations().getProperties(table)) {
+ AccumuloClient accumuloClient = getClient();
+ for (Entry<String,String> entry : accumuloClient.tableOperations().getProperties(table)) {
if (entry.getKey().equals("table.custom.description"))
assertEquals("Initial property was not set correctly", "description", entry.getValue());
@@ -1553,8 +1554,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
for (int i = 0; i < 6; i++) {
ts.exec("insert " + i + " cf cq value", true);
}
- Connector connector = getConnector();
- try (Scanner s = connector.createScanner(table, Authorizations.EMPTY)) {
+ AccumuloClient accumuloClient = getClient();
+ try (Scanner s = accumuloClient.createScanner(table, Authorizations.EMPTY)) {
IteratorSetting cfg = new IteratorSetting(30, SlowIterator.class);
SlowIterator.setSleepTime(cfg, 500);
s.addScanIterator(cfg);
@@ -1605,7 +1606,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
// loopback...?
String hostPortPattern = ".+:\\d+";
assertTrue(tserver.matches(hostPortPattern));
- assertTrue(getConnector().instanceOperations().getTabletServers().contains(tserver));
+ assertTrue(getClient().instanceOperations().getTabletServers().contains(tserver));
String client = parts[1].trim();
assertTrue(client + " does not match " + hostPortPattern, client.matches(hostPortPattern));
// Scan ID should be a long (throwing an exception if it fails to parse)
@@ -2000,7 +2001,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
}
private String getTableId(String tableName) throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
for (int i = 0; i < 5; i++) {
Map<String,String> nameToId = conn.tableOperations().tableIdMap();
@@ -2147,8 +2148,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
public void testCreateTableWithLocalityGroups() throws Exception {
final String table = name.getMethodName();
ts.exec("createtable " + table + " -l locg1=fam1,fam2", true);
- Connector connector = getConnector();
- Map<String,Set<Text>> lMap = connector.tableOperations().getLocalityGroups(table);
+ AccumuloClient accumuloClient = getClient();
+ Map<String,Set<Text>> lMap = accumuloClient.tableOperations().getLocalityGroups(table);
Set<Text> expectedColFams = new HashSet<>(Arrays.asList(new Text("fam1"), new Text("fam2")));
for (Entry<String,Set<Text>> entry : lMap.entrySet()) {
assertEquals("locg1", entry.getKey());
@@ -2166,8 +2167,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
public void testCreateTableWithMultipleLocalityGroups() throws Exception {
final String table = name.getMethodName();
ts.exec("createtable " + table + " -l locg1=fam1,fam2 locg2=colfam1", true);
- Connector connector = getConnector();
- Map<String,Set<Text>> lMap = connector.tableOperations().getLocalityGroups(table);
+ AccumuloClient accumuloClient = getClient();
+ Map<String,Set<Text>> lMap = accumuloClient.tableOperations().getLocalityGroups(table);
assertTrue(lMap.keySet().contains("locg1"));
assertTrue(lMap.keySet().contains("locg2"));
Set<Text> expectedColFams1 = new HashSet<>(Arrays.asList(new Text("fam1"), new Text("fam2")));
diff --git a/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java b/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
index 1e29009..41100b8 100644
--- a/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
@@ -25,9 +25,9 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
@@ -60,7 +60,7 @@ public class SplitCancelsMajCIT extends SharedMiniClusterBase {
@Test
public void test() throws Exception {
final String tableName = getUniqueNames(1)[0];
- final Connector c = getConnector();
+ final AccumuloClient c = getClient();
c.tableOperations().create(tableName);
// majc should take 100 * .5 secs
IteratorSetting it = new IteratorSetting(100, SlowIterator.class);
diff --git a/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
index fb49fa4..8cd6e8b 100644
--- a/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
@@ -22,9 +22,9 @@ import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Table;
@@ -52,9 +52,9 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
return result;
}
- boolean isOffline(String tablename, Connector connector) throws TableNotFoundException {
- String tableId = connector.tableOperations().tableIdMap().get(tablename);
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ boolean isOffline(String tablename, AccumuloClient accumuloClient) throws TableNotFoundException {
+ String tableId = accumuloClient.tableOperations().tableIdMap().get(tablename);
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(new Range(new Text(tableId + ";"), new Text(tableId + "<")));
scanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
return Iterators.size(scanner.iterator()) == 0;
@@ -73,23 +73,23 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
for (int tn = 0; tn < 2; tn++) {
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getAccumuloClient();
// create a table and put some data in it
- connector.tableOperations().create(tableName);
- BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
+ accumuloClient.tableOperations().create(tableName);
+ BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
bw.addMutation(m("a"));
bw.addMutation(m("b"));
bw.addMutation(m("c"));
bw.close();
// take the table offline
- connector.tableOperations().offline(tableName);
- while (!isOffline(tableName, connector))
+ accumuloClient.tableOperations().offline(tableName);
+ while (!isOffline(tableName, accumuloClient))
sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
// poke a partial split into the metadata table
- connector.securityOperations().grantTablePermission(getAdminPrincipal(), MetadataTable.NAME,
- TablePermission.WRITE);
- Table.ID tableId = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
+ accumuloClient.securityOperations().grantTablePermission(getAdminPrincipal(),
+ MetadataTable.NAME, TablePermission.WRITE);
+ Table.ID tableId = Table.ID.of(accumuloClient.tableOperations().tableIdMap().get(tableName));
KeyExtent extent = new KeyExtent(tableId, null, new Text("b"));
Mutation m = extent.getPrevRowUpdateMutation();
@@ -98,14 +98,15 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
new Value(Double.toString(0.5).getBytes()));
TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(m,
KeyExtent.encodePrevEndRow(null));
- bw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
+ bw = accumuloClient.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
bw.addMutation(m);
if (tn == 1) {
bw.flush();
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME,
+ Authorizations.EMPTY)) {
scanner.setRange(extent.toMetadataRange());
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
@@ -124,10 +125,10 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
bw.close();
// bring the table online
- connector.tableOperations().online(tableName);
+ accumuloClient.tableOperations().online(tableName);
// verify the tablets went online
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
String expected[] = {"a", "b", "c"};
for (Entry<Key,Value> entry : scanner) {
@@ -136,7 +137,7 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
}
assertEquals(3, i);
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java b/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java
index 3f0652d..11b8242 100644
--- a/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.impl.Namespace;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.DefaultConfiguration;
@@ -52,7 +52,7 @@ public class TableConfigurationUpdateIT extends AccumuloClusterHarness {
@Test
public void test() throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
ServerContext context = getCluster().getServerContext();
String table = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
index 6668410..5cf2eac 100644
--- a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -37,11 +37,11 @@ import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableExistsException;
@@ -72,7 +72,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
static TabletClientService.Client client;
- private Connector connector;
+ private AccumuloClient accumuloClient;
@Override
public int defaultTimeoutSeconds() {
@@ -81,7 +81,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
@Before
public void setup() throws Exception {
- connector = getConnector();
+ accumuloClient = getAccumuloClient();
}
@After
@@ -93,23 +93,23 @@ public class TableOperationsIT extends AccumuloClusterHarness {
public void getDiskUsageErrors() throws TableExistsException, AccumuloException,
AccumuloSecurityException, TableNotFoundException, TException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
- List<DiskUsage> diskUsage = connector.tableOperations()
+ accumuloClient.tableOperations().create(tableName);
+ List<DiskUsage> diskUsage = accumuloClient.tableOperations()
.getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsage.size());
assertEquals(0, (long) diskUsage.get(0).getUsage());
assertEquals(tableName, diskUsage.get(0).getTables().iterator().next());
- connector.securityOperations().revokeTablePermission(getAdminPrincipal(), tableName,
+ accumuloClient.securityOperations().revokeTablePermission(getAdminPrincipal(), tableName,
TablePermission.READ);
try {
- connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
+ accumuloClient.tableOperations().getDiskUsage(Collections.singleton(tableName));
fail("Should throw securityexception");
} catch (AccumuloSecurityException e) {}
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
try {
- connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
+ accumuloClient.tableOperations().getDiskUsage(Collections.singleton(tableName));
fail("Should throw tablenotfound");
} catch (TableNotFoundException e) {}
}
@@ -119,10 +119,10 @@ public class TableOperationsIT extends AccumuloClusterHarness {
AccumuloSecurityException, TableNotFoundException, TException {
final String[] names = getUniqueNames(2);
String tableName = names[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
// verify 0 disk usage
- List<DiskUsage> diskUsages = connector.tableOperations()
+ List<DiskUsage> diskUsages = accumuloClient.tableOperations()
.getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsages.size());
assertEquals(1, diskUsages.get(0).getTables().size());
@@ -130,17 +130,17 @@ public class TableOperationsIT extends AccumuloClusterHarness {
assertEquals(tableName, diskUsages.get(0).getTables().first());
// add some data
- BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
+ BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
Mutation m = new Mutation("a");
m.put("b", "c", new Value("abcde".getBytes()));
bw.addMutation(m);
bw.flush();
bw.close();
- connector.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
+ accumuloClient.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
// verify we have usage
- diskUsages = connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
+ diskUsages = accumuloClient.tableOperations().getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsages.size());
assertEquals(1, diskUsages.get(0).getTables().size());
assertTrue(diskUsages.get(0).getUsage() > 0);
@@ -149,49 +149,49 @@ public class TableOperationsIT extends AccumuloClusterHarness {
String newTable = names[1];
// clone table
- connector.tableOperations().clone(tableName, newTable, false, null, null);
+ accumuloClient.tableOperations().clone(tableName, newTable, false, null, null);
// verify tables are exactly the same
Set<String> tables = new HashSet<>();
tables.add(tableName);
tables.add(newTable);
- diskUsages = connector.tableOperations().getDiskUsage(tables);
+ diskUsages = accumuloClient.tableOperations().getDiskUsage(tables);
assertEquals(1, diskUsages.size());
assertEquals(2, diskUsages.get(0).getTables().size());
assertTrue(diskUsages.get(0).getUsage() > 0);
- connector.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
- connector.tableOperations().compact(newTable, new Text("A"), new Text("z"), true, true);
+ accumuloClient.tableOperations().compact(tableName, new Text("A"), new Text("z"), true, true);
+ accumuloClient.tableOperations().compact(newTable, new Text("A"), new Text("z"), true, true);
// verify tables have differences
- diskUsages = connector.tableOperations().getDiskUsage(tables);
+ diskUsages = accumuloClient.tableOperations().getDiskUsage(tables);
assertEquals(2, diskUsages.size());
assertEquals(1, diskUsages.get(0).getTables().size());
assertEquals(1, diskUsages.get(1).getTables().size());
assertTrue(diskUsages.get(0).getUsage() > 0);
assertTrue(diskUsages.get(1).getUsage() > 0);
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
@Test
public void createTable() throws TableExistsException, AccumuloException,
AccumuloSecurityException, TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
- Iterable<Map.Entry<String,String>> itrProps = connector.tableOperations()
+ accumuloClient.tableOperations().create(tableName);
+ Iterable<Map.Entry<String,String>> itrProps = accumuloClient.tableOperations()
.getProperties(tableName);
Map<String,String> props = propsToMap(itrProps);
assertEquals(DefaultKeySizeConstraint.class.getName(),
props.get(Property.TABLE_CONSTRAINT_PREFIX + "1"));
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
@Test
public void createMergeClonedTable() throws Exception {
String[] names = getUniqueNames(2);
String originalTable = names[0];
- TableOperations tops = connector.tableOperations();
+ TableOperations tops = accumuloClient.tableOperations();
TreeSet<Text> splits = Sets
.newTreeSet(Arrays.asList(new Text("a"), new Text("b"), new Text("c"), new Text("d")));
@@ -199,7 +199,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
tops.create(originalTable);
tops.addSplits(originalTable, splits);
- BatchWriter bw = connector.createBatchWriter(originalTable, new BatchWriterConfig());
+ BatchWriter bw = accumuloClient.createBatchWriter(originalTable, new BatchWriterConfig());
for (Text row : splits) {
Mutation m = new Mutation(row);
for (int i = 0; i < 10; i++) {
@@ -219,7 +219,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
tops.merge(clonedTable, null, new Text("b"));
Map<String,Integer> rowCounts = new HashMap<>();
- try (Scanner s = connector.createScanner(clonedTable, new Authorizations())) {
+ try (Scanner s = accumuloClient.createScanner(clonedTable, new Authorizations())) {
for (Entry<Key,Value> entry : s) {
final Key key = entry.getKey();
String row = key.getRow().toString();
@@ -258,18 +258,18 @@ public class TableOperationsIT extends AccumuloClusterHarness {
public void testCompactEmptyTableWithGeneratorIterator() throws TableExistsException,
AccumuloException, AccumuloSecurityException, TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, HardListIterator.class));
- connector.tableOperations().compact(tableName, null, null, list, true, true);
+ accumuloClient.tableOperations().compact(tableName, null, null, list, true, true);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
for (Map.Entry<Key,Value> entry : scanner)
actual.put(entry.getKey(), entry.getValue());
assertEquals(HardListIterator.allEntriesToInject, actual);
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
@@ -287,21 +287,21 @@ public class TableOperationsIT extends AccumuloClusterHarness {
public void testCompactEmptyTableWithGeneratorIterator_Splits() throws TableExistsException,
AccumuloException, AccumuloSecurityException, TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
SortedSet<Text> splitset = new TreeSet<>();
splitset.add(new Text("f"));
- connector.tableOperations().addSplits(tableName, splitset);
+ accumuloClient.tableOperations().addSplits(tableName, splitset);
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, HardListIterator.class));
- connector.tableOperations().compact(tableName, null, null, list, true, true);
+ accumuloClient.tableOperations().compact(tableName, null, null, list, true, true);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
for (Map.Entry<Key,Value> entry : scanner)
actual.put(entry.getKey(), entry.getValue());
assertEquals(HardListIterator.allEntriesToInject, actual);
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
@@ -310,18 +310,19 @@ public class TableOperationsIT extends AccumuloClusterHarness {
throws TableExistsException, AccumuloException, AccumuloSecurityException,
TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
SortedSet<Text> splitset = new TreeSet<>();
splitset.add(new Text("f"));
- connector.tableOperations().addSplits(tableName, splitset);
+ accumuloClient.tableOperations().addSplits(tableName, splitset);
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, HardListIterator.class));
- connector.tableOperations().compact(tableName, null, null, list, true, false); // don't block
- connector.tableOperations().cancelCompaction(tableName);
+ accumuloClient.tableOperations().compact(tableName, null, null, list, true, false); // don't
+ // block
+ accumuloClient.tableOperations().cancelCompaction(tableName);
// depending on timing, compaction will finish or be canceled
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
for (Map.Entry<Key,Value> entry : scanner)
actual.put(entry.getKey(), entry.getValue());
@@ -345,7 +346,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
fail("Unexpected number of entries");
break;
}
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
@@ -354,24 +355,24 @@ public class TableOperationsIT extends AccumuloClusterHarness {
throws TableExistsException, AccumuloException, AccumuloSecurityException,
TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
Text splitRow = new Text("f");
SortedSet<Text> splitset = new TreeSet<>();
splitset.add(splitRow);
- connector.tableOperations().addSplits(tableName, splitset);
+ accumuloClient.tableOperations().addSplits(tableName, splitset);
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, HardListIterator.class));
// compact the second tablet, not the first
- connector.tableOperations().compact(tableName, splitRow, null, list, true, true);
+ accumuloClient.tableOperations().compact(tableName, splitRow, null, list, true, true);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
Map<Key,Value> actual = new TreeMap<>(COMPARE_KEY_TO_COLQ); // only compare row, colF, colQ
for (Map.Entry<Key,Value> entry : scanner)
actual.put(entry.getKey(), entry.getValue());
// only expect the entries in the second tablet
assertEquals(HardListIterator.allEntriesToInject.tailMap(new Key(splitRow)), actual);
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
@@ -380,20 +381,21 @@ public class TableOperationsIT extends AccumuloClusterHarness {
public void testCompactEmptyTablesWithBadIterator_FailsAndCancel() throws TableExistsException,
AccumuloException, AccumuloSecurityException, TableNotFoundException {
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, BadIterator.class));
- connector.tableOperations().compact(tableName, null, null, list, true, false); // don't block
+ accumuloClient.tableOperations().compact(tableName, null, null, list, true, false); // don't
+ // block
sleepUninterruptibly(2, TimeUnit.SECONDS); // start compaction
- connector.tableOperations().cancelCompaction(tableName);
+ accumuloClient.tableOperations().cancelCompaction(tableName);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
Map<Key,Value> actual = new TreeMap<>();
for (Map.Entry<Key,Value> entry : scanner)
actual.put(entry.getKey(), entry.getValue());
assertTrue("Should be empty. Actual is " + actual, actual.isEmpty());
- connector.tableOperations().delete(tableName);
+ accumuloClient.tableOperations().delete(tableName);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
index 6991ce8..7d6dd36 100644
--- a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
@@ -23,7 +23,7 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
@@ -46,7 +46,7 @@ public class TabletServerGivesUpIT extends ConfigurableMacBase {
@Test(timeout = 45 * 1000)
public void test() throws Exception {
- final Connector conn = this.getConnector();
+ final AccumuloClient conn = this.getClient();
// Yes, there's a tabletserver
assertEquals(1, conn.instanceOperations().getTabletServers().size());
final String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
index 1e063f0..63d9ac9 100644
--- a/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TabletServerHdfsRestartIT.java
@@ -18,8 +18,8 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.security.Authorizations;
@@ -44,7 +44,7 @@ public class TabletServerHdfsRestartIT extends ConfigurableMacBase {
@Test(timeout = 2 * 60 * 1000)
public void test() throws Exception {
- final Connector conn = this.getConnector();
+ final AccumuloClient conn = this.getClient();
// Yes, there's a tabletserver
assertEquals(1, conn.instanceOperations().getTabletServers().size());
final String tableName = getUniqueNames(1)[0];
diff --git a/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java b/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java
index 461efda..3c637f4 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java
@@ -26,8 +26,8 @@ import java.util.TreeSet;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
@@ -87,13 +87,13 @@ public class TestBinaryRows {
public long num = 0;
}
- public static void runTest(Connector connector, Opts opts, BatchWriterOpts bwOpts,
+ public static void runTest(AccumuloClient accumuloClient, Opts opts, BatchWriterOpts bwOpts,
ScannerOpts scanOpts) throws Exception {
final Text CF = new Text("cf"), CQ = new Text("cq");
final byte[] CF_BYTES = "cf".getBytes(UTF_8), CQ_BYTES = "cq".getBytes(UTF_8);
if (opts.mode.equals("ingest") || opts.mode.equals("delete")) {
- BatchWriter bw = connector.createBatchWriter(opts.getTableName(),
+ BatchWriter bw = accumuloClient.createBatchWriter(opts.getTableName(),
bwOpts.getBatchWriterConfig());
boolean delete = opts.mode.equals("delete");
@@ -112,7 +112,7 @@ public class TestBinaryRows {
bw.close();
} else if (opts.mode.equals("verifyDeleted")) {
- try (Scanner s = connector.createScanner(opts.getTableName(), opts.auths)) {
+ try (Scanner s = accumuloClient.createScanner(opts.getTableName(), opts.auths)) {
s.setBatchSize(scanOpts.scanBatchSize);
Key startKey = new Key(encodeLong(opts.start), CF_BYTES, CQ_BYTES, new byte[0],
Long.MAX_VALUE);
@@ -129,7 +129,7 @@ public class TestBinaryRows {
} else if (opts.mode.equals("verify")) {
long t1 = System.currentTimeMillis();
- try (Scanner s = connector.createScanner(opts.getTableName(), opts.auths)) {
+ try (Scanner s = accumuloClient.createScanner(opts.getTableName(), opts.auths)) {
Key startKey = new Key(encodeLong(opts.start), CF_BYTES, CQ_BYTES, new byte[0],
Long.MAX_VALUE);
Key stopKey = new Key(encodeLong(opts.start + opts.num - 1), CF_BYTES, CQ_BYTES,
@@ -168,7 +168,7 @@ public class TestBinaryRows {
for (int i = 0; i < numLookups; i++) {
long row = ((r.nextLong() & 0x7fffffffffffffffL) % opts.num) + opts.start;
- try (Scanner s = connector.createScanner(opts.getTableName(), opts.auths)) {
+ try (Scanner s = accumuloClient.createScanner(opts.getTableName(), opts.auths)) {
s.setBatchSize(scanOpts.scanBatchSize);
Key startKey = new Key(encodeLong(row), CF_BYTES, CQ_BYTES, new byte[0], Long.MAX_VALUE);
Key stopKey = new Key(encodeLong(row), CF_BYTES, CQ_BYTES, new byte[0], 0);
@@ -211,8 +211,8 @@ public class TestBinaryRows {
System.out.printf("added split point 0x%016x %,12d%n", splitPoint, splitPoint);
}
- connector.tableOperations().create(opts.getTableName());
- connector.tableOperations().addSplits(opts.getTableName(), splits);
+ accumuloClient.tableOperations().create(opts.getTableName());
+ accumuloClient.tableOperations().addSplits(opts.getTableName(), splits);
} else {
throw new Exception("ERROR : " + opts.mode + " is not a valid operation.");
diff --git a/test/src/main/java/org/apache/accumulo/test/TestIngest.java b/test/src/main/java/org/apache/accumulo/test/TestIngest.java
index 7926e13..7938af6 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestIngest.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestIngest.java
@@ -26,10 +26,10 @@ import java.util.TreeSet;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.cli.ClientOnDefaultTable;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -113,7 +113,7 @@ public class TestIngest {
}
}
- public static void createTable(Connector conn, Opts args)
+ public static void createTable(AccumuloClient conn, Opts args)
throws AccumuloException, AccumuloSecurityException, TableExistsException {
if (args.createTable) {
TreeSet<Text> splits = getSplitPoints(args.startRow, args.startRow + args.rows,
@@ -206,9 +206,9 @@ public class TestIngest {
}
}
- public static void ingest(Connector connector, FileSystem fs, Opts opts, BatchWriterOpts bwOpts)
- throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException,
- MutationsRejectedException, TableExistsException {
+ public static void ingest(AccumuloClient accumuloClient, FileSystem fs, Opts opts,
+ BatchWriterOpts bwOpts) throws IOException, AccumuloException, AccumuloSecurityException,
+ TableNotFoundException, MutationsRejectedException, TableExistsException {
long stopTime;
byte[][] bytevals = generateValues(opts.dataSize);
@@ -218,7 +218,7 @@ public class TestIngest {
long bytesWritten = 0;
- createTable(connector, opts);
+ createTable(accumuloClient, opts);
BatchWriter bw = null;
FileSKVWriter writer = null;
@@ -230,8 +230,8 @@ public class TestIngest {
.withTableConfiguration(DefaultConfiguration.getInstance()).build();
writer.startDefaultLocalityGroup();
} else {
- bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
- connector.securityOperations().changeUserAuthorizations(opts.getPrincipal(), AUTHS);
+ bw = accumuloClient.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
+ accumuloClient.securityOperations().changeUserAuthorizations(opts.getPrincipal(), AUTHS);
}
Text labBA = new Text(opts.columnVisibility.getExpression());
@@ -350,7 +350,7 @@ public class TestIngest {
elapsed);
}
- public static void ingest(Connector c, Opts opts, BatchWriterOpts batchWriterOpts)
+ public static void ingest(AccumuloClient c, Opts opts, BatchWriterOpts batchWriterOpts)
throws MutationsRejectedException, IOException, AccumuloException, AccumuloSecurityException,
TableNotFoundException, TableExistsException {
ingest(c, FileSystem.get(CachedConfiguration.getInstance()), opts, batchWriterOpts);
diff --git a/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java b/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java
index 3d522c0..7dd2a64 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java
@@ -25,9 +25,9 @@ import java.util.Map.Entry;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.cli.ClientOpts;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
@@ -52,7 +52,7 @@ public class TestMultiTableIngest {
String prefix = "test_";
}
- private static void readBack(Opts opts, ScannerOpts scanOpts, Connector conn,
+ private static void readBack(Opts opts, ScannerOpts scanOpts, AccumuloClient conn,
List<String> tableNames) throws Exception {
int i = 0;
for (String table : tableNames) {
@@ -82,9 +82,9 @@ public class TestMultiTableIngest {
BatchWriterOpts bwOpts = new BatchWriterOpts();
opts.parseArgs(TestMultiTableIngest.class.getName(), args, scanOpts, bwOpts);
// create the test table within accumulo
- Connector connector;
+ AccumuloClient accumuloClient;
try {
- connector = opts.getConnector();
+ accumuloClient = opts.getConnector();
} catch (AccumuloException | AccumuloSecurityException e) {
throw new RuntimeException(e);
}
@@ -94,11 +94,11 @@ public class TestMultiTableIngest {
if (!opts.readonly) {
for (String table : tableNames)
- connector.tableOperations().create(table);
+ accumuloClient.tableOperations().create(table);
MultiTableBatchWriter b;
try {
- b = connector.createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
+ b = accumuloClient.createMultiTableBatchWriter(bwOpts.getBatchWriterConfig());
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -117,7 +117,7 @@ public class TestMultiTableIngest {
}
}
try {
- readBack(opts, scanOpts, connector, tableNames);
+ readBack(opts, scanOpts, accumuloClient, tableNames);
} catch (Exception e) {
throw new RuntimeException(e);
}
diff --git a/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java b/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
index a0d00d1..bdebd11 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestRandomDeletes.java
@@ -25,8 +25,8 @@ import java.util.TreeSet;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.cli.ClientOnDefaultTable;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Column;
import org.apache.accumulo.core.data.Key;
@@ -82,7 +82,7 @@ public class TestRandomDeletes {
private static TreeSet<RowColumn> scanAll(ClientOnDefaultTable opts, ScannerOpts scanOpts,
String tableName) throws Exception {
TreeSet<RowColumn> result = new TreeSet<>();
- Connector conn = opts.getConnector();
+ AccumuloClient conn = opts.getConnector();
try (Scanner scanner = conn.createScanner(tableName, auths)) {
scanner.setBatchSize(scanOpts.scanBatchSize);
for (Entry<Key,Value> entry : scanner) {
@@ -102,8 +102,9 @@ public class TestRandomDeletes {
ArrayList<RowColumn> entries = new ArrayList<>(rows);
java.util.Collections.shuffle(entries);
- Connector connector = opts.getConnector();
- BatchWriter mutations = connector.createBatchWriter(tableName, bwOpts.getBatchWriterConfig());
+ AccumuloClient accumuloClient = opts.getConnector();
+ BatchWriter mutations = accumuloClient.createBatchWriter(tableName,
+ bwOpts.getBatchWriterConfig());
for (int i = 0; i < (entries.size() + 1) / 2; i++) {
RowColumn rc = entries.get(i);
diff --git a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
index 8d0a7f6..3ee711b 100644
--- a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
@@ -127,7 +127,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne
@Test
public void testMasterService() throws Exception {
final MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
- final String instanceID = getConnector().getInstanceID();
+ final String instanceID = getAccumuloClient().getInstanceID();
// Wait for the Master to grab its lock
while (true) {
@@ -190,7 +190,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne
@Test
public void testGarbageCollectorPorts() throws Exception {
final MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
- String instanceID = getConnector().getInstanceID();
+ String instanceID = getAccumuloClient().getInstanceID();
// Wait for the Master to grab its lock
while (true) {
diff --git a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
index 492f7a0..f99f2e6 100644
--- a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
@@ -23,9 +23,9 @@ import java.security.SecureRandom;
import java.util.Random;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
@@ -56,7 +56,7 @@ public class TotalQueuedIT extends ConfigurableMacBase {
@Test(timeout = 4 * 60 * 1000)
public void test() throws Exception {
Random random = new SecureRandom();
- Connector c = getConnector();
+ AccumuloClient c = getClient();
c.instanceOperations().setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(),
"" + SMALL_QUEUE_SIZE);
String tableName = getUniqueNames(1)[0];
@@ -122,7 +122,7 @@ public class TotalQueuedIT extends ConfigurableMacBase {
}
private long getSyncs() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getClient();
ServerContext context = getServerContext();
for (String address : c.instanceOperations().getTabletServers()) {
TabletClientService.Client client = ThriftUtil
diff --git a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
index 8f24560..281df72 100644
--- a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
@@ -21,8 +21,8 @@ import static org.junit.Assert.assertTrue;
import java.util.concurrent.TimeUnit;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
@@ -55,7 +55,7 @@ public class TracerRecoversAfterOfflineTableIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
Process tracer = null;
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
if (!conn.tableOperations().exists("trace")) {
MiniAccumuloClusterImpl mac = cluster;
tracer = mac.exec(TraceServer.class);
diff --git a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
index 52b5b0c..f33c542 100644
--- a/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/UnusedWALIT.java
@@ -22,9 +22,9 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
@@ -77,7 +77,7 @@ public class UnusedWALIT extends ConfigurableMacBase {
String[] tableNames = getUniqueNames(2);
String bigTable = tableNames[0];
String lilTable = tableNames[1];
- Connector c = getConnector();
+ AccumuloClient c = getClient();
c.tableOperations().create(bigTable);
c.tableOperations().create(lilTable);
@@ -111,8 +111,8 @@ public class UnusedWALIT extends ConfigurableMacBase {
scanSomeData(c, lilTable, 1, 10, 0, 10);
}
- private void scanSomeData(Connector c, String table, int startRow, int rowCount, int startCol,
- int colCount) throws Exception {
+ private void scanSomeData(AccumuloClient c, String table, int startRow, int rowCount,
+ int startCol, int colCount) throws Exception {
try (Scanner s = c.createScanner(table, Authorizations.EMPTY)) {
s.setRange(
new Range(Integer.toHexString(startRow), Integer.toHexString(startRow + rowCount)));
@@ -142,8 +142,8 @@ public class UnusedWALIT extends ConfigurableMacBase {
return result;
}
- private void writeSomeData(Connector conn, String table, int startRow, int rowCount, int startCol,
- int colCount) throws Exception {
+ private void writeSomeData(AccumuloClient conn, String table, int startRow, int rowCount,
+ int startCol, int colCount) throws Exception {
BatchWriterConfig config = new BatchWriterConfig();
config.setMaxMemory(10 * 1024 * 1024);
BatchWriter bw = conn.createBatchWriter(table, config);
diff --git a/test/src/main/java/org/apache/accumulo/test/UserCompactionStrategyIT.java b/test/src/main/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
index 64be809..85b9348 100644
--- a/test/src/main/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
@@ -32,10 +32,10 @@ import java.util.Random;
import java.util.Set;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -74,7 +74,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
@Test
public void testDropA() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
@@ -105,7 +105,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
private void testDropNone(Map<String,String> options) throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
@@ -146,7 +146,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
// test per-table classpath + user specified compaction strategy
- final Connector c = getConnector();
+ final AccumuloClient c = getAccumuloClient();
final String tableName = getUniqueNames(1)[0];
File target = new File(System.getProperty("user.dir"), "target");
assertTrue(target.mkdirs() || target.isDirectory());
@@ -191,7 +191,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
public void testIterators() throws Exception {
// test compaction strategy + iterators
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
@@ -233,7 +233,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
@Test
public void testFileSize() throws Exception {
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
@@ -269,7 +269,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
public void testConcurrent() throws Exception {
// two compactions without iterators or strategy should be able to run concurrently
- Connector c = getConnector();
+ AccumuloClient c = getAccumuloClient();
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
@@ -299,7 +299,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
} catch (AccumuloException e) {}
}
- void writeRandomValue(Connector c, String tableName, int size) throws Exception {
+ void writeRandomValue(AccumuloClient c, String tableName, int size) throws Exception {
Random rand = new SecureRandom();
byte data1[] = new byte[size];
@@ -315,7 +315,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
c.tableOperations().flush(tableName, null, null, true);
}
- private Set<String> getRows(Connector c, String tableName) throws TableNotFoundException {
+ private Set<String> getRows(AccumuloClient c, String tableName) throws TableNotFoundException {
Set<String> rows = new HashSet<>();
try (Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY)) {
for (Entry<Key,Value> entry : scanner)
@@ -324,7 +324,7 @@ public class UserCompactionStrategyIT extends AccumuloClusterHarness {
return rows;
}
- private void writeFlush(Connector conn, String tablename, String row) throws Exception {
+ private void writeFlush(AccumuloClient conn, String tablename, String row) throws Exception {
BatchWriter bw = conn.createBatchWriter(tablename, new BatchWriterConfig());
Mutation m = new Mutation(row);
m.put("", "", "");
diff --git a/test/src/main/java/org/apache/accumulo/test/UsersIT.java b/test/src/main/java/org/apache/accumulo/test/UsersIT.java
index b3385b5..77359e8 100644
--- a/test/src/main/java/org/apache/accumulo/test/UsersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/UsersIT.java
@@ -23,8 +23,8 @@ import static org.junit.Assert.fail;
import java.util.Set;
import org.apache.accumulo.cluster.ClusterUser;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.SecurityErrorCode;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.harness.AccumuloClusterHarness;
@@ -35,7 +35,7 @@ public class UsersIT extends AccumuloClusterHarness {
@Test
public void testCreateExistingUser() throws Exception {
ClusterUser user0 = getUser(0);
- Connector conn = getConnector();
+ AccumuloClient conn = getAccumuloClient();
Set<String> currentUsers = conn.securityOperations().listLocalUsers();
// Ensure that the user exists
diff --git a/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java b/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
index c025226..84b8b24 100644
--- a/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
+++ b/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
@@ -22,9 +22,9 @@ import java.util.Map.Entry;
import java.util.Random;
import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
@@ -77,12 +77,12 @@ public class VerifyIngest {
}
}
- public static void verifyIngest(Connector connector, Opts opts, ScannerOpts scanOpts)
+ public static void verifyIngest(AccumuloClient accumuloClient, Opts opts, ScannerOpts scanOpts)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
byte[][] bytevals = TestIngest.generateValues(opts.dataSize);
Authorizations labelAuths = new Authorizations("L1", "L2", "G1", "GROUP2");
- connector.securityOperations().changeUserAuthorizations(opts.getPrincipal(), labelAuths);
+ accumuloClient.securityOperations().changeUserAuthorizations(opts.getPrincipal(), labelAuths);
int expectedRow = opts.startRow;
int expectedCol = 0;
@@ -105,7 +105,7 @@ public class VerifyIngest {
Text colf = new Text(opts.columnFamily);
Text colq = new Text("col_" + String.format("%07d", expectedCol));
- try (Scanner scanner = connector.createScanner("test_ingest", labelAuths)) {
+ try (Scanner scanner = accumuloClient.createScanner("test_ingest", labelAuths)) {
scanner.setBatchSize(1);
Key startKey = new Key(rowKey, colf, colq);
Range range = new Range(startKey, startKey.followingKey(PartialKey.ROW_COLFAM_COLQUAL));
@@ -151,7 +151,7 @@ public class VerifyIngest {
Key startKey = new Key(new Text("row_" + String.format("%010d", expectedRow)));
- try (Scanner scanner = connector.createScanner(opts.getTableName(), labelAuths)) {
+ try (Scanner scanner = accumuloClient.createScanner(opts.getTableName(), labelAuths)) {
scanner.setBatchSize(scanOpts.scanBatchSize);
scanner.setRange(new Range(startKey, endKey));
for (int j = 0; j < opts.cols; j++) {
diff --git a/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
index 51a7690..3443540 100644
--- a/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java
@@ -25,8 +25,8 @@ import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.security.Authorizations;
@@ -74,7 +74,7 @@ public class VerifySerialRecoveryIT extends ConfigurableMacBase {
public void testSerializedRecovery() throws Exception {
// make a table with many splits
String tableName = getUniqueNames(1)[0];
- Connector c = getConnector();
+ AccumuloClient c = getClient();
c.tableOperations().create(tableName);
SortedSet<Text> splits = new TreeSet<>();
for (int i = 0; i < 200; i++) {
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
index 3de8eba..aae3676 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeChooserFailureIT.java
@@ -22,9 +22,9 @@ import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -100,13 +100,13 @@ public class VolumeChooserFailureIT extends ConfigurableMacBase {
}
- public static void addSplits(Connector connector, String tableName)
+ public static void addSplits(AccumuloClient accumuloClient, String tableName)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
// Add 10 splits to the table
SortedSet<Text> partitions = new TreeSet<>();
for (String s : rows)
partitions.add(new Text(s));
- connector.tableOperations().addSplits(tableName, partitions);
+ accumuloClient.tableOperations().addSplits(tableName, partitions);
}
// Test that uses one table with 10 split points each. It uses the PreferredVolumeChooser, but no
@@ -117,18 +117,18 @@ public class VolumeChooserFailureIT extends ConfigurableMacBase {
log.info("Starting missingVolumePreferredVolumeChooser");
// Create namespace
- Connector connector = getConnector();
- connector.namespaceOperations().create(namespace1);
+ AccumuloClient accumuloClient = getClient();
+ accumuloClient.namespaceOperations().create(namespace1);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace1,
+ accumuloClient.namespaceOperations().setProperty(namespace1,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, PreferredVolumeChooser.class.getName());
// deliberately do not set preferred volumes
// Create table1 on namespace1 (will fail)
String tableName = namespace1 + ".1";
thrown.expect(AccumuloException.class);
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
}
// Test that uses one table with 10 split points each. It uses the PreferredVolumeChooser, but
@@ -139,24 +139,24 @@ public class VolumeChooserFailureIT extends ConfigurableMacBase {
log.info("Starting notInstancePreferredVolumeChooser");
// Create namespace
- Connector connector = getConnector();
- connector.namespaceOperations().create(namespace1);
+ AccumuloClient accumuloClient = getClient();
+ accumuloClient.namespaceOperations().create(namespace1);
// Set properties on the namespace
String propertyName = PerTableVolumeChooser.TABLE_VOLUME_CHOOSER;
String volume = PreferredVolumeChooser.class.getName();
- connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
+ accumuloClient.namespaceOperations().setProperty(namespace1, propertyName, volume);
// set to v3 which is not included in the list of instance volumes, so it should go to the
// system default preferred volumes
propertyName = PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES;
volume = v3.toString();
- connector.namespaceOperations().setProperty(namespace1, propertyName, volume);
+ accumuloClient.namespaceOperations().setProperty(namespace1, propertyName, volume);
// Create table1 on namespace1 (will fail)
String tableName = namespace1 + ".1";
thrown.expect(AccumuloException.class);
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
index 141d73f..8548208 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java
@@ -28,11 +28,11 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Table;
@@ -123,21 +123,22 @@ public class VolumeChooserIT extends ConfigurableMacBase {
}
- public static void addSplits(Connector connector, String tableName)
+ public static void addSplits(AccumuloClient accumuloClient, String tableName)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
// Add 10 splits to the table
SortedSet<Text> partitions = new TreeSet<>();
for (String s : rows)
partitions.add(new Text(s));
- connector.tableOperations().addSplits(tableName, partitions);
+ accumuloClient.tableOperations().addSplits(tableName, partitions);
}
- public static void writeAndReadData(Connector connector, String tableName) throws Exception {
- writeDataToTable(connector, tableName);
+ public static void writeAndReadData(AccumuloClient accumuloClient, String tableName)
+ throws Exception {
+ writeDataToTable(accumuloClient, tableName);
// Write the data to disk, read it back
- connector.tableOperations().flush(tableName, null, null, true);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ accumuloClient.tableOperations().flush(tableName, null, null, true);
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
for (Entry<Key,Value> entry : scanner) {
assertEquals("Data read is not data written", rows[i++],
@@ -146,9 +147,10 @@ public class VolumeChooserIT extends ConfigurableMacBase {
}
}
- public static void writeDataToTable(Connector connector, String tableName) throws Exception {
+ public static void writeDataToTable(AccumuloClient accumuloClient, String tableName)
+ throws Exception {
// Write some data to the table
- BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
+ BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
for (String s : rows) {
Mutation m = new Mutation(new Text(s));
m.put(EMPTY, EMPTY, EMPTY_VALUE);
@@ -157,8 +159,8 @@ public class VolumeChooserIT extends ConfigurableMacBase {
bw.close();
}
- public static void verifyVolumes(Connector connector, String tableName, Range tableRange,
- String vol) throws Exception {
+ public static void verifyVolumes(AccumuloClient accumuloClient, String tableName,
+ Range tableRange, String vol) throws Exception {
// Verify the new files are written to the Volumes specified
ArrayList<String> volumes = new ArrayList<>();
for (String s : vol.split(","))
@@ -166,7 +168,7 @@ public class VolumeChooserIT extends ConfigurableMacBase {
TreeSet<String> volumesSeen = new TreeSet<>();
int fileCount = 0;
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(tableRange);
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
for (Entry<Key,Value> entry : scanner) {
@@ -189,9 +191,9 @@ public class VolumeChooserIT extends ConfigurableMacBase {
assertEquals("Wrong number of files", 26, fileCount);
}
- public static void verifyNoVolumes(Connector connector, String tableName, Range tableRange)
- throws Exception {
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ public static void verifyNoVolumes(AccumuloClient accumuloClient, String tableName,
+ Range tableRange) throws Exception {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(tableRange);
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
for (Entry<Key,Value> entry : scanner) {
@@ -200,32 +202,32 @@ public class VolumeChooserIT extends ConfigurableMacBase {
}
}
- private void configureNamespace(Connector connector, String volumeChooserClassName,
+ private void configureNamespace(AccumuloClient accumuloClient, String volumeChooserClassName,
String configuredVolumes, String namespace) throws Exception {
- connector.namespaceOperations().create(namespace);
+ accumuloClient.namespaceOperations().create(namespace);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace,
+ accumuloClient.namespaceOperations().setProperty(namespace,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, volumeChooserClassName);
- connector.namespaceOperations().setProperty(namespace,
+ accumuloClient.namespaceOperations().setProperty(namespace,
PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, configuredVolumes);
}
- private void verifyVolumesForWritesToNewTable(Connector connector, String myNamespace,
+ private void verifyVolumesForWritesToNewTable(AccumuloClient accumuloClient, String myNamespace,
String expectedVolumes) throws Exception {
String tableName = myNamespace + ".1";
- connector.tableOperations().create(tableName);
- Table.ID tableID = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
+ accumuloClient.tableOperations().create(tableName);
+ Table.ID tableID = Table.ID.of(accumuloClient.tableOperations().tableIdMap().get(tableName));
// Add 10 splits to the table
- addSplits(connector, tableName);
+ addSplits(accumuloClient, tableName);
// Write some data to the table
- writeAndReadData(connector, tableName);
+ writeAndReadData(accumuloClient, tableName);
// Verify the new files are written to the Volumes specified
- verifyVolumes(connector, tableName, TabletsSection.getRange(tableID), expectedVolumes);
+ verifyVolumes(accumuloClient, tableName, TabletsSection.getRange(tableID), expectedVolumes);
}
- public static void verifyWaLogVolumes(Connector connector, Range tableRange, String vol)
+ public static void verifyWaLogVolumes(AccumuloClient accumuloClient, Range tableRange, String vol)
throws TableNotFoundException {
// Verify the new files are written to the Volumes specified
ArrayList<String> volumes = new ArrayList<>();
@@ -233,7 +235,7 @@ public class VolumeChooserIT extends ConfigurableMacBase {
volumes.add(s);
TreeSet<String> volumesSeen = new TreeSet<>();
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(tableRange);
scanner.fetchColumnFamily(TabletsSection.LogColumnFamily.NAME);
for (Entry<Key,Value> entry : scanner) {
@@ -257,28 +259,28 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesPreferredVolumeChooser");
// Create namespace
- Connector connector = getConnector();
- connector.namespaceOperations().create(namespace1);
+ AccumuloClient accumuloClient = getClient();
+ accumuloClient.namespaceOperations().create(namespace1);
// Set properties on the namespace
// namespace 1 -> v2
- connector.namespaceOperations().setProperty(namespace1,
+ accumuloClient.namespaceOperations().setProperty(namespace1,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, PreferredVolumeChooser.class.getName());
- connector.namespaceOperations().setProperty(namespace1,
+ accumuloClient.namespaceOperations().setProperty(namespace1,
PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, v2.toString());
// Create table1 on namespace1
- verifyVolumesForWritesToNewTable(connector, namespace1, v2.toString());
+ verifyVolumesForWritesToNewTable(accumuloClient, namespace1, v2.toString());
- connector.namespaceOperations().create(namespace2);
+ accumuloClient.namespaceOperations().create(namespace2);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace2,
+ accumuloClient.namespaceOperations().setProperty(namespace2,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, PreferredVolumeChooser.class.getName());
- connector.namespaceOperations().setProperty(namespace2,
+ accumuloClient.namespaceOperations().setProperty(namespace2,
PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, v1.toString());
// Create table2 on namespace2
- verifyVolumesForWritesToNewTable(connector, namespace2, v1.toString());
+ verifyVolumesForWritesToNewTable(accumuloClient, namespace2, v1.toString());
}
// Test that uses two tables with 10 split points each. They each use the RandomVolumeChooser to
@@ -288,43 +290,44 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesRandomVolumeChooser()");
// Create namespace
- Connector connector = getConnector();
- connector.namespaceOperations().create(namespace1);
+ AccumuloClient accumuloClient = getClient();
+ accumuloClient.namespaceOperations().create(namespace1);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace1,
+ accumuloClient.namespaceOperations().setProperty(namespace1,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, RandomVolumeChooser.class.getName());
// Create table1 on namespace1
String tableName = namespace1 + ".1";
- connector.tableOperations().create(tableName);
- Table.ID tableID = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
+ accumuloClient.tableOperations().create(tableName);
+ Table.ID tableID = Table.ID.of(accumuloClient.tableOperations().tableIdMap().get(tableName));
// Add 10 splits to the table
- addSplits(connector, tableName);
+ addSplits(accumuloClient, tableName);
// Write some data to the table
- writeAndReadData(connector, tableName);
+ writeAndReadData(accumuloClient, tableName);
// Verify the new files are written to the Volumes specified
- verifyVolumes(connector, tableName, TabletsSection.getRange(tableID), v1 + "," + v2 + "," + v4);
+ verifyVolumes(accumuloClient, tableName, TabletsSection.getRange(tableID),
+ v1 + "," + v2 + "," + v4);
- connector.namespaceOperations().create(namespace2);
+ accumuloClient.namespaceOperations().create(namespace2);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace2,
+ accumuloClient.namespaceOperations().setProperty(namespace2,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, RandomVolumeChooser.class.getName());
// Create table2 on namespace2
String tableName2 = namespace2 + ".1";
- connector.tableOperations().create(tableName2);
- Table.ID tableID2 = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName2));
+ accumuloClient.tableOperations().create(tableName2);
+ Table.ID tableID2 = Table.ID.of(accumuloClient.tableOperations().tableIdMap().get(tableName2));
// / Add 10 splits to the table
- addSplits(connector, tableName2);
+ addSplits(accumuloClient, tableName2);
// Write some data to the table
- writeAndReadData(connector, tableName2);
+ writeAndReadData(accumuloClient, tableName2);
// Verify the new files are written to the Volumes specified
- verifyVolumes(connector, tableName2, TabletsSection.getRange(tableID2),
+ verifyVolumes(accumuloClient, tableName2, TabletsSection.getRange(tableID2),
v1 + "," + v2 + "," + v4);
}
@@ -336,49 +339,49 @@ public class VolumeChooserIT extends ConfigurableMacBase {
log.info("Starting twoTablesDiffChoosers");
// Create namespace
- Connector connector = getConnector();
- connector.namespaceOperations().create(namespace1);
+ AccumuloClient accumuloClient = getClient();
+ accumuloClient.namespaceOperations().create(namespace1);
// Set properties on the namespace
- connector.namespaceOperations().setProperty(namespace1,
+ accumuloClient.namespaceOperations().setProperty(namespace1,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, RandomVolumeChooser.class.getName());
// Create table1 on namespace1
- verifyVolumesForWritesToNewTable(connector, namespace1, v1 + "," + v2 + "," + v4);
- connector.namespaceOperations().create(namespace2);
+ verifyVolumesForWritesToNewTable(accumuloClient, namespace1, v1 + "," + v2 + "," + v4);
+ accumuloClient.namespaceOperations().create(namespace2);
- connector.namespaceOperations().setProperty(namespace2,
+ accumuloClient.namespaceOperations().setProperty(namespace2,
PerTableVolumeChooser.TABLE_VOLUME_CHOOSER, PreferredVolumeChooser.class.getName());
- connector.namespaceOperations().setProperty(namespace2,
+ accumuloClient.namespaceOperations().setProperty(namespace2,
PreferredVolumeChooser.TABLE_PREFERRED_VOLUMES, v1.toString());
// Create table2 on namespace2
- verifyVolumesForWritesToNewTable(connector, namespace2, v1.toString());
+ verifyVolumesForWritesToNewTable(accumuloClient, namespace2, v1.toString());
}
@Test
public void includeSpecialVolumeForTable() throws Exception {
log.info("Starting includeSpecialVolumeForTable");
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
// the following table will be configured to go to the excluded volume
String configuredVolumes = v4.toString();
- configureNamespace(connector, PreferredVolumeChooser.class.getName(), configuredVolumes,
+ configureNamespace(accumuloClient, PreferredVolumeChooser.class.getName(), configuredVolumes,
namespace2);
- verifyVolumesForWritesToNewTable(connector, namespace2, configuredVolumes);
+ verifyVolumesForWritesToNewTable(accumuloClient, namespace2, configuredVolumes);
}
@Test
public void waLogsSentToConfiguredVolumes() throws Exception {
log.info("Starting waLogsSentToConfiguredVolumes");
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = "anotherTable";
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
- VolumeChooserIT.addSplits(connector, tableName);
- VolumeChooserIT.writeDataToTable(connector, tableName);
+ VolumeChooserIT.addSplits(accumuloClient, tableName);
+ VolumeChooserIT.writeDataToTable(accumuloClient, tableName);
// should only go to v2 as per configuration in configure()
- VolumeChooserIT.verifyWaLogVolumes(connector, new Range(), v2.toString());
+ VolumeChooserIT.verifyWaLogVolumes(accumuloClient, new Range(), v2.toString());
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
index 95b247c..073ef8b 100644
--- a/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/VolumeIT.java
@@ -34,11 +34,11 @@ import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import org.apache.accumulo.core.client.AccumuloClient;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableExistsException;
@@ -120,16 +120,16 @@ public class VolumeIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
// create a table
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName);
+ accumuloClient.tableOperations().create(tableName);
SortedSet<Text> partitions = new TreeSet<>();
// with some splits
for (String s : "d,m,t".split(","))
partitions.add(new Text(s));
- connector.tableOperations().addSplits(tableName, partitions);
+ accumuloClient.tableOperations().addSplits(tableName, partitions);
// scribble over the splits
- BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
+ BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
String[] rows = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",");
for (String s : rows) {
Mutation m = new Mutation(new Text(s));
@@ -138,15 +138,15 @@ public class VolumeIT extends ConfigurableMacBase {
}
bw.close();
// write the data to disk, read it back
- connector.tableOperations().flush(tableName, null, null, true);
- try (Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY)) {
+ accumuloClient.tableOperations().flush(tableName, null, null, true);
+ try (Scanner scanner = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) {
int i = 0;
for (Entry<Key,Value> entry : scanner) {
assertEquals(rows[i++], entry.getKey().getRow().toString());
}
}
// verify the new files are written to the different volumes
- try (Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ try (Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
scanner.setRange(new Range("1", "1<"));
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
int fileCount = 0;
@@ -158,7 +158,7 @@ public class VolumeIT extends ConfigurableMacBase {
fileCount++;
}
assertEquals(4, fileCount);
- List<DiskUsage> diskUsage = connector.tableOperations()
+ List<DiskUsage> diskUsage = accumuloClient.tableOperations()
.getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsage.size());
long usage = diskUsage.get(0).getUsage();
@@ -189,21 +189,21 @@ public class VolumeIT extends ConfigurableMacBase {
List<String> expected = new ArrayList<>();
- Connector connector = getConnector();
+ AccumuloClient accumuloClient = getClient();
String tableName = getUniqueNames(1)[0];
- connector.tableOperations().create(tableName,
+ accumuloClient.tableOperations().create(tableName,
new NewTableConfiguration().withoutDefaultIterators());
- Table.ID tableId = Table.ID.of(connector.tableOperations().tableIdMap().get(tableName));
+ Table.ID tableId = Table.ID.of(accumuloClient.tableOperations().tableIdMap().get(tableName));
SortedSet<Text> partitions = new TreeSet<>();
// with some splits
for (String s : "c,g,k,p,s,v".split(","))
partitions.add(new Text(s));
- connector.tableOperations().addSplits(tableName, partitions);
+ accumuloClient.tableOperations().addSplits(tableName, partitions);
- BatchWriter bw = connector.createBatchWriter(tableName, new BatchWriterConfig());
+ BatchWriter bw = accumuloClient.createBatchWriter(tableName, new BatchWriterConfig());
// create two files in each tablet
@@ -216,7 +216,7 @@ public class VolumeIT extends ConfigurableMacBase {
}
bw.flush();
- connector.tableOperations().flush(tableName, null, null, true);
+ accumuloClient.tableOperations().flush(tableName, null, null, true);
for (String s : rows) {
Mutation m = new Mutation(s);
@@ -226,20 +226,22 @@ public class VolumeIT extends ConfigurableMacBase {
}
bw.close();
- connector.tableOperations().flush(tableName, null, null, true);
+ accumuloClient.tableOperations().flush(tableName, null, null, true);
- verifyData(expected, connector.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
- connector.tableOperations().offline(tableName, true);
+ accumuloClient.tableOperations().offline(tableName, true);
- connector.securityOperations().grantTablePermission("root", MetadataTable.NAME,
+ accumuloClient.securityOperations().grantTablePermission("root", MetadataTable.NAME,
TablePermission.WRITE);
- try (Scanner metaScanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) {
+ try (Scanner metaScanner = accumuloClient.createScanner(MetadataTable.NAME,
+ Authorizations.EMPTY)) {
metaScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME);
metaScanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange());
- BatchWriter mbw = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
+ BatchWriter mbw = accumuloClient.createBatchWriter(MetadataTable.NAME,
+ new BatchWriterConfig());
for (Entry<Key,Value> entry : metaScanner) {
String cq = entry.getKey().getColumnQualifier().toString();
@@ -256,13 +258,13 @@ public class VolumeIT extends ConfigurableMacBase {
mbw.close();
- connector.tableOperations().online(tableName, true);
+ accumuloClient.tableOperations().online(tableName, true);
- verifyData(expected, connector.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
- connector.tableOperations().compact(tableName, null, null, true, true);
+ accumuloClient.tableOperations().compact(tableName, null, null, true, true);
- verifyData(expected, connector.createScanner(tableName, Authorizations.EMPTY));
+ verifyData(expected, accumuloClient.createScanner(tableName, Authorizations.EMPTY));
for (Entry<Key,Value> entry : metaScanner) {
String cq = entry.getKey().getColumnQualifier().toString();
@@ -278,7 +280,7 @@ public class VolumeIT extends ConfigurableMacBase {
String[] tableNames = getUniqueNames(2);
// grab this before shutting down cluster
- String uuid = getConnector().getInstanceID();
+ String uuid = getClient().getInstanceID();
verifyVolumesUsed(tableNames[0], false, v1, v2);
@@ -319,7 +321,7 @@ public class VolumeIT extends ConfigurableMacBase {
String[] tableNames = getUniqueNames(2);
// grab this before shutting down cluster
- String uuid = getConnector().getInstanceID();
+ String uuid = getClient().getInstanceID();
verifyVolumesUsed(tableNames[0], false, v1, v2);
@@ -359,13 +361,13 @@ public class VolumeIT extends ConfigurableMacBase {
expected.add(row + ":cf1:cq1:1");
}
- verifyData(expected, getConnector().createScanner(tableNames[0], Authorizations.EMPTY));
+ verifyData(expected, getClient().createScanner(tableNames[0], Authorizations.EMPTY));
// v1 should not have any data for tableNames[1]
verifyVolumesUsed(tableNames[1], false, v2, v3);
}
- private void writeData(String tableName, Connector conn)
+ private void writeData(String tableName, AccumuloClient conn)
throws AccumuloException, AccumuloSecurityException, TableExistsException,
TableNotFoundException, MutationsRejectedException {
TreeSet<Text> splits = new TreeSet<>();
@@ -390,7 +392,7 @@ public class VolumeIT extends ConfigurableMacBase {
private void verifyVolumesUsed(String tableName, boolean shouldExist, Path... paths)
throws Exception {
- Connector conn = getConnector();
+ AccumuloClient conn = getClient();
List<String> expected = new ArrayList<>();
for (int i = 0; i < 100; i++) {
@@ -494,14 +496,14 @@ public class VolumeIT extends ConfigurableMacBase {
// start cluster and verify that volume was decommissioned
cluster.start();
- Connector conn = cluster.getConnector("root", new PasswordToken(ROOT_PASSWORD));
+ AccumuloClient conn = cluster.getAccumuloClient("root", new PasswordToken(ROOT_PASSWORD));
conn.tableOperations().compact(tableNames[0], null, null, true, true);
verifyVolumesUsed(tableNames[0], true, v2);
// check that root tablet is not on volume 1
ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
- String zpath = ZooUtil.getRoot(getConnector().getInstanceID()) + RootTable.ZROOT_TABLET_PATH;
+ String zpath = ZooUtil.getRoot(getClient().getInstanceID()) + RootTable.ZROOT_TABLET_PATH;
String rootTabletDir = new String(zreader.getData(zpath, false, null), UTF_8);
assertTrue(rootTabletDir.startsWith(v2.toString()));
@@ -522,7 +524,7 @@ public class VolumeIT extends ConfigurableMacBase {
verifyVolumesUsed(tableNames[0], false, v1, v2);
// write to 2nd table, but do not flush data to disk before shutdown
- writeData(tableNames[1], cluster.getConnector("root", new PasswordToken(ROOT_PASSWORD)));
+ writeData(tableNames[1], cluster.getAccumuloClient("root", new PasswordToken(ROOT_PASSWORD)));
if (cleanShutdown)
assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
@@ -553,23 +555,23 @@ public class VolumeIT extends ConfigurableMacBase {
verifyVolumesUsed(tableNames[1], true, v8, v9);
// verify writes to new dir
- getConnector().tableOperations().compact(tableNames[0], null, null, true, true);
- getConnector().tableOperations().compact(tableNames[1], null, null, true, true);
+ getClient().tableOperations().compact(tableNames[0], null, null, true, true);
+ getClient().tableOperations().compact(tableNames[1], null, null, true, true);
verifyVolumesUsed(tableNames[0], true, v8, v9);
verifyVolumesUsed(tableNames[1], true, v8, v9);
// check that root tablet is not on volume 1 or 2
ZooReader zreader = new ZooReader(cluster.getZooKeepers(), 30000);
- String zpath = ZooUtil.getRoot(getConnector().getInstanceID()) + RootTable.ZROOT_TABLET_PATH;
... 6809 lines suppressed ...