From 24ebbcabc39b0e8daa01c6ec004da62a3909b803 Mon Sep 17 00:00:00 2001 From: eclark Date: Mon, 25 Feb 2013 22:50:17 +0000 Subject: [PATCH] HBASE-7188 Move classes into hbase-client git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1449950 13f79535-47bb-0310-9956-ffa450edef68 --- hbase-client/pom.xml | 9 + .../org/apache/hadoop/hbase/Abortable.java | 0 .../java/org/apache/hadoop/hbase/Chore.java | 0 .../org/apache/hadoop/hbase/ClusterId.java | 6 +- .../apache/hadoop/hbase/ClusterStatus.java | 15 +- .../org/apache/hadoop/hbase/Coprocessor.java | 4 +- .../hadoop/hbase/CoprocessorEnvironment.java | 4 +- .../hadoop/hbase/HColumnDescriptor.java | 46 +++--- .../org/apache/hadoop/hbase/HRegionInfo.java | 26 +-- .../apache/hadoop/hbase/HRegionLocation.java | 0 .../apache/hadoop/hbase/HTableDescriptor.java | 34 ++-- .../org/apache/hadoop/hbase/IpcProtocol.java | 0 .../hadoop/hbase/MasterAdminProtocol.java | 0 .../hadoop/hbase/MasterMonitorProtocol.java | 0 .../apache/hadoop/hbase/MasterProtocol.java | 0 .../org/apache/hadoop/hbase/RegionLoad.java | 4 +- .../apache/hadoop/hbase/RegionTransition.java | 13 +- .../hadoop/hbase/RemoteExceptionHandler.java | 6 +- .../java/org/apache/hadoop/hbase/Server.java | 0 .../org/apache/hadoop/hbase/ServerLoad.java | 14 +- .../org/apache/hadoop/hbase/ServerName.java | 8 +- .../org/apache/hadoop/hbase/Stoppable.java | 0 .../hadoop/hbase/catalog/CatalogTracker.java | 42 ++--- .../hadoop/hbase/catalog/MetaReader.java | 16 +- .../hbase/client/AbstractClientScanner.java | 6 +- .../apache/hadoop/hbase/client/Action.java | 0 .../hadoop/hbase/client/AdminProtocol.java | 2 +- .../apache/hadoop/hbase/client/Append.java | 8 +- .../hadoop/hbase/client/Attributes.java | 4 +- .../hadoop/hbase/client/ClientProtocol.java | 2 +- .../hadoop/hbase/client/ClientScanner.java | 19 +-- .../hadoop/hbase/client/ConnectionUtils.java | 0 .../apache/hadoop/hbase/client/Delete.java | 0 .../org/apache/hadoop/hbase/client/Get.java | 0 .../hadoop/hbase/client/HBaseAdmin.java | 73 ++++----- .../hadoop/hbase/client/HConnection.java | 14 +- .../hbase/client/HConnectionManager.java | 71 ++++---- .../apache/hadoop/hbase/client/HTable.java | 41 +++-- .../hadoop/hbase/client/HTableFactory.java | 0 .../hadoop/hbase/client/HTableInterface.java | 10 +- .../hbase/client/HTableInterfaceFactory.java | 4 +- .../hbase/client/HTableMultiplexer.java | 20 +-- .../hadoop/hbase/client/HTablePool.java | 12 +- .../hadoop/hbase/client/HTableUtil.java | 12 +- .../apache/hadoop/hbase/client/Increment.java | 10 +- .../hadoop/hbase/client/IsolationLevel.java | 0 .../MasterAdminKeepAliveConnection.java | 0 .../MasterMonitorKeepAliveConnection.java | 0 .../hadoop/hbase/client/MetaScanner.java | 18 +- .../hadoop/hbase/client/MultiAction.java | 8 +- .../hadoop/hbase/client/MultiResponse.java | 2 +- .../apache/hadoop/hbase/client/Mutation.java | 12 +- .../client/NoServerForRegionException.java | 2 +- .../apache/hadoop/hbase/client/Operation.java | 6 +- .../hbase/client/OperationWithAttributes.java | 8 +- .../org/apache/hadoop/hbase/client/Put.java | 0 .../hbase/client/RegionOfflineException.java | 2 +- .../apache/hadoop/hbase/client/Result.java | 12 +- .../hadoop/hbase/client/ResultScanner.java | 6 +- .../client/RetriesExhaustedException.java | 6 +- .../RetriesExhaustedWithDetailsException.java | 2 +- .../org/apache/hadoop/hbase/client/Row.java | 0 .../hadoop/hbase/client/RowMutations.java | 10 +- .../org/apache/hadoop/hbase/client/Scan.java | 0 .../hadoop/hbase/client/ScannerCallable.java | 15 +- .../hbase/client/ScannerTimeoutException.java | 2 +- .../hadoop/hbase/client/ServerCallable.java | 25 ++- .../client/UnmodifyableHColumnDescriptor.java | 0 .../hbase/client/UnmodifyableHRegionInfo.java | 0 .../client/UnmodifyableHTableDescriptor.java | 0 .../client/ZooKeeperKeepAliveConnection.java | 0 .../client/coprocessor/AggregationClient.java | 33 ++-- .../hbase/client/coprocessor/Batch.java | 4 +- .../coprocessor/LongColumnInterpreter.java | 4 +- .../coprocessor/SecureBulkLoadClient.java | 4 +- .../client/coprocessor/package-info.java | 0 .../hbase/client/metrics/ScanMetrics.java | 0 .../hadoop/hbase/client/package-info.java | 0 .../client/replication/ReplicationAdmin.java | 8 +- .../hbase/coprocessor/ColumnInterpreter.java | 11 +- .../exceptions}/AccessDeniedException.java | 4 +- .../CallerDisconnectedException.java | 2 +- .../exceptions}/ClockOutOfSyncException.java | 2 +- .../exceptions}/ConstraintException.java | 5 +- .../exceptions}/CoprocessorException.java | 4 +- .../exceptions}/CorruptHFileException.java | 8 +- .../CorruptedSnapshotException.java | 2 +- .../exceptions}/DeserializationException.java | 2 +- .../exceptions}/DoNotRetryIOException.java | 4 +- .../exceptions}/DroppedSnapshotException.java | 5 +- .../exceptions}/ExportSnapshotException.java | 2 +- .../exceptions}/FailedLogCloseException.java | 6 +- .../FailedSanityCheckException.java | 4 +- .../FileSystemVersionException.java | 2 +- .../hbase/exceptions}/HBaseException.java | 2 +- .../hbase/exceptions}/HBaseIOException.java | 6 +- .../exceptions}/HBaseSnapshotException.java | 3 +- .../InvalidFamilyOperationException.java | 6 +- .../exceptions}/InvalidHFileException.java | 2 +- .../hbase/exceptions}/LeaseException.java | 4 +- .../exceptions}/LockTimeoutException.java | 2 +- .../MasterNotRunningException.java | 6 +- .../NoSuchColumnFamilyException.java | 3 +- .../NotAllMetaRegionsOnlineException.java | 3 +- .../NotServingRegionException.java | 6 +- .../OrphanHLogAfterSplitException.java | 6 +- .../OutOfOrderScannerNextException.java | 2 +- .../exceptions}/PleaseHoldException.java | 2 +- .../RegionAlreadyInTransitionException.java | 6 +- .../hbase/exceptions}/RegionException.java | 6 +- .../exceptions}/RegionMovedException.java | 4 +- .../RegionServerRunningException.java | 6 +- .../RegionServerStoppedException.java | 6 +- .../exceptions}/RegionTooBusyException.java | 2 +- .../exceptions}/RestoreSnapshotException.java | 2 +- .../ServerNotRunningYetException.java | 6 +- .../SnapshotCreationException.java | 2 +- .../SnapshotDoesNotExistException.java | 2 +- .../exceptions}/SnapshotExistsException.java | 2 +- .../exceptions}/TableExistsException.java | 6 +- .../TableInfoMissingException.java | 2 +- .../TableNotDisabledException.java | 6 +- .../exceptions}/TableNotEnabledException.java | 6 +- .../exceptions}/TableNotFoundException.java | 2 +- .../TablePartiallyOpenException.java | 6 +- .../exceptions}/UnknownProtocolException.java | 6 +- .../exceptions}/UnknownRegionException.java | 2 +- .../exceptions}/UnknownScannerException.java | 2 +- .../exceptions}/UnknownSnapshotException.java | 2 +- .../exceptions}/WrongRegionException.java | 6 +- .../exceptions}/YouAreDeadException.java | 6 +- .../ZooKeeperConnectionException.java | 6 +- .../hadoop/hbase/executor/EventType.java | 115 +++++++++++++ .../hadoop/hbase/executor/ExecutorType.java | 57 +++++++ .../hadoop/hbase/filter/BinaryComparator.java | 5 +- .../hbase/filter/BinaryPrefixComparator.java | 5 +- .../hadoop/hbase/filter/BitComparator.java | 5 +- .../hbase/filter/ByteArrayComparable.java | 5 +- .../hbase/filter/ColumnCountGetFilter.java | 9 +- .../hbase/filter/ColumnPaginationFilter.java | 15 +- .../hbase/filter/ColumnPrefixFilter.java | 11 +- .../hbase/filter/ColumnRangeFilter.java | 9 +- .../hadoop/hbase/filter/CompareFilter.java | 3 +- .../hbase/filter/DependentColumnFilter.java | 21 ++- .../hadoop/hbase/filter/FamilyFilter.java | 5 +- .../apache/hadoop/hbase/filter/Filter.java | 2 +- .../hadoop/hbase/filter/FilterBase.java | 2 +- .../hadoop/hbase/filter/FilterList.java | 5 +- .../hadoop/hbase/filter/FilterWrapper.java | 12 +- .../hbase/filter/FirstKeyOnlyFilter.java | 9 +- ...FirstKeyValueMatchingQualifiersFilter.java | 2 +- .../hadoop/hbase/filter/FuzzyRowFilter.java | 13 +- .../hbase/filter/InclusiveStopFilter.java | 10 +- .../filter/IncompatibleFilterException.java | 0 .../filter/InvalidRowFilterException.java | 0 .../hadoop/hbase/filter/KeyOnlyFilter.java | 7 +- .../filter/MultipleColumnPrefixFilter.java | 9 +- .../hadoop/hbase/filter/NullComparator.java | 5 +- .../hadoop/hbase/filter/PageFilter.java | 8 +- .../hadoop/hbase/filter/ParseConstants.java | 4 +- .../hadoop/hbase/filter/ParseFilter.java | 18 +- .../hadoop/hbase/filter/PrefixFilter.java | 12 +- .../hadoop/hbase/filter/QualifierFilter.java | 7 +- .../hadoop/hbase/filter/RandomRowFilter.java | 7 +- .../hbase/filter/RegexStringComparator.java | 16 +- .../apache/hadoop/hbase/filter/RowFilter.java | 9 +- .../SingleColumnValueExcludeFilter.java | 7 +- .../hbase/filter/SingleColumnValueFilter.java | 11 +- .../hadoop/hbase/filter/SkipFilter.java | 8 +- .../hbase/filter/SubstringComparator.java | 5 +- .../hadoop/hbase/filter/TimestampsFilter.java | 17 +- .../hadoop/hbase/filter/ValueFilter.java | 5 +- .../hadoop/hbase/filter/WhileMatchFilter.java | 10 +- .../hadoop/hbase/filter/package-info.java | 0 .../hadoop/hbase/ipc/BlockingRpcCallback.java | 0 .../hbase/ipc/CoprocessorRpcChannel.java | 9 +- .../apache/hadoop/hbase/ipc/HBaseClient.java | 96 ++++++----- .../hadoop/hbase/ipc/HBaseClientRPC.java | 18 +- .../ipc/MasterCoprocessorRpcChannel.java | 9 +- .../hbase/ipc/ProtobufRpcClientEngine.java | 21 +-- .../ipc/RegionCoprocessorRpcChannel.java | 0 .../hadoop/hbase/ipc/RpcClientEngine.java | 1 - .../hadoop/hbase/ipc/ServerRpcController.java | 0 .../hadoop/hbase/master/RegionState.java | 10 +- .../hadoop/hbase/protobuf/ProtobufUtil.java | 123 ++++---------- .../hbase/protobuf/RequestConverter.java | 77 +-------- .../hbase/protobuf/ResponseConverter.java | 11 +- .../apache/hadoop/hbase/protobuf/package.html | 0 .../hadoop/hbase/regionserver/BloomType.java | 0 .../regionserver/RegionOpeningState.java | 0 .../hbase/replication/ReplicationPeer.java | 14 +- .../replication/ReplicationStateImpl.java | 9 +- .../ReplicationStateInterface.java | 4 +- .../replication/ReplicationZookeeper.java | 47 +++--- .../hadoop/hbase/security/AuthMethod.java | 68 ++++++++ .../hbase/security/HBaseSaslRpcClient.java | 49 +++--- .../hadoop/hbase/security/KerberosInfo.java | 4 +- .../hadoop/hbase/security/SaslStatus.java | 30 ++++ .../hadoop/hbase/security/SaslUtil.java | 48 ++++++ .../hbase/security/SecureBulkLoadUtil.java | 40 +++++ .../hadoop/hbase/security/TokenInfo.java | 4 +- .../apache/hadoop/hbase/security/User.java | 3 +- .../hbase/security/access/Permission.java | 0 .../security/access/TablePermission.java | 0 .../hbase/security/access/UserPermission.java | 0 .../token/AuthenticationTokenIdentifier.java | 9 +- .../token/AuthenticationTokenSelector.java | 4 +- .../ClientSnapshotDescriptionUtils.java | 66 ++++++++ .../apache/hadoop/hbase/util/HasThread.java | 4 +- .../org/apache/hadoop/hbase/util/PoolMap.java | 6 +- .../org/apache/hadoop/hbase/util/Sleeper.java | 0 .../apache/hadoop/hbase/util/Writables.java | 8 +- .../hadoop/hbase/zookeeper/EmptyWatcher.java | 2 +- .../hadoop/hbase/zookeeper/HQuorumPeer.java | 26 +-- .../hbase/zookeeper/MasterAddressTracker.java | 6 +- .../hbase/zookeeper/MetaNodeTracker.java | 0 .../hbase/zookeeper/RecoverableZooKeeper.java | 16 +- .../hbase/zookeeper/RootRegionTracker.java | 2 +- .../hadoop/hbase/zookeeper/ZKAssign.java | 13 +- .../hadoop/hbase/zookeeper/ZKClusterId.java | 2 +- .../hadoop/hbase/zookeeper/ZKConfig.java | 18 +- .../hbase/zookeeper/ZKLeaderManager.java | 4 +- .../hadoop/hbase/zookeeper/ZKTable.java | 17 +- .../hbase/zookeeper/ZKTableReadOnly.java | 22 ++- .../apache/hadoop/hbase/zookeeper/ZKUtil.java | 35 ++-- .../hbase/zookeeper/ZooKeeperListener.java | 0 .../hbase/zookeeper/ZooKeeperNodeTracker.java | 0 .../hbase/zookeeper/ZooKeeperWatcher.java | 16 +- .../hadoop/hbase/client/TestAttributes.java | 0 .../apache/hadoop/hbase/client/TestGet.java | 0 .../hadoop/hbase/client/TestOperation.java | 0 .../hadoop/hbase/client/TestPutDotHas.java | 0 .../apache/hadoop/hbase/client/TestScan.java | 0 .../hbase/client/TestSnapshotFromAdmin.java | 0 hbase-common/pom.xml | 96 ++++++++--- .../org/apache/hadoop/hbase/HConstants.java | 34 ++++ .../org/apache/hadoop/hbase/io/TimeRange.java | 0 .../io/encoding/BufferedDataBlockEncoder.java | 0 .../hbase/io/encoding/CompressionState.java | 0 .../io/encoding/CopyKeyDataBlockEncoder.java | 0 .../io/encoding/DiffKeyDeltaEncoder.java | 0 .../hbase/io/encoding/EncodedDataBlock.java | 5 +- .../EncoderBufferTooSmallException.java | 0 .../io/encoding/FastDiffDeltaEncoder.java | 0 .../HFileBlockDefaultEncodingContext.java | 2 +- .../io/encoding/PrefixKeyDeltaEncoder.java | 0 .../apache/hadoop/hbase/util/Addressing.java | 0 .../org/apache/hadoop/hbase/util/Classes.java | 0 .../org/apache/hadoop/hbase/util/Hash.java | 0 .../apache/hadoop/hbase/util/JenkinsHash.java | 0 .../org/apache/hadoop/hbase/util/Methods.java | 0 .../apache/hadoop/hbase/util/MurmurHash.java | 0 .../org/apache/hadoop/hbase/util/Pair.java | 0 .../hadoop/hbase/util/PairOfSameType.java | 0 .../hadoop/hbase/util/RetryCounter.java | 0 .../hbase/util/RetryCounterFactory.java | 0 .../hadoop/hbase/util/SoftValueSortedMap.java | 0 .../org/apache/hadoop/hbase/util/Triple.java | 0 .../src/main/resources/hbase-default.xml | 0 .../src/saveVersion.sh | 0 .../example/BulkDeleteEndpoint.java | 2 +- .../coprocessor/example/RowCountEndpoint.java | 2 +- .../hadoop/hbase/DistributedHBaseCluster.java | 2 + .../codec/prefixtree/scanner/CellScanner.java | 0 hbase-server/pom.xml | 10 -- .../org/apache/hadoop/hbase/SplitLogTask.java | 1 + .../backup/example/HFileArchiveManager.java | 2 +- .../example/TableHFileArchiveTracker.java | 2 +- .../hadoop/hbase/catalog/MetaEditor.java | 5 +- .../catalog/MetaMigrationConvertingToPB.java | 2 +- .../hadoop/hbase/constraint/Constraint.java | 7 +- .../hadoop/hbase/constraint/package-info.java | 2 +- .../coprocessor/AggregateImplementation.java | 5 +- .../hbase/coprocessor/BaseMasterObserver.java | 1 - .../coprocessor/BaseRowProcessorEndpoint.java | 1 + .../hbase/coprocessor/CoprocessorHost.java | 3 +- .../coprocessor/MultiRowMutationEndpoint.java | 8 +- .../hadoop/hbase/executor/EventHandler.java | 95 +---------- .../hbase/executor/ExecutorService.java | 56 ++----- .../hadoop/hbase/io/hfile/CacheConfig.java | 2 +- .../apache/hadoop/hbase/io/hfile/HFile.java | 6 +- .../hadoop/hbase/io/hfile/HFileBlock.java | 72 ++++---- .../io/hfile/HFileDataBlockEncoderImpl.java | 3 +- .../apache/hadoop/hbase/ipc/HBaseServer.java | 28 ++-- .../hbase/ipc/ProtobufRpcServerEngine.java | 1 + .../hadoop/hbase/ipc/RpcCallContext.java | 2 + .../hbase/mapreduce/HFileOutputFormat.java | 3 +- .../apache/hadoop/hbase/mapreduce/Import.java | 2 +- .../mapreduce/LoadIncrementalHFiles.java | 2 +- .../hbase/master/ActiveMasterManager.java | 2 +- .../hbase/master/AssignmentManager.java | 20 +-- .../apache/hadoop/hbase/master/HMaster.java | 26 +-- .../hbase/master/HMasterCommandLine.java | 4 +- .../hadoop/hbase/master/MasterFileSystem.java | 6 +- .../hadoop/hbase/master/MasterServices.java | 4 +- .../hadoop/hbase/master/ServerManager.java | 10 +- .../hadoop/hbase/master/SplitLogManager.java | 2 +- .../hadoop/hbase/master/TableLockManager.java | 2 +- .../master/handler/ClosedRegionHandler.java | 1 + .../master/handler/CreateTableHandler.java | 16 +- .../master/handler/DeleteTableHandler.java | 1 + .../master/handler/DisableTableHandler.java | 5 +- .../master/handler/EnableTableHandler.java | 5 +- .../handler/MetaServerShutdownHandler.java | 1 + .../master/handler/ModifyTableHandler.java | 1 + .../master/handler/OpenedRegionHandler.java | 1 + .../master/handler/ServerShutdownHandler.java | 1 + .../master/handler/SplitRegionHandler.java | 3 +- .../master/handler/TableAddFamilyHandler.java | 3 +- .../handler/TableDeleteFamilyHandler.java | 1 + .../master/handler/TableEventHandler.java | 8 +- .../handler/TableModifyFamilyHandler.java | 1 + .../master/snapshot/CloneSnapshotHandler.java | 9 +- .../DisabledTableSnapshotHandler.java | 10 +- .../snapshot/EnabledTableSnapshotHandler.java | 2 +- .../snapshot/MasterSnapshotVerifier.java | 4 +- .../snapshot/RestoreSnapshotHandler.java | 12 +- .../master/snapshot/SnapshotManager.java | 46 +++--- .../master/snapshot/TakeSnapshotHandler.java | 10 +- .../protobuf/ReplicationProtbufUtil.java | 154 ++++++++++++++++++ .../hadoop/hbase/regionserver/HRegion.java | 25 +-- .../hbase/regionserver/HRegionServer.java | 29 ++-- .../regionserver/HRegionThriftServer.java | 2 +- .../hadoop/hbase/regionserver/HStore.java | 4 +- .../hadoop/hbase/regionserver/Leases.java | 3 +- .../hadoop/hbase/regionserver/LogRoller.java | 2 +- .../hbase/regionserver/MemStoreFlusher.java | 2 +- .../MultiRowMutationProcessor.java | 2 +- .../hbase/regionserver/RowProcessor.java | 2 +- .../hbase/regionserver/SplitLogWorker.java | 2 +- .../hbase/regionserver/SplitTransaction.java | 2 +- .../hbase/regionserver/StoreScanner.java | 2 +- .../handler/CloseMetaHandler.java | 1 + .../handler/CloseRegionHandler.java | 1 + .../handler/CloseRootHandler.java | 1 + .../regionserver/handler/OpenMetaHandler.java | 1 + .../handler/OpenRegionHandler.java | 2 +- .../regionserver/handler/OpenRootHandler.java | 1 + .../handler/ParallelSeekHandler.java | 1 + .../snapshot/FlushSnapshotSubprocedure.java | 4 +- .../snapshot/RegionServerSnapshotManager.java | 2 +- .../hadoop/hbase/regionserver/wal/FSHLog.java | 3 +- .../hadoop/hbase/regionserver/wal/HLog.java | 13 +- .../hbase/regionserver/wal/HLogSplitter.java | 4 +- .../hbase/regionserver/wal/HLogUtil.java | 7 +- .../regionserver/ReplicationSource.java | 5 +- .../hadoop/hbase/rest/RegionsResource.java | 2 +- .../apache/hadoop/hbase/rest/RowResource.java | 2 +- .../hadoop/hbase/rest/RowResultGenerator.java | 2 +- .../hadoop/hbase/rest/ScannerResource.java | 2 +- .../hbase/rest/ScannerResultGenerator.java | 2 +- .../hadoop/hbase/rest/SchemaResource.java | 4 +- .../hbase/security/HBaseSaslRpcServer.java | 87 +--------- .../security/access/AccessControlFilter.java | 11 +- .../security/access/AccessControlLists.java | 2 +- .../security/access/AccessController.java | 3 +- .../access/SecureBulkLoadEndpoint.java | 19 +-- .../security/access/TableAuthManager.java | 2 +- .../hbase/security/token/TokenProvider.java | 2 +- .../hadoop/hbase/snapshot/ExportSnapshot.java | 1 + .../snapshot/SnapshotDescriptionUtils.java | 41 +---- .../hbase/snapshot/TableInfoCopyTask.java | 2 +- .../hbase/snapshot/TakeSnapshotUtils.java | 1 + .../hbase/thrift/ThriftServerRunner.java | 2 +- .../org/apache/hadoop/hbase/tool/Canary.java | 2 +- .../hadoop/hbase/util/FSTableDescriptors.java | 4 +- .../org/apache/hadoop/hbase/util/FSUtils.java | 5 +- .../apache/hadoop/hbase/util/HBaseFsck.java | 4 +- .../hadoop/hbase/util/HBaseFsckRepair.java | 2 +- .../org/apache/hadoop/hbase/util/HMerge.java | 2 +- .../org/apache/hadoop/hbase/util/Merge.java | 4 +- .../util/hbck/HFileCorruptionChecker.java | 2 +- .../hbase/zookeeper/LoadBalancerTracker.java | 2 +- .../hadoop/hbase/HBaseTestingUtility.java | 6 +- .../hadoop/hbase/TestAcidGuarantees.java | 1 + .../hadoop/hbase/TestHColumnDescriptor.java | 2 +- .../hadoop/hbase/TestHTableDescriptor.java | 1 + .../hadoop/hbase/TestMultiVersions.java | 2 + .../hadoop/hbase/TestSerialization.java | 1 + .../hbase/catalog/TestCatalogTracker.java | 4 +- .../client/HConnectionTestingUtility.java | 2 +- .../apache/hadoop/hbase/client/TestAdmin.java | 18 +- .../hbase/client/TestClientTimeouts.java | 4 +- .../hbase/client/TestFromClientSide.java | 5 +- .../apache/hadoop/hbase/client/TestHCM.java | 2 +- .../client/TestRestoreSnapshotFromClient.java | 16 +- .../hbase/client/TestSnapshotFromClient.java | 4 +- .../hbase/constraint/AllFailConstraint.java | 1 + .../constraint/RuntimeFailConstraint.java | 1 + .../hbase/constraint/TestConstraint.java | 1 + .../ColumnAggregationEndpoint.java | 1 + .../coprocessor/TestCoprocessorInterface.java | 3 +- ...tMasterCoprocessorExceptionWithRemove.java | 4 +- ...nServerCoprocessorExceptionWithRemove.java | 2 +- .../hbase/executor/TestExecutorService.java | 4 +- .../filter/TestFilterWithScanLimits.java | 8 +- .../hbase/filter/TestFilterWrapper.java | 8 +- .../io/encoding/TestDataBlockEncoders.java | 8 +- .../hadoop/hbase/io/hfile/CacheTestUtils.java | 3 +- .../hadoop/hbase/io/hfile/TestChecksum.java | 18 +- .../hadoop/hbase/io/hfile/TestHFile.java | 1 + .../hadoop/hbase/io/hfile/TestHFileBlock.java | 15 +- .../io/hfile/TestHFileBlockCompatibility.java | 11 +- .../io/hfile/TestHFileDataBlockEncoder.java | 9 +- .../hbase/mapred/TestTableInputFormat.java | 13 +- ...estLoadIncrementalHFilesSplitRecovery.java | 2 +- .../hbase/mapreduce/TestTimeRangeMapRed.java | 2 + .../hadoop/hbase/master/MockRegionServer.java | 4 +- .../apache/hadoop/hbase/master/Mocking.java | 4 +- .../hbase/master/TestAssignmentManager.java | 10 +- .../hbase/master/TestCatalogJanitor.java | 2 +- .../hbase/master/TestClockSkewDetection.java | 3 +- .../hbase/master/TestHMasterRPCException.java | 2 +- .../hadoop/hbase/master/TestMaster.java | 2 +- .../hbase/master/TestMasterFailover.java | 5 +- ...TestMasterFailoverBalancerPersistence.java | 4 +- .../hbase/master/TestMasterNoCluster.java | 4 +- .../hbase/master/TestOpenedRegionHandler.java | 3 +- .../hbase/master/TestRestartCluster.java | 3 +- .../hbase/master/TestTableLockManager.java | 4 +- .../master/TestZKBasedOpenCloseRegion.java | 2 +- .../cleaner/TestSnapshotFromMaster.java | 2 +- .../regionserver/CreateRandomStoreFile.java | 4 +- .../TestEndToEndSplitTransaction.java | 2 +- .../TestGetClosestAtOrBefore.java | 3 +- .../hbase/regionserver/TestHRegion.java | 12 +- .../regionserver/TestHRegionBusyWait.java | 2 +- .../hbase/regionserver/TestHRegionInfo.java | 4 +- .../TestHRegionServerBulkLoad.java | 1 + .../hbase/regionserver/TestKeepDeletes.java | 3 +- .../TestRegionServerNoMaster.java | 8 +- .../hbase/regionserver/TestScanner.java | 2 +- .../TestServerCustomProtocol.java | 2 +- .../TestSplitTransactionOnCluster.java | 15 +- .../hbase/regionserver/TestStoreFile.java | 4 +- .../handler/TestCloseRegionHandler.java | 6 +- .../handler/TestOpenRegionHandler.java | 2 +- .../hbase/regionserver/wal/TestHLogSplit.java | 5 +- .../regionserver/wal/TestLogRollAbort.java | 4 +- .../regionserver/wal/TestLogRolling.java | 3 +- .../hbase/regionserver/wal/TestWALReplay.java | 4 +- .../TestReplicationQueueFailover.java | 2 +- .../access/TestAccessControlFilter.java | 2 +- .../security/access/TestAccessController.java | 2 +- .../security/access/TestTablePermissions.java | 2 +- .../hbase/snapshot/SnapshotTestingUtils.java | 4 +- .../snapshot/TestFlushSnapshotFromClient.java | 10 +- .../TestRestoreFlushSnapshotFromClient.java | 2 +- .../hadoop/hbase/util/LoadTestTool.java | 2 - .../apache/hadoop/hbase/util/MockServer.java | 2 +- .../hbase/util/TestFSTableDescriptors.java | 1 + .../apache/hadoop/hbase/util/TestFSUtils.java | 2 +- .../hadoop/hbase/util/TestFSVisitor.java | 10 -- .../util/TestMiniClusterLoadSequential.java | 2 +- .../hadoop/hbase/zookeeper/TestZKTable.java | 1 + pom.xml | 1 + 456 files changed, 2058 insertions(+), 1900 deletions(-) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/Abortable.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/Chore.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ClusterId.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/Coprocessor.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/IpcProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/MasterAdminProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/MasterMonitorProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/MasterProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/RegionLoad.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/RegionTransition.java (95%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/Server.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ServerLoad.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ServerName.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/Stoppable.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Action.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Append.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Attributes.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Delete.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Get.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HConnection.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTable.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Increment.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/IsolationLevel.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Mutation.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Operation.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Put.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java (95%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Result.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Row.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/Scan.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java (95%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHColumnDescriptor.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHRegionInfo.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/ZooKeeperKeepAliveConnection.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/coprocessor/package-info.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/package-info.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/security => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/AccessDeniedException.java (91%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/ipc => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/CallerDisconnectedException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/ClockOutOfSyncException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/constraint => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/ConstraintException.java (90%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/CoprocessorException.java (93%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/CorruptHFileException.java (84%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/CorruptedSnapshotException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/DeserializationException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/DoNotRetryIOException.java (93%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/DroppedSnapshotException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/ExportSnapshotException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/FailedLogCloseException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/FailedSanityCheckException.java (89%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/util => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/FileSystemVersionException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/HBaseException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/HBaseIOException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/HBaseSnapshotException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/InvalidFamilyOperationException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/InvalidHFileException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/LeaseException.java (91%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/LockTimeoutException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/MasterNotRunningException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/NoSuchColumnFamilyException.java (92%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/NotAllMetaRegionsOnlineException.java (94%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/NotServingRegionException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/OrphanHLogAfterSplitException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/OutOfOrderScannerNextException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/PleaseHoldException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionAlreadyInTransitionException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionMovedException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionServerRunningException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionServerStoppedException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RegionTooBusyException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/RestoreSnapshotException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/ipc => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/ServerNotRunningYetException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/SnapshotCreationException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/SnapshotDoesNotExistException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/SnapshotExistsException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TableExistsException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TableInfoMissingException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TableNotDisabledException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TableNotEnabledException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TableNotFoundException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/TablePartiallyOpenException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/ipc => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/UnknownProtocolException.java (89%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/UnknownRegionException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/UnknownScannerException.java (97%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/UnknownSnapshotException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/WrongRegionException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/YouAreDeadException.java (96%) rename {hbase-server/src/main/java/org/apache/hadoop/hbase => hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions}/ZooKeeperConnectionException.java (97%) create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/executor/EventType.java create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/Filter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/filter/package-info.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcCallback.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java (88%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java (95%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java (96%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/ipc/ServerRpcController.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/master/RegionState.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java (95%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java (93%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/protobuf/package.html (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/regionserver/BloomType.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java (99%) create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/security/AuthMethod.java rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java (93%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java (100%) create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslStatus.java create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslUtil.java create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/security/SecureBulkLoadUtil.java rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/User.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/access/TablePermission.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/access/UserPermission.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java (100%) create mode 100644 hbase-client/src/main/java/org/apache/hadoop/hbase/snapshot/ClientSnapshotDescriptionUtils.java rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/util/HasThread.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/util/Writables.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaNodeTracker.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java (97%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java (98%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java (93%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java (99%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperListener.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperNodeTracker.java (100%) rename {hbase-server => hbase-client}/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java (99%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java (100%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestGet.java (100%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java (100%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestPutDotHas.java (100%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestScan.java (100%) rename {hbase-server => hbase-client}/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromAdmin.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/CompressionState.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/CopyKeyDataBlockEncoder.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/DiffKeyDeltaEncoder.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java (98%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Addressing.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Classes.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Hash.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/JenkinsHash.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Methods.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/MurmurHash.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Pair.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/RetryCounter.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java (100%) rename {hbase-server => hbase-common}/src/main/java/org/apache/hadoop/hbase/util/Triple.java (100%) rename {hbase-server => hbase-common}/src/main/resources/hbase-default.xml (100%) rename {hbase-server => hbase-common}/src/saveVersion.sh (100%) delete mode 100644 hbase-prefix-tree/src/main/java/org/apache/hbase/codec/prefixtree/scanner/CellScanner.java create mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index fb034548bbd..84c726e2e5a 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -58,6 +58,15 @@ org.apache.hbase hbase-common + + org.apache.hbase + hbase-prefix-tree + + + org.apache.hbase + hbase-common + test-jar + org.apache.hbase hbase-protocol diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Abortable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/Abortable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/Abortable.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Chore.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Chore.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/Chore.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/Chore.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterId.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterId.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java index a8e8560b218..d2342bd1612 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterId.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java @@ -18,14 +18,14 @@ package org.apache.hadoop.hbase; -import java.util.UUID; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ClusterIdProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.InvalidProtocolBufferException; +import java.util.UUID; /** * The identifier for this cluster. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java index d9dfac038e8..686a4b0b3a0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java @@ -19,13 +19,7 @@ package org.apache.hadoop.hbase; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - +import com.google.protobuf.ByteString; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.master.RegionState; @@ -40,7 +34,12 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.Re import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.io.VersionedWritable; -import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Map; /** * Status information on the HBase cluster. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Coprocessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Coprocessor.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/Coprocessor.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/Coprocessor.java index 88ecd2f9f2c..e097d8f5730 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/Coprocessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/Coprocessor.java @@ -15,11 +15,11 @@ package org.apache.hadoop.hbase; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Coprocess interface. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java index 3806426c898..9b1e1e50de3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java @@ -15,13 +15,13 @@ package org.apache.hadoop.hbase; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.HTableInterface; +import java.io.IOException; + /** * Coprocessor environment state. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java index 112f17dcef3..ecb0826b5ed 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java @@ -18,6 +18,24 @@ */ package org.apache.hadoop.hbase; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.io.compress.Compression; +import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilySchema; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameStringPair; +import org.apache.hadoop.hbase.regionserver.BloomType; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.io.WritableComparable; + import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; @@ -27,28 +45,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.io.compress.Compression; -import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; -import org.apache.hadoop.hbase.io.hfile.HFile; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilySchema; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameStringPair; -import org.apache.hadoop.hbase.regionserver.BloomType; -import org.apache.hadoop.hbase.regionserver.wal.HLog; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.io.WritableComparable; - -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * An HColumnDescriptor contains information about a column family such as the * number of versions, compression settings, etc. @@ -165,7 +161,7 @@ public class HColumnDescriptor implements WritableComparable /** * Default size of blocks in files stored to the filesytem (hfiles). */ - public static final int DEFAULT_BLOCKSIZE = HFile.DEFAULT_BLOCKSIZE; + public static final int DEFAULT_BLOCKSIZE = HConstants.DEFAULT_BLOCKSIZE; /** * Default setting for whether or not to use bloomfilters. @@ -454,10 +450,10 @@ public class HColumnDescriptor implements WritableComparable Bytes.toString(b)); } } - byte[] recoveredEdit = Bytes.toBytes(HLog.RECOVERED_EDITS_DIR); + byte[] recoveredEdit = Bytes.toBytes(HConstants.RECOVERED_EDITS_DIR); if (Bytes.equals(recoveredEdit, b)) { throw new IllegalArgumentException("Family name cannot be: " + - HLog.RECOVERED_EDITS_DIR); + HConstants.RECOVERED_EDITS_DIR); } return b; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java index 66f19d1ff1e..e8a67176b9a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java @@ -18,23 +18,15 @@ */ package org.apache.hadoop.hbase; -import java.io.ByteArrayInputStream; -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.DataOutput; -import java.io.EOFException; -import java.io.IOException; -import java.io.SequenceInputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.KeyValue.KVComparator; import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionInfo; @@ -45,8 +37,16 @@ import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.util.PairOfSameType; import org.apache.hadoop.io.DataInputBuffer; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.ByteArrayInputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.EOFException; +import java.io.IOException; +import java.io.SequenceInputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * HRegion information. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java index 74fe2780701..4317dfc91ed 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -18,6 +18,23 @@ */ package org.apache.hadoop.hbase; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilySchema; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameStringPair; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema; +import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.Writables; +import org.apache.hadoop.io.WritableComparable; + import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; @@ -34,23 +51,6 @@ import java.util.TreeMap; import java.util.TreeSet; import java.util.regex.Matcher; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilySchema; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameStringPair; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema; -import org.apache.hadoop.hbase.security.User; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.util.Writables; -import org.apache.hadoop.io.WritableComparable; - -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * HTableDescriptor contains the details about an HBase table such as the descriptors of * all the column families, is the table a catalog table, -ROOT- or diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/IpcProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/IpcProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/IpcProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/IpcProtocol.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/MasterAdminProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MasterAdminProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/MasterAdminProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/MasterAdminProtocol.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/MasterMonitorProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MasterMonitorProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/MasterMonitorProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/MasterMonitorProtocol.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/MasterProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MasterProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/MasterProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/MasterProtocol.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RegionLoad.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java index cdb3fbaa5dd..791a82284b2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionLoad.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java @@ -20,11 +20,9 @@ package org.apache.hadoop.hbase; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.util.Bytes; -import java.util.TreeSet; -import java.util.Set; /** * Encapsulates per-region load metrics. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTransition.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionTransition.java similarity index 95% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTransition.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/RegionTransition.java index 67e24882112..73140e18fa2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTransition.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionTransition.java @@ -17,16 +17,15 @@ */ package org.apache.hadoop.hbase; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.executor.EventHandler; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * Current state of a region in transition. Holds state of a region as it moves through the * steps that take it from offline to open, etc. Used by regionserver, master, and zk packages. @@ -49,8 +48,8 @@ public class RegionTransition { this.rt = rt; } - public EventHandler.EventType getEventType() { - return EventHandler.EventType.get(this.rt.getEventTypeCode()); + public EventType getEventType() { + return EventType.get(this.rt.getEventTypeCode()); } public ServerName getServerName() { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java index a7e6dd2ac78..288068ec305 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java @@ -18,13 +18,13 @@ */ package org.apache.hadoop.hbase; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.ipc.RemoteException; + import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.ipc.RemoteException; - /** * An immutable class which contains a static method for handling * org.apache.hadoop.ipc.RemoteException exceptions. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Server.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/Server.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ServerLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ServerLoad.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java index bd88b6a75f4..18cdaa0ff1a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ServerLoad.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java @@ -20,21 +20,19 @@ package org.apache.hadoop.hbase; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.TreeSet; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.Coprocessor; -import org.apache.hadoop.hbase.RegionLoad; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Strings; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.TreeSet; + /** * This class is used for exporting current state of load on a RegionServer. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ServerName.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ServerName.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java index f3ae6b50e81..c816bab5ad1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ServerName.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java @@ -18,17 +18,17 @@ */ package org.apache.hadoop.hbase; -import java.util.Collection; -import java.util.regex.Pattern; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.RootRegionServer; import org.apache.hadoop.hbase.util.Addressing; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.InvalidProtocolBufferException; +import java.util.Collection; +import java.util.regex.Pattern; /** * Instance of an HBase ServerName. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/Stoppable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/Stoppable.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/Stoppable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/Stoppable.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java index 5d08d28d081..b5358c2036a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java @@ -17,6 +17,27 @@ */ package org.apache.hadoop.hbase.catalog; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.Abortable; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.client.AdminProtocol; +import org.apache.hadoop.hbase.client.HConnection; +import org.apache.hadoop.hbase.client.HConnectionManager; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.RetriesExhaustedException; +import org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.exceptions.ServerNotRunningYetException; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.zookeeper.MetaNodeTracker; +import org.apache.hadoop.hbase.zookeeper.RootRegionTracker; +import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.apache.hadoop.ipc.RemoteException; + import java.io.EOFException; import java.io.IOException; import java.net.ConnectException; @@ -26,27 +47,6 @@ import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; -import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.client.AdminProtocol; -import org.apache.hadoop.hbase.client.HConnection; -import org.apache.hadoop.hbase.client.HConnectionManager; -import org.apache.hadoop.hbase.client.HTable; -import org.apache.hadoop.hbase.client.RetriesExhaustedException; -import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.zookeeper.MetaNodeTracker; -import org.apache.hadoop.hbase.zookeeper.RootRegionTracker; -import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; -import org.apache.hadoop.ipc.RemoteException; - /** * Tracks the availability of the catalog tables -ROOT- and * .META.. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java index 2eb71f53509..9cde94572d0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java @@ -17,14 +17,6 @@ */ package org.apache.hadoop.hbase.catalog; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.Set; -import java.util.TreeMap; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -41,6 +33,14 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.NavigableMap; +import java.util.Set; +import java.util.TreeMap; + /** * Reads region and assignment information from .META.. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java index 2bb0687affb..99957935cbd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractClientScanner.java @@ -17,12 +17,12 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; -import java.util.Iterator; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; +import java.util.Iterator; + /** * Helper class for custom client scanners. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Action.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Action.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Action.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Action.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java index cd7ce3c5665..7a43451791a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AdminProtocol.java @@ -21,8 +21,8 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.IpcProtocol; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.security.TokenInfo; import org.apache.hadoop.hbase.security.KerberosInfo; +import org.apache.hadoop.hbase.security.TokenInfo; /** * Protocol that a HBase client uses to communicate with a region server. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Append.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Append.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java index ba1e0857be9..619234e91e1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Append.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java @@ -17,15 +17,15 @@ */ package org.apache.hadoop.hbase.client; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.util.Bytes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * Performs Append operations on a single row. *

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Attributes.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Attributes.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Attributes.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Attributes.java index f916ea621bc..181a04b72de 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Attributes.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Attributes.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hbase.client; -import java.util.Map; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.util.Map; + @InterfaceAudience.Public @InterfaceStability.Stable public interface Attributes { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java index 53244416b73..16ae40ce4d8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientProtocol.java @@ -22,8 +22,8 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.IpcProtocol; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService; -import org.apache.hadoop.hbase.security.TokenInfo; import org.apache.hadoop.hbase.security.KerberosInfo; +import org.apache.hadoop.hbase.security.TokenInfo; /** * Protocol that a HBase client uses to communicate with a region server. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java index 8a4999a217d..eb7f0c36230 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java @@ -17,28 +17,27 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedList; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.NotServingRegionException; -import org.apache.hadoop.hbase.OutOfOrderScannerNextException; -import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException; +import org.apache.hadoop.hbase.exceptions.RegionServerStoppedException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.MapReduceProtos; -import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException; import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.io.DataOutputBuffer; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedList; /** * Implements the scanner interface for the HBase client. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Delete.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Delete.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Delete.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Get.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 851819f3ba2..0c8ec7298a0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -18,18 +18,8 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.io.InterruptedIOException; -import java.net.SocketTimeoutException; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Pattern; - +import com.google.protobuf.ByteString; +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -37,26 +27,31 @@ import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.ClusterStatus; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.NotServingRegionException; -import org.apache.hadoop.hbase.RegionException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.TableExistsException; -import org.apache.hadoop.hbase.TableNotEnabledException; -import org.apache.hadoop.hbase.TableNotFoundException; -import org.apache.hadoop.hbase.UnknownRegionException; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.catalog.MetaReader; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitorBase; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; +import org.apache.hadoop.hbase.exceptions.HBaseSnapshotException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.RegionException; +import org.apache.hadoop.hbase.exceptions.RestoreSnapshotException; +import org.apache.hadoop.hbase.exceptions.SnapshotCreationException; +import org.apache.hadoop.hbase.exceptions.TableExistsException; +import org.apache.hadoop.hbase.exceptions.TableNotEnabledException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.UnknownRegionException; +import org.apache.hadoop.hbase.exceptions.UnknownSnapshotException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; import org.apache.hadoop.hbase.ipc.MasterCoprocessorRpcChannel; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; @@ -105,12 +100,7 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetSchemaA import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetSchemaAlterStatusResponse; import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetTableDescriptorsRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetTableDescriptorsResponse; -import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException; -import org.apache.hadoop.hbase.snapshot.HBaseSnapshotException; -import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException; -import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; -import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; -import org.apache.hadoop.hbase.snapshot.UnknownSnapshotException; +import org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils; import org.apache.hadoop.hbase.util.Addressing; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -119,8 +109,17 @@ import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.util.StringUtils; import org.apache.zookeeper.KeeperException; -import com.google.protobuf.ByteString; -import com.google.protobuf.ServiceException; +import java.io.Closeable; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.net.SocketTimeoutException; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.regex.Pattern; /** * Provides an interface to manage HBase database table metadata + general @@ -184,7 +183,7 @@ public class HBaseAdmin implements Abortable, Closeable { /** * @return A new CatalogTracker instance; call {@link #cleanupCatalogTracker(CatalogTracker)} * to cleanup the returned catalog tracker. - * @throws ZooKeeperConnectionException + * @throws org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException * @throws IOException * @see #cleanupCatalogTracker(CatalogTracker) */ @@ -363,7 +362,7 @@ public class HBaseAdmin implements Abortable, Closeable { * * @throws IllegalArgumentException if the table name is reserved * @throws MasterNotRunningException if master is not running - * @throws TableExistsException if table already exists (If concurrent + * @throws org.apache.hadoop.hbase.exceptions.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence * and attempt-at-creation). * @throws IOException @@ -396,7 +395,7 @@ public class HBaseAdmin implements Abortable, Closeable { * @throws IllegalArgumentException if the table name is reserved, if the split keys * are repeated and if the split key has empty byte array. * @throws MasterNotRunningException if master is not running - * @throws TableExistsException if table already exists (If concurrent + * @throws org.apache.hadoop.hbase.exceptions.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence * and attempt-at-creation). * @throws IOException @@ -485,7 +484,7 @@ public class HBaseAdmin implements Abortable, Closeable { * @throws IllegalArgumentException Bad table name, if the split keys * are repeated and if the split key has empty byte array. * @throws MasterNotRunningException if master is not running - * @throws TableExistsException if table already exists (If concurrent + * @throws org.apache.hadoop.hbase.exceptions.TableExistsException if table already exists (If concurrent * threads, the table may have been created between test-for-existence * and attempt-at-creation). * @throws IOException @@ -1643,7 +1642,7 @@ public class HBaseAdmin implements Abortable, Closeable { /** * Query on the catalog janitor state (Enabled/Disabled?) * @throws ServiceException - * @throws MasterNotRunningException + * @throws org.apache.hadoop.hbase.exceptions.MasterNotRunningException */ public boolean isCatalogJanitorEnabled() throws ServiceException, MasterNotRunningException { MasterAdminKeepAliveConnection master = connection.getKeepAliveMasterAdmin(); @@ -2216,7 +2215,7 @@ public class HBaseAdmin implements Abortable, Closeable { long maxPauseTime = max / this.numRetries; int tries = 0; LOG.debug("Waiting a max of " + max + " ms for snapshot '" + - SnapshotDescriptionUtils.toString(snapshot) + "'' to complete. (max " + + ClientSnapshotDescriptionUtils.toString(snapshot) + "'' to complete. (max " + maxPauseTime + " ms per retry)"); while (tries == 0 || ((EnvironmentEdgeManager.currentTimeMillis() - start) < max && !done.getDone())) { @@ -2258,7 +2257,7 @@ public class HBaseAdmin implements Abortable, Closeable { */ public TakeSnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException, SnapshotCreationException { - SnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot); + ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot); final TakeSnapshotRequest request = TakeSnapshotRequest.newBuilder().setSnapshot(snapshot) .build(); // run the snapshot on the master @@ -2459,7 +2458,7 @@ public class HBaseAdmin implements Abortable, Closeable { */ private RestoreSnapshotResponse internalRestoreSnapshotAsync(final SnapshotDescription snapshot) throws IOException, RestoreSnapshotException { - SnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot); + ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot); final RestoreSnapshotRequest request = RestoreSnapshotRequest.newBuilder().setSnapshot(snapshot) .build(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnection.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnection.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnection.java index b840f912f13..a71a323307c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnection.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnection.java @@ -18,11 +18,6 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.ExecutorService; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; @@ -31,13 +26,18 @@ import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MasterAdminProtocol; import org.apache.hadoop.hbase.MasterMonitorProtocol; -import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.client.coprocessor.Batch; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import java.io.Closeable; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ExecutorService; + /** * Cluster connection. Hosts a connection to the ZooKeeper ensemble and * thereafter into the HBase cluster. Knows how to locate regions out on the cluster, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 547c1f7f96b..e0238eabfc3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -18,62 +18,34 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.lang.reflect.UndeclaredThrowableException; -import java.net.InetSocketAddress; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.Map.Entry; -import java.util.Set; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Chore; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.IpcProtocol; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.MasterAdminProtocol; import org.apache.hadoop.hbase.MasterMonitorProtocol; -import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MasterProtocol; -import org.apache.hadoop.hbase.IpcProtocol; -import org.apache.hadoop.hbase.RegionMovedException; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.Stoppable; -import org.apache.hadoop.hbase.TableNotFoundException; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitorBase; import org.apache.hadoop.hbase.client.coprocessor.Batch; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.RegionMovedException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.ipc.HBaseClientRPC; import org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine; import org.apache.hadoop.hbase.ipc.RpcClientEngine; @@ -97,7 +69,34 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.ipc.RemoteException; import org.apache.zookeeper.KeeperException; -import com.google.protobuf.ServiceException; +import java.io.Closeable; +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.lang.reflect.UndeclaredThrowableException; +import java.net.InetSocketAddress; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.NavigableMap; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; /** * A non-instantiable class that manages {@link HConnection}s. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java index 9a9128e5a63..bb8aa7c9e3d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -18,25 +18,8 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.io.InterruptedIOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.TreeMap; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - +import com.google.protobuf.Service; +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -68,8 +51,24 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.util.Threads; -import com.google.protobuf.Service; -import com.google.protobuf.ServiceException; +import java.io.Closeable; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.NavigableMap; +import java.util.TreeMap; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** *

Used to communicate with a single HBase table. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java index ffbf2d2467d..4bd7c29feae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java @@ -18,11 +18,6 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.util.List; -import java.util.Map; - import com.google.protobuf.Service; import com.google.protobuf.ServiceException; import org.apache.hadoop.classification.InterfaceAudience; @@ -33,6 +28,11 @@ import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.coprocessor.Batch; import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; +import java.io.Closeable; +import java.io.IOException; +import java.util.List; +import java.util.Map; + /** * Used to communicate with a single HBase table. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java index 40f1f47f5f2..fb452a58daa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterfaceFactory.java @@ -18,12 +18,12 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; +import java.io.IOException; + /** * Defines methods to create new HTableInterface. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java index 771c2a78eed..2fffd6c83a6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java @@ -19,6 +19,16 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; + import java.io.IOException; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; @@ -32,16 +42,6 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; -import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; - /** * HTableMultiplexer provides a thread-safe non blocking PUT API across all the tables. * Each put will be sharded into different buffer queues based on its destination region server. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java index 84fe1f8ca5e..1b31222d3ec 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java @@ -18,12 +18,6 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.Map; - import com.google.protobuf.Service; import com.google.protobuf.ServiceException; import org.apache.hadoop.classification.InterfaceAudience; @@ -38,6 +32,12 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.PoolMap; import org.apache.hadoop.hbase.util.PoolMap.PoolType; +import java.io.Closeable; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Map; + /** * A simple pool of HTable instances. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java index 7ad6e65b969..402a4663697 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableUtil.java @@ -18,20 +18,16 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.HRegionLocation; + import java.io.IOException; -import java.lang.InterruptedException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.client.HTable; -import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.client.Row; - /** * Utility class for HTable. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Increment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Increment.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java index 8e59bd6f165..2ca0eaab46d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Increment.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java @@ -18,17 +18,17 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.io.TimeRange; +import org.apache.hadoop.hbase.util.Bytes; + import java.io.IOException; import java.util.Map; import java.util.NavigableMap; import java.util.Set; import java.util.TreeMap; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.io.TimeRange; -import org.apache.hadoop.hbase.util.Bytes; - /** * Used to perform Increment operations on a single row. *

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/IsolationLevel.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/IsolationLevel.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/IsolationLevel.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/IsolationLevel.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterAdminKeepAliveConnection.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterMonitorKeepAliveConnection.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java index eba32a738fe..5c7dc3be049 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java @@ -19,14 +19,6 @@ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.NavigableMap; -import java.util.TreeMap; -import java.util.TreeSet; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -34,11 +26,19 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.HConnectionManager.HConnectable; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.PairOfSameType; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.NavigableMap; +import java.util.TreeMap; +import java.util.TreeSet; + /** * Scanner class that contains the .META. table scanning logic * and uses a Retryable scanner. Provided visitors will be called diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java index 5605013ffa8..78938d70639 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiAction.java @@ -18,16 +18,16 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.util.Bytes; + import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.util.Bytes; - /** * Container for Actions (i.e. Get, Delete, or Put), which are grouped by * regionName. Intended to be used with HConnectionManager.processBatch() diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java index f83f9ab41af..b7f5625e6fa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MultiResponse.java @@ -24,10 +24,10 @@ import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.ArrayList; import java.util.TreeMap; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Mutation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Mutation.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java index dd883a56571..2c5c3c93cdd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Mutation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java @@ -19,6 +19,12 @@ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.util.Bytes; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -26,12 +32,6 @@ import java.util.Map; import java.util.TreeMap; import java.util.UUID; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.util.Bytes; - @InterfaceAudience.Public @InterfaceStability.Evolving public abstract class Mutation extends OperationWithAttributes implements Row { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java index 6de1007a1e1..dac7b353428 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.RegionException; +import org.apache.hadoop.hbase.exceptions.RegionException; /** * Thrown when no region server can be found for a region diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Operation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Operation.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Operation.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Operation.java index 07e9c19a539..f0a01349d78 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Operation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Operation.java @@ -18,13 +18,13 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; -import java.util.Map; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.codehaus.jackson.map.ObjectMapper; +import java.io.IOException; +import java.util.Map; + /** * Superclass for any type that maps to a potentially application-level query. * (e.g. Put, Get, Delete, Scan, Next, etc.) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java index 5c6f532c4f7..b1f1462f47c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java @@ -19,15 +19,15 @@ package org.apache.hadoop.hbase.client; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + @InterfaceAudience.Public @InterfaceStability.Evolving public abstract class OperationWithAttributes extends Operation implements Attributes { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Put.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Put.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java similarity index 95% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java index 65a50880898..e1cbe00ce51 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.RegionException; +import org.apache.hadoop.hbase.exceptions.RegionException; /** Thrown when a table can not be located */ @InterfaceAudience.Public diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Result.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Result.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java index 9e15bbb9ce4..0308f9d82fb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Result.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java @@ -19,6 +19,12 @@ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.KeyValue.SplitKeyValue; +import org.apache.hadoop.hbase.util.Bytes; + import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -29,12 +35,6 @@ import java.util.Map; import java.util.NavigableMap; import java.util.TreeMap; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.KeyValue.SplitKeyValue; -import org.apache.hadoop.hbase.util.Bytes; - /** * Single row result of a {@link Get} or {@link Scan} query.

* diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java index ef725438e99..560b33c8a69 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResultScanner.java @@ -18,12 +18,12 @@ */ package org.apache.hadoop.hbase.client; -import java.io.Closeable; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.Closeable; +import java.io.IOException; + /** * Interface for client-side scanning. * Go to {@link HTable} to obtain instances. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java index 4c1428885d0..f28fcd58cff 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java @@ -14,13 +14,13 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; + import java.io.IOException; import java.util.Date; import java.util.List; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; - /** * Exception thrown by HTable methods when an attempt to do something (like * commit changes) fails after a bunch of retries. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java index e6e8dd7dd85..65c4343ef94 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedWithDetailsException.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.util.Bytes; import java.io.PrintWriter; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Row.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Row.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Row.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Row.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java index 8a6e5a7e25c..26473f36198 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java @@ -17,17 +17,17 @@ */ package org.apache.hadoop.hbase.client; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.util.Bytes; + import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.util.Bytes; - /** * Performs multiple mutations atomically on a single row. * Currently {@link Put} and {@link Delete} are supported. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/Scan.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java index 85be8e684cc..15eb844f019 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java @@ -18,31 +18,30 @@ package org.apache.hadoop.hbase.client; -import java.io.IOException; -import java.net.UnknownHostException; - +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RemoteExceptionHandler; -import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.RegionServerStoppedException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.RequestConverter; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanResponse; -import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.net.DNS; -import com.google.protobuf.ServiceException; +import java.io.IOException; +import java.net.UnknownHostException; /** * Retries scanner operations such as create, next, etc. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java similarity index 95% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java index 08bc61c2b40..f782f2d3981 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.client; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; /** * Thrown when a scanner has timed out. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java index bc2a2083ac1..79a12e58b42 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ServerCallable.java @@ -19,6 +19,18 @@ package org.apache.hadoop.hbase.client; +import com.google.protobuf.ServiceException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; +import org.apache.hadoop.hbase.ipc.HBaseClientRPC; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.ipc.RemoteException; + import java.io.IOException; import java.lang.reflect.UndeclaredThrowableException; import java.net.ConnectException; @@ -27,19 +39,6 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HRegionLocation; -import org.apache.hadoop.hbase.ipc.HBaseClientRPC; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; -import org.apache.hadoop.ipc.RemoteException; - -import com.google.protobuf.ServiceException; - /** * Abstract class that implements {@link Callable}. Implementation stipulates * return type and method we actually invoke on remote Server. Usually diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHColumnDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHColumnDescriptor.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHColumnDescriptor.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHColumnDescriptor.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHRegionInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHRegionInfo.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHRegionInfo.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHRegionInfo.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/ZooKeeperKeepAliveConnection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZooKeeperKeepAliveConnection.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/ZooKeeperKeepAliveConnection.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZooKeeperKeepAliveConnection.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java index 272c0fc6510..2db0e7a443c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java @@ -19,20 +19,8 @@ package org.apache.hadoop.hbase.client.coprocessor; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.NavigableSet; -import java.util.TreeMap; -import java.util.concurrent.atomic.AtomicLong; - +import com.google.protobuf.ByteString; +import com.google.protobuf.Message; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -44,18 +32,25 @@ import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.coprocessor.ColumnInterpreter; +import org.apache.hadoop.hbase.ipc.BlockingRpcCallback; +import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateArgument; import org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse; import org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService; -import org.apache.hadoop.hbase.coprocessor.ColumnInterpreter; -import org.apache.hadoop.hbase.ipc.BlockingRpcCallback; -import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; -import com.google.protobuf.ByteString; -import com.google.protobuf.Message; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.NavigableMap; +import java.util.NavigableSet; +import java.util.TreeMap; +import java.util.concurrent.atomic.AtomicLong; /** * This client class is for invoking the aggregate functions deployed on the diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java index c1b6e351100..5186da8ff98 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/Batch.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hbase.client.coprocessor; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * A collection of interfaces and utilities used for interacting with custom RPC diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java index de8908e7970..016b44f43dc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/LongColumnInterpreter.java @@ -18,8 +18,6 @@ */ package org.apache.hadoop.hbase.client.coprocessor; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.KeyValue; @@ -28,6 +26,8 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.LongMsg; import org.apache.hadoop.hbase.util.Bytes; +import java.io.IOException; + /** * a concrete column interpreter implementation. The cell value is a Long value * and its promoted data type is also a Long value. For computing aggregation diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java index 07d55587474..8abd49c4bad 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/SecureBulkLoadClient.java @@ -26,7 +26,7 @@ import org.apache.hadoop.hbase.ipc.BlockingRpcCallback; import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos; -import org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint; +import org.apache.hadoop.hbase.security.SecureBulkLoadUtil; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.security.token.Token; @@ -170,6 +170,6 @@ public class SecureBulkLoadClient { } public Path getStagingPath(String bulkToken, byte[] family) throws IOException { - return SecureBulkLoadEndpoint.getStagingPath(table.getConfiguration(), bulkToken, family); + return SecureBulkLoadUtil.getStagingPath(table.getConfiguration(), bulkToken, family); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/package-info.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/package-info.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/coprocessor/package-info.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/package-info.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/metrics/ScanMetrics.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/package-info.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/package-info.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/package-info.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/package-info.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java index 3a40af8dee4..8a81e8fb387 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationAdmin.java @@ -18,10 +18,6 @@ */ package org.apache.hadoop.hbase.client.replication; -import java.io.Closeable; -import java.io.IOException; -import java.util.Map; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -33,6 +29,10 @@ import org.apache.hadoop.hbase.replication.ReplicationZookeeper; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException; +import java.io.Closeable; +import java.io.IOException; +import java.util.Map; + /** *

* This class provides the administrative interface to HBase cluster diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java index 2e83259bf9b..204bd53ac89 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/coprocessor/ColumnInterpreter.java @@ -19,16 +19,13 @@ package org.apache.hadoop.hbase.coprocessor; -import java.io.IOException; - +import com.google.protobuf.Message; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.client.coprocessor.AggregationClient; import org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter; -import com.google.protobuf.ByteString; -import com.google.protobuf.Message; +import java.io.IOException; /** * Defines how value for specific column is interpreted and provides utility @@ -47,9 +44,9 @@ import com.google.protobuf.Message; * . There is a conversion method * {@link ColumnInterpreter#castToReturnType(Object)} which takes a type and * returns a type. - * The {@link AggregateImplementation} uses PB messages to initialize the + * The AggregateImplementation uses PB messages to initialize the * user's ColumnInterpreter implementation, and for sending the responses - * back to {@link AggregationClient}. + * back to AggregationClient. * @param Cell value data type * @param Promoted data type * @param

PB message that is used to transport initializer specific bytes diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/AccessDeniedException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/AccessDeniedException.java similarity index 91% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/AccessDeniedException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/AccessDeniedException.java index b8c5d3b929c..3d759e8bd56 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/AccessDeniedException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/AccessDeniedException.java @@ -15,9 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.security; +package org.apache.hadoop.hbase.exceptions; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; /** * Exception thrown by access-related methods. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallerDisconnectedException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CallerDisconnectedException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallerDisconnectedException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CallerDisconnectedException.java index 63ce00cc9b2..d526d87ae5e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallerDisconnectedException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CallerDisconnectedException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.ipc; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClockOutOfSyncException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClockOutOfSyncException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ClockOutOfSyncException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClockOutOfSyncException.java index 1998593af04..2f716b76537 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ClockOutOfSyncException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClockOutOfSyncException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/ConstraintException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ConstraintException.java similarity index 90% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/ConstraintException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ConstraintException.java index 754b1c53896..b1486f5c336 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/ConstraintException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ConstraintException.java @@ -15,10 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.constraint; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.client.Put; /** @@ -29,7 +28,7 @@ import org.apache.hadoop.hbase.client.Put; * idempotent). */ @InterfaceAudience.Private -public class ConstraintException extends DoNotRetryIOException { +public class ConstraintException extends org.apache.hadoop.hbase.exceptions.DoNotRetryIOException { private static final long serialVersionUID = 1197446454511704140L; public ConstraintException() { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CoprocessorException.java similarity index 93% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CoprocessorException.java index 8597e3f6a9e..a66591ea1e7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CoprocessorException.java @@ -16,11 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.coprocessor; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; /** * Thrown if a coprocessor encounters any exception. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CorruptHFileException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptHFileException.java similarity index 84% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CorruptHFileException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptHFileException.java index 818e3826dbc..61288ea86b3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CorruptHFileException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptHFileException.java @@ -15,10 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.io.hfile; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; /** * This exception is thrown when attempts to read an HFile fail due to corruption or truncation @@ -28,11 +28,11 @@ import org.apache.hadoop.hbase.DoNotRetryIOException; public class CorruptHFileException extends DoNotRetryIOException { private static final long serialVersionUID = 1L; - CorruptHFileException(String m, Throwable t) { + public CorruptHFileException(String m, Throwable t) { super(m, t); } - CorruptHFileException(String m) { + public CorruptHFileException(String m) { super(m); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/CorruptedSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptedSnapshotException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/CorruptedSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptedSnapshotException.java index 2e16c1b37a4..112cf2beb17 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/CorruptedSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/CorruptedSnapshotException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/DeserializationException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/DeserializationException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java index fa69f26e4b3..b8967419170 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/DeserializationException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DeserializationException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java similarity index 93% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java index 96d027ad7c5..a539a6650e0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/DoNotRetryIOException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DoNotRetryIOException.java @@ -16,14 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; /** * Subclass if exception is not meant to be retried: e.g. - * {@link UnknownScannerException} + * {@link org.apache.hadoop.hbase.exceptions.UnknownScannerException} */ @InterfaceAudience.Public @InterfaceStability.Stable diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DroppedSnapshotException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DroppedSnapshotException.java index 76aae2a3b82..768470d8e74 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/DroppedSnapshotException.java @@ -12,12 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown during flush if the possibility snapshot content was not properly diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ExportSnapshotException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ExportSnapshotException.java index 76a83cd55e3..60638d66d33 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ExportSnapshotException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FailedLogCloseException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedLogCloseException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FailedLogCloseException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedLogCloseException.java index 8fb8f085486..c3a0d7baadc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FailedLogCloseException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedLogCloseException.java @@ -16,12 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver.wal; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; +import java.io.IOException; + /** * Thrown when we fail close of the write-ahead-log file. * Package private. Only used inside this package. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/FailedSanityCheckException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedSanityCheckException.java similarity index 89% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/FailedSanityCheckException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedSanityCheckException.java index b62d466fc38..e116283498d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/FailedSanityCheckException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FailedSanityCheckException.java @@ -15,12 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; /** * Exception thrown if a mutation fails sanity checks. */ -public class FailedSanityCheckException extends DoNotRetryIOException { +public class FailedSanityCheckException extends org.apache.hadoop.hbase.exceptions.DoNotRetryIOException { private static final long serialVersionUID = 1788783640409186240L; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FileSystemVersionException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FileSystemVersionException.java index 8bd974c6529..2b0e399c513 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/FileSystemVersionException.java @@ -17,7 +17,7 @@ * limitations under the License. */ -package org.apache.hadoop.hbase.util; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java index 28fe3376038..283cb093f85 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseIOException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseIOException.java index 193dc911e36..37c2b68a509 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseIOException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseIOException.java @@ -15,13 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * All hbase specific IOExceptions should be subclasses of HBaseIOException */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/HBaseSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/HBaseSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java index 70a884255a9..f25ed11724e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/HBaseSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/HBaseSnapshotException.java @@ -15,11 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.HBaseIOException; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/InvalidFamilyOperationException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidFamilyOperationException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/InvalidFamilyOperationException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidFamilyOperationException.java index c3db9432cb6..7fa1ada4f65 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/InvalidFamilyOperationException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidFamilyOperationException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown if a request is table schema modification is requested but * made for an invalid family name. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/InvalidHFileException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidHFileException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/InvalidHFileException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidHFileException.java index b68929bf628..012699dbcc5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/InvalidHFileException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/InvalidHFileException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.io.hfile; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LeaseException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LeaseException.java similarity index 91% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LeaseException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LeaseException.java index 16166ae7927..1d1cece986c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LeaseException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LeaseException.java @@ -16,10 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; /** * Reports a problem with a lease diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/LockTimeoutException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LockTimeoutException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/LockTimeoutException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LockTimeoutException.java index a3bbbba3ede..9013312a68a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LockTimeoutException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/LockTimeoutException.java @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/MasterNotRunningException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterNotRunningException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/MasterNotRunningException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterNotRunningException.java index 8c0a4aa70ba..090c1242f13 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/MasterNotRunningException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterNotRunningException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown if the master is not running */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NoSuchColumnFamilyException.java similarity index 92% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NoSuchColumnFamilyException.java index 3fc7e576f9d..93510fe5657 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NoSuchColumnFamilyException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NoSuchColumnFamilyException.java @@ -16,10 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; /** * Thrown if request for nonexistent column family. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/NotAllMetaRegionsOnlineException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotAllMetaRegionsOnlineException.java similarity index 94% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/NotAllMetaRegionsOnlineException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotAllMetaRegionsOnlineException.java index 49bc93505b3..c772c05047f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/NotAllMetaRegionsOnlineException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotAllMetaRegionsOnlineException.java @@ -17,11 +17,10 @@ * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DoNotRetryIOException; /** * Thrown when an operation requires the root and all meta regions to be online diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotServingRegionException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotServingRegionException.java index 47d0a26b820..4eac75e434f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/NotServingRegionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/NotServingRegionException.java @@ -16,14 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; +import java.io.IOException; + /** * Thrown by a region server if it is sent a request for a region it is not * serving. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OrphanHLogAfterSplitException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OrphanHLogAfterSplitException.java index 640bffad140..94410012f75 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OrphanHLogAfterSplitException.java @@ -16,12 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver.wal; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; +import java.io.IOException; + @InterfaceAudience.Private public class OrphanHLogAfterSplitException extends IOException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/OutOfOrderScannerNextException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OutOfOrderScannerNextException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/OutOfOrderScannerNextException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OutOfOrderScannerNextException.java index b84e705fb14..e34cffcadb3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/OutOfOrderScannerNextException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/OutOfOrderScannerNextException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/PleaseHoldException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/PleaseHoldException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java index 66fe5fbf296..31bd3430503 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/PleaseHoldException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/PleaseHoldException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionAlreadyInTransitionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionAlreadyInTransitionException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionAlreadyInTransitionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionAlreadyInTransitionException.java index 01ada319a1f..a2443642add 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionAlreadyInTransitionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionAlreadyInTransitionException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * This exception is thrown when a region server is asked to open or close * a region but it's already processing it diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RegionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java index 8c1d3656998..7437edac91f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionException.java @@ -16,12 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; + +import java.io.IOException; /** * Thrown when something happens related to region handling. * Subclasses have to be more specific. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionMovedException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionMovedException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RegionMovedException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionMovedException.java index cf4ddcc5192..6597648f663 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionMovedException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionMovedException.java @@ -15,12 +15,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.ipc.RemoteException; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerRunningException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerRunningException.java index e8bce88083e..2ed06541bd5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerRunningException.java @@ -16,12 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; +import java.io.IOException; + /** * Thrown if the region server log directory exists (which indicates another * region server is running at the same address) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerStoppedException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerStoppedException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerStoppedException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerStoppedException.java index 11ec0723b4e..5ab1aed738a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerStoppedException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionServerStoppedException.java @@ -16,12 +16,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; +import java.io.IOException; + /** * Thrown by the region server when it is in shutting down state. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTooBusyException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionTooBusyException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTooBusyException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionTooBusyException.java index f5217bcdcf3..516eb42455c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionTooBusyException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RegionTooBusyException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import java.io.IOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RestoreSnapshotException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RestoreSnapshotException.java index ff40783844a..be12e920694 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/RestoreSnapshotException.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerNotRunningYetException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ServerNotRunningYetException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerNotRunningYetException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ServerNotRunningYetException.java index aa36b4c158d..5da9c766b9b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerNotRunningYetException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ServerNotRunningYetException.java @@ -17,12 +17,12 @@ * limitations under the License. */ -package org.apache.hadoop.hbase.ipc; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; +import java.io.IOException; + @SuppressWarnings("serial") @InterfaceAudience.Private public class ServerNotRunningYetException extends IOException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotCreationException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotCreationException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotCreationException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotCreationException.java index 69dc3d031dc..6d3e9c46573 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotCreationException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotCreationException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDoesNotExistException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotDoesNotExistException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDoesNotExistException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotDoesNotExistException.java index eb02ece2c51..9624f5aeee1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDoesNotExistException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotDoesNotExistException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotExistsException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotExistsException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotExistsException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotExistsException.java index 2ce2d318308..76e2e74a2a1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotExistsException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/SnapshotExistsException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableExistsException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableExistsException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/TableExistsException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableExistsException.java index 5c94dbd2fcc..26b952dd6ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableExistsException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableExistsException.java @@ -12,13 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown when a table exists but should not */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java index bc8bc7fc194..b500f102bc8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableInfoMissingException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotDisabledException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotDisabledException.java index 1273bd87d79..180c69db351 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotDisabledException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotDisabledException.java @@ -16,14 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; +import java.io.IOException; + /** * Thrown if a table should be offline but is not */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotEnabledException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotEnabledException.java index b3c31b40b6d..3c90fde8c74 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotEnabledException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotEnabledException.java @@ -16,14 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; +import java.io.IOException; + /** * Thrown if a table should be enabled but is not */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotFoundException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotFoundException.java index fbd3db452b4..3e6e22c9058 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TableNotFoundException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TablePartiallyOpenException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TablePartiallyOpenException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TablePartiallyOpenException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TablePartiallyOpenException.java index 6b27be8ab06..040aeacc4b4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TablePartiallyOpenException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/TablePartiallyOpenException.java @@ -15,14 +15,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.util.Bytes; +import java.io.IOException; + /** * Thrown if a table should be online/offline but is partially open */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/UnknownProtocolException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownProtocolException.java similarity index 89% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/UnknownProtocolException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownProtocolException.java index 36af9238987..4c4181b19b4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/UnknownProtocolException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownProtocolException.java @@ -17,15 +17,13 @@ * limitations under the License. */ -package org.apache.hadoop.hbase.ipc; - -import org.apache.hadoop.hbase.DoNotRetryIOException; +package org.apache.hadoop.hbase.exceptions; /** * An error requesting an RPC protocol that the server is not serving. */ @SuppressWarnings("serial") -public class UnknownProtocolException extends DoNotRetryIOException { +public class UnknownProtocolException extends org.apache.hadoop.hbase.exceptions.DoNotRetryIOException { private Class protocol; public UnknownProtocolException(String mesg) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownRegionException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownRegionException.java index 046670ff79b..f751cb0fb57 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownRegionException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownScannerException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownScannerException.java index 856c029c408..486d65bb5f0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/UnknownScannerException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownScannerException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/UnknownSnapshotException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownSnapshotException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/UnknownSnapshotException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownSnapshotException.java index a6b381fe3b3..e8b235320cc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/UnknownSnapshotException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/UnknownSnapshotException.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.snapshot; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/WrongRegionException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/WrongRegionException.java index dfc6aabbb39..2a88bfefa94 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/WrongRegionException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase.regionserver; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown when a request contains a key which is not part of this region */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/YouAreDeadException.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/YouAreDeadException.java index 76fc841d036..5773c1a6e42 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/YouAreDeadException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * This exception is thrown by the master when a region server reports and is * already being processed as dead. This can happen when a region server loses diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ZooKeeperConnectionException.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ZooKeeperConnectionException.java index feedff34111..c653c89c3fc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ZooKeeperConnectionException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ZooKeeperConnectionException.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; - -import java.io.IOException; +package org.apache.hadoop.hbase.exceptions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.io.IOException; + /** * Thrown if the client can't connect to zookeeper */ diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/EventType.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/EventType.java new file mode 100644 index 00000000000..e802672e5b9 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/EventType.java @@ -0,0 +1,115 @@ +/** + * + * 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.hadoop.hbase.executor; + +import org.apache.hadoop.classification.InterfaceAudience; + +/** + * List of all HBase event handler types. Event types are named by a + * convention: event type names specify the component from which the event + * originated and then where its destined -- e.g. RS2ZK_ prefix means the + * event came from a regionserver destined for zookeeper -- and then what + * the even is; e.g. REGION_OPENING. + * + *

We give the enums indices so we can add types later and keep them + * grouped together rather than have to add them always to the end as we + * would have to if we used raw enum ordinals. + */ +@InterfaceAudience.Private +public enum EventType { + // Messages originating from RS (NOTE: there is NO direct communication from + // RS to Master). These are a result of RS updates into ZK. + // RS_ZK_REGION_CLOSING (1), // It is replaced by M_ZK_REGION_CLOSING(HBASE-4739) + RS_ZK_REGION_CLOSED (2, ExecutorType.MASTER_CLOSE_REGION), // RS has finished closing a region + RS_ZK_REGION_OPENING (3, null), // RS is in process of opening a region + RS_ZK_REGION_OPENED (4, ExecutorType.MASTER_OPEN_REGION), // RS has finished opening a region + RS_ZK_REGION_SPLITTING (5, null), // RS has started a region split + RS_ZK_REGION_SPLIT (6, ExecutorType.MASTER_SERVER_OPERATIONS), // RS split has completed. + RS_ZK_REGION_FAILED_OPEN (7, ExecutorType.MASTER_CLOSE_REGION), // RS failed to open a region + + // Messages originating from Master to RS + M_RS_OPEN_REGION (20, ExecutorType.RS_OPEN_REGION), // Master asking RS to open a region + M_RS_OPEN_ROOT (21, ExecutorType.RS_OPEN_ROOT), // Master asking RS to open root + M_RS_OPEN_META (22, ExecutorType.RS_OPEN_META), // Master asking RS to open meta + M_RS_CLOSE_REGION (23, ExecutorType.RS_CLOSE_REGION), // Master asking RS to close a region + M_RS_CLOSE_ROOT (24, ExecutorType.RS_CLOSE_ROOT), // Master asking RS to close root + M_RS_CLOSE_META (25, ExecutorType.RS_CLOSE_META), // Master asking RS to close meta + + // Messages originating from Client to Master + C_M_DELETE_TABLE (40, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to delete a table + C_M_DISABLE_TABLE (41, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to disable a table + C_M_ENABLE_TABLE (42, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to enable a table + C_M_MODIFY_TABLE (43, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to modify a table + C_M_ADD_FAMILY (44, null), // Client asking Master to add family to table + C_M_DELETE_FAMILY (45, null), // Client asking Master to delete family of table + C_M_MODIFY_FAMILY (46, null), // Client asking Master to modify family of table + C_M_CREATE_TABLE (47, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to create a table + C_M_SNAPSHOT_TABLE (48, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to snapshot an offline table + C_M_RESTORE_SNAPSHOT (49, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to restore a snapshot + + // Updates from master to ZK. This is done by the master and there is + // nothing to process by either Master or RS + M_ZK_REGION_OFFLINE (50, null), // Master adds this region as offline in ZK + M_ZK_REGION_CLOSING (51, null), // Master adds this region as closing in ZK + + // Master controlled events to be executed on the master + M_SERVER_SHUTDOWN (70, ExecutorType.MASTER_SERVER_OPERATIONS), // Master is processing shutdown of a RS + M_META_SERVER_SHUTDOWN (72, ExecutorType.MASTER_META_SERVER_OPERATIONS), // Master is processing shutdown of RS hosting a meta region (-ROOT- or .META.). + M_MASTER_RECOVERY (73, ExecutorType.MASTER_SERVER_OPERATIONS), // Master is processing recovery of regions found in ZK RIT + + // RS controlled events to be executed on the RS + RS_PARALLEL_SEEK (80, ExecutorType.RS_PARALLEL_SEEK); + + private final int code; + private final ExecutorType executor; + + /** + * Constructor + */ + EventType(final int code, final ExecutorType executor) { + this.code = code; + this.executor = executor; + } + + public int getCode() { + return this.code; + } + + public static EventType get(final int code) { + // Is this going to be slow? Its used rare but still... + for (EventType et: EventType.values()) { + if (et.getCode() == code) return et; + } + throw new IllegalArgumentException("Unknown code " + code); + } + + public boolean isOnlineSchemaChangeSupported() { + return ( + this.equals(EventType.C_M_ADD_FAMILY) || + this.equals(EventType.C_M_DELETE_FAMILY) || + this.equals(EventType.C_M_MODIFY_FAMILY) || + this.equals(EventType.C_M_MODIFY_TABLE) + ); + } + + ExecutorType getExecutorServiceType() { + return this.executor; + } +} diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java new file mode 100644 index 00000000000..dd53657ca99 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java @@ -0,0 +1,57 @@ +/** + * + * 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.hadoop.hbase.executor; + +import org.apache.hadoop.classification.InterfaceAudience; + +/** + * The following is a list of all executor types, both those that run in the + * master and those that run in the regionserver. + */ +@InterfaceAudience.Private +public enum ExecutorType { + + // Master executor services + MASTER_CLOSE_REGION (1), + MASTER_OPEN_REGION (2), + MASTER_SERVER_OPERATIONS (3), + MASTER_TABLE_OPERATIONS (4), + MASTER_RS_SHUTDOWN (5), + MASTER_META_SERVER_OPERATIONS (6), + + // RegionServer executor services + RS_OPEN_REGION (20), + RS_OPEN_ROOT (21), + RS_OPEN_META (22), + RS_CLOSE_REGION (23), + RS_CLOSE_ROOT (24), + RS_CLOSE_META (25), + RS_PARALLEL_SEEK (26); + + ExecutorType(int value) {} + + /** + * @param serverName + * @return Conflation of the executor type and the passed servername. + */ + String getExecutorName(String serverName) { + return this.toString() + "-" + serverName.replace("%", "%%"); + } +} \ No newline at end of file diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java index 26282db5e54..9ad806555e0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryComparator.java @@ -19,14 +19,13 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A binary comparator which lexicographically compares against the specified * byte array using {@link org.apache.hadoop.hbase.util.Bytes#compareTo(byte[], byte[])}. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java index 575ff1e7c46..36ca2dd2c5d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BinaryPrefixComparator.java @@ -19,14 +19,13 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A comparator which compares against a specified byte array, but only compares * up to the length of this byte array. For the rest it is similar to diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java index 73afedca461..729e831891c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/BitComparator.java @@ -19,13 +19,12 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A bit comparator which performs the specified bitwise operation on each of the bytes * with the specified byte array. Then returns whether the result is non-zero. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java index 86ad77ca85e..6c0d6ec02c9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ByteArrayComparable.java @@ -18,14 +18,13 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.ByteString; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.ByteString; - /** Base class for byte array comparators */ @InterfaceAudience.Public diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java index d775177d62c..96253f1cfed 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnCountGetFilter.java @@ -19,17 +19,16 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.InvalidProtocolBufferException; - /** * Simple filter that returns first N columns on row only. * This filter was written to test filters in Get and as soon as it gets @@ -87,7 +86,7 @@ public class ColumnCountGetFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link ColumnCountGetFilter} instance * @return An instance of {@link ColumnCountGetFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static ColumnCountGetFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java index d58429fb627..625eac60d8c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPaginationFilter.java @@ -18,16 +18,15 @@ */ package org.apache.hadoop.hbase.filter; -import java.util.ArrayList; - -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; - import com.google.common.base.Preconditions; import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; + +import java.util.ArrayList; /** * A filter, based on the ColumnCountGetFilter, takes two arguments: limit and offset. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java index 226b2b1d3a2..289890aa063 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnPrefixFilter.java @@ -19,19 +19,18 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * This filter is used for selecting only those keys with columns that matches * a particular prefix. For example, if prefix is 'an', it will pass keys with @@ -101,7 +100,7 @@ public class ColumnPrefixFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link ColumnPrefixFilter} instance * @return An instance of {@link ColumnPrefixFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static ColumnPrefixFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java index a275d7d28da..6094b254044 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ColumnRangeFilter.java @@ -19,19 +19,18 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * This filter is used for selecting only those keys with columns that are * between minColumn to maxColumn. For example, if minColumn is 'an', and diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java index 8c1a0ca940a..0c239fdd512 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/CompareFilter.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; @@ -28,8 +29,6 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.CompareType; import org.apache.hadoop.hbase.util.Bytes; import java.util.ArrayList; - -import com.google.common.base.Preconditions; /** * This is a generic filter to be used to filter by comparison. It takes an * operator (equal, greater, not equal, etc) and a byte [] comparator. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java index 3b286d97ab3..62410ae2b47 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java @@ -18,24 +18,23 @@ */ package org.apache.hadoop.hbase.filter; -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.ArrayList; - +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; /** * A filter for adding inter-column timestamp matching diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java index fb7af8db458..46f9f45423b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FamilyFilter.java @@ -19,15 +19,14 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - import java.io.IOException; import java.util.ArrayList; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/Filter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/Filter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java index c600306c89c..6646e0accdb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/Filter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/Filter.java @@ -21,8 +21,8 @@ package org.apache.hadoop.hbase.filter; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import java.util.List; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java index fd31b028400..0b635dadea2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterBase.java @@ -22,8 +22,8 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.KeyValue; -import java.util.List; import java.util.ArrayList; +import java.util.List; /** * Abstract base class to help you implement new Filters. Common "ignore" or NOOP type diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java index 0d218538a7d..07166a3a8fa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterList.java @@ -18,18 +18,17 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; -import com.google.protobuf.InvalidProtocolBufferException; - import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java index 1f09cfb9ee9..d37f337b749 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FilterWrapper.java @@ -19,18 +19,16 @@ */ package org.apache.hadoop.hbase.filter; -import java.io.IOException; -import java.util.List; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; - -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.util.List; /** * This is a Filter wrapper class which is used in the server side. Some filter @@ -65,7 +63,7 @@ public class FilterWrapper extends Filter { /** * @param pbBytes A pb serialized {@link FilterWrapper} instance * @return An instance of {@link FilterWrapper} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static FilterWrapper parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java index 9f59ca24516..0189f75ca80 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.java @@ -18,17 +18,16 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A filter that will only return the first KV from each row. *

@@ -85,7 +84,7 @@ public class FirstKeyOnlyFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link FirstKeyOnlyFilter} instance * @return An instance of {@link FirstKeyOnlyFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static FirstKeyOnlyFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java index f4794207cac..34e2b6962db 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FirstKeyValueMatchingQualifiersFilter.java @@ -22,8 +22,8 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java index 00d7b124f22..8d62e7149f7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java @@ -17,21 +17,20 @@ */ package org.apache.hadoop.hbase.filter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * Filters data based on fuzzy row key. Performs fast-forwards during scanning. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java index 6fb1a6241e6..b6f1f12035d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InclusiveStopFilter.java @@ -19,19 +19,17 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A Filter that stops after the given row. There is no "RowStopFilter" because * the Scan spec allows you to specify a stop row. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java index 3bb1390322a..ba5172fb27c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/KeyOnlyFilter.java @@ -19,17 +19,16 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A filter that will only return the key component of each KV (the value will * be rewritten as empty). diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java index be165aa6f74..4d1ad0d9318 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java @@ -17,20 +17,19 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - +import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.TreeSet; -import java.util.ArrayList; /** * This filter is used for selecting only those keys with columns that matches diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java index af27d60d4c7..b262bd1aa13 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/NullComparator.java @@ -19,13 +19,12 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; -import com.google.protobuf.InvalidProtocolBufferException; - /** * A binary comparator which lexicographically compares against the specified * byte array using {@link org.apache.hadoop.hbase.util.Bytes#compareTo(byte[], byte[])}. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java index 2e4628819a4..254dcbea657 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PageFilter.java @@ -18,16 +18,14 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import java.util.ArrayList; - -import com.google.common.base.Preconditions; -import com.google.protobuf.InvalidProtocolBufferException; /** * Implementation of Filter interface that limits results to a specific page * size. It terminates scanning once the number of filter-passed rows is > diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java index 449104ceee1..2e06df9c202 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseConstants.java @@ -18,11 +18,11 @@ */ package org.apache.hadoop.hbase.filter; -import java.nio.ByteBuffer; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.nio.ByteBuffer; + /** * ParseConstants holds a bunch of constants related to parsing Filter Strings * Used by {@link ParseFilter} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java index 02100d7901b..bb9b2aa0ce6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java @@ -18,12 +18,6 @@ */ package org.apache.hadoop.hbase.filter; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.nio.ByteBuffer; -import java.nio.charset.CharacterCodingException; -import java.util.*; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -32,6 +26,18 @@ import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.util.Bytes; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.nio.charset.CharacterCodingException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EmptyStackException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + /** * This class allows a user to specify a filter via a string * The string is parsed using the methods of this class and diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java index 9c37b3e685c..eb93cdf6a66 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java @@ -19,19 +19,17 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.util.Bytes; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * Pass results that have same row prefix. */ @@ -89,7 +87,7 @@ public class PrefixFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link PrefixFilter} instance * @return An instance of {@link PrefixFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static PrefixFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java index 24dcb60a97e..c3cbe233593 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/QualifierFilter.java @@ -19,16 +19,15 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - import java.io.IOException; import java.util.ArrayList; @@ -91,7 +90,7 @@ public class QualifierFilter extends CompareFilter { /** * @param pbBytes A pb serialized {@link QualifierFilter} instance * @return An instance of {@link QualifierFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static QualifierFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java index 97243695be1..d5968ce8682 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RandomRowFilter.java @@ -19,15 +19,14 @@ package org.apache.hadoop.hbase.filter; -import java.util.Random; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; +import java.util.Random; /** * A filter that includes rows based on a chance. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java index 96c35c38812..6e932b41896 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java @@ -18,17 +18,15 @@ */ package org.apache.hadoop.hbase.filter; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; -import org.apache.hadoop.hbase.util.Bytes; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - -import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; +import org.apache.hadoop.hbase.util.Bytes; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java index 0226a138b7c..635769d63cb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RowFilter.java @@ -19,18 +19,17 @@ package org.apache.hadoop.hbase.filter; -import java.io.IOException; -import java.util.ArrayList; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.util.ArrayList; /** * This filter is used to filter based on the key. It takes an operator diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java index 1daa8022057..86bbe74085e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.java @@ -19,20 +19,19 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - import java.io.IOException; import java.util.ArrayList; -import java.util.List; import java.util.Iterator; +import java.util.List; /** * A {@link Filter} that checks a single column value, but does not emit the diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java index 7f8ad27a859..6bc231f5d4d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SingleColumnValueFilter.java @@ -19,13 +19,16 @@ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; @@ -36,10 +39,6 @@ import org.apache.hadoop.hbase.util.Bytes; import java.io.IOException; import java.util.ArrayList; -import com.google.common.base.Preconditions; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; - /** * This filter is used to filter cells based on value. It takes a {@link CompareFilter.CompareOp} * operator (equal, greater, not equal, etc), and either a byte [] value or @@ -325,7 +324,7 @@ public class SingleColumnValueFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link SingleColumnValueFilter} instance * @return An instance of {@link SingleColumnValueFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static SingleColumnValueFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java index 0b39284d5d5..5d1f54d98a0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SkipFilter.java @@ -19,19 +19,15 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - -import java.io.DataInput; -import java.io.DataOutput; import java.io.IOException; -import java.util.List; /** * A wrapper filter that filters an entire row if any of the KeyValue checks do diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java index 1ed08a2a78a..ad9ffdc6ade 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/SubstringComparator.java @@ -18,14 +18,13 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.Bytes; -import com.google.protobuf.InvalidProtocolBufferException; - /** * This comparator is for use with SingleColumnValueFilter, for filtering based on diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java index 20f5d25ec31..6a8a76bf79f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java @@ -17,19 +17,18 @@ */ package org.apache.hadoop.hbase.filter; +import com.google.common.base.Preconditions; +import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; + import java.util.ArrayList; import java.util.List; import java.util.TreeSet; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; - -import com.google.common.base.Preconditions; -import com.google.protobuf.InvalidProtocolBufferException; - /** * Filter that returns only cells whose timestamp (version) is * in the specified list of timestamps (versions). diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java index de100f3ac0a..786cfc91165 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ValueFilter.java @@ -19,15 +19,14 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - import java.io.IOException; import java.util.ArrayList; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java index f048570495c..859425b82ad 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/WhileMatchFilter.java @@ -19,19 +19,15 @@ package org.apache.hadoop.hbase.filter; +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -import com.google.protobuf.InvalidProtocolBufferException; - -import java.io.DataInput; -import java.io.DataOutput; import java.io.IOException; -import java.util.List; /** * A wrapper filter that returns true from {@link #filterAllRemaining()} as soon @@ -107,7 +103,7 @@ public class WhileMatchFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link WhileMatchFilter} instance * @return An instance of {@link WhileMatchFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see #toByteArray */ public static WhileMatchFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/filter/package-info.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/package-info.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/filter/package-info.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/filter/package-info.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcCallback.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcCallback.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcCallback.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcCallback.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java similarity index 88% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java index d3d92e2c9b5..b998d4127cc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/CoprocessorRpcChannel.java @@ -18,7 +18,14 @@ package org.apache.hadoop.hbase.ipc; -import com.google.protobuf.*; +import com.google.protobuf.BlockingRpcChannel; +import com.google.protobuf.Descriptors; +import com.google.protobuf.Message; +import com.google.protobuf.RpcCallback; +import com.google.protobuf.RpcChannel; +import com.google.protobuf.RpcController; +import com.google.protobuf.Service; +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java index ed44a6d4351..737346b0252 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java @@ -19,6 +19,50 @@ package org.apache.hadoop.hbase.ipc; +import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.Message; +import com.google.protobuf.Message.Builder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.IpcProtocol; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ConnectionHeader; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcException; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestBody; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestHeader; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseBody; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader.Status; +import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation; +import org.apache.hadoop.hbase.protobuf.generated.Tracing.RPCTInfo; +import org.apache.hadoop.hbase.security.AuthMethod; +import org.apache.hadoop.hbase.security.HBaseSaslRpcClient; +import org.apache.hadoop.hbase.security.KerberosInfo; +import org.apache.hadoop.hbase.security.TokenInfo; +import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.security.token.AuthenticationTokenIdentifier; +import org.apache.hadoop.hbase.security.token.AuthenticationTokenSelector; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.hbase.util.Pair; +import org.apache.hadoop.hbase.util.PoolMap; +import org.apache.hadoop.hbase.util.PoolMap.PoolType; +import org.apache.hadoop.io.IOUtils; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.ipc.RemoteException; +import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.security.SecurityUtil; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.TokenIdentifier; +import org.apache.hadoop.security.token.TokenSelector; +import org.cloudera.htrace.Span; +import org.cloudera.htrace.Trace; + +import javax.net.SocketFactory; +import javax.security.sasl.SaslException; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.DataInputStream; @@ -47,52 +91,6 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; -import javax.net.SocketFactory; -import javax.security.sasl.SaslException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.IpcProtocol; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcException; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestBody; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseBody; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader.Status; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ConnectionHeader; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestHeader; -import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation; -import org.apache.hadoop.hbase.protobuf.generated.Tracing.RPCTInfo; -import org.apache.hadoop.hbase.security.HBaseSaslRpcClient; -import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.AuthMethod; -import org.apache.hadoop.hbase.security.KerberosInfo; -import org.apache.hadoop.hbase.security.TokenInfo; -import org.apache.hadoop.hbase.security.User; -import org.apache.hadoop.hbase.security.token.AuthenticationTokenIdentifier; -import org.apache.hadoop.hbase.security.token.AuthenticationTokenSelector; -import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; -import org.apache.hadoop.hbase.util.Pair; -import org.apache.hadoop.hbase.util.PoolMap; -import org.apache.hadoop.hbase.util.PoolMap.PoolType; -import org.apache.hadoop.io.IOUtils; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.ipc.RemoteException; -import org.apache.hadoop.net.NetUtils; -import org.apache.hadoop.security.SecurityUtil; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.security.token.Token; -import org.apache.hadoop.security.token.TokenIdentifier; -import org.apache.hadoop.security.token.TokenSelector; -import org.cloudera.htrace.Span; -import org.cloudera.htrace.Trace; - -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Message; -import com.google.protobuf.Message.Builder; - /** A client for an IPC service. IPC calls take a single Protobuf message as a * parameter, and return a single Protobuf message as their value. A service runs on @@ -101,7 +99,7 @@ import com.google.protobuf.Message.Builder; *

This is the org.apache.hadoop.ipc.Client renamed as HBaseClient and * moved into this package so can access package-private methods. * - * @see HBaseServer + * See HBaseServer */ @InterfaceAudience.Private public class HBaseClient { @@ -846,8 +844,8 @@ public class HBaseClient { private void writeRpcHeader(OutputStream outStream) throws IOException { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(outStream)); // Write out the header, version and authentication method - out.write(HBaseServer.HEADER.array()); - out.write(HBaseServer.CURRENT_VERSION); + out.write(HConstants.RPC_HEADER.array()); + out.write(HConstants.CURRENT_VERSION); authMethod.write(out); out.flush(); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java similarity index 95% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java index 16451c496ef..d457d5a9e9b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClientRPC.java @@ -19,16 +19,6 @@ package org.apache.hadoop.hbase.ipc; -import java.io.IOException; -import java.lang.reflect.Proxy; -import java.net.ConnectException; -import java.net.InetSocketAddress; -import java.net.SocketTimeoutException; -import java.util.HashMap; -import java.util.Map; - -import javax.net.SocketFactory; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -36,9 +26,11 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.IpcProtocol; import org.apache.hadoop.hbase.client.RetriesExhaustedException; -import org.apache.hadoop.hbase.security.User; -import org.apache.hadoop.net.NetUtils; -import org.apache.hadoop.util.ReflectionUtils; + +import java.io.IOException; +import java.net.ConnectException; +import java.net.InetSocketAddress; +import java.net.SocketTimeoutException; /** * An RPC implementation. This class provides the client side. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java index 6971b34999b..de59dd2d4b1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/MasterCoprocessorRpcChannel.java @@ -18,8 +18,9 @@ package org.apache.hadoop.hbase.ipc; -import java.io.IOException; - +import com.google.protobuf.ByteString; +import com.google.protobuf.Descriptors; +import com.google.protobuf.Message; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -29,9 +30,7 @@ import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceResponse; -import com.google.protobuf.ByteString; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Message; +import java.io.IOException; /** * Provides clients with an RPC connection to call coprocessor endpoint {@link com.google.protobuf.Service}s diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java index 92bb807eec6..3e3d8023a02 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcClientEngine.java @@ -19,16 +19,8 @@ package org.apache.hadoop.hbase.ipc; -import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.net.InetSocketAddress; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import javax.net.SocketFactory; - +import com.google.protobuf.Message; +import com.google.protobuf.ServiceException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -37,8 +29,13 @@ import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestBody; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.ipc.RemoteException; -import com.google.protobuf.Message; -import com.google.protobuf.ServiceException; +import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.net.InetSocketAddress; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class ProtobufRpcClientEngine implements RpcClientEngine { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RegionCoprocessorRpcChannel.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java similarity index 96% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java index 157d2ae73f0..cbdbcff2a3e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientEngine.java @@ -22,7 +22,6 @@ package org.apache.hadoop.hbase.ipc; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.IpcProtocol; -import org.apache.hadoop.hbase.security.User; import java.io.IOException; import java.net.InetSocketAddress; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerRpcController.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ServerRpcController.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerRpcController.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/ServerRpcController.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionState.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/master/RegionState.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionState.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/master/RegionState.java index e927d4109e5..c29c699d0e6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionState.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/master/RegionState.java @@ -17,17 +17,17 @@ */ package org.apache.hadoop.hbase.master; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.HRegionInfo; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos; + import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Date; import java.util.concurrent.atomic.AtomicLong; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos; - /** * State of a Region while undergoing transitions. * Region state cannot be modified except the stamp field. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java similarity index 95% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java index ae3be098662..fb1f5a90dca 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java @@ -17,27 +17,15 @@ */ package org.apache.hadoop.hbase.protobuf; -import static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.NavigableMap; -import java.util.NavigableSet; -import java.util.TreeMap; - -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; +import com.google.protobuf.RpcChannel; +import com.google.protobuf.Service; +import com.google.protobuf.ServiceException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; @@ -60,6 +48,8 @@ import org.apache.hadoop.hbase.client.Row; import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.metrics.ScanMetrics; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.io.TimeRange; @@ -76,13 +66,8 @@ import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoRespo import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetStoreFileRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetStoreFileResponse; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.SplitRegionRequest; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.UUID; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry.WALEdit.FamilyScope; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry.WALKey; import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest; @@ -109,9 +94,6 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.Re import org.apache.hadoop.hbase.protobuf.generated.MapReduceProtos; import org.apache.hadoop.hbase.protobuf.generated.MasterAdminProtos.CreateTableRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetTableDescriptorsResponse; -import org.apache.hadoop.hbase.regionserver.wal.HLog; -import org.apache.hadoop.hbase.regionserver.wal.HLogKey; -import org.apache.hadoop.hbase.regionserver.wal.WALEdit; import org.apache.hadoop.hbase.security.access.Permission; import org.apache.hadoop.hbase.security.access.TablePermission; import org.apache.hadoop.hbase.security.access.UserPermission; @@ -123,15 +105,23 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.security.token.Token; import org.apache.hbase.Cell; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Lists; -import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.Message; -import com.google.protobuf.RpcChannel; -import com.google.protobuf.Service; -import com.google.protobuf.ServiceException; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.NavigableMap; +import java.util.NavigableSet; + +import static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME; /** * Protobufs utility. @@ -927,45 +917,6 @@ public final class ProtobufUtil { return builder.build(); } - /** - * Get the HLog entries from a list of protocol buffer WALEntry - * - * @param protoList the list of protocol buffer WALEntry - * @return an array of HLog entries - */ - public static HLog.Entry[] - toHLogEntries(final List protoList) { - List entries = new ArrayList(); - for (WALEntry entry: protoList) { - WALKey walKey = entry.getKey(); - java.util.UUID clusterId = HConstants.DEFAULT_CLUSTER_ID; - if (walKey.hasClusterId()) { - UUID protoUuid = walKey.getClusterId(); - clusterId = new java.util.UUID( - protoUuid.getMostSigBits(), protoUuid.getLeastSigBits()); - } - HLogKey key = new HLogKey(walKey.getEncodedRegionName().toByteArray(), - walKey.getTableName().toByteArray(), walKey.getLogSequenceNumber(), - walKey.getWriteTime(), clusterId); - WALEntry.WALEdit walEdit = entry.getEdit(); - WALEdit edit = new WALEdit(); - for (ByteString keyValue: walEdit.getKeyValueBytesList()) { - edit.add(new KeyValue(keyValue.toByteArray())); - } - if (walEdit.getFamilyScopeCount() > 0) { - TreeMap scopes = - new TreeMap(Bytes.BYTES_COMPARATOR); - for (FamilyScope scope: walEdit.getFamilyScopeList()) { - scopes.put(scope.getFamily().toByteArray(), - Integer.valueOf(scope.getScopeType().ordinal())); - } - edit.setScopes(scopes); - } - entries.add(new HLog.Entry(key, edit)); - } - return entries.toArray(new HLog.Entry[entries.size()]); - } - /** * Convert a delete KeyValue type to protocol buffer DeleteType. * @@ -1301,24 +1252,6 @@ public final class ProtobufUtil { } } - /** - * A helper to replicate a list of HLog entries using admin protocol. - * - * @param admin - * @param entries - * @throws IOException - */ - public static void replicateWALEntry(final AdminProtocol admin, - final HLog.Entry[] entries) throws IOException { - ReplicateWALEntryRequest request = - RequestConverter.buildReplicateWALEntryRequest(entries); - try { - admin.replicateWALEntry(null, request); - } catch (ServiceException se) { - throw ProtobufUtil.getRemoteException(se); - } - } - /** * A helper to get the list of files of a column family * on a given region using admin protocol. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java similarity index 93% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java index 9683a9700a3..ae2e6c3a643 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java @@ -17,19 +17,11 @@ */ package org.apache.hadoop.hbase.protobuf; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.UUID; - +import com.google.protobuf.ByteString; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.Action; import org.apache.hadoop.hbase.client.Append; @@ -41,9 +33,10 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Row; import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CompactRegionRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.FlushRegionRequest; @@ -53,14 +46,9 @@ import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoReque import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetStoreFileRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest.RegionOpenInfo; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.SplitRegionRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.StopServerRequest; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry.WALEdit.FamilyScope; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry.WALEdit.ScopeType; -import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.WALEntry.WALKey; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest.FamilyPath; @@ -101,13 +89,11 @@ import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetSchemaA import org.apache.hadoop.hbase.protobuf.generated.MasterMonitorProtos.GetTableDescriptorsRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsMasterRunningRequest; import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.GetLastFlushedSequenceIdRequest; -import org.apache.hadoop.hbase.regionserver.wal.HLog; -import org.apache.hadoop.hbase.regionserver.wal.HLogKey; -import org.apache.hadoop.hbase.regionserver.wal.WALEdit; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; -import com.google.protobuf.ByteString; +import java.io.IOException; +import java.util.List; /** * Helper utility to build protocol buffer requests, @@ -716,55 +702,7 @@ public final class RequestConverter { return builder.build(); } - /** - * Create a new ReplicateWALEntryRequest from a list of HLog entries - * - * @param entries the HLog entries to be replicated - * @return a ReplicateWALEntryRequest - */ - public static ReplicateWALEntryRequest - buildReplicateWALEntryRequest(final HLog.Entry[] entries) { - FamilyScope.Builder scopeBuilder = FamilyScope.newBuilder(); - WALEntry.Builder entryBuilder = WALEntry.newBuilder(); - ReplicateWALEntryRequest.Builder builder = - ReplicateWALEntryRequest.newBuilder(); - for (HLog.Entry entry: entries) { - entryBuilder.clear(); - WALKey.Builder keyBuilder = entryBuilder.getKeyBuilder(); - HLogKey key = entry.getKey(); - keyBuilder.setEncodedRegionName( - ByteString.copyFrom(key.getEncodedRegionName())); - keyBuilder.setTableName(ByteString.copyFrom(key.getTablename())); - keyBuilder.setLogSequenceNumber(key.getLogSeqNum()); - keyBuilder.setWriteTime(key.getWriteTime()); - UUID clusterId = key.getClusterId(); - if (clusterId != null) { - AdminProtos.UUID.Builder uuidBuilder = keyBuilder.getClusterIdBuilder(); - uuidBuilder.setLeastSigBits(clusterId.getLeastSignificantBits()); - uuidBuilder.setMostSigBits(clusterId.getMostSignificantBits()); - } - WALEdit edit = entry.getEdit(); - WALEntry.WALEdit.Builder editBuilder = entryBuilder.getEditBuilder(); - NavigableMap scopes = edit.getScopes(); - if (scopes != null && !scopes.isEmpty()) { - for (Map.Entry scope: scopes.entrySet()) { - scopeBuilder.setFamily(ByteString.copyFrom(scope.getKey())); - ScopeType scopeType = ScopeType.valueOf(scope.getValue().intValue()); - scopeBuilder.setScopeType(scopeType); - editBuilder.addFamilyScope(scopeBuilder.build()); - } - } - List keyValues = edit.getKeyValues(); - for (KeyValue value: keyValues) { - editBuilder.addKeyValueBytes(ByteString.copyFrom( - value.getBuffer(), value.getOffset(), value.getLength())); - } - builder.addEntry(entryBuilder.build()); - } - return builder.build(); - } - - /** + /** * Create a new RollWALWriterRequest * * @return a ReplicateWALEntryRequest @@ -891,7 +829,8 @@ public final class RequestConverter { * @throws DeserializationException */ public static MoveRegionRequest buildMoveRegionRequest( - final byte [] encodedRegionName, final byte [] destServerName) throws DeserializationException { + final byte [] encodedRegionName, final byte [] destServerName) throws + DeserializationException { MoveRegionRequest.Builder builder = MoveRegionRequest.newBuilder(); builder.setRegion( buildRegionSpecifier(RegionSpecifierType.ENCODED_REGION_NAME,encodedRegionName)); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java index edbe968960c..39672081523 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java @@ -17,10 +17,8 @@ */ package org.apache.hadoop.hbase.protobuf; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - +import com.google.protobuf.ByteString; +import com.google.protobuf.RpcController; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; @@ -44,8 +42,9 @@ import org.apache.hadoop.hbase.regionserver.RegionOpeningState; import org.apache.hadoop.hbase.security.access.UserPermission; import org.apache.hadoop.util.StringUtils; -import com.google.protobuf.ByteString; -import com.google.protobuf.RpcController; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * Helper utility to build protocol buffer responses, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/package.html b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/package.html similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/package.html rename to hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/package.html diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/BloomType.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/regionserver/BloomType.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/BloomType.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/regionserver/BloomType.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java index a4c83f1ea92..8b63e3a8c66 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java @@ -18,24 +18,24 @@ */ package org.apache.hadoop.hbase.replication; -import java.io.Closeable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + /** * This class acts as a wrapper for all the objects used to identify and * communicate with remote peers and is responsible for answering to expired diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java index 1227b49b1a1..60358c26c4a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateImpl.java @@ -18,13 +18,11 @@ */ package org.apache.hadoop.hbase.replication; -import java.io.IOException; -import java.util.concurrent.atomic.AtomicBoolean; - +import com.google.protobuf.InvalidProtocolBufferException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; import org.apache.hadoop.hbase.zookeeper.ZKUtil; @@ -32,7 +30,8 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicBoolean; /** * ReplicationStateImpl is responsible for maintaining the replication state diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java index 7fb63f3b04f..c3028d41061 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationStateInterface.java @@ -18,10 +18,10 @@ */ package org.apache.hadoop.hbase.replication; -import java.io.Closeable; - import org.apache.zookeeper.KeeperException; +import java.io.Closeable; + /** * This provides an interface for getting and setting the replication state of a * cluster. This state is used to indicate whether replication is enabled or diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java index 440fa4237db..0913268c802 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java @@ -18,6 +18,29 @@ */ package org.apache.hadoop.hbase.replication; +import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.Abortable; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.Server; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.zookeeper.ZKClusterId; +import org.apache.hadoop.hbase.zookeeper.ZKUtil; +import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp; +import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener; +import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.apache.zookeeper.KeeperException; +import org.apache.zookeeper.KeeperException.ConnectionLossException; +import org.apache.zookeeper.KeeperException.NodeExistsException; +import org.apache.zookeeper.KeeperException.SessionExpiredException; + import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; @@ -32,30 +55,6 @@ import java.util.TreeSet; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.Server; -import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; -import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.zookeeper.ZKClusterId; -import org.apache.hadoop.hbase.zookeeper.ZKUtil; -import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener; -import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; -import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp; -import org.apache.zookeeper.KeeperException; -import org.apache.zookeeper.KeeperException.ConnectionLossException; -import org.apache.zookeeper.KeeperException.NodeExistsException; -import org.apache.zookeeper.KeeperException.SessionExpiredException; - -import com.google.protobuf.InvalidProtocolBufferException; - /** * This class serves as a helper for all things related to zookeeper in * replication. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/AuthMethod.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/AuthMethod.java new file mode 100644 index 00000000000..26ab35d7736 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/AuthMethod.java @@ -0,0 +1,68 @@ +/** + * + * 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.hadoop.hbase.security; + +import org.apache.hadoop.security.UserGroupInformation; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** Authentication method */ +public enum AuthMethod { + SIMPLE((byte) 80, "", UserGroupInformation.AuthenticationMethod.SIMPLE), + KERBEROS((byte) 81, "GSSAPI", UserGroupInformation.AuthenticationMethod.KERBEROS), + DIGEST((byte) 82, "DIGEST-MD5", UserGroupInformation.AuthenticationMethod.TOKEN); + + /** The code for this method. */ + public final byte code; + public final String mechanismName; + public final UserGroupInformation.AuthenticationMethod authenticationMethod; + + AuthMethod(byte code, String mechanismName, + UserGroupInformation.AuthenticationMethod authMethod) { + this.code = code; + this.mechanismName = mechanismName; + this.authenticationMethod = authMethod; + } + + private static final int FIRST_CODE = values()[0].code; + + /** Return the object represented by the code. */ + private static AuthMethod valueOf(byte code) { + final int i = (code & 0xff) - FIRST_CODE; + return i < 0 || i >= values().length ? null : values()[i]; + } + + /** Return the SASL mechanism name */ + public String getMechanismName() { + return mechanismName; + } + + /** Read from in */ + public static AuthMethod read(DataInput in) throws IOException { + return valueOf(in.readByte()); + } + + /** Write to out */ + public void write(DataOutput out) throws IOException { + out.write(code); + } +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java similarity index 93% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java index 859ad120277..abf691a21a6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java @@ -18,13 +18,14 @@ package org.apache.hadoop.hbase.security; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.io.WritableUtils; +import org.apache.hadoop.ipc.RemoteException; +import org.apache.hadoop.security.SaslInputStream; +import org.apache.hadoop.security.SaslOutputStream; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.TokenIdentifier; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; @@ -34,19 +35,15 @@ import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.sasl.RealmCallback; import javax.security.sasl.RealmChoiceCallback; import javax.security.sasl.Sasl; -import javax.security.sasl.SaslException; import javax.security.sasl.SaslClient; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.io.WritableUtils; -import org.apache.hadoop.ipc.RemoteException; -import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.AuthMethod; -import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; -import org.apache.hadoop.security.SaslInputStream; -import org.apache.hadoop.security.SaslOutputStream; -import org.apache.hadoop.security.token.Token; -import org.apache.hadoop.security.token.TokenIdentifier; +import javax.security.sasl.SaslException; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; /** * A utility class that encapsulates SASL logic for RPC client. @@ -74,8 +71,8 @@ public class HBaseSaslRpcClient { LOG.debug("Creating SASL " + AuthMethod.DIGEST.getMechanismName() + " client to authenticate to service at " + token.getService()); saslClient = Sasl.createSaslClient(new String[] { AuthMethod.DIGEST - .getMechanismName() }, null, null, HBaseSaslRpcServer.SASL_DEFAULT_REALM, - HBaseSaslRpcServer.SASL_PROPS, new SaslClientCallbackHandler(token)); + .getMechanismName() }, null, null, SaslUtil.SASL_DEFAULT_REALM, + SaslUtil.SASL_PROPS, new SaslClientCallbackHandler(token)); break; case KERBEROS: if (LOG.isDebugEnabled()) { @@ -88,7 +85,7 @@ public class HBaseSaslRpcClient { throw new IOException( "Failed to specify server's Kerberos principal name"); } - String names[] = HBaseSaslRpcServer.splitKerberosName(serverPrincipal); + String names[] = SaslUtil.splitKerberosName(serverPrincipal); if (names.length != 3) { throw new IOException( "Kerberos principal does not have the expected format: " @@ -96,7 +93,7 @@ public class HBaseSaslRpcClient { } saslClient = Sasl.createSaslClient(new String[] { AuthMethod.KERBEROS .getMechanismName() }, null, names[0], names[1], - HBaseSaslRpcServer.SASL_PROPS, null); + SaslUtil.SASL_PROPS, null); break; default: throw new IOException("Unknown authentication method " + method); @@ -146,7 +143,7 @@ public class HBaseSaslRpcClient { if (!saslClient.isComplete()) { readStatus(inStream); int len = inStream.readInt(); - if (len == HBaseSaslRpcServer.SWITCH_TO_SIMPLE_AUTH) { + if (len == SaslUtil.SWITCH_TO_SIMPLE_AUTH) { if (LOG.isDebugEnabled()) LOG.debug("Server asks us to fall back to simple auth."); saslClient.dispose(); @@ -235,8 +232,8 @@ public class HBaseSaslRpcClient { private final char[] userPassword; public SaslClientCallbackHandler(Token token) { - this.userName = HBaseSaslRpcServer.encodeIdentifier(token.getIdentifier()); - this.userPassword = HBaseSaslRpcServer.encodePassword(token.getPassword()); + this.userName = SaslUtil.encodeIdentifier(token.getIdentifier()); + this.userPassword = SaslUtil.encodePassword(token.getPassword()); } public void handle(Callback[] callbacks) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java index 5e5e6ee2b6b..5a15e7c3717 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java @@ -18,13 +18,13 @@ package org.apache.hadoop.hbase.security; +import org.apache.hadoop.classification.InterfaceAudience; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.apache.hadoop.classification.InterfaceAudience; - /** * Indicates Kerberos related information to be used for authorizing connections * over a given RPC protocol interface. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslStatus.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslStatus.java new file mode 100644 index 00000000000..95ac4536e41 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslStatus.java @@ -0,0 +1,30 @@ +/** + * + * 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.hadoop.hbase.security; + +public enum SaslStatus { + SUCCESS (0), + ERROR (1); + + public final int state; + SaslStatus(int state) { + this.state = state; + } +} diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslUtil.java new file mode 100644 index 00000000000..42e21be44f8 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslUtil.java @@ -0,0 +1,48 @@ +/** + * + * 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.hadoop.hbase.security; + +import org.apache.commons.codec.binary.Base64; + +import java.util.Map; +import java.util.TreeMap; + +public class SaslUtil { + public static final String SASL_DEFAULT_REALM = "default"; + public static final Map SASL_PROPS = + new TreeMap(); + public static final int SWITCH_TO_SIMPLE_AUTH = -88; + + /** Splitting fully qualified Kerberos name into parts */ + public static String[] splitKerberosName(String fullName) { + return fullName.split("[/@]"); + } + + static String encodeIdentifier(byte[] identifier) { + return new String(Base64.encodeBase64(identifier)); + } + + static byte[] decodeIdentifier(String identifier) { + return Base64.decodeBase64(identifier.getBytes()); + } + + static char[] encodePassword(byte[] password) { + return new String(Base64.encodeBase64(password)).toCharArray(); + } +} diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SecureBulkLoadUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SecureBulkLoadUtil.java new file mode 100644 index 00000000000..41b5cb93014 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/SecureBulkLoadUtil.java @@ -0,0 +1,40 @@ +/** + * + * 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.hadoop.hbase.security; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.util.Bytes; + +public class SecureBulkLoadUtil { + private final static String BULKLOAD_STAGING_DIR = "hbase.bulkload.staging.dir"; + + /** + * This returns the staging path for a given column family. + * This is needed for clean recovery and called reflectively in LoadIncrementalHFiles + */ + public static Path getStagingPath(Configuration conf, String bulkToken, byte[] family) { + Path stageP = new Path(getBaseStagingDir(conf), bulkToken); + return new Path(stageP, Bytes.toString(family)); + } + + public static Path getBaseStagingDir(Configuration conf) { + return new Path(conf.get(BULKLOAD_STAGING_DIR, "/tmp/hbase-staging")); + } +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java index a652a745785..44b2e024663 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java @@ -18,13 +18,13 @@ package org.apache.hadoop.hbase.security; +import org.apache.hadoop.classification.InterfaceAudience; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.apache.hadoop.classification.InterfaceAudience; - /** * Indicates Token related information to be used in authorizing connections * over a given RPC protocol interface. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/User.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/User.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/User.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/User.java index 2cc3f59b66a..b9cc7583a00 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/User.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/User.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.security; +import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; @@ -34,8 +35,6 @@ import java.lang.reflect.UndeclaredThrowableException; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; -import org.apache.commons.logging.Log; - /** * Wrapper to abstract out usage of user and group information in HBase. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TablePermission.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/TablePermission.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TablePermission.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/TablePermission.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/UserPermission.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/UserPermission.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/UserPermission.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/UserPermission.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java index 83f824ab17b..1445e04f7e5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenIdentifier.java @@ -18,17 +18,16 @@ package org.apache.hadoop.hbase.security.token; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - import com.google.protobuf.ByteString; import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos; import org.apache.hadoop.io.Text; -import org.apache.hadoop.io.WritableUtils; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.TokenIdentifier; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + /** * Represents the identity information stored in an HBase authentication token. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java index 6b71f3adc19..53e8fb7fd0e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/AuthenticationTokenSelector.java @@ -18,8 +18,6 @@ package org.apache.hadoop.hbase.security.token; -import java.util.Collection; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.io.Text; @@ -27,6 +25,8 @@ import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.TokenIdentifier; import org.apache.hadoop.security.token.TokenSelector; +import java.util.Collection; + public class AuthenticationTokenSelector implements TokenSelector { private static Log LOG = LogFactory.getLog(AuthenticationTokenSelector.class); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/snapshot/ClientSnapshotDescriptionUtils.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/snapshot/ClientSnapshotDescriptionUtils.java new file mode 100644 index 00000000000..c42f38d2768 --- /dev/null +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/snapshot/ClientSnapshotDescriptionUtils.java @@ -0,0 +1,66 @@ +/** + * + * 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.hadoop.hbase.snapshot; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; +import org.apache.hadoop.hbase.util.Bytes; + +/** + * Class to help with dealing with a snapshot description on the client side. + * There is a corresponding class on the server side. + */ +@InterfaceAudience.Private +public class ClientSnapshotDescriptionUtils { + /** + * Check to make sure that the description of the snapshot requested is valid + * @param snapshot description of the snapshot + * @throws IllegalArgumentException if the name of the snapshot or the name of the table to + * snapshot are not valid names. + */ + public static void assertSnapshotRequestIsValid(HBaseProtos.SnapshotDescription snapshot) + throws IllegalArgumentException { + // FIXME these method names is really bad - trunk will probably change + // .META. and -ROOT- snapshots are not allowed + if (HTableDescriptor.isMetaTable(Bytes.toBytes(snapshot.getTable()))) { + throw new IllegalArgumentException(".META. and -ROOT- snapshots are not allowed"); + } + // make sure the snapshot name is valid + HTableDescriptor.isLegalTableName(Bytes.toBytes(snapshot.getName())); + // make sure the table name is valid + HTableDescriptor.isLegalTableName(Bytes.toBytes(snapshot.getTable())); + } + + /** + * Returns a single line (no \n) representation of snapshot metadata. Use this instead of + * {@link org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription#toString()}. We don't replace SnapshotDescrpition's toString + * because it is auto-generated by protoc. + * @param ssd + * @return Single line string with a summary of the snapshot parameters + */ + public static String toString(HBaseProtos.SnapshotDescription ssd) { + if (ssd == null) { + return null; + } + return "{ ss=" + ssd.getName() + " table=" + ssd.getTable() + + " type=" + ssd.getType() + " }"; + } +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HasThread.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/HasThread.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/HasThread.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/util/HasThread.java index dbf9164d81d..63a7d08d780 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HasThread.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/HasThread.java @@ -17,10 +17,10 @@ */ package org.apache.hadoop.hbase.util; -import java.lang.Thread.UncaughtExceptionHandler; - import org.apache.hadoop.classification.InterfaceAudience; +import java.lang.Thread.UncaughtExceptionHandler; + /** * Abstract class which contains a Thread and delegates the common Thread * methods to that instance. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java index 364be666ac1..9847b309801 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/PoolMap.java @@ -18,6 +18,9 @@ */ package org.apache.hadoop.hbase.util; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -31,9 +34,6 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; - /** * * The PoolMap maps a key to a collection of values, the elements diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Writables.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/Writables.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Writables.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/util/Writables.java index 13157eb5da4..2c3e7a6fb82 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Writables.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/util/Writables.java @@ -18,6 +18,10 @@ */ package org.apache.hadoop.hbase.util; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.io.DataInputBuffer; +import org.apache.hadoop.io.Writable; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; @@ -26,10 +30,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.io.DataInputBuffer; -import org.apache.hadoop.io.Writable; - /** * Utility class with methods for manipulating Writable objects */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java index 8894cb53aac..9d8baa2f543 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java @@ -18,8 +18,8 @@ package org.apache.hadoop.hbase.zookeeper; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.zookeeper.Watcher; import org.apache.zookeeper.WatchedEvent; +import org.apache.zookeeper.Watcher; /** * An empty ZooKeeper watcher diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java index 136df57b990..d715bb5e5d9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java @@ -18,8 +18,17 @@ */ package org.apache.hadoop.hbase.zookeeper; -import static org.apache.hadoop.hbase.HConstants.DEFAULT_ZK_SESSION_TIMEOUT; -import static org.apache.hadoop.hbase.HConstants.ZK_SESSION_TIMEOUT; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.util.Strings; +import org.apache.hadoop.net.DNS; +import org.apache.hadoop.util.StringUtils; +import org.apache.zookeeper.server.ServerConfig; +import org.apache.zookeeper.server.ZooKeeperServerMain; +import org.apache.zookeeper.server.quorum.QuorumPeerConfig; +import org.apache.zookeeper.server.quorum.QuorumPeerMain; import java.io.File; import java.io.IOException; @@ -33,17 +42,8 @@ import java.util.List; import java.util.Map.Entry; import java.util.Properties; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.util.Strings; -import org.apache.hadoop.net.DNS; -import org.apache.hadoop.util.StringUtils; -import org.apache.zookeeper.server.ServerConfig; -import org.apache.zookeeper.server.ZooKeeperServerMain; -import org.apache.zookeeper.server.quorum.QuorumPeerConfig; -import org.apache.zookeeper.server.quorum.QuorumPeerMain; +import static org.apache.hadoop.hbase.HConstants.DEFAULT_ZK_SESSION_TIMEOUT; +import static org.apache.hadoop.hbase.HConstants.ZK_SESSION_TIMEOUT; /** * HBase's version of ZooKeeper's QuorumPeer. When HBase is set to manage diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java index 1fc5629531f..7ee592dfa83 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java @@ -17,18 +17,18 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.io.IOException; - import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.data.Stat; +import java.io.IOException; + /** * Manages the location of the current active Master for the RegionServer. *

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaNodeTracker.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaNodeTracker.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaNodeTracker.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/MetaNodeTracker.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java index 9a4c94526b8..db9f15c2b55 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java @@ -18,14 +18,6 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Random; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -47,6 +39,14 @@ import org.apache.zookeeper.data.Stat; import org.apache.zookeeper.proto.CreateRequest; import org.apache.zookeeper.proto.SetDataRequest; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; + /** * A zookeeper that can handle 'recoverable' errors. * To handle recoverable errors, developers need to realize that there are two diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java index c7145a2fcda..8a18502aa37 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java @@ -19,8 +19,8 @@ package org.apache.hadoop.hbase.zookeeper; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java index 18fd7acaa3e..923a1d1e3b9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java @@ -18,20 +18,16 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.util.List; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.ServerName; -// We should not be importing this Type here, nor a RegionTransition, etc. This class should be -// about zk and bytes only. -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException.Code; @@ -39,6 +35,11 @@ import org.apache.zookeeper.KeeperException.NoNodeException; import org.apache.zookeeper.KeeperException.NodeExistsException; import org.apache.zookeeper.data.Stat; +import java.util.List; + +// We should not be importing this Type here, nor a RegionTransition, etc. This class should be +// about zk and bytes only. + /** * Utility class for doing region assignment in ZooKeeper. This class extends * stuff done in {@link ZKUtil} to cover specific assignment operations. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java similarity index 97% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java index 8d5234145db..b766fbd117b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKClusterId.java @@ -22,7 +22,7 @@ package org.apache.hadoop.hbase.zookeeper; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.ClusterId; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.zookeeper.KeeperException; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java index 3c74636c7ce..6de3b6919e3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java @@ -18,15 +18,6 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.Map.Entry; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -35,6 +26,15 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.util.StringUtils; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; +import java.util.Properties; + /** * Utility methods for reading, and building the ZooKeeper configuration. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java index 71d3cade6a9..06996ac16cd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKLeaderManager.java @@ -18,8 +18,6 @@ package org.apache.hadoop.hbase.zookeeper; -import java.util.concurrent.atomic.AtomicBoolean; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -28,6 +26,8 @@ import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.util.Bytes; import org.apache.zookeeper.KeeperException; +import java.util.concurrent.atomic.AtomicBoolean; + /** * Handles coordination of a single "leader" instance among many possible * candidates. The first {@link ZKLeaderManager} to successfully create diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java index eaa8ae7e05f..b6b63df5411 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java @@ -18,22 +18,21 @@ */ package org.apache.hadoop.hbase.zookeeper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; +import org.apache.zookeeper.KeeperException; + import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.master.AssignmentManager; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; -import org.apache.zookeeper.KeeperException; - /** - * Helper class for table state tracking for use by {@link AssignmentManager}. + * Helper class for table state tracking for use by AssignmentManager. * Reads, caches and sets state up in zookeeper. If multiple read/write * clients, will make for confusion. Read-only clients other than * AssignmentManager interested in learning table state can use the diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java similarity index 93% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java index a89d793d87b..aa369b8517b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTableReadOnly.java @@ -19,21 +19,19 @@ */ package org.apache.hadoop.hbase.zookeeper; +import com.google.protobuf.InvalidProtocolBufferException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; +import org.apache.zookeeper.KeeperException; + import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.master.AssignmentManager; -import org.apache.zookeeper.KeeperException; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; - -import com.google.protobuf.InvalidProtocolBufferException; - /** * Non-instantiable class that provides helper functions for - * clients other than {@link AssignmentManager} for reading the + * clients other than AssignmentManager for reading the * state of a table in ZK. * *

Does not cache state like {@link ZKTable}, actually reads from ZK each call. @@ -45,7 +43,7 @@ public class ZKTableReadOnly { /** * Go to zookeeper and see if state of table is {@code ZooKeeperProtos.Table.State#DISABLED}. * This method does not use cache. - * This method is for clients other than {@link AssignmentManager} + * This method is for clients other than AssignmentManager * @param zkw * @param tableName * @return True if table is enabled. @@ -61,7 +59,7 @@ public class ZKTableReadOnly { /** * Go to zookeeper and see if state of table is {@code ZooKeeperProtos.Table.State#ENABLED}. * This method does not use cache. - * This method is for clients other than {@link AssignmentManager} + * This method is for clients other than AssignmentManager * @param zkw * @param tableName * @return True if table is enabled. @@ -77,7 +75,7 @@ public class ZKTableReadOnly { * Go to zookeeper and see if state of table is {@code ZooKeeperProtos.Table.State#DISABLING} * of {@code ZooKeeperProtos.Table.State#DISABLED}. * This method does not use cache. - * This method is for clients other than {@link AssignmentManager}. + * This method is for clients other than AssignmentManager. * @param zkw * @param tableName * @return True if table is enabled. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java index 14f8cddaf53..066507a097c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java @@ -18,32 +18,15 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; - import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DeserializationException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.zookeeper.ZKUtil.ZKUtilOp.CreateAndFailSilent; @@ -67,6 +50,22 @@ import org.apache.zookeeper.proto.DeleteRequest; import org.apache.zookeeper.proto.SetDataRequest; import org.apache.zookeeper.server.ZooKeeperSaslServer; +import javax.security.auth.login.AppConfigurationEntry; +import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + /** * Internal HBase utility class for ZooKeeper. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperListener.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperListener.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperListener.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperListener.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperNodeTracker.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperNodeTracker.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperNodeTracker.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperNodeTracker.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java similarity index 99% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java rename to hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java index 6952b97e457..b4b7dd47306 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java @@ -18,13 +18,6 @@ */ package org.apache.hadoop.hbase.zookeeper; -import java.io.Closeable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -32,7 +25,7 @@ import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.util.Threads; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -40,6 +33,13 @@ import org.apache.zookeeper.Watcher; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.data.ACL; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CountDownLatch; + /** * Acts as the single ZooKeeper Watcher. One instance of this is instantiated * for each Master, RegionServer, and client process. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAttributes.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGet.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestGet.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDotHas.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutDotHas.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestPutDotHas.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestPutDotHas.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScan.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScan.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromAdmin.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromAdmin.java similarity index 100% rename from hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromAdmin.java rename to hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromAdmin.java diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index 753bbc72428..945d7f0303f 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -31,32 +31,82 @@ Common functionality for HBase + + + src/main/resources/ + + hbase-default.xml + + true + + - - maven-surefire-plugin - - - - listener - org.apache.hadoop.hbase.ResourceCheckerJUnitListener - - - - - - - secondPartTestsExecution - test - - test - + + maven-antrun-plugin + + + + generate + generate-sources + + + + + + + + + + + run + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + versionInfo-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/java + + + + + + + maven-surefire-plugin - true + + + listener + org.apache.hadoop.hbase.ResourceCheckerJUnitListener + + - - - + + + + secondPartTestsExecution + test + + test + + + true + + + + diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 1d4c63d9336..44d968aeeb7 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hbase; +import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; @@ -27,6 +28,9 @@ import java.util.regex.Pattern; import org.apache.commons.lang.ArrayUtils; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import org.apache.hadoop.hbase.util.Bytes; + +import static org.apache.hadoop.hbase.io.hfile.BlockType.MAGIC_LENGTH; /** * HConstants holds a bunch of HBase-related constants @@ -39,6 +43,36 @@ public final class HConstants { /** When we encode strings, we always specify UTF8 encoding */ public static final Charset UTF8_CHARSET = Charset.forName(UTF8_ENCODING); + /** + * Default block size for an HFile. + */ + public final static int DEFAULT_BLOCKSIZE = 64 * 1024; + /* + * Name of directory that holds recovered edits written by the wal log + * splitting code, one per region + */ + public static final String RECOVERED_EDITS_DIR = "recovered.edits"; + /** + * The first four bytes of Hadoop RPC connections + */ + public static final ByteBuffer RPC_HEADER = ByteBuffer.wrap("hrpc".getBytes()); + public static final byte CURRENT_VERSION = 5; + + // HFileBlock constants. + + /** The size data structures with minor version is 0 */ + public static final int HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM = MAGIC_LENGTH + 2 * Bytes.SIZEOF_INT + + Bytes.SIZEOF_LONG; + /** The size of a version 2 HFile block header, minor version 1. + * There is a 1 byte checksum type, followed by a 4 byte bytesPerChecksum + * followed by another 4 byte value to store sizeofDataOnDisk. + */ + public static final int HFILEBLOCK_HEADER_SIZE = HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM + + Bytes.SIZEOF_BYTE + 2 * Bytes.SIZEOF_INT; + /** Just an array of bytes of the right size. */ + public static final byte[] HFILEBLOCK_DUMMY_HEADER = new byte[HFILEBLOCK_HEADER_SIZE]; + + //End HFileBlockConstants. private static byte[] toBytes(String target) { return target.getBytes(UTF8_CHARSET); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/BufferedDataBlockEncoder.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/CompressionState.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/CompressionState.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/CompressionState.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/CompressionState.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/CopyKeyDataBlockEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/CopyKeyDataBlockEncoder.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/CopyKeyDataBlockEncoder.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/CopyKeyDataBlockEncoder.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/DiffKeyDeltaEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DiffKeyDeltaEncoder.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/DiffKeyDeltaEncoder.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/DiffKeyDeltaEncoder.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java similarity index 98% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java index e8a36f33085..e6f4765f732 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java @@ -17,7 +17,6 @@ package org.apache.hadoop.hbase.io.encoding; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -27,10 +26,10 @@ import java.util.Iterator; import org.apache.commons.lang.NotImplementedException; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; -import org.apache.hadoop.hbase.io.hfile.HFileBlock; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.io.compress.Compressor; @@ -65,7 +64,7 @@ public class EncodedDataBlock { this.dataBlockEncoder = dataBlockEncoder; encodingCtx = dataBlockEncoder.newDataBlockEncodingContext(Compression.Algorithm.NONE, - encoding, HFileBlock.DUMMY_HEADER); + encoding, HConstants.HFILEBLOCK_DUMMY_HEADER); this.rawKVs = rawKVs; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/FastDiffDeltaEncoder.java diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java index e7164bc09a0..c3bffe66421 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java @@ -87,7 +87,7 @@ public class HFileBlockDefaultEncodingContext implements } } dummyHeader = Preconditions.checkNotNull(headerBytes, - "Please pass HFileBlock.DUMMY_HEADER instead of null for param headerBytes"); + "Please pass HFileBlock.HFILEBLOCK_DUMMY_HEADER instead of null for param headerBytes"); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/PrefixKeyDeltaEncoder.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Addressing.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Addressing.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Addressing.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Addressing.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Classes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Classes.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Classes.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Classes.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Hash.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Hash.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Hash.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JenkinsHash.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/JenkinsHash.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/JenkinsHash.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/JenkinsHash.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Methods.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Methods.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Methods.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Methods.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/MurmurHash.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/MurmurHash.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/MurmurHash.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/MurmurHash.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Pair.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Pair.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Pair.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Pair.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RetryCounter.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounter.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/RetryCounter.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounter.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Triple.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java similarity index 100% rename from hbase-server/src/main/java/org/apache/hadoop/hbase/util/Triple.java rename to hbase-common/src/main/java/org/apache/hadoop/hbase/util/Triple.java diff --git a/hbase-server/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml similarity index 100% rename from hbase-server/src/main/resources/hbase-default.xml rename to hbase-common/src/main/resources/hbase-default.xml diff --git a/hbase-server/src/saveVersion.sh b/hbase-common/src/saveVersion.sh similarity index 100% rename from hbase-server/src/saveVersion.sh rename to hbase-common/src/saveVersion.sh diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/BulkDeleteEndpoint.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/BulkDeleteEndpoint.java index a0c7dc0a072..e36ee43d1a7 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/BulkDeleteEndpoint.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/BulkDeleteEndpoint.java @@ -34,7 +34,7 @@ import org.apache.hadoop.hbase.HConstants.OperationStatusCode; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.coprocessor.CoprocessorException; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.example.generated.BulkDeleteProtos.BulkDeleteRequest; diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/RowCountEndpoint.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/RowCountEndpoint.java index 465b4e07fa6..91230a53cd6 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/RowCountEndpoint.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/RowCountEndpoint.java @@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.coprocessor.CoprocessorException; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.example.generated.ExampleProtos; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java index e1385212de2..05b3e86b6f5 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java @@ -28,6 +28,8 @@ import org.apache.hadoop.hbase.client.ClientProtocol; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HConnectionManager; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-prefix-tree/src/main/java/org/apache/hbase/codec/prefixtree/scanner/CellScanner.java b/hbase-prefix-tree/src/main/java/org/apache/hbase/codec/prefixtree/scanner/CellScanner.java deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index 2e09df1011c..60623c08eeb 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -40,13 +40,6 @@ hbase-webapps/** - - src/main/resources/ - - hbase-default.xml - - true - @@ -118,9 +111,6 @@ - - - diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogTask.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogTask.java index f5fe4a39bb4..67a099446d2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogTask.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/SplitLogTask.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hbase; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/HFileArchiveManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/HFileArchiveManager.java index 4b0e3b543b7..8e9cd577532 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/HFileArchiveManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/HFileArchiveManager.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.master.cleaner.HFileCleaner; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/TableHFileArchiveTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/TableHFileArchiveTracker.java index f1d67808700..683010db9e8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/TableHFileArchiveTracker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/TableHFileArchiveTracker.java @@ -24,7 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java index 466ee58caec..90ccee62924 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.io.InterruptedIOException; import java.net.ConnectException; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.apache.commons.logging.Log; @@ -29,7 +28,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HTable; @@ -418,7 +417,7 @@ public class MetaEditor { * Deletes daughters references in offlined split parent. * @param catalogTracker * @param parent Parent row we're to remove daughter reference from - * @throws NotAllMetaRegionsOnlineException + * @throws org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException * @throws IOException */ public static void deleteDaughtersReferencesInParent(CatalogTracker catalogTracker, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java index 2b8c98eac38..d167eec0c05 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java @@ -23,7 +23,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.catalog.MetaReader.Visitor; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java index 4253296ae44..31628099bd7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/Constraint.java @@ -21,6 +21,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.exceptions.ConstraintException; /** * Apply a {@link Constraint} (in traditional database terminology) to a HTable. @@ -39,7 +40,7 @@ import org.apache.hadoop.hbase.client.Put; * enabling/disabling of a given {@link Constraint} after it has been added. *

* If a {@link Put} is invalid, the Constraint should throw some sort of - * {@link ConstraintException}, indicating that the {@link Put} has failed. When + * {@link org.apache.hadoop.hbase.exceptions.ConstraintException}, indicating that the {@link Put} has failed. When * this exception is thrown, not further retries of the {@link Put} are * attempted nor are any other {@link Constraint Constraints} attempted (the * {@link Put} is clearly not valid). Therefore, there are performance @@ -47,7 +48,7 @@ import org.apache.hadoop.hbase.client.Put; * specified. *

* If a {@link Constraint} fails to fail the {@link Put} via a - * {@link ConstraintException}, but instead throws a {@link RuntimeException}, + * {@link org.apache.hadoop.hbase.exceptions.ConstraintException}, but instead throws a {@link RuntimeException}, * the entire constraint processing mechanism ({@link ConstraintProcessor}) will * be unloaded from the table. This ensures that the region server is still * functional, but no more {@link Put Puts} will be checked via @@ -72,7 +73,7 @@ public interface Constraint extends Configurable { * propagated back to the client so you can see what caused the {@link Put} to * fail. * @param p {@link Put} to check - * @throws ConstraintException when the {@link Put} does not match the + * @throws org.apache.hadoop.hbase.exceptions.ConstraintException when the {@link Put} does not match the * constraint. */ public void check(Put p) throws ConstraintException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/package-info.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/package-info.java index 8ded75e2022..860fff962d8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/package-info.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/constraint/package-info.java @@ -146,7 +146,7 @@

Note that all exceptions that you expect to be thrown must be caught and then rethrown as a - {@link org.apache.hadoop.hbase.constraint.ConstraintException}. This way, you can be sure that a + {@link org.apache.hadoop.hbase.exceptions.ConstraintException}. This way, you can be sure that a {@link org.apache.hadoop.hbase.client.Put} fails for an expected reason, rather than for any reason. For example, an {@link java.lang.OutOfMemoryError} is probably indicative of an inherent problem in the {@link org.apache.hadoop.hbase.constraint.Constraint}, rather than a failed {@link org.apache.hadoop.hbase.client.Put}. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java index f7fc6708434..780da4ae673 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java @@ -19,10 +19,6 @@ package org.apache.hadoop.hbase.coprocessor; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -37,6 +33,7 @@ import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.coprocessor.AggregationClient; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.ResponseConverter; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java index 64a03230c13..78326271be2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java @@ -26,7 +26,6 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.CoprocessorEnvironment; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.UnknownRegionException; import org.apache.hadoop.hbase.master.RegionPlan; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRowProcessorEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRowProcessorEndpoint.java index 7f32ba1f37d..02d768dc1c7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRowProcessorEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRowProcessorEndpoint.java @@ -25,6 +25,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorRequest; import org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorResult; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java index 73158742fd8..6d3b86e7127 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java @@ -31,8 +31,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.client.coprocessor.Batch; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java index 4f2946076b9..cc004e4d2ec 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java @@ -27,17 +27,15 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.client.Mutation; -import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.regionserver.HRegion; -import org.apache.hadoop.hbase.regionserver.WrongRegionException; +import org.apache.hadoop.hbase.exceptions.WrongRegionException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Mutate; -import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Mutate.MutateType; import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutation.MultiMutateRequest; import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutation.MultiMutateResponse; import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutation.MultiRowMutationService; @@ -106,7 +104,7 @@ CoprocessorService, Coprocessor { throw new WrongRegionException(msg); } else { // rows are split between regions, do not retry - throw new DoNotRetryIOException(msg); + throw new org.apache.hadoop.hbase.exceptions.DoNotRetryIOException(msg); } } rowsToLock.add(m.getRow()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java index a3cc26cef92..f20cac115cf 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java @@ -25,7 +25,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.Server; -import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType; import org.cloudera.htrace.Sampler; import org.cloudera.htrace.Span; import org.cloudera.htrace.Trace; @@ -47,7 +46,7 @@ import org.cloudera.htrace.Trace; * a full list in one place -- and as enums is a good shorthand for an * implemenations -- because event handlers can be passed to executors when * they are to be run asynchronously. The - * hbase executor, see {@link ExecutorService}, has a switch for passing + * hbase executor, see ExecutorService, has a switch for passing * event type to executor. *

* Event listeners can be installed and will be called pre- and post- process if @@ -96,98 +95,6 @@ public abstract class EventHandler implements Runnable, Comparable { public void afterProcess(EventHandler event); } - /** - * List of all HBase event handler types. Event types are named by a - * convention: event type names specify the component from which the event - * originated and then where its destined -- e.g. RS2ZK_ prefix means the - * event came from a regionserver destined for zookeeper -- and then what - * the even is; e.g. REGION_OPENING. - * - *

We give the enums indices so we can add types later and keep them - * grouped together rather than have to add them always to the end as we - * would have to if we used raw enum ordinals. - */ - public enum EventType { - // Messages originating from RS (NOTE: there is NO direct communication from - // RS to Master). These are a result of RS updates into ZK. - // RS_ZK_REGION_CLOSING (1), // It is replaced by M_ZK_REGION_CLOSING(HBASE-4739) - RS_ZK_REGION_CLOSED (2, ExecutorType.MASTER_CLOSE_REGION), // RS has finished closing a region - RS_ZK_REGION_OPENING (3, null), // RS is in process of opening a region - RS_ZK_REGION_OPENED (4, ExecutorType.MASTER_OPEN_REGION), // RS has finished opening a region - RS_ZK_REGION_SPLITTING (5, null), // RS has started a region split - RS_ZK_REGION_SPLIT (6, ExecutorType.MASTER_SERVER_OPERATIONS), // RS split has completed. - RS_ZK_REGION_FAILED_OPEN (7, ExecutorType.MASTER_CLOSE_REGION), // RS failed to open a region - - // Messages originating from Master to RS - M_RS_OPEN_REGION (20, ExecutorType.RS_OPEN_REGION), // Master asking RS to open a region - M_RS_OPEN_ROOT (21, ExecutorType.RS_OPEN_ROOT), // Master asking RS to open root - M_RS_OPEN_META (22, ExecutorType.RS_OPEN_META), // Master asking RS to open meta - M_RS_CLOSE_REGION (23, ExecutorType.RS_CLOSE_REGION), // Master asking RS to close a region - M_RS_CLOSE_ROOT (24, ExecutorType.RS_CLOSE_ROOT), // Master asking RS to close root - M_RS_CLOSE_META (25, ExecutorType.RS_CLOSE_META), // Master asking RS to close meta - - // Messages originating from Client to Master - C_M_DELETE_TABLE (40, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to delete a table - C_M_DISABLE_TABLE (41, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to disable a table - C_M_ENABLE_TABLE (42, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to enable a table - C_M_MODIFY_TABLE (43, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to modify a table - C_M_ADD_FAMILY (44, null), // Client asking Master to add family to table - C_M_DELETE_FAMILY (45, null), // Client asking Master to delete family of table - C_M_MODIFY_FAMILY (46, null), // Client asking Master to modify family of table - C_M_CREATE_TABLE (47, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to create a table - C_M_SNAPSHOT_TABLE (48, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to snapshot an offline table - C_M_RESTORE_SNAPSHOT (49, ExecutorType.MASTER_TABLE_OPERATIONS), // Client asking Master to restore a snapshot - - // Updates from master to ZK. This is done by the master and there is - // nothing to process by either Master or RS - M_ZK_REGION_OFFLINE (50, null), // Master adds this region as offline in ZK - M_ZK_REGION_CLOSING (51, null), // Master adds this region as closing in ZK - - // Master controlled events to be executed on the master - M_SERVER_SHUTDOWN (70, ExecutorType.MASTER_SERVER_OPERATIONS), // Master is processing shutdown of a RS - M_META_SERVER_SHUTDOWN (72, ExecutorType.MASTER_META_SERVER_OPERATIONS), // Master is processing shutdown of RS hosting a meta region (-ROOT- or .META.). - M_MASTER_RECOVERY (73, ExecutorType.MASTER_SERVER_OPERATIONS), // Master is processing recovery of regions found in ZK RIT - - // RS controlled events to be executed on the RS - RS_PARALLEL_SEEK (80, ExecutorType.RS_PARALLEL_SEEK); - - private final int code; - private final ExecutorService.ExecutorType executor; - - /** - * Constructor - */ - EventType(final int code, final ExecutorType executor) { - this.code = code; - this.executor = executor; - } - - public int getCode() { - return this.code; - } - - public static EventType get(final int code) { - // Is this going to be slow? Its used rare but still... - for (EventType et: EventType.values()) { - if (et.getCode() == code) return et; - } - throw new IllegalArgumentException("Unknown code " + code); - } - - public boolean isOnlineSchemaChangeSupported() { - return ( - this.equals(EventType.C_M_ADD_FAMILY) || - this.equals(EventType.C_M_DELETE_FAMILY) || - this.equals(EventType.C_M_MODIFY_FAMILY) || - this.equals(EventType.C_M_MODIFY_TABLE) - ); - } - - ExecutorType getExecutorServiceType() { - return this.executor; - } - } - /** * Default base class constructor. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java index 5cf0ea0bd2d..9d73586bbe2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java @@ -44,7 +44,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; /** * This is a generic executor service. This component abstracts a - * threadpool, a queue to which {@link EventHandler.EventType}s can be submitted, + * threadpool, a queue to which {@link EventType}s can be submitted, * and a Runnable that handles the object that is added to the queue. * *

In order to create a new service, create an instance of this class and @@ -54,8 +54,8 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; *

In order to use the service created above, call * {@link #submit(EventHandler)}. Register pre- and post- processing listeners * by registering your implementation of {@link EventHandler.EventHandlerListener} - * with {@link #registerListener(EventHandler.EventType, EventHandler.EventHandlerListener)}. Be sure - * to deregister your listener when done via {@link #unregisterListener(EventHandler.EventType)}. + * with {@link #registerListener(EventType, EventHandler.EventHandlerListener)}. Be sure + * to deregister your listener when done via {@link #unregisterListener(EventType)}. */ @InterfaceAudience.Private public class ExecutorService { @@ -66,46 +66,12 @@ public class ExecutorService { new ConcurrentHashMap(); // listeners that are called before and after an event is processed - private ConcurrentHashMap eventHandlerListeners = - new ConcurrentHashMap(); + private ConcurrentHashMap eventHandlerListeners = + new ConcurrentHashMap(); // Name of the server hosting this executor service. private final String servername; - /** - * The following is a list of all executor types, both those that run in the - * master and those that run in the regionserver. - */ - public enum ExecutorType { - - // Master executor services - MASTER_CLOSE_REGION (1), - MASTER_OPEN_REGION (2), - MASTER_SERVER_OPERATIONS (3), - MASTER_TABLE_OPERATIONS (4), - MASTER_RS_SHUTDOWN (5), - MASTER_META_SERVER_OPERATIONS (6), - - // RegionServer executor services - RS_OPEN_REGION (20), - RS_OPEN_ROOT (21), - RS_OPEN_META (22), - RS_CLOSE_REGION (23), - RS_CLOSE_ROOT (24), - RS_CLOSE_META (25), - RS_PARALLEL_SEEK (26); - - ExecutorType(int value) {} - - /** - * @param serverName - * @return Conflation of the executor type and the passed servername. - */ - String getExecutorName(String serverName) { - return this.toString() + "-" + serverName.replace("%", "%%"); - } - } - /** * Default constructor. * @param servername Name of the hosting server. @@ -185,23 +151,23 @@ public class ExecutorService { /** * Subscribe to updates before and after processing instances of - * {@link EventHandler.EventType}. Currently only one listener per + * {@link EventType}. Currently only one listener per * event type. * @param type Type of event we're registering listener for * @param listener The listener to run. */ - public void registerListener(final EventHandler.EventType type, + public void registerListener(final EventType type, final EventHandlerListener listener) { this.eventHandlerListeners.put(type, listener); } /** * Stop receiving updates before and after processing instances of - * {@link EventHandler.EventType} + * {@link EventType} * @param type Type of event we're registering listener for * @return The listener we removed or null if we did not remove it. */ - public EventHandlerListener unregisterListener(final EventHandler.EventType type) { + public EventHandlerListener unregisterListener(final EventType type) { return this.eventHandlerListeners.remove(type); } @@ -224,12 +190,12 @@ public class ExecutorService { // work queue to use - unbounded queue final BlockingQueue q = new LinkedBlockingQueue(); private final String name; - private final Map eventHandlerListeners; + private final Map eventHandlerListeners; private static final AtomicLong seqids = new AtomicLong(0); private final long id; protected Executor(String name, int maxThreads, - final Map eventHandlerListeners) { + final Map eventHandlerListeners) { this.id = seqids.incrementAndGet(); this.name = name; this.eventHandlerListeners = eventHandlerListeners; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java index 1f67492e9b8..1dbad25d3e2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java @@ -367,7 +367,7 @@ public class CacheConfig { MemoryUsage mu = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); long lruCacheSize = (long) (mu.getMax() * cachePercentage); int blockSize = conf.getInt("hbase.offheapcache.minblocksize", - HFile.DEFAULT_BLOCKSIZE); + HConstants.DEFAULT_BLOCKSIZE); long offHeapCacheSize = (long) (conf.getFloat("hbase.offheapcache.percentage", (float) 0) * DirectMemoryUtils.getDirectMemorySize()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java index b615266776b..cf3572ffd0d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java @@ -53,6 +53,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.KeyComparator; +import org.apache.hadoop.hbase.exceptions.CorruptHFileException; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; @@ -143,11 +144,6 @@ public class HFile { */ public final static int MAXIMUM_KEY_LENGTH = Integer.MAX_VALUE; - /** - * Default block size for an HFile. - */ - public final static int DEFAULT_BLOCKSIZE = 64 * 1024; - /** * Default compression: none. */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java index 3fa7ad52b5a..f655d622baa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java @@ -17,8 +17,6 @@ */ package org.apache.hadoop.hbase.io.hfile; -import static org.apache.hadoop.hbase.io.hfile.BlockType.MAGIC_LENGTH; - import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -35,6 +33,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; @@ -44,7 +43,6 @@ import org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultDecodingContext; import org.apache.hadoop.hbase.io.encoding.HFileBlockDefaultEncodingContext; import org.apache.hadoop.hbase.io.encoding.HFileBlockEncodingContext; import org.apache.hadoop.hbase.io.hfile.bucket.BucketCache; -import org.apache.hadoop.hbase.regionserver.MemStore; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ChecksumType; import org.apache.hadoop.hbase.util.ClassSize; @@ -100,32 +98,18 @@ public class HFileBlock implements Cacheable { */ static final int CHECKSUM_VERIFICATION_NUM_IO_THRESHOLD = 3; - /** The size data structures with minor version is 0 */ - static final int HEADER_SIZE_NO_CHECKSUM = MAGIC_LENGTH + 2 * Bytes.SIZEOF_INT - + Bytes.SIZEOF_LONG; - public static final boolean FILL_HEADER = true; public static final boolean DONT_FILL_HEADER = false; - /** The size of a version 2 {@link HFile} block header, minor version 1. - * There is a 1 byte checksum type, followed by a 4 byte bytesPerChecksum - * followed by another 4 byte value to store sizeofDataOnDisk. - */ - public static final int HEADER_SIZE = HEADER_SIZE_NO_CHECKSUM + - Bytes.SIZEOF_BYTE + 2 * Bytes.SIZEOF_INT; - /** * The size of block header when blockType is {@link BlockType#ENCODED_DATA}. * This extends normal header by adding the id of encoder. */ - public static final int ENCODED_HEADER_SIZE = HEADER_SIZE + public static final int ENCODED_HEADER_SIZE = HConstants.HFILEBLOCK_HEADER_SIZE + DataBlockEncoding.ID_SIZE; - /** Just an array of bytes of the right size. */ - public static final byte[] DUMMY_HEADER = new byte[HEADER_SIZE]; - - static final byte[] DUMMY_HEADER_NO_CHECKSUM = - new byte[HEADER_SIZE_NO_CHECKSUM]; + static final byte[] DUMMY_HEADER_NO_CHECKSUM = + new byte[HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM]; public static final int BYTE_BUFFER_HEAP_SIZE = (int) ClassSize.estimateBase( ByteBuffer.wrap(new byte[0], 0, 0).getClass(), false); @@ -212,7 +196,7 @@ public class HFileBlock implements Cacheable { /** * The on-disk size of the next block, including the header, obtained by - * peeking into the first {@link HEADER_SIZE} bytes of the next block's + * peeking into the first {@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes of the next block's * header, or -1 if unknown. */ private int nextBlockOnDiskSizeWithHeader = -1; @@ -230,9 +214,9 @@ public class HFileBlock implements Cacheable { * compression is disabled. * @param prevBlockOffset the offset of the previous block in the * {@link HFile} - * @param buf block header ({@link #HEADER_SIZE} bytes) followed by + * @param buf block header ({@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes) followed by * uncompressed data. This - * @param fillHeader true to fill in the first {@link #HEADER_SIZE} bytes of + * @param fillHeader true to fill in the first {@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes of * the buffer based on the header fields provided * @param offset the file offset the block was read from * @param minorVersion the minor version of this block @@ -284,7 +268,7 @@ public class HFileBlock implements Cacheable { this.checksumType = ChecksumType.NULL.getCode(); this.bytesPerChecksum = 0; this.onDiskDataSizeWithHeader = onDiskSizeWithoutHeader + - HEADER_SIZE_NO_CHECKSUM; + HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM; } buf = b; buf.rewind(); @@ -340,7 +324,7 @@ public class HFileBlock implements Cacheable { } /** - * Writes header fields into the first {@link HEADER_SIZE} bytes of the + * Writes header fields into the first {@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes of the * buffer. Resets the buffer position to the end of header as side effect. */ private void overwriteHeader() { @@ -410,7 +394,7 @@ public class HFileBlock implements Cacheable { /** * Checks if the block is internally consistent, i.e. the first - * {@link #HEADER_SIZE} bytes of the buffer contain a valid header consistent + * {@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes of the buffer contain a valid header consistent * with the fields. This function is primary for testing and debugging, and * is not thread-safe, because it alters the internal buffer pointer. */ @@ -448,7 +432,7 @@ public class HFileBlock implements Cacheable { + ", got " + buf.limit()); } - // We might optionally allocate HEADER_SIZE more bytes to read the next + // We might optionally allocate HFILEBLOCK_HEADER_SIZE more bytes to read the next // block's, header, so there are two sensible values for buffer capacity. int size = uncompressedSizeWithoutHeader + hdrSize + cksumBytes; if (buf.capacity() != size && @@ -658,7 +642,7 @@ public class HFileBlock implements Cacheable { /** * The stream we use to accumulate data in uncompressed format for each * block. We reset this stream at the end of each block and reuse it. The - * header is written as the first {@link #HEADER_SIZE} bytes into this + * header is written as the first {@link HConstants#HFILEBLOCK_HEADER_SIZE} bytes into this * stream. */ private ByteArrayOutputStream baosInMemory; @@ -694,7 +678,7 @@ public class HFileBlock implements Cacheable { /** * Valid in the READY state. Contains the header and the uncompressed (but * potentially encoded, if this is a data block) bytes, so the length is - * {@link #uncompressedSizeWithoutHeader} + {@link HFileBlock#HEADER_SIZE}. + * {@link #uncompressedSizeWithoutHeader} + {@link org.apache.hadoop.hbase.HConstants#HFILEBLOCK_HEADER_SIZE}. * Does not store checksums. */ private byte[] uncompressedBytesWithHeader; @@ -733,14 +717,14 @@ public class HFileBlock implements Cacheable { this.dataBlockEncoder = dataBlockEncoder != null ? dataBlockEncoder : NoOpDataBlockEncoder.INSTANCE; defaultBlockEncodingCtx = - new HFileBlockDefaultEncodingContext(compressionAlgorithm, null, DUMMY_HEADER); + new HFileBlockDefaultEncodingContext(compressionAlgorithm, null, HConstants.HFILEBLOCK_DUMMY_HEADER); dataBlockEncodingCtx = this.dataBlockEncoder.newOnDiskDataBlockEncodingContext( - compressionAlgorithm, DUMMY_HEADER); + compressionAlgorithm, HConstants.HFILEBLOCK_DUMMY_HEADER); - if (bytesPerChecksum < HEADER_SIZE) { + if (bytesPerChecksum < HConstants.HFILEBLOCK_HEADER_SIZE) { throw new RuntimeException("Unsupported value of bytesPerChecksum. " + - " Minimum is " + HEADER_SIZE + " but the configured value is " + + " Minimum is " + HConstants.HFILEBLOCK_HEADER_SIZE + " but the configured value is " + bytesPerChecksum); } @@ -773,7 +757,7 @@ public class HFileBlock implements Cacheable { blockType = newBlockType; baosInMemory.reset(); - baosInMemory.write(DUMMY_HEADER); + baosInMemory.write(HConstants.HFILEBLOCK_DUMMY_HEADER); state = State.WRITING; @@ -860,8 +844,8 @@ public class HFileBlock implements Cacheable { private void encodeDataBlockForDisk() throws IOException { // do data block encoding, if data block encoder is set ByteBuffer rawKeyValues = - ByteBuffer.wrap(uncompressedBytesWithHeader, HEADER_SIZE, - uncompressedBytesWithHeader.length - HEADER_SIZE).slice(); + ByteBuffer.wrap(uncompressedBytesWithHeader, HConstants.HFILEBLOCK_HEADER_SIZE, + uncompressedBytesWithHeader.length - HConstants.HFILEBLOCK_HEADER_SIZE).slice(); //do the encoding dataBlockEncoder.beforeWriteToDisk(rawKeyValues, @@ -885,8 +869,8 @@ public class HFileBlock implements Cacheable { private void putHeader(byte[] dest, int offset, int onDiskSize, int uncompressedSize, int onDiskDataSize) { offset = blockType.put(dest, offset); - offset = Bytes.putInt(dest, offset, onDiskSize - HEADER_SIZE); - offset = Bytes.putInt(dest, offset, uncompressedSize - HEADER_SIZE); + offset = Bytes.putInt(dest, offset, onDiskSize - HConstants.HFILEBLOCK_HEADER_SIZE); + offset = Bytes.putInt(dest, offset, uncompressedSize - HConstants.HFILEBLOCK_HEADER_SIZE); offset = Bytes.putLong(dest, offset, prevOffset); offset = Bytes.putByte(dest, offset, checksumType.getCode()); offset = Bytes.putInt(dest, offset, bytesPerChecksum); @@ -977,7 +961,7 @@ public class HFileBlock implements Cacheable { */ int getOnDiskSizeWithoutHeader() { expectState(State.BLOCK_READY); - return onDiskBytesWithHeader.length + onDiskChecksum.length - HEADER_SIZE; + return onDiskBytesWithHeader.length + onDiskChecksum.length - HConstants.HFILEBLOCK_HEADER_SIZE; } /** @@ -997,7 +981,7 @@ public class HFileBlock implements Cacheable { */ int getUncompressedSizeWithoutHeader() { expectState(State.BLOCK_READY); - return uncompressedBytesWithHeader.length - HEADER_SIZE; + return uncompressedBytesWithHeader.length - HConstants.HFILEBLOCK_HEADER_SIZE; } /** @@ -1322,8 +1306,8 @@ public class HFileBlock implements Cacheable { */ private static class PrefetchedHeader { long offset = -1; - byte[] header = new byte[HEADER_SIZE]; - ByteBuffer buf = ByteBuffer.wrap(header, 0, HEADER_SIZE); + byte[] header = new byte[HConstants.HFILEBLOCK_HEADER_SIZE]; + ByteBuffer buf = ByteBuffer.wrap(header, 0, HConstants.HFILEBLOCK_HEADER_SIZE); } /** Reads version 2 blocks from the filesystem. */ @@ -1825,9 +1809,9 @@ public class HFileBlock implements Cacheable { */ static private int headerSize(int minorVersion) { if (minorVersion < MINOR_VERSION_WITH_CHECKSUM) { - return HEADER_SIZE_NO_CHECKSUM; + return HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM; } - return HEADER_SIZE; + return HConstants.HFILEBLOCK_HEADER_SIZE; } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoderImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoderImpl.java index eb50a3cc961..03679048c31 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoderImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoderImpl.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoder; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; @@ -70,7 +71,7 @@ public class HFileDataBlockEncoderImpl implements HFileDataBlockEncoder { */ public HFileDataBlockEncoderImpl(DataBlockEncoding onDisk, DataBlockEncoding inCache, byte[] dummyHeader) { - dummyHeader = dummyHeader == null ? HFileBlock.DUMMY_HEADER : dummyHeader; + dummyHeader = dummyHeader == null ? HConstants.HFILEBLOCK_DUMMY_HEADER : dummyHeader; this.onDisk = onDisk != null ? onDisk : DataBlockEncoding.NONE; this.inCache = inCache != null ? diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java index 8b075fafd82..970d5236c0a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java @@ -68,6 +68,8 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.IpcProtocol; +import org.apache.hadoop.hbase.exceptions.CallerDisconnectedException; +import org.apache.hadoop.hbase.exceptions.ServerNotRunningYetException; import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler; import org.apache.hadoop.hbase.monitoring.TaskMonitor; import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.ConnectionHeader; @@ -78,10 +80,11 @@ import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader; import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcResponseHeader.Status; import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.UserInformation; import org.apache.hadoop.hbase.security.HBaseSaslRpcServer; -import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.AuthMethod; +import org.apache.hadoop.hbase.security.AuthMethod; import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslDigestCallbackHandler; import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslGssCallbackHandler; -import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; +import org.apache.hadoop.hbase.security.SaslStatus; +import org.apache.hadoop.hbase.security.SaslUtil; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.ByteBufferOutputStream; import org.apache.hadoop.io.BytesWritable; @@ -125,11 +128,6 @@ import com.google.protobuf.Message; public abstract class HBaseServer implements RpcServer { private final boolean authorize; protected boolean isSecurityEnabled; - /** - * The first four bytes of Hadoop RPC connections - */ - public static final ByteBuffer HEADER = ByteBuffer.wrap("hrpc".getBytes()); - public static final byte CURRENT_VERSION = 5; /** * How many calls/handler are allowed in the queue. @@ -1245,8 +1243,8 @@ public abstract class HBaseServer implements RpcServer { "Server is not configured to do DIGEST authentication."); } saslServer = Sasl.createSaslServer(AuthMethod.DIGEST - .getMechanismName(), null, HBaseSaslRpcServer.SASL_DEFAULT_REALM, - HBaseSaslRpcServer.SASL_PROPS, new SaslDigestCallbackHandler( + .getMechanismName(), null, SaslUtil.SASL_DEFAULT_REALM, + SaslUtil.SASL_PROPS, new SaslDigestCallbackHandler( secretManager, this)); break; default: @@ -1255,7 +1253,7 @@ public abstract class HBaseServer implements RpcServer { String fullName = current.getUserName(); if (LOG.isDebugEnabled()) LOG.debug("Kerberos principal name is " + fullName); - final String names[] = HBaseSaslRpcServer.splitKerberosName(fullName); + final String names[] = SaslUtil.splitKerberosName(fullName); if (names.length != 3) { throw new AccessControlException( "Kerberos principal name does NOT have the expected " @@ -1266,7 +1264,7 @@ public abstract class HBaseServer implements RpcServer { public Object run() throws SaslException { saslServer = Sasl.createSaslServer(AuthMethod.KERBEROS .getMechanismName(), names[0], names[1], - HBaseSaslRpcServer.SASL_PROPS, new SaslGssCallbackHandler()); + SaslUtil.SASL_PROPS, new SaslGssCallbackHandler()); return null; } }); @@ -1380,11 +1378,11 @@ public abstract class HBaseServer implements RpcServer { authMethod = AuthMethod.read(new DataInputStream( new ByteArrayInputStream(method))); dataLengthBuffer.flip(); - if (!HEADER.equals(dataLengthBuffer) || version != CURRENT_VERSION) { + if (!HConstants.RPC_HEADER.equals(dataLengthBuffer) || version != HConstants.CURRENT_VERSION) { LOG.warn("Incorrect header or version mismatch from " + hostAddress + ":" + remotePort + " got version " + version + - " expected version " + CURRENT_VERSION); + " expected version " + HConstants.CURRENT_VERSION); setupBadVersionResponse(version); return -1; } @@ -1402,7 +1400,7 @@ public abstract class HBaseServer implements RpcServer { } if (!isSecurityEnabled && authMethod != AuthMethod.SIMPLE) { doRawSaslReply(SaslStatus.SUCCESS, new IntWritable( - HBaseSaslRpcServer.SWITCH_TO_SIMPLE_AUTH), null, null); + SaslUtil.SWITCH_TO_SIMPLE_AUTH), null, null); authMethod = AuthMethod.SIMPLE; // client has already sent the initial Sasl message and we // should ignore it. Both client and server should fall back @@ -1470,7 +1468,7 @@ public abstract class HBaseServer implements RpcServer { * @throws IOException */ private void setupBadVersionResponse(int clientVersion) throws IOException { - String errMsg = "Server IPC version " + CURRENT_VERSION + + String errMsg = "Server IPC version " + HConstants.CURRENT_VERSION + " cannot communicate with client version " + clientVersion; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcServerEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcServerEngine.java index cf684977b15..dcb1ae87fc3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcServerEngine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ProtobufRpcServerEngine.java @@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.IpcProtocol; import org.apache.hadoop.hbase.client.Operation; +import org.apache.hadoop.hbase.exceptions.UnknownProtocolException; import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RpcRequestBody; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java index 60236d6eb49..acea988b1aa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hbase.ipc; +import org.apache.hadoop.hbase.exceptions.CallerDisconnectedException; + public interface RpcCallContext extends Delayable { /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java index 878c94da06d..0eb20050adf 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java @@ -51,7 +51,6 @@ import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.io.hfile.AbstractHFileWriter; import org.apache.hadoop.hbase.io.hfile.CacheConfig; -import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoderImpl; import org.apache.hadoop.hbase.io.hfile.NoOpDataBlockEncoder; @@ -98,7 +97,7 @@ public class HFileOutputFormat extends FileOutputFormat protoList) { + List entries = new ArrayList(); + for (AdminProtos.WALEntry entry: protoList) { + AdminProtos.WALEntry.WALKey walKey = entry.getKey(); + java.util.UUID clusterId = HConstants.DEFAULT_CLUSTER_ID; + if (walKey.hasClusterId()) { + AdminProtos.UUID protoUuid = walKey.getClusterId(); + clusterId = new java.util.UUID( + protoUuid.getMostSigBits(), protoUuid.getLeastSigBits()); + } + HLogKey key = new HLogKey(walKey.getEncodedRegionName().toByteArray(), + walKey.getTableName().toByteArray(), walKey.getLogSequenceNumber(), + walKey.getWriteTime(), clusterId); + AdminProtos.WALEntry.WALEdit walEdit = entry.getEdit(); + WALEdit edit = new WALEdit(); + for (ByteString keyValue: walEdit.getKeyValueBytesList()) { + edit.add(new KeyValue(keyValue.toByteArray())); + } + if (walEdit.getFamilyScopeCount() > 0) { + TreeMap scopes = + new TreeMap(Bytes.BYTES_COMPARATOR); + for (AdminProtos.WALEntry.WALEdit.FamilyScope scope: walEdit.getFamilyScopeList()) { + scopes.put(scope.getFamily().toByteArray(), + Integer.valueOf(scope.getScopeType().ordinal())); + } + edit.setScopes(scopes); + } + entries.add(new HLog.Entry(key, edit)); + } + return entries.toArray(new HLog.Entry[entries.size()]); + } + + /** + * A helper to replicate a list of HLog entries using admin protocol. + * + * @param admin + * @param entries + * @throws java.io.IOException + */ + public static void replicateWALEntry(final AdminProtocol admin, + final HLog.Entry[] entries) throws IOException { + AdminProtos.ReplicateWALEntryRequest request = + buildReplicateWALEntryRequest(entries); + try { + admin.replicateWALEntry(null, request); + } catch (ServiceException se) { + throw ProtobufUtil.getRemoteException(se); + } + } + + /** + * Create a new ReplicateWALEntryRequest from a list of HLog entries + * + * @param entries the HLog entries to be replicated + * @return a ReplicateWALEntryRequest + */ + public static AdminProtos.ReplicateWALEntryRequest + buildReplicateWALEntryRequest(final HLog.Entry[] entries) { + AdminProtos.WALEntry.WALEdit.FamilyScope.Builder scopeBuilder = AdminProtos.WALEntry + .WALEdit + .FamilyScope + .newBuilder(); + AdminProtos.WALEntry.Builder entryBuilder = AdminProtos.WALEntry.newBuilder(); + AdminProtos.ReplicateWALEntryRequest.Builder builder = + AdminProtos.ReplicateWALEntryRequest.newBuilder(); + for (HLog.Entry entry: entries) { + entryBuilder.clear(); + AdminProtos.WALEntry.WALKey.Builder keyBuilder = entryBuilder.getKeyBuilder(); + HLogKey key = entry.getKey(); + keyBuilder.setEncodedRegionName( + ByteString.copyFrom(key.getEncodedRegionName())); + keyBuilder.setTableName(ByteString.copyFrom(key.getTablename())); + keyBuilder.setLogSequenceNumber(key.getLogSeqNum()); + keyBuilder.setWriteTime(key.getWriteTime()); + UUID clusterId = key.getClusterId(); + if (clusterId != null) { + AdminProtos.UUID.Builder uuidBuilder = keyBuilder.getClusterIdBuilder(); + uuidBuilder.setLeastSigBits(clusterId.getLeastSignificantBits()); + uuidBuilder.setMostSigBits(clusterId.getMostSignificantBits()); + } + WALEdit edit = entry.getEdit(); + AdminProtos.WALEntry.WALEdit.Builder editBuilder = entryBuilder.getEditBuilder(); + NavigableMap scopes = edit.getScopes(); + if (scopes != null && !scopes.isEmpty()) { + for (Map.Entry scope: scopes.entrySet()) { + scopeBuilder.setFamily(ByteString.copyFrom(scope.getKey())); + AdminProtos.WALEntry.WALEdit.ScopeType + scopeType = AdminProtos.WALEntry + .WALEdit + .ScopeType + .valueOf(scope.getValue().intValue()); + scopeBuilder.setScopeType(scopeType); + editBuilder.addFamilyScope(scopeBuilder.build()); + } + } + List keyValues = edit.getKeyValues(); + for (KeyValue value: keyValues) { + editBuilder.addKeyValueBytes(ByteString.copyFrom( + value.getBuffer(), value.getOffset(), value.getLength())); + } + builder.addEntry(entryBuilder.build()); + } + return builder.build(); + } +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 36efefb2007..7f4a03d9064 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -71,9 +71,8 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.CompoundConfiguration; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.DroppedSnapshotException; -import org.apache.hadoop.hbase.FailedSanityCheckException; +import org.apache.hadoop.hbase.exceptions.DroppedSnapshotException; +import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; @@ -82,9 +81,10 @@ import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.NotServingRegionException; -import org.apache.hadoop.hbase.RegionTooBusyException; -import org.apache.hadoop.hbase.UnknownScannerException; +import org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.RegionTooBusyException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.backup.HFileArchiver; import org.apache.hadoop.hbase.client.Append; import org.apache.hadoop.hbase.client.Delete; @@ -98,6 +98,7 @@ import org.apache.hadoop.hbase.client.Row; import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.errorhandling.ForeignExceptionSnare; +import org.apache.hadoop.hbase.exceptions.WrongRegionException; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; @@ -109,7 +110,7 @@ import org.apache.hadoop.hbase.io.hfile.BlockCache; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.ipc.HBaseServer; import org.apache.hadoop.hbase.ipc.RpcCallContext; -import org.apache.hadoop.hbase.ipc.UnknownProtocolException; +import org.apache.hadoop.hbase.exceptions.UnknownProtocolException; import org.apache.hadoop.hbase.monitoring.MonitoredTask; import org.apache.hadoop.hbase.monitoring.TaskMonitor; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState; @@ -2370,10 +2371,10 @@ public class HRegion implements HeapSize { // , Writable{ checkResources(); boolean isPut = w instanceof Put; if (!isPut && !(w instanceof Delete)) - throw new DoNotRetryIOException("Action must be Put or Delete"); + throw new org.apache.hadoop.hbase.exceptions.DoNotRetryIOException("Action must be Put or Delete"); Row r = (Row)w; if (!Bytes.equals(row, r.getRow())) { - throw new DoNotRetryIOException("Action's getRow must match the passed row"); + throw new org.apache.hadoop.hbase.exceptions.DoNotRetryIOException("Action's getRow must match the passed row"); } startRegionOperation(); @@ -2445,7 +2446,7 @@ public class HRegion implements HeapSize { // , Writable{ @SuppressWarnings("unchecked") private void doBatchMutate(Mutation mutation, Integer lid) throws IOException, - DoNotRetryIOException { + org.apache.hadoop.hbase.exceptions.DoNotRetryIOException { Pair[] mutateWithLocks = new Pair[] { new Pair(mutation, lid) }; OperationStatus[] batchMutate = this.batchMutate(mutateWithLocks); if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) { @@ -3325,7 +3326,7 @@ public class HRegion implements HeapSize { // , Writable{ Store store = getStore(familyName); if (store == null) { - IOException ioe = new DoNotRetryIOException( + IOException ioe = new org.apache.hadoop.hbase.exceptions.DoNotRetryIOException( "No such column family " + Bytes.toStringBinary(familyName)); ioes.add(ioe); failures.add(p); @@ -5009,7 +5010,7 @@ public class HRegion implements HeapSize { // , Writable{ amount += Bytes.toLong(kv.getBuffer(), kv.getValueOffset(), Bytes.SIZEOF_LONG); } else { // throw DoNotRetryIOException instead of IllegalArgumentException - throw new DoNotRetryIOException( + throw new org.apache.hadoop.hbase.exceptions.DoNotRetryIOException( "Attempted to increment field that isn't 64 bits wide"); } idx++; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index eef00f102d0..fe65aa026fe 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -58,25 +58,30 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Chore; -import org.apache.hadoop.hbase.ClockOutOfSyncException; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.FailedSanityCheckException; +import org.apache.hadoop.hbase.exceptions.ClockOutOfSyncException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HealthCheckChore; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.NotServingRegionException; -import org.apache.hadoop.hbase.OutOfOrderScannerNextException; -import org.apache.hadoop.hbase.RegionMovedException; +import org.apache.hadoop.hbase.exceptions.LeaseException; +import org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.OutOfOrderScannerNextException; +import org.apache.hadoop.hbase.exceptions.RegionAlreadyInTransitionException; +import org.apache.hadoop.hbase.exceptions.RegionMovedException; import org.apache.hadoop.hbase.RegionServerStatusProtocol; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.TableDescriptors; -import org.apache.hadoop.hbase.UnknownScannerException; -import org.apache.hadoop.hbase.YouAreDeadException; +import org.apache.hadoop.hbase.exceptions.RegionServerRunningException; +import org.apache.hadoop.hbase.exceptions.RegionServerStoppedException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; +import org.apache.hadoop.hbase.exceptions.YouAreDeadException; import org.apache.hadoop.hbase.ZNodeClearer; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.catalog.MetaEditor; @@ -95,7 +100,7 @@ import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.executor.ExecutorService; -import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType; +import org.apache.hadoop.hbase.executor.ExecutorType; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.fs.HFileSystem; @@ -106,9 +111,10 @@ import org.apache.hadoop.hbase.ipc.HBaseServerRPC; import org.apache.hadoop.hbase.ipc.ProtobufRpcClientEngine; import org.apache.hadoop.hbase.ipc.RpcClientEngine; import org.apache.hadoop.hbase.ipc.RpcServer; -import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; +import org.apache.hadoop.hbase.exceptions.ServerNotRunningYetException; import org.apache.hadoop.hbase.ipc.ServerRpcController; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.ReplicationProtbufUtil; import org.apache.hadoop.hbase.protobuf.RequestConverter; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest; @@ -171,7 +177,6 @@ import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.Regio import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.ReportRSFatalErrorRequest; import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException; import org.apache.hadoop.hbase.regionserver.compactions.CompactionProgress; -import org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest; import org.apache.hadoop.hbase.regionserver.handler.CloseMetaHandler; import org.apache.hadoop.hbase.regionserver.handler.CloseRegionHandler; import org.apache.hadoop.hbase.regionserver.handler.CloseRootHandler; @@ -3686,7 +3691,7 @@ public class HRegionServer implements ClientProtocol, if (replicationSinkHandler != null) { checkOpen(); requestCount.increment(); - HLog.Entry[] entries = ProtobufUtil.toHLogEntries(request.getEntryList()); + HLog.Entry[] entries = ReplicationProtbufUtil.toHLogEntries(request.getEntryList()); if (entries != null && entries.length > 0) { replicationSinkHandler.replicateLogEntries(entries); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java index a24c8d29430..c39e6ade5b1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java @@ -31,7 +31,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java index ac4de6f9163..3c8f9aea9e1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -50,10 +50,10 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.KeyValue.KVComparator; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.backup.HFileArchiver; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.WrongRegionException; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.io.compress.Compression; @@ -62,7 +62,7 @@ import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoderImpl; import org.apache.hadoop.hbase.io.hfile.HFileScanner; -import org.apache.hadoop.hbase.io.hfile.InvalidHFileException; +import org.apache.hadoop.hbase.exceptions.InvalidHFileException; import org.apache.hadoop.hbase.io.hfile.NoOpDataBlockEncoder; import org.apache.hadoop.hbase.monitoring.MonitoredTask; import org.apache.hadoop.hbase.regionserver.compactions.CompactSelection; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Leases.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Leases.java index 19de8161e9b..fd100d09451 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Leases.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Leases.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.regionserver; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.exceptions.LeaseException; import org.apache.hadoop.hbase.util.HasThread; import java.util.ConcurrentModificationException; @@ -187,7 +188,7 @@ public class Leases extends HasThread { * Renew a lease * * @param leaseName name of lease - * @throws LeaseException + * @throws org.apache.hadoop.hbase.exceptions.LeaseException */ public void renewLease(final String leaseName) throws LeaseException { synchronized (leaseQueue) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java index 9488749c11e..c1a93ed86c3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.*; -import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.regionserver.wal.HLogKey; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java index ca7ce44b5ba..d66bc9ebb64 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java @@ -39,7 +39,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DroppedSnapshotException; +import org.apache.hadoop.hbase.exceptions.DroppedSnapshotException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiRowMutationProcessor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiRowMutationProcessor.java index 4bea0116983..d8cdcdb8478 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiRowMutationProcessor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiRowMutationProcessor.java @@ -22,7 +22,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Mutation; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RowProcessor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RowProcessor.java index 88805403d27..e07ffe855c1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RowProcessor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RowProcessor.java @@ -37,7 +37,7 @@ import com.google.protobuf.Message; * Defines the procedure to atomically perform multiple scans and mutations * on a HRegion. * - * This is invoked by {@link HRegion#processRowsWithLocks()}. + * This is invoked by HRegion#processRowsWithLocks(). * This class performs scans and generates mutations and WAL edits. * The locks and MVCC will be handled by HRegion. * diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java index 9c7dc581256..ff5d98b8217 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java @@ -29,7 +29,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.SplitLogCounters; import org.apache.hadoop.hbase.SplitLogTask; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java index ffd797c800a..e9b8ad8a9be 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java @@ -42,7 +42,7 @@ import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.catalog.MetaEditor; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.CancelableProgressable; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index 620af1f1479..3a3ab8361d6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -29,7 +29,7 @@ import java.util.concurrent.CountDownLatch; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Scan; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java index 3eb5e928546..fe69f28a33a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.regionserver.handler; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.Server; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.RegionServerServices; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java index bf23a364cf6..c98970e4790 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java @@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.executor.EventHandler; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.RegionServerServices; import org.apache.hadoop.hbase.zookeeper.ZKAssign; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java index e6270839445..633cdf3179c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java @@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.regionserver.handler; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.Server; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.RegionServerServices; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java index 0c1929c715d..2278e0babae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java @@ -22,6 +22,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.Server; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.RegionServerServices; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java index 1f361a0e807..2dcb3ff6073 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java @@ -28,10 +28,10 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.executor.EventHandler; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.RegionServerAccounting; import org.apache.hadoop.hbase.regionserver.RegionServerServices; -import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.util.CancelableProgressable; import org.apache.hadoop.hbase.zookeeper.ZKAssign; import org.apache.zookeeper.KeeperException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java index dfe87d55c33..25728e6de1e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java @@ -22,6 +22,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.Server; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.RegionServerServices; /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/ParallelSeekHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/ParallelSeekHandler.java index 9a5f84deb53..f0935faa959 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/ParallelSeekHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/ParallelSeekHandler.java @@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.executor.EventHandler; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.KeyValueScanner; import org.apache.hadoop.hbase.regionserver.MultiVersionConsistencyControl; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/FlushSnapshotSubprocedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/FlushSnapshotSubprocedure.java index 9c27008cf75..b0a1b33d687 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/FlushSnapshotSubprocedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/FlushSnapshotSubprocedure.java @@ -31,7 +31,7 @@ import org.apache.hadoop.hbase.procedure.Subprocedure; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.snapshot.RegionServerSnapshotManager.SnapshotSubprocedurePool; -import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; +import org.apache.hadoop.hbase.snapshot.ClientSnapshotDescriptionUtils; /** * This online snapshot implementation uses the distributed procedure framework to force a @@ -101,7 +101,7 @@ public class FlushSnapshotSubprocedure extends Subprocedure { // assert that the taskManager is empty. if (taskManager.hasTasks()) { throw new IllegalStateException("Attempting to take snapshot " - + SnapshotDescriptionUtils.toString(snapshot) + + ClientSnapshotDescriptionUtils.toString(snapshot) + " but we currently have outstanding tasks"); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java index 987a713ca28..f9ad6a71bfa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/snapshot/RegionServerSnapshotManager.java @@ -48,7 +48,7 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescriptio import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.RegionServerServices; -import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.hadoop.hbase.exceptions.SnapshotCreationException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java index fbcfa30aa20..59405d1a245 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java @@ -40,8 +40,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -57,6 +55,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.hbase.util.DrainBarrier; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java index 8093491cefc..9442180a743 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java @@ -22,17 +22,15 @@ package org.apache.hadoop.hbase.regionserver.wal; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import java.io.OutputStream; -import java.util.NavigableSet; import java.util.UUID; import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; import org.apache.hadoop.io.Writable; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; @@ -53,11 +51,6 @@ public interface HLog { /** The META region's HLog filename extension */ public static final String META_HLOG_FILE_EXTN = ".meta"; - /* - * Name of directory that holds recovered edits written by the wal log - * splitting code, one per region - */ - static final String RECOVERED_EDITS_DIR = "recovered.edits"; static final Pattern EDITFILES_NAME_PATTERN = Pattern.compile("-?[0-9]+"); public static final String RECOVERED_LOG_TMPFILE_SUFFIX = ".temp"; @@ -207,7 +200,7 @@ public interface HLog { * @return If lots of logs, flush the returned regions so next time through we * can clean logs. Returns null if nothing to flush. Names are actual * region names as returned by {@link HRegionInfo#getEncodedName()} - * @throws org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException + * @throws org.apache.hadoop.hbase.exceptions.FailedLogCloseException * @throws IOException */ public byte[][] rollWriter() throws FailedLogCloseException, IOException; @@ -225,7 +218,7 @@ public interface HLog { * @return If lots of logs, flush the returned regions so next time through we * can clean logs. Returns null if nothing to flush. Names are actual * region names as returned by {@link HRegionInfo#getEncodedName()} - * @throws org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException + * @throws org.apache.hadoop.hbase.exceptions.FailedLogCloseException * @throws IOException */ public byte[][] rollWriter(boolean force) throws FailedLogCloseException, diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java index 8d500f2ba3d..7ab4828343b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java @@ -49,10 +49,10 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.RemoteExceptionHandler; +import org.apache.hadoop.hbase.exceptions.OrphanHLogAfterSplitException; import org.apache.hadoop.hbase.io.HeapSize; import org.apache.hadoop.hbase.master.SplitLogManager; import org.apache.hadoop.hbase.monitoring.MonitoredTask; @@ -610,7 +610,7 @@ public class HLogSplitter { fs.mkdirs(tmp); } tmp = new Path(tmp, - HLog.RECOVERED_EDITS_DIR + "_" + encodedRegionName); + HConstants.RECOVERED_EDITS_DIR + "_" + encodedRegionName); LOG.warn("Found existing old file: " + dir + ". It could be some " + "leftover of an old installation. It should be a folder instead. " + "So moving it to " + tmp); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogUtil.java index 4bb546f3675..b2cd2f67d7e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogUtil.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogUtil.java @@ -20,9 +20,6 @@ package org.apache.hadoop.hbase.regionserver.wal; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; import java.util.NavigableSet; import java.util.TreeSet; import java.util.regex.Matcher; @@ -36,8 +33,6 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.regionserver.wal.HLog.Reader; -import org.apache.hadoop.hbase.regionserver.wal.HLog.Writer; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.HConstants; @@ -157,7 +152,7 @@ public class HLogUtil { * regiondir */ public static Path getRegionDirRecoveredEditsDir(final Path regiondir) { - return new Path(regiondir, HLog.RECOVERED_EDITS_DIR); + return new Path(regiondir, HConstants.RECOVERED_EDITS_DIR); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index c0429ab0fd0..8910a7eb68f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -52,6 +52,7 @@ import org.apache.hadoop.hbase.client.AdminProtocol; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HConnectionManager; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.protobuf.ReplicationProtbufUtil; import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.regionserver.wal.HLogKey; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; @@ -635,8 +636,8 @@ public class ReplicationSource extends Thread } try { AdminProtocol rrs = getRS(); - ProtobufUtil.replicateWALEntry(rrs, - Arrays.copyOf(this.entriesArray, currentNbEntries)); + ReplicationProtbufUtil.replicateWALEntry(rrs, + Arrays.copyOf(this.entriesArray, currentNbEntries)); if (this.lastLoggedPosition != this.repLogReader.getPosition()) { this.manager.logPositionAndCleanOldLogs(this.currentPath, this.peerClusterZnode, this.repLogReader.getPosition(), diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java index 03ec2787855..ce9d463772f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java @@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.MetaScanner; import org.apache.hadoop.hbase.rest.model.TableInfoModel; import org.apache.hadoop.hbase.rest.model.TableRegionModel; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java index 333b691f130..c3872511f3a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java @@ -40,7 +40,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HTableInterface; import org.apache.hadoop.hbase.client.HTablePool; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java index 91b099dcf63..400d15e1cfd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java @@ -28,7 +28,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HTableInterface; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResource.java index dbc2e7d74d6..e12401260fd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResource.java @@ -39,7 +39,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.rest.model.ScannerModel; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java index 3426f6dfcff..2776955d24a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java @@ -26,7 +26,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.UnknownScannerException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.client.HTableInterface; import org.apache.hadoop.hbase.client.HTablePool; import org.apache.hadoop.hbase.client.Result; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java index 09bc4cef586..6cef00578c3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java @@ -42,8 +42,8 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableExistsException; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableExistsException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTableInterface; import org.apache.hadoop.hbase.client.HTablePool; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcServer.java index 09a26ffe7f6..2ba2b455b08 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcServer.java @@ -19,12 +19,8 @@ package org.apache.hadoop.hbase.security; import java.io.ByteArrayInputStream; -import java.io.DataInput; import java.io.DataInputStream; -import java.io.DataOutput; import java.io.IOException; -import java.util.Map; -import java.util.TreeMap; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; @@ -35,7 +31,6 @@ import javax.security.sasl.AuthorizeCallback; import javax.security.sasl.RealmCallback; import javax.security.sasl.Sasl; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -43,7 +38,6 @@ import org.apache.hadoop.hbase.ipc.HBaseServer; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.token.SecretManager; import org.apache.hadoop.security.token.TokenIdentifier; -import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod; import org.apache.hadoop.security.token.SecretManager.InvalidToken; /** @@ -51,11 +45,6 @@ import org.apache.hadoop.security.token.SecretManager.InvalidToken; */ public class HBaseSaslRpcServer { public static final Log LOG = LogFactory.getLog(HBaseSaslRpcServer.class); - public static final String SASL_DEFAULT_REALM = "default"; - public static final Map SASL_PROPS = - new TreeMap(); - - public static final int SWITCH_TO_SIMPLE_AUTH = -88; public static enum QualityOfProtection { AUTHENTICATION("auth"), @@ -85,21 +74,13 @@ public class HBaseSaslRpcServer { saslQOP = QualityOfProtection.PRIVACY; } - SASL_PROPS.put(Sasl.QOP, saslQOP.getSaslQop()); - SASL_PROPS.put(Sasl.SERVER_AUTH, "true"); - } - - static String encodeIdentifier(byte[] identifier) { - return new String(Base64.encodeBase64(identifier)); - } - - static byte[] decodeIdentifier(String identifier) { - return Base64.decodeBase64(identifier.getBytes()); + SaslUtil.SASL_PROPS.put(Sasl.QOP, saslQOP.getSaslQop()); + SaslUtil.SASL_PROPS.put(Sasl.SERVER_AUTH, "true"); } public static T getIdentifier(String id, SecretManager secretManager) throws InvalidToken { - byte[] tokenId = decodeIdentifier(id); + byte[] tokenId = SaslUtil.decodeIdentifier(id); T tokenIdentifier = secretManager.createIdentifier(); try { tokenIdentifier.readFields(new DataInputStream(new ByteArrayInputStream( @@ -111,66 +92,6 @@ public class HBaseSaslRpcServer { return tokenIdentifier; } - static char[] encodePassword(byte[] password) { - return new String(Base64.encodeBase64(password)).toCharArray(); - } - - /** Splitting fully qualified Kerberos name into parts */ - public static String[] splitKerberosName(String fullName) { - return fullName.split("[/@]"); - } - - public enum SaslStatus { - SUCCESS (0), - ERROR (1); - - public final int state; - private SaslStatus(int state) { - this.state = state; - } - } - - /** Authentication method */ - public static enum AuthMethod { - SIMPLE((byte) 80, "", AuthenticationMethod.SIMPLE), - KERBEROS((byte) 81, "GSSAPI", AuthenticationMethod.KERBEROS), - DIGEST((byte) 82, "DIGEST-MD5", AuthenticationMethod.TOKEN); - - /** The code for this method. */ - public final byte code; - public final String mechanismName; - public final AuthenticationMethod authenticationMethod; - - private AuthMethod(byte code, String mechanismName, - AuthenticationMethod authMethod) { - this.code = code; - this.mechanismName = mechanismName; - this.authenticationMethod = authMethod; - } - - private static final int FIRST_CODE = values()[0].code; - - /** Return the object represented by the code. */ - private static AuthMethod valueOf(byte code) { - final int i = (code & 0xff) - FIRST_CODE; - return i < 0 || i >= values().length ? null : values()[i]; - } - - /** Return the SASL mechanism name */ - public String getMechanismName() { - return mechanismName; - } - - /** Read from in */ - public static AuthMethod read(DataInput in) throws IOException { - return valueOf(in.readByte()); - } - - /** Write to out */ - public void write(DataOutput out) throws IOException { - out.write(code); - } - }; /** CallbackHandler for SASL DIGEST-MD5 mechanism */ public static class SaslDigestCallbackHandler implements CallbackHandler { @@ -185,7 +106,7 @@ public class HBaseSaslRpcServer { } private char[] getPassword(TokenIdentifier tokenid) throws InvalidToken { - return encodePassword(secretManager.retrievePassword(tokenid)); + return SaslUtil.encodePassword(secretManager.retrievePassword(tokenid)); } /** {@inheritDoc} */ diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlFilter.java index a7115cc1789..8d01effb923 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlFilter.java @@ -18,18 +18,11 @@ package org.apache.hadoop.hbase.security.access; -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.filter.FilterBase; -import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; import org.apache.hadoop.hbase.security.User; -import com.google.protobuf.InvalidProtocolBufferException; - /** * NOTE: for internal use only by AccessController implementation * @@ -84,7 +77,7 @@ class AccessControlFilter extends FilterBase { /** * @param pbBytes A pb serialized {@link AccessControlFilter} instance * @return An instance of {@link AccessControlFilter} made from bytes - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException * @see {@link #toByteArray()} */ public static AccessControlFilter parseFrom(final byte [] pbBytes) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java index 4c9eb67224c..f829dd45acc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java @@ -32,7 +32,7 @@ import java.util.TreeSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java index 84f67775679..720fd9bba08 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java @@ -46,6 +46,7 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.coprocessor.*; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.filter.CompareFilter; import org.apache.hadoop.hbase.filter.FilterList; import org.apache.hadoop.hbase.filter.ByteArrayComparable; @@ -62,7 +63,7 @@ import org.apache.hadoop.hbase.regionserver.Store; import org.apache.hadoop.hbase.regionserver.ScanType; import org.apache.hadoop.hbase.regionserver.StoreFile; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; -import org.apache.hadoop.hbase.security.AccessDeniedException; +import org.apache.hadoop.hbase.exceptions.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.access.Permission.Action; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java index bfef425530b..d2ed1ba3111 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java @@ -31,7 +31,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.ipc.RequestContext; @@ -45,6 +45,7 @@ import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.CleanupBu import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.SecureBulkLoadHFilesRequest; import org.apache.hadoop.hbase.protobuf.generated.SecureBulkLoadProtos.SecureBulkLoadHFilesResponse; import org.apache.hadoop.hbase.regionserver.HRegion; +import org.apache.hadoop.hbase.security.SecureBulkLoadUtil; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Methods; @@ -100,7 +101,6 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService private final static FsPermission PERM_ALL_ACCESS = FsPermission.valueOf("-rwxrwxrwx"); private final static FsPermission PERM_HIDDEN = FsPermission.valueOf("-rwx--x--x"); - private final static String BULKLOAD_STAGING_DIR = "hbase.bulkload.staging.dir"; private SecureRandom random; private FileSystem fs; @@ -118,7 +118,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService this.env = (RegionCoprocessorEnvironment)env; random = new SecureRandom(); conf = env.getConfiguration(); - baseStagingDir = getBaseStagingDir(conf); + baseStagingDir = SecureBulkLoadUtil.getBaseStagingDir(conf); try { fs = FileSystem.get(conf); @@ -290,19 +290,6 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService return user; } - /** - * This returns the staging path for a given column family. - * This is needed for clean recovery and called reflectively in LoadIncrementalHFiles - */ - public static Path getStagingPath(Configuration conf, String bulkToken, byte[] family) { - Path stageP = new Path(getBaseStagingDir(conf), bulkToken); - return new Path(stageP, Bytes.toString(family)); - } - - private static Path getBaseStagingDir(Configuration conf) { - return new Path(conf.get(BULKLOAD_STAGING_DIR, "/tmp/hbase-staging")); - } - @Override public Service getService() { return this; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TableAuthManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TableAuthManager.java index 0252f46e455..2e5a6103a0c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TableAuthManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/TableAuthManager.java @@ -24,7 +24,7 @@ import com.google.common.collect.Lists; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java index 7f3492a405f..cb649d9fcad 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/TokenProvider.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.ipc.RpcServer; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos; -import org.apache.hadoop.hbase.security.AccessDeniedException; +import org.apache.hadoop.hbase.exceptions.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java index 498c553eb28..0bf084cfab1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java @@ -41,6 +41,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.exceptions.ExportSnapshotException; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.io.HLogLink; import org.apache.hadoop.hbase.mapreduce.JobUtil; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java index e04876871ee..44c1a0275fd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java @@ -28,9 +28,9 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.exceptions.CorruptedSnapshotException; +import org.apache.hadoop.hbase.exceptions.SnapshotCreationException; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; -import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.FSUtils; @@ -123,25 +123,6 @@ public class SnapshotDescriptionUtils { // private constructor for utility class } - /** - * Check to make sure that the description of the snapshot requested is valid - * @param snapshot description of the snapshot - * @throws IllegalArgumentException if the name of the snapshot or the name of the table to - * snapshot are not valid names. - */ - public static void assertSnapshotRequestIsValid(SnapshotDescription snapshot) - throws IllegalArgumentException { - // FIXME these method names is really bad - trunk will probably change - // .META. and -ROOT- snapshots are not allowed - if (HTableDescriptor.isMetaTable(Bytes.toBytes(snapshot.getTable()))) { - throw new IllegalArgumentException(".META. and -ROOT- snapshots are not allowed"); - } - // make sure the snapshot name is valid - HTableDescriptor.isLegalTableName(Bytes.toBytes(snapshot.getName())); - // make sure the table name is valid - HTableDescriptor.isLegalTableName(Bytes.toBytes(snapshot.getTable())); - } - /** * @param conf {@link Configuration} from which to check for the timeout * @param type type of snapshot being taken @@ -304,7 +285,7 @@ public class SnapshotDescriptionUtils { * @param fs filesystem where the snapshot was taken * @param snapshotDir directory where the snapshot was stored * @return the stored snapshot description - * @throws CorruptedSnapshotException if the snapshot cannot be read + * @throws org.apache.hadoop.hbase.exceptions.CorruptedSnapshotException if the snapshot cannot be read */ public static SnapshotDescription readSnapshotInfo(FileSystem fs, Path snapshotDir) throws CorruptedSnapshotException { @@ -329,7 +310,7 @@ public class SnapshotDescriptionUtils { * @param rootdir root directory of the hbase installation * @param workingDir directory where the in progress snapshot was built * @param fs {@link FileSystem} where the snapshot was built - * @throws SnapshotCreationException if the snapshot could not be moved + * @throws org.apache.hadoop.hbase.exceptions.SnapshotCreationException if the snapshot could not be moved * @throws IOException the filesystem could not be reached */ public static void completeSnapshot(SnapshotDescription snapshot, Path rootdir, Path workingDir, @@ -343,18 +324,4 @@ public class SnapshotDescriptionUtils { } } - /** - * Returns a single line (no \n) representation of snapshot metadata. Use this instead of - * {@link SnapshotDescription#toString()}. We don't replace SnapshotDescrpition's toString - * because it is auto-generated by protoc. - * @param ssd - * @return Single line string with a summary of the snapshot parameters - */ - public static String toString(SnapshotDescription ssd) { - if (ssd == null) { - return null; - } - return "{ ss=" + ssd.getName() + " table=" + ssd.getTable() - + " type=" + ssd.getType() + " }"; - } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TableInfoCopyTask.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TableInfoCopyTask.java index 9d431b48d9c..e7c79e2e588 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TableInfoCopyTask.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TableInfoCopyTask.java @@ -59,7 +59,7 @@ public class TableInfoCopyTask extends SnapshotTask { LOG.debug("Running table info copy."); this.rethrowException(); LOG.debug("Attempting to copy table info for snapshot:" - + SnapshotDescriptionUtils.toString(this.snapshot)); + + ClientSnapshotDescriptionUtils.toString(this.snapshot)); // get the HTable descriptor HTableDescriptor orig = FSTableDescriptors.getTableDescriptor(fs, rootDir, Bytes.toBytes(this.snapshot.getTable())); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java index 54c6e4ac38b..9d95daff759 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java @@ -35,6 +35,7 @@ import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.errorhandling.ForeignExceptionListener; import org.apache.hadoop.hbase.errorhandling.TimeoutExceptionInjector; +import org.apache.hadoop.hbase.exceptions.CorruptedSnapshotException; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HStore; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index f8280dc4126..12d9a006101 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java @@ -52,7 +52,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HBaseAdmin; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java index 47e4fe3ce7b..a3c88c62921 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java @@ -22,6 +22,7 @@ package org.apache.hadoop.hbase.tool; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; @@ -31,7 +32,6 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HBaseConfiguration; -import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HTable; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index b092fd0298d..7bfeacf3e3a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -39,11 +39,11 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableDescriptors; -import org.apache.hadoop.hbase.TableInfoMissingException; +import org.apache.hadoop.hbase.exceptions.TableInfoMissingException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import com.google.common.primitives.Ints; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java index 840425d441d..af154bede3d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java @@ -48,12 +48,13 @@ import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.fs.permission.FsAction; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hbase.ClusterId; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.RemoteExceptionHandler; +import org.apache.hadoop.hbase.exceptions.FileSystemVersionException; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.FSProtos; @@ -289,7 +290,7 @@ public abstract class FSUtils { * @param rootdir root hbase directory * @return null if no version file exists, version string otherwise. * @throws IOException e - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException */ public static String getVersion(FileSystem fs, Path rootdir) throws IOException, DeserializationException { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 0098f0acdf1..5bc8313764a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -63,9 +63,9 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.MetaEditor; import org.apache.hadoop.hbase.client.AdminProtocol; import org.apache.hadoop.hbase.client.Delete; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java index 8935db62d38..373e51e11a8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.MetaEditor; import org.apache.hadoop.hbase.client.AdminProtocol; import org.apache.hadoop.hbase.client.HBaseAdmin; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HMerge.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HMerge.java index b24943009ce..1b0c508b798 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HMerge.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HMerge.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.RemoteExceptionHandler; -import org.apache.hadoop.hbase.TableNotDisabledException; +import org.apache.hadoop.hbase.exceptions.TableNotDisabledException; import org.apache.hadoop.hbase.catalog.MetaEditor; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HBaseAdmin; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Merge.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Merge.java index 3037aae4b9e..4ff74c6edbb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Merge.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/Merge.java @@ -33,8 +33,8 @@ import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HBaseAdmin; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java index 46d13d5e20c..2e67afad5d1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java @@ -40,7 +40,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.hfile.CacheConfig; -import org.apache.hadoop.hbase.io.hfile.CorruptHFileException; +import org.apache.hadoop.hbase.exceptions.CorruptHFileException; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.util.FSUtils.FamilyDirFilter; import org.apache.hadoop.hbase.util.FSUtils.HFileFilter; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java index bd15540eb72..43168a27d82 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.LoadBalancerProtos; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 8946d33f3f1..0d58d2ef99c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -63,6 +63,10 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.TableExistsException; +import org.apache.hadoop.hbase.exceptions.TableNotEnabledException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; @@ -2115,7 +2119,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { * @param serverName * @return * @throws IOException - * @throws ZooKeeperConnectionException + * @throws org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException * @throws KeeperException * @throws NodeExistsException */ diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java index d2b33eb5bad..ec3ec27cd8d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java @@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.TableExistsException; import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.util.Tool; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java index e54baba77e9..253460936dd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHColumnDescriptor.java @@ -20,11 +20,11 @@ package org.apache.hadoop.hbase; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.regionserver.BloomType; -import org.apache.hadoop.hbase.regionserver.StoreFile; import org.junit.experimental.categories.Category; import org.junit.Test; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java index 690337a9969..bc8e72c8689 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver; import org.apache.hadoop.hbase.coprocessor.SampleRegionWALObserver; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java index 09e7b724f5f..a02f0507e84 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestMultiVersions.java @@ -40,6 +40,8 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.util.Bytes; import org.junit.After; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java index cc0123468db..62b002f2242 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestSerialization.java @@ -34,6 +34,7 @@ import java.util.Set; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.filter.BinaryComparator; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java index 644f7426485..29921d81fc1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java @@ -37,7 +37,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.MediumTests; -import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.AdminProtocol; import org.apache.hadoop.hbase.client.ClientProtocol; @@ -47,7 +47,7 @@ import org.apache.hadoop.hbase.client.HConnectionTestingUtility; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.RetriesExhaustedException; import org.apache.hadoop.hbase.client.ServerCallable; -import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException; +import org.apache.hadoop.hbase.exceptions.ServerNotRunningYetException; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoRequest; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetRequest; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java index ac697071ca6..aef8ee4727a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java @@ -24,7 +24,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation; import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionKey; import org.mockito.Mockito; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java index 847821ffbca..7909f9833b3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java @@ -41,17 +41,21 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.catalog.CatalogTracker; +import org.apache.hadoop.hbase.exceptions.InvalidFamilyOperationException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.TableExistsException; +import org.apache.hadoop.hbase.exceptions.TableNotDisabledException; +import org.apache.hadoop.hbase.exceptions.TableNotEnabledException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.executor.EventHandler; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; -import org.apache.hadoop.hbase.executor.ExecutorService; import org.apache.hadoop.hbase.master.AssignmentManager; import org.apache.hadoop.hbase.master.HMaster; -import org.apache.hadoop.hbase.master.MasterServices; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.wal.HLogUtilsForTests; -import org.apache.hadoop.hbase.InvalidFamilyOperationException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.zookeeper.ZKTableReadOnly; @@ -244,7 +248,7 @@ public class TestAdmin { boolean ok = false; try { ht.get(get); - } catch (DoNotRetryIOException e) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException e) { ok = true; } assertTrue(ok); @@ -290,7 +294,7 @@ public class TestAdmin { try { ht1.get(get); ht2.get(get); - } catch (DoNotRetryIOException e) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException e) { ok = true; } @@ -999,7 +1003,7 @@ public class TestAdmin { this.admin.disableTable(tableName); try { new HTable(TEST_UTIL.getConfiguration(), tableName); - } catch (DoNotRetryIOException e) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException e) { //expected } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java index b77c6c20e01..26d10d1b6e4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestClientTimeouts.java @@ -27,9 +27,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.MasterAdminProtocol; -import org.apache.hadoop.hbase.MasterMonitorProtocol; -import org.apache.hadoop.hbase.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.ipc.RandomTimeoutRpcEngine; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java index a7efa223fd2..ac893bb9921 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java @@ -49,7 +49,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DoNotRetryIOException; +import org.apache.hadoop.hbase.exceptions.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; @@ -85,13 +85,12 @@ import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutation.MultiMutateRe import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutation.MultiRowMutationService; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; -import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException; +import org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException; import org.apache.hadoop.hbase.regionserver.Store; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; -import org.apache.hadoop.io.DataInputBuffer; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java index 56b6854ac83..e80f2080154 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java @@ -30,7 +30,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Random; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -42,6 +41,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation; import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionKey; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java index 0e57ecbe588..ab1ecd8ec07 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClient.java @@ -24,33 +24,21 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.util.HashSet; -import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FileStatus; -import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.MasterFileSystem; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; -import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; -import org.apache.hadoop.hbase.regionserver.HRegion; -import org.apache.hadoop.hbase.regionserver.HRegionServer; -import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException; -import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; -import org.apache.hadoop.hbase.snapshot.SnapshotDoesNotExistException; -import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; +import org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException; +import org.apache.hadoop.hbase.exceptions.SnapshotDoesNotExistException; import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.util.FSTableDescriptors; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.MD5Hash; import org.junit.*; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java index 8c96ab5e916..21d2c7e0adb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java @@ -32,11 +32,11 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy; -import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.hadoop.hbase.exceptions.SnapshotCreationException; import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java index 03fec35aa28..a18c7c82a48 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hbase.constraint; import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.exceptions.ConstraintException; /** * Always fail the put. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java index 64f6e6d342a..4173afb80ab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hbase.constraint; import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.exceptions.ConstraintException; /** * Always non-gracefully fail on attempt diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java index 47f7e33427d..fd302dd594c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/constraint/TestConstraint.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException; +import org.apache.hadoop.hbase.exceptions.ConstraintException; import org.apache.hadoop.hbase.util.Bytes; import org.junit.After; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/ColumnAggregationEndpoint.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/ColumnAggregationEndpoint.java index 87decc5711e..1fa33de18eb 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/ColumnAggregationEndpoint.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/ColumnAggregationEndpoint.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.coprocessor.protobuf.generated.ColumnAggregationProtos.ColumnAggregationService; import org.apache.hadoop.hbase.coprocessor.protobuf.generated.ColumnAggregationProtos.SumRequest; import org.apache.hadoop.hbase.coprocessor.protobuf.generated.ColumnAggregationProtos.SumResponse; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.protobuf.ResponseConverter; import org.apache.hadoop.hbase.regionserver.InternalScanner; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java index c08559200f8..9dde497dbce 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java @@ -33,7 +33,6 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Coprocessor; import org.apache.hadoop.hbase.CoprocessorEnvironment; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; @@ -322,7 +321,7 @@ public class TestCoprocessorInterface extends HBaseTestCase { Get g = new Get(regions[i].getStartKey()); regions[i].get(g); fail(); - } catch (DoNotRetryIOException xc) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException xc) { } assertNull(regions[i].getCoprocessorHost(). findCoprocessor(CoprocessorII.class.getName())); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java index a2c6b20a788..4f57ced0610 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterCoprocessorExceptionWithRemove.java @@ -40,7 +40,7 @@ import static org.junit.Assert.*; /** * Tests unhandled exceptions thrown by coprocessors running on master. * Expected result is that the master will remove the buggy coprocessor from - * its set of coprocessors and throw a org.apache.hadoop.hbase.DoNotRetryIOException + * its set of coprocessors and throw a org.apache.hadoop.hbase.exceptions.DoNotRetryIOException * back to the client. * (HBASE-4014). */ @@ -183,7 +183,7 @@ public class TestMasterCoprocessorExceptionWithRemove { HBaseAdmin admin = UTIL.getHBaseAdmin(); admin.createTable(htd1); } catch (IOException e) { - if (e.getClass().getName().equals("org.apache.hadoop.hbase.DoNotRetryIOException")) { + if (e.getClass().getName().equals("org.apache.hadoop.hbase.exceptions.DoNotRetryIOException")) { threwDNRE = true; } } finally { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java index 5da6b974555..0534d3ab44d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithRemove.java @@ -39,7 +39,7 @@ import static org.junit.Assert.*; /** * Tests unhandled exceptions thrown by coprocessors running on regionserver. * Expected result is that the master will remove the buggy coprocessor from - * its set of coprocessors and throw a org.apache.hadoop.hbase.DoNotRetryIOException + * its set of coprocessors and throw a org.apache.hadoop.hbase.exceptions.DoNotRetryIOException * back to the client. * (HBASE-4014). */ diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java index 5d079446dce..faac76e99cf 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java @@ -22,7 +22,6 @@ import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; import java.io.IOException; -import java.io.PrintWriter; import java.io.StringWriter; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; @@ -31,10 +30,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.*; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; import org.apache.hadoop.hbase.executor.ExecutorService.Executor; import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorStatus; -import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType; +import org.apache.hadoop.hbase.executor.ExecutorType; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWithScanLimits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWithScanLimits.java index 35fe2c24f37..768a8644820 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWithScanLimits.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWithScanLimits.java @@ -31,18 +31,14 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.SmallTests; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.filter.CompareFilter; -import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; -import org.apache.hadoop.hbase.filter.SubstringComparator; import org.apache.hadoop.hbase.util.Bytes; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java index bd89a165755..b17285c9103 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterWrapper.java @@ -31,18 +31,14 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.SmallTests; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.filter.CompareFilter; -import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; -import org.apache.hadoop.hbase.filter.SubstringComparator; import org.apache.hadoop.hbase.util.Bytes; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java index dd2bbf7582d..fa9b6274ff5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/encoding/TestDataBlockEncoders.java @@ -29,11 +29,11 @@ import java.util.List; import java.util.Random; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.LargeTests; import org.apache.hadoop.hbase.io.compress.Compression; -import org.apache.hadoop.hbase.io.hfile.HFileBlock; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.test.RedundantKVGenerator; import org.junit.Test; @@ -53,7 +53,7 @@ public class TestDataBlockEncoders { static int NUM_RANDOM_SEEKS = 10000; private static int ENCODED_DATA_OFFSET = - HFileBlock.HEADER_SIZE + DataBlockEncoding.ID_SIZE; + HConstants.HFILEBLOCK_HEADER_SIZE + DataBlockEncoding.ID_SIZE; private RedundantKVGenerator generator = new RedundantKVGenerator(); private Random randomizer = new Random(42l); @@ -74,9 +74,9 @@ public class TestDataBlockEncoders { DataBlockEncoder encoder = encoding.getEncoder(); if (encoder != null) { return encoder.newDataBlockEncodingContext(algo, encoding, - HFileBlock.DUMMY_HEADER); + HConstants.HFILEBLOCK_DUMMY_HEADER); } else { - return new HFileBlockDefaultEncodingContext(algo, encoding, HFileBlock.DUMMY_HEADER); + return new HFileBlockDefaultEncodingContext(algo, encoding, HConstants.HFILEBLOCK_DUMMY_HEADER); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java index 0ae8523b634..c9125a7dc25 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java @@ -33,6 +33,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MultithreadedTestUtil; import org.apache.hadoop.hbase.MultithreadedTestUtil.TestThread; import org.apache.hadoop.hbase.io.HeapSize; @@ -344,7 +345,7 @@ public class CacheTestUtils { prevBlockOffset, cachedBuffer, HFileBlock.DONT_FILL_HEADER, blockSize, includesMemstoreTS, HFileBlock.MINOR_VERSION_NO_CHECKSUM, 0, ChecksumType.NULL.getCode(), - onDiskSizeWithoutHeader + HFileBlock.HEADER_SIZE); + onDiskSizeWithoutHeader + HConstants.HFILEBLOCK_HEADER_SIZE); String strKey; /* No conflicting keys */ diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java index fa23be06ede..a9ba9c12057 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java @@ -21,20 +21,11 @@ package org.apache.hadoop.hbase.io.hfile; import static org.junit.Assert.*; -import java.io.ByteArrayOutputStream; import java.io.ByteArrayInputStream; import java.io.DataOutputStream; import java.io.DataInputStream; import java.io.IOException; -import java.io.OutputStream; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.zip.Checksum; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -43,15 +34,12 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.SmallTests; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; -import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ChecksumType; -import org.apache.hadoop.io.WritableUtils; -import org.apache.hadoop.io.compress.Compressor; import static org.apache.hadoop.hbase.io.compress.Compression.Algorithm.*; @@ -208,7 +196,7 @@ public class TestChecksum { os.close(); long expectedChunks = ChecksumUtil.numChunks( - dataSize + HFileBlock.HEADER_SIZE, + dataSize + HConstants.HFILEBLOCK_HEADER_SIZE, bytesPerChecksum); LOG.info("testChecksumChunks: pread=" + pread + ", bytesPerChecksum=" + bytesPerChecksum + @@ -230,7 +218,7 @@ public class TestChecksum { assertEquals(dataSize, b.getUncompressedSizeWithoutHeader()); // verify that we have the expected number of checksum chunks - assertEquals(totalSize, HFileBlock.HEADER_SIZE + dataSize + + assertEquals(totalSize, HConstants.HFILEBLOCK_HEADER_SIZE + dataSize + expectedChunks * HFileBlock.CHECKSUM_SIZE); // assert that we did not encounter hbase checksum verification failures diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java index fbee924fef8..70eea63cb14 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java @@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.KeyValue.KeyComparator; import org.apache.hadoop.hbase.SmallTests; +import org.apache.hadoop.hbase.exceptions.CorruptHFileException; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.hfile.HFile.Reader; import org.apache.hadoop.hbase.io.hfile.HFile.Writer; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java index 8f704f3ec7e..4edb0fbb030 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlock.java @@ -45,6 +45,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.fs.HFileSystem; @@ -215,7 +216,7 @@ public class TestHFileBlock { int correctLength) throws IOException { HFileBlock.Writer hbw = createTestV2Block(algo, includesMemstoreTS); byte[] testV2Block = hbw.getHeaderAndDataForTest(); - int osOffset = HFileBlock.HEADER_SIZE + 9; + int osOffset = HConstants.HFILEBLOCK_HEADER_SIZE + 9; if (testV2Block.length == correctLength) { // Force-set the "OS" field of the gzip header to 3 (Unix) to avoid // variations across operating systems. @@ -295,13 +296,13 @@ public class TestHFileBlock { if (algo == GZ) { is = fs.open(path); hbr = new HFileBlock.FSReaderV2(is, algo, totalSize); - b = hbr.readBlockData(0, 2173 + HFileBlock.HEADER_SIZE + + b = hbr.readBlockData(0, 2173 + HConstants.HFILEBLOCK_HEADER_SIZE + b.totalChecksumBytes(), -1, pread); assertEquals(blockStr, b.toString()); int wrongCompressedSize = 2172; try { b = hbr.readBlockData(0, wrongCompressedSize - + HFileBlock.HEADER_SIZE, -1, pread); + + HConstants.HFILEBLOCK_HEADER_SIZE, -1, pread); fail("Exception expected"); } catch (IOException ex) { String expectedPrefix = "On-disk size without header provided is " @@ -341,7 +342,7 @@ public class TestHFileBlock { for (int blockId = 0; blockId < numBlocks; ++blockId) { DataOutputStream dos = hbw.startWriting(BlockType.DATA); writeEncodedBlock(algo, encoding, dos, encodedSizes, encodedBlocks, - blockId, includesMemstoreTS, HFileBlock.DUMMY_HEADER); + blockId, includesMemstoreTS, HConstants.HFILEBLOCK_DUMMY_HEADER); hbw.writeHeaderAndData(os); totalSize += hbw.getOnDiskSizeWithHeader(); } @@ -490,7 +491,7 @@ public class TestHFileBlock { for (int i = 0; i < NUM_TEST_BLOCKS; ++i) { if (!pread) { assertEquals(is.getPos(), curOffset + (i == 0 ? 0 : - HFileBlock.HEADER_SIZE)); + HConstants.HFILEBLOCK_HEADER_SIZE)); } assertEquals(expectedOffsets.get(i).longValue(), curOffset); @@ -749,7 +750,7 @@ public class TestHFileBlock { } for (int size : new int[] { 100, 256, 12345 }) { - byte[] byteArr = new byte[HFileBlock.HEADER_SIZE + size]; + byte[] byteArr = new byte[HConstants.HFILEBLOCK_HEADER_SIZE + size]; ByteBuffer buf = ByteBuffer.wrap(byteArr, 0, size); HFileBlock block = new HFileBlock(BlockType.DATA, size, size, -1, buf, HFileBlock.FILL_HEADER, -1, includesMemstoreTS, @@ -757,7 +758,7 @@ public class TestHFileBlock { 0); long byteBufferExpectedSize = ClassSize.align(ClassSize.estimateBase(buf.getClass(), true) - + HFileBlock.HEADER_SIZE + size); + + HConstants.HFILEBLOCK_HEADER_SIZE + size); long hfileBlockExpectedSize = ClassSize.align(ClassSize.estimateBase(HFileBlock.class, true)); long expected = hfileBlockExpectedSize + byteBufferExpectedSize; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockCompatibility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockCompatibility.java index ffb672d3710..f28579b06ae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockCompatibility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockCompatibility.java @@ -39,6 +39,7 @@ import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.SmallTests; import org.apache.hadoop.hbase.fs.HFileSystem; import org.apache.hadoop.hbase.io.compress.Compression; @@ -129,7 +130,7 @@ public class TestHFileBlockCompatibility { int correctLength) throws IOException { Writer hbw = createTestV2Block(algo); byte[] testV2Block = hbw.getHeaderAndData(); - int osOffset = HFileBlock.HEADER_SIZE_NO_CHECKSUM + 9; + int osOffset = HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM + 9; if (testV2Block.length == correctLength) { // Force-set the "OS" field of the gzip header to 3 (Unix) to avoid // variations across operating systems. @@ -205,13 +206,13 @@ public class TestHFileBlockCompatibility { is = fs.open(path); hbr = new HFileBlock.FSReaderV2(is, is, algo, totalSize, MINOR_VERSION, fs, path); - b = hbr.readBlockData(0, 2173 + HFileBlock.HEADER_SIZE_NO_CHECKSUM + + b = hbr.readBlockData(0, 2173 + HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM + b.totalChecksumBytes(), -1, pread); assertEquals(blockStr, b.toString()); int wrongCompressedSize = 2172; try { b = hbr.readBlockData(0, wrongCompressedSize - + HFileBlock.HEADER_SIZE_NO_CHECKSUM, -1, pread); + + HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM, -1, pread); fail("Exception expected"); } catch (IOException ex) { String expectedPrefix = "On-disk size without header provided is " @@ -314,7 +315,7 @@ public class TestHFileBlockCompatibility { public static final class Writer { // These constants are as they were in minorVersion 0. - private static final int HEADER_SIZE = HFileBlock.HEADER_SIZE_NO_CHECKSUM; + private static final int HEADER_SIZE = HConstants.HFILEBLOCK_HEADER_SIZE_NO_CHECKSUM; private static final boolean DONT_FILL_HEADER = HFileBlock.DONT_FILL_HEADER; private static final byte[] DUMMY_HEADER = HFileBlock.DUMMY_HEADER_NO_CHECKSUM; @@ -371,7 +372,7 @@ public class TestHFileBlockCompatibility { /** * Valid in the READY state. Contains the header and the uncompressed (but * potentially encoded, if this is a data block) bytes, so the length is - * {@link #uncompressedSizeWithoutHeader} + {@link HFileBlock#HEADER_SIZE}. + * {@link #uncompressedSizeWithoutHeader} + {@link org.apache.hadoop.hbase.HConstants#HFILEBLOCK_HEADER_SIZE}. */ private byte[] uncompressedBytesWithHeader; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java index b69761cad7f..f27efd7721c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java @@ -27,6 +27,7 @@ import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.SmallTests; import org.apache.hadoop.hbase.io.HeapSize; import org.apache.hadoop.hbase.io.compress.Compression; @@ -112,12 +113,12 @@ public class TestHFileDataBlockEncoder { // usually we have just block without headers, but don't complicate that HFileBlock block = getSampleHFileBlock(); HFileBlockEncodingContext context = new HFileBlockDefaultEncodingContext( - Compression.Algorithm.NONE, blockEncoder.getEncodingOnDisk(), HFileBlock.DUMMY_HEADER); + Compression.Algorithm.NONE, blockEncoder.getEncodingOnDisk(), HConstants.HFILEBLOCK_DUMMY_HEADER); blockEncoder.beforeWriteToDisk(block.getBufferWithoutHeader(), includesMemstoreTS, context, block.getBlockType()); byte[] encodedBytes = context.getUncompressedBytesWithHeader(); - int size = encodedBytes.length - HFileBlock.HEADER_SIZE; + int size = encodedBytes.length - HConstants.HFILEBLOCK_HEADER_SIZE; HFileBlock blockOnDisk = new HFileBlock(context.getBlockType(), size, size, -1, ByteBuffer.wrap(encodedBytes), HFileBlock.FILL_HEADER, 0, @@ -148,8 +149,8 @@ public class TestHFileDataBlockEncoder { ByteBuffer keyValues = RedundantKVGenerator.convertKvToByteBuffer( generator.generateTestKeyValues(60), includesMemstoreTS); int size = keyValues.limit(); - ByteBuffer buf = ByteBuffer.allocate(size + HFileBlock.HEADER_SIZE); - buf.position(HFileBlock.HEADER_SIZE); + ByteBuffer buf = ByteBuffer.allocate(size + HConstants.HFILEBLOCK_HEADER_SIZE); + buf.position(HConstants.HFILEBLOCK_HEADER_SIZE); keyValues.rewind(); buf.put(keyValues); HFileBlock b = new HFileBlock(BlockType.DATA, size, size, -1, buf, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java index d5398705ce2..fd8292d454c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.util.Bytes; import org.junit.AfterClass; @@ -298,7 +299,7 @@ public class TestTableInputFormat { * Run test assuming UnknownScannerException (which is a type of * DoNotRetryIOException) using mapred api. * - * @throws DoNotRetryIOException + * @throws org.apache.hadoop.hbase.exceptions.DoNotRetryIOException */ @Test public void testTableRecordReaderScannerTimeout() throws IOException { @@ -310,9 +311,9 @@ public class TestTableInputFormat { * Run test assuming UnknownScannerException (which is a type of * DoNotRetryIOException) using mapred api. * - * @throws DoNotRetryIOException + * @throws org.apache.hadoop.hbase.exceptions.DoNotRetryIOException */ - @Test(expected = DoNotRetryIOException.class) + @Test(expected = org.apache.hadoop.hbase.exceptions.DoNotRetryIOException.class) public void testTableRecordReaderScannerTimeoutTwice() throws IOException { HTable htable = createDNRIOEScannerTable("table5".getBytes(), 2); runTestMapred(htable); @@ -362,7 +363,7 @@ public class TestTableInputFormat { * DoNotRetryIOException) using newer mapreduce api * * @throws InterruptedException - * @throws DoNotRetryIOException + * @throws org.apache.hadoop.hbase.exceptions.DoNotRetryIOException */ @Test public void testTableRecordReaderScannerTimeoutMapreduce() @@ -376,9 +377,9 @@ public class TestTableInputFormat { * DoNotRetryIOException) using newer mapreduce api * * @throws InterruptedException - * @throws DoNotRetryIOException + * @throws org.apache.hadoop.hbase.exceptions.DoNotRetryIOException */ - @Test(expected = DoNotRetryIOException.class) + @Test(expected = org.apache.hadoop.hbase.exceptions.DoNotRetryIOException.class) public void testTableRecordReaderScannerTimeoutMapreduceTwice() throws IOException, InterruptedException { HTable htable = createDNRIOEScannerTable("table5-mr".getBytes(), 2); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java index b8a668aa534..0573953ceb1 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java @@ -43,7 +43,7 @@ import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.LargeTests; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.TableExistsException; +import org.apache.hadoop.hbase.exceptions.TableExistsException; import org.apache.hadoop.hbase.client.ClientProtocol; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HTable; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java index de5dc02b2c8..baa919386f2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTimeRangeMapRed.java @@ -38,6 +38,8 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.io.MapWritable; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java index c582373f7c6..ae601eb0fb2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java @@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.client.AdminProtocol; import org.apache.hadoop.hbase.client.ClientProtocol; @@ -149,7 +149,7 @@ class MockRegionServer implements AdminProtocol, ClientProtocol, RegionServerSer /** * @param sn Name of this mock regionserver * @throws IOException - * @throws ZooKeeperConnectionException + * @throws org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException */ MockRegionServer(final Configuration conf, final ServerName sn) throws ZooKeeperConnectionException, IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/Mocking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/Mocking.java index 5dbc0e676a5..b4384971dab 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/Mocking.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/Mocking.java @@ -19,11 +19,11 @@ package org.apache.hadoop.hbase.master; import static org.junit.Assert.assertNotSame; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.zookeeper.ZKAssign; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java index 82299a24005..61450af2c2a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java @@ -30,27 +30,27 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.MediumTests; -import org.apache.hadoop.hbase.RegionException; +import org.apache.hadoop.hbase.exceptions.RegionException; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.catalog.MetaMockingUtil; import org.apache.hadoop.hbase.client.ClientProtocol; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HConnectionTestingUtility; import org.apache.hadoop.hbase.client.Result; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.executor.ExecutorService; -import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType; +import org.apache.hadoop.hbase.executor.ExecutorType; import org.apache.hadoop.hbase.master.RegionState.State; import org.apache.hadoop.hbase.master.TableLockManager.NullTableLockManager; import org.apache.hadoop.hbase.master.balancer.DefaultLoadBalancer; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java index 59db7867638..0e0c4f95f0b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java @@ -42,7 +42,7 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; +import org.apache.hadoop.hbase.exceptions.NotAllMetaRegionsOnlineException; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.SmallTests; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClockSkewDetection.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClockSkewDetection.java index d46e98df844..b77b0f79e3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClockSkewDetection.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestClockSkewDetection.java @@ -22,13 +22,12 @@ import static org.junit.Assert.fail; import java.net.InetAddress; -import junit.framework.Assert; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.catalog.CatalogTracker; +import org.apache.hadoop.hbase.exceptions.ClockOutOfSyncException; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java index 4932a95c877..41bda109f05 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestHMasterRPCException.java @@ -66,7 +66,7 @@ public class TestHMasterRPCException { IOException ie = ProtobufUtil.getRemoteException(ex); if (!(ie instanceof SocketTimeoutException)) { if(ie.getMessage().startsWith( - "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet")) { + "org.apache.hadoop.hbase.exceptions.ServerNotRunningYetException: Server is not running yet")) { return; } } else { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java index 57e9b02f65d..63ebb073c1d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java @@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.catalog.MetaReader; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.executor.EventHandler; import org.apache.hadoop.hbase.executor.EventHandler.EventHandlerListener; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java index 56ec09bf1c1..25812c287fa 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java @@ -46,7 +46,8 @@ import org.apache.hadoop.hbase.LargeTests; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.exceptions.RegionServerStoppedException; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; @@ -780,7 +781,7 @@ public class TestMasterFailover { cluster.getRegionServerThreads()) { try { onlineRegions.addAll(ProtobufUtil.getOnlineRegions(rst.getRegionServer())); - } catch (org.apache.hadoop.hbase.regionserver.RegionServerStoppedException e) { + } catch (RegionServerStoppedException e) { LOG.info("Got RegionServerStoppedException", e); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java index c5d0ff5bfb9..d48fd296557 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailoverBalancerPersistence.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.master; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.junit.Test; @@ -103,7 +103,7 @@ public class TestMasterFailoverBalancerPersistence { /** * return the index of the active master in the cluster * - * @throws org.apache.hadoop.hbase.MasterNotRunningException + * @throws org.apache.hadoop.hbase.exceptions.MasterNotRunningException * if no active master found */ private int getActiveMasterIndex(MiniHBaseCluster cluster) throws MasterNotRunningException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java index 12302aa8382..931f5f41b30 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterNoCluster.java @@ -27,14 +27,14 @@ import java.net.UnknownHostException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.catalog.MetaMockingUtil; import org.apache.hadoop.hbase.client.HConnection; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java index 9cdf78e9a6d..5d37b9cdb69 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestOpenedRegionHandler.java @@ -31,7 +31,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.master.handler.OpenedRegionHandler; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java index 6053322e433..c2e24ac9351 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java @@ -28,7 +28,8 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.MetaScanner; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.exceptions.TableExistsException; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.zookeeper.ZKAssign; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java index c8316f48bb3..091cb61ed82 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestTableLockManager.java @@ -39,8 +39,8 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.LockTimeoutException; -import org.apache.hadoop.hbase.TableNotDisabledException; +import org.apache.hadoop.hbase.exceptions.LockTimeoutException; +import org.apache.hadoop.hbase.exceptions.TableNotDisabledException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.coprocessor.BaseMasterObserver; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java index b795735881e..a5bd5cc9e78 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java @@ -44,7 +44,7 @@ import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.executor.EventHandler; import org.apache.hadoop.hbase.executor.EventHandler.EventHandlerListener; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.master.handler.TotesHRegionInfo; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.regionserver.HRegionServer; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java index 75c0a9dea79..9beb347020e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java @@ -52,7 +52,7 @@ import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; -import org.apache.hadoop.hbase.snapshot.UnknownSnapshotException; +import org.apache.hadoop.hbase.exceptions.UnknownSnapshotException; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; import org.junit.After; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/CreateRandomStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/CreateRandomStoreFile.java index b1da9c51352..cc510afe128 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/CreateRandomStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/CreateRandomStoreFile.java @@ -34,12 +34,12 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.io.hfile.HFileBlockIndex; -import org.apache.hadoop.hbase.regionserver.StoreFile; import org.apache.hadoop.hbase.util.BloomFilterFactory; import org.apache.hadoop.io.BytesWritable; @@ -168,7 +168,7 @@ public class CreateRandomStoreFile { BLOOM_FILTER_OPTION)); } - int blockSize = HFile.DEFAULT_BLOCKSIZE; + int blockSize = HConstants.DEFAULT_BLOCKSIZE; if (cmdLine.hasOption(BLOCK_SIZE_OPTION)) blockSize = Integer.valueOf(cmdLine.getOptionValue(BLOCK_SIZE_OPTION)); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java index 4dc3af1be72..a05dbbd1f57 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java @@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.Stoppable; import org.apache.hadoop.hbase.client.Get; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java index ff949024b0c..bdb23090e8b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java @@ -37,12 +37,11 @@ import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; -import org.apache.hadoop.hbase.client.TestGet; import org.apache.hadoop.hbase.util.Bytes; import org.junit.experimental.categories.Category; /** - * {@link TestGet} is a medley of tests of get all done up as a single test. + * TestGet is a medley of tests of get all done up as a single test. * This class */ @Category(MediumTests.class) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index 0cdd6d1591c..24c4cbc20c5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -38,8 +38,7 @@ import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; -import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.hadoop.hbase.FailedSanityCheckException; +import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -64,6 +63,9 @@ import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.NoSuchColumnFamilyException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.WrongRegionException; import org.apache.hadoop.hbase.filter.BinaryComparator; import org.apache.hadoop.hbase.filter.ColumnCountGetFilter; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; @@ -1002,7 +1004,7 @@ public class TestHRegion extends HBaseTestCase { boolean res = region.checkAndMutate(row, fam1, qual1, CompareOp.EQUAL, new BinaryComparator(value2), put, false); fail(); - } catch (DoNotRetryIOException expected) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException expected) { // expected exception. } } finally { @@ -1520,7 +1522,7 @@ public class TestHRegion extends HBaseTestCase { //Test try { region.get(get); - } catch (DoNotRetryIOException e) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException e) { assertFalse(false); return; } @@ -1889,7 +1891,7 @@ public class TestHRegion extends HBaseTestCase { try { region.getScanner(null); fail("Expected to get an exception during getScanner on a region that is closed"); - } catch (org.apache.hadoop.hbase.NotServingRegionException e) { + } catch (NotServingRegionException e) { //this is the correct exception that is expected } catch (IOException e) { fail("Got wrong type of exception - should be a NotServingRegionException, but was an IOException: " diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionBusyWait.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionBusyWait.java index 966eca31ff1..ea1184c8f73 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionBusyWait.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionBusyWait.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.hbase.MediumTests; -import org.apache.hadoop.hbase.RegionTooBusyException; +import org.apache.hadoop.hbase.exceptions.RegionTooBusyException; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Test; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java index ee6001b787e..5cf67b5d82b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java @@ -29,14 +29,12 @@ import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.SmallTests; import org.apache.hadoop.hbase.util.Bytes; -import org.apache.hadoop.hbase.util.FSTableDescriptors; import org.apache.hadoop.hbase.util.MD5Hash; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java index 2d7f7ab6f41..626d22886a9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java @@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.ServerCallable; +import org.apache.hadoop.hbase.exceptions.TableExistsException; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.io.hfile.HFile; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java index d0ecf4d8ef6..23fbfcbc25f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; @@ -276,7 +275,7 @@ public class TestKeepDeletes extends HBaseTestCase { try { InternalScanner scan = region.getScanner(s); fail("raw scanner with columns should have failed"); - } catch (DoNotRetryIOException dnre) { + } catch (org.apache.hadoop.hbase.exceptions.DoNotRetryIOException dnre) { // ok! } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java index fcc1b9516e2..3daa397aa33 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java @@ -26,10 +26,10 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MediumTests; -import org.apache.hadoop.hbase.NotServingRegionException; +import org.apache.hadoop.hbase.exceptions.NotServingRegionException; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.executor.EventHandler; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.protobuf.RequestConverter; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; import org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler; @@ -297,7 +297,7 @@ public class TestRegionServerNoMaster { // The open handler should have updated the value in ZK. Assert.assertTrue(ZKAssign.deleteNode( getRS().getZooKeeperWatcher(), hri.getEncodedName(), - EventHandler.EventType.RS_ZK_REGION_FAILED_OPEN, 1) + EventType.RS_ZK_REGION_FAILED_OPEN, 1) ); reopenRegion(); @@ -330,7 +330,7 @@ public class TestRegionServerNoMaster { // The close should have left the ZK state as it is: it's the job the AM to delete it Assert.assertTrue(ZKAssign.deleteNode( getRS().getZooKeeperWatcher(), hri.getEncodedName(), - EventHandler.EventType.M_ZK_REGION_CLOSING, 0) + EventType.M_ZK_REGION_CLOSING, 0) ); // The state in RIT should have changed to close diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java index c50ceccdd16..bd24dafcab6 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java @@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.SmallTests; -import org.apache.hadoop.hbase.UnknownScannerException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Put; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java index bfebaa20402..13075d18b0b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java @@ -39,7 +39,7 @@ import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.coprocessor.Batch; -import org.apache.hadoop.hbase.coprocessor.CoprocessorException; +import org.apache.hadoop.hbase.exceptions.CoprocessorException; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; import org.apache.hadoop.hbase.coprocessor.CoprocessorService; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java index fb4e9f27912..3448a41d645 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java @@ -34,26 +34,26 @@ import java.util.concurrent.CountDownLatch; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.UnknownRegionException; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.UnknownRegionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.MetaReader; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.RegionState; import org.apache.hadoop.hbase.master.RegionStates; @@ -211,7 +211,8 @@ public class TestSplitTransactionOnCluster { * @throws DeserializationException */ @Test (timeout = 300000) public void testRSSplitEphemeralsDisappearButDaughtersAreOnlinedAfterShutdownHandling() - throws IOException, InterruptedException, NodeExistsException, KeeperException, DeserializationException, ServiceException { + throws IOException, InterruptedException, NodeExistsException, KeeperException, + DeserializationException, ServiceException { final byte [] tableName = Bytes.toBytes("ephemeral"); @@ -878,7 +879,7 @@ public class TestSplitTransactionOnCluster { * @return Index of the server hosting the single table region * @throws UnknownRegionException * @throws MasterNotRunningException - * @throws ZooKeeperConnectionException + * @throws org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException * @throws InterruptedException */ private int ensureTableRegionNotOnSameServerAsMeta(final HBaseAdmin admin, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java index 25a7e95bfd8..78998e1fdf7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java @@ -35,6 +35,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.SmallTests; @@ -44,7 +45,6 @@ import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.io.hfile.BlockCache; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.io.hfile.CacheStats; -import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder; import org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoderImpl; import org.apache.hadoop.hbase.io.hfile.HFileScanner; @@ -991,7 +991,7 @@ public class TestStoreFile extends HBaseTestCase { dataBlockEncoderAlgo); cacheConf = new CacheConfig(conf); StoreFile.Writer writer = new StoreFile.WriterBuilder(conf, cacheConf, fs, - HFile.DEFAULT_BLOCKSIZE) + HConstants.DEFAULT_BLOCKSIZE) .withFilePath(path) .withDataBlockEncoder(dataBlockEncoder) .withMaxKeyCount(2000) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java index 8390544e5a3..731897a127d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestCloseRegionHandler.java @@ -25,7 +25,7 @@ import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; @@ -33,7 +33,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.Server; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.RegionServerServices; import org.apache.hadoop.hbase.util.Bytes; @@ -172,7 +172,7 @@ public class TestCloseRegionHandler { * @throws IOException * @throws NodeExistsException * @throws KeeperException - * @throws DeserializationException + * @throws org.apache.hadoop.hbase.exceptions.DeserializationException */ @Test public void testCloseRegion() throws IOException, NodeExistsException, KeeperException, DeserializationException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java index 5f1e62ce533..0bbc7c3bb29 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/handler/TestOpenRegionHandler.java @@ -25,7 +25,7 @@ import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.*; -import org.apache.hadoop.hbase.executor.EventHandler.EventType; +import org.apache.hadoop.hbase.executor.EventType; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.RegionServerServices; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java index 1e4f13140d9..aa407267b3d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java @@ -40,6 +40,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.Log4JLogger; +import org.apache.hadoop.hbase.exceptions.OrphanHLogAfterSplitException; import org.apache.log4j.Level; import org.apache.hadoop.hdfs.server.datanode.DataNode; import org.apache.hadoop.hdfs.server.namenode.FSNamesystem; @@ -357,7 +358,7 @@ public class TestHLogSplit { HConstants.META_TABLE_NAME, 1, now, HConstants.DEFAULT_CLUSTER_ID), new WALEdit()); Path parent = HLogUtil.getRegionDirRecoveredEditsDir(regiondir); - assertEquals(parent.getName(), HLog.RECOVERED_EDITS_DIR); + assertEquals(parent.getName(), HConstants.RECOVERED_EDITS_DIR); fs.createNewFile(parent); // create a recovered.edits file Path p = HLogSplitter.getRegionSplitEditsPath(fs, entry, HBASEDIR, true); @@ -1076,7 +1077,7 @@ public class TestHLogSplit { } Path tableDir = new Path(HBASEDIR, new String(TABLE_NAME)); Path regionDir = new Path(tableDir, REGIONS.get(0)); - Path recoveredEdits = new Path(regionDir, HLog.RECOVERED_EDITS_DIR); + Path recoveredEdits = new Path(regionDir, HConstants.RECOVERED_EDITS_DIR); String region = "juliet"; Path julietLog = new Path(HLOGDIR, HLOG_FILE_PREFIX + ".juliet"); try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java index edbb2217262..6c430aab614 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java @@ -20,16 +20,14 @@ package org.apache.hadoop.hbase.regionserver.wal; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.IOException; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.Log4JLogger; -import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java index 887dafd5166..43f27aa5538 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java @@ -25,6 +25,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; +import org.apache.hadoop.hbase.exceptions.FailedLogCloseException; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.*; @@ -186,7 +187,7 @@ public class TestLogRolling { /** * Tests that logs are deleted * @throws IOException - * @throws FailedLogCloseException + * @throws org.apache.hadoop.hbase.exceptions.FailedLogCloseException */ @Test public void testLogRolling() throws FailedLogCloseException, IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java index ff8279a6e26..0496db5bae9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java @@ -46,11 +46,9 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; -import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HTable; @@ -58,6 +56,8 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.exceptions.MasterNotRunningException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.monitoring.MonitoredTask; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationQueueFailover.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationQueueFailover.java index 9e7e0f555ea..3d8402bab4a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationQueueFailover.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationQueueFailover.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.UnknownScannerException; +import org.apache.hadoop.hbase.exceptions.UnknownScannerException; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java index fece055ad5e..8a6cf1bb51f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java @@ -40,7 +40,7 @@ import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService; -import org.apache.hadoop.hbase.security.AccessDeniedException; +import org.apache.hadoop.hbase.exceptions.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; import org.junit.AfterClass; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java index 1b3ed341bc2..c0d20b527ee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java @@ -71,7 +71,7 @@ import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost; import org.apache.hadoop.hbase.regionserver.RegionServerCoprocessorHost; import org.apache.hadoop.hbase.regionserver.ScanType; -import org.apache.hadoop.hbase.security.AccessDeniedException; +import org.apache.hadoop.hbase.exceptions.AccessDeniedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.access.Permission.Action; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java index 8825fd9f7a3..75e80430211 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestTablePermissions.java @@ -38,7 +38,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.LargeTests; import org.apache.hadoop.hbase.client.HBaseAdmin; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java index a134a68fc7e..9feb006ae38 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java @@ -24,7 +24,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -38,7 +37,8 @@ import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; -import org.apache.hadoop.hbase.TableNotEnabledException; +import org.apache.hadoop.hbase.exceptions.HBaseSnapshotException; +import org.apache.hadoop.hbase.exceptions.TableNotEnabledException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java index f852a13e6d4..0b97f8369cd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java @@ -37,7 +37,8 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.SnapshotCreationException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.master.HMaster; @@ -341,13 +342,14 @@ public class TestFlushSnapshotFromClient { public void run() { try { HBaseAdmin admin = UTIL.getHBaseAdmin(); - LOG.info("Submitting snapshot request: " + SnapshotDescriptionUtils.toString(ss)); + LOG.info("Submitting snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss)); admin.takeSnapshotAsync(ss); } catch (Exception e) { - LOG.info("Exception during snapshot request: " + SnapshotDescriptionUtils.toString(ss) + LOG.info("Exception during snapshot request: " + ClientSnapshotDescriptionUtils.toString( + ss) + ". This is ok, we expect some", e); } - LOG.info("Submitted snapshot request: " + SnapshotDescriptionUtils.toString(ss)); + LOG.info("Submitted snapshot request: " + ClientSnapshotDescriptionUtils.toString(ss)); toBeSubmitted.countDown(); } }; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java index 498d50885aa..ca50ea7efd7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreFlushSnapshotFromClient.java @@ -23,7 +23,6 @@ import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HBaseTestingUtility; @@ -33,6 +32,7 @@ import org.apache.hadoop.hbase.LargeTests; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.exceptions.SnapshotDoesNotExistException; import org.apache.hadoop.hbase.master.MasterFileSystem; import org.apache.hadoop.hbase.master.snapshot.SnapshotManager; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java index ca2f5860c74..c672884a156 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java @@ -27,12 +27,10 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.PerformanceEvaluation; -import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; import org.apache.hadoop.hbase.regionserver.BloomType; -import org.apache.hadoop.hbase.regionserver.StoreFile; import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MockServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MockServer.java index 50cef63854d..f5a4b2eaee8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MockServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MockServer.java @@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerName; -import org.apache.hadoop.hbase.ZooKeeperConnectionException; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java index 70bd2dff7d6..fd3e483c928 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java @@ -29,6 +29,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.*; +import org.apache.hadoop.hbase.exceptions.TableExistsException; import org.junit.Test; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java index 0436d383864..45829837646 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java @@ -34,7 +34,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; -import org.apache.hadoop.hbase.DeserializationException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java index db63a77b14c..43749c5cf15 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import java.io.File; import java.io.IOException; import java.util.UUID; import java.util.Set; @@ -32,22 +31,13 @@ import java.util.HashSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; -import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.fs.permission.FsPermission; -import org.apache.hadoop.hbase.DeserializationException; -import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.MediumTests; import org.apache.hadoop.hbase.regionserver.wal.HLogUtil; -import org.apache.hadoop.hbase.util.MD5Hash; -import org.apache.hadoop.hbase.util.FSUtils; import org.junit.*; import org.junit.experimental.categories.Category; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java index e945d1a2838..a7f5eb7da2a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMiniClusterLoadSequential.java @@ -30,7 +30,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.LargeTests; -import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.exceptions.TableNotFoundException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java index f6baf840980..c40d393598c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java @@ -27,6 +27,7 @@ import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.*; +import org.apache.hadoop.hbase.exceptions.ZooKeeperConnectionException; import org.apache.zookeeper.KeeperException; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/pom.xml b/pom.xml index 69a9c2cb884..9a66361a0da 100644 --- a/pom.xml +++ b/pom.xml @@ -626,6 +626,7 @@ **/8e8ab58dcf39412da19833fcd8f687ac **/.git/** **/.idea/** + **/*.iml **/target/** **/CHANGES.txt **/generated/**