hbase git commit: HBASE-15607 Remove PB references from Admin for 2.0 (Ram)

2016-05-02 Thread ramkrishna
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 319ea27bd -> 63186e66f


HBASE-15607 Remove PB references from Admin for 2.0 (Ram)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/63186e66
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/63186e66
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/63186e66

Branch: refs/heads/branch-1.3
Commit: 63186e66fd424095e8b80de72a19142f50dd393f
Parents: 319ea27
Author: Ramkrishna 
Authored: Tue May 3 10:53:45 2016 +0530
Committer: Ramkrishna 
Committed: Tue May 3 10:53:45 2016 +0530

--
 .../main/java/org/apache/hadoop/hbase/client/Admin.java   | 10 ++
 1 file changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/63186e66/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 8fd855c..c8b91a9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -1030,6 +1030,7 @@ public interface Admin extends Abortable, Closeable {
* @return the current compaction state
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   AdminProtos.GetRegionInfoResponse.CompactionState 
getCompactionStateForRegion(
 final byte[] regionName) throws IOException;
 
@@ -1109,6 +1110,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot creation failed
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   void snapshot(final String snapshotName,
   final TableName tableName,
   HBaseProtos.SnapshotDescription.Type type) throws IOException, 
SnapshotCreationException,
@@ -1132,6 +1134,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot failed to be taken
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   void snapshot(HBaseProtos.SnapshotDescription snapshot)
   throws IOException, SnapshotCreationException, IllegalArgumentException;
 
@@ -1145,6 +1148,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot creation failed
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   MasterProtos.SnapshotResponse 
takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)
   throws IOException, SnapshotCreationException;
 
@@ -1164,6 +1168,7 @@ public interface Admin extends Abortable, Closeable {
* @throws org.apache.hadoop.hbase.snapshot.UnknownSnapshotException if the 
requested snapshot is
* unknown
*/
+  @Deprecated
   boolean isSnapshotFinished(final HBaseProtos.SnapshotDescription snapshot)
   throws IOException, HBaseSnapshotException, UnknownSnapshotException;
 
@@ -1303,6 +1308,7 @@ public interface Admin extends Abortable, Closeable {
* @return a list of snapshot descriptors for completed snapshots
* @throws IOException if a network error occurs
*/
+  @Deprecated
   List listSnapshots() throws IOException;
 
   /**
@@ -1312,6 +1318,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listSnapshots(String regex) throws 
IOException;
 
   /**
@@ -1321,6 +1328,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listSnapshots(Pattern pattern) throws 
IOException;
 
   /**
@@ -1331,6 +1339,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of completed SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listTableSnapshots(String 
tableNameRegex,
   String snapshotNameRegex) throws IOException;
 
@@ -1342,6 +1351,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of completed SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listTableSnapshots(Pattern 
tableNamePattern,
   Pattern snapshotNamePattern) throws IOException;
 



hbase git commit: HBASE-15607 Remove PB references from Admin for 2.0 (Ram)

2016-05-02 Thread ramkrishna
Repository: hbase
Updated Branches:
  refs/heads/branch-1 7e0e86072 -> 902b67316


HBASE-15607 Remove PB references from Admin for 2.0 (Ram)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/902b6731
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/902b6731
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/902b6731

Branch: refs/heads/branch-1
Commit: 902b67316784d74f594eada82d56c11b0d1204a8
Parents: 7e0e860
Author: Ramkrishna 
Authored: Tue May 3 10:52:59 2016 +0530
Committer: Ramkrishna 
Committed: Tue May 3 10:52:59 2016 +0530

--
 .../main/java/org/apache/hadoop/hbase/client/Admin.java   | 10 ++
 1 file changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/902b6731/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 8fd855c..c8b91a9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -1030,6 +1030,7 @@ public interface Admin extends Abortable, Closeable {
* @return the current compaction state
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   AdminProtos.GetRegionInfoResponse.CompactionState 
getCompactionStateForRegion(
 final byte[] regionName) throws IOException;
 
@@ -1109,6 +1110,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot creation failed
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   void snapshot(final String snapshotName,
   final TableName tableName,
   HBaseProtos.SnapshotDescription.Type type) throws IOException, 
SnapshotCreationException,
@@ -1132,6 +1134,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot failed to be taken
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   void snapshot(HBaseProtos.SnapshotDescription snapshot)
   throws IOException, SnapshotCreationException, IllegalArgumentException;
 
@@ -1145,6 +1148,7 @@ public interface Admin extends Abortable, Closeable {
* @throws SnapshotCreationException if snapshot creation failed
* @throws IllegalArgumentException if the snapshot request is formatted 
incorrectly
*/
+  @Deprecated
   MasterProtos.SnapshotResponse 
takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)
   throws IOException, SnapshotCreationException;
 
@@ -1164,6 +1168,7 @@ public interface Admin extends Abortable, Closeable {
* @throws org.apache.hadoop.hbase.snapshot.UnknownSnapshotException if the 
requested snapshot is
* unknown
*/
+  @Deprecated
   boolean isSnapshotFinished(final HBaseProtos.SnapshotDescription snapshot)
   throws IOException, HBaseSnapshotException, UnknownSnapshotException;
 
@@ -1303,6 +1308,7 @@ public interface Admin extends Abortable, Closeable {
* @return a list of snapshot descriptors for completed snapshots
* @throws IOException if a network error occurs
*/
+  @Deprecated
   List listSnapshots() throws IOException;
 
   /**
@@ -1312,6 +1318,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listSnapshots(String regex) throws 
IOException;
 
   /**
@@ -1321,6 +1328,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listSnapshots(Pattern pattern) throws 
IOException;
 
   /**
@@ -1331,6 +1339,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of completed SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listTableSnapshots(String 
tableNameRegex,
   String snapshotNameRegex) throws IOException;
 
@@ -1342,6 +1351,7 @@ public interface Admin extends Abortable, Closeable {
* @return - returns a List of completed SnapshotDescription
* @throws IOException if a remote or network exception occurs
*/
+  @Deprecated
   List listTableSnapshots(Pattern 
tableNamePattern,
   Pattern snapshotNamePattern) throws IOException;
 



[2/2] hbase git commit: HBASE-15607 Remove PB references from Admin for 2.0 (Ram)

2016-05-02 Thread ramkrishna
HBASE-15607 Remove PB references from Admin for 2.0 (Ram)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c06a976a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c06a976a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c06a976a

Branch: refs/heads/master
Commit: c06a976a98f04b3c834c2d8ee2e889b7882591d2
Parents: d77972f
Author: Ramkrishna 
Authored: Tue May 3 10:51:46 2016 +0530
Committer: Ramkrishna 
Committed: Tue May 3 10:51:46 2016 +0530

--
 .../org/apache/hadoop/hbase/client/Admin.java   |  61 +++
 .../apache/hadoop/hbase/client/CompactType.java |  35 +++
 .../hadoop/hbase/client/CompactionState.java|  29 ++
 .../apache/hadoop/hbase/client/HBaseAdmin.java  | 104 +--
 .../hadoop/hbase/client/MasterSwitchType.java   |  29 ++
 .../hbase/client/SnapshotDescription.java   |  84 +++
 .../hadoop/hbase/client/SnapshotType.java   |  29 ++
 .../hadoop/hbase/protobuf/ProtobufUtil.java |  75 +
 .../hadoop/hbase/protobuf/RequestConverter.java |  14 +--
 .../hbase/client/TestSnapshotFromAdmin.java |  25 +++--
 .../hbase/chaos/actions/CompactMobAction.java   |   5 +-
 .../hbase/rsgroup/RSGroupAdminEndpoint.java |   6 +-
 .../hbase/tmpl/master/MasterStatusTmpl.jamon|   2 +-
 .../BaseMasterAndRegionObserver.java|   6 +-
 .../hbase/coprocessor/BaseMasterObserver.java   |   6 +-
 .../hbase/coprocessor/MasterObserver.java   |   6 +-
 .../hadoop/hbase/master/AssignmentManager.java  |   6 +-
 .../org/apache/hadoop/hbase/master/HMaster.java |   6 +-
 .../hbase/master/MasterCoprocessorHost.java |   6 +-
 .../hadoop/hbase/master/MasterRpcServices.java  |  12 +--
 .../normalizer/SimpleRegionNormalizer.java  |   2 +-
 .../hbase/security/access/AccessController.java |   6 +-
 .../visibility/VisibilityController.java|   6 +-
 .../hadoop/hbase/snapshot/CreateSnapshot.java   |   8 +-
 .../hadoop/hbase/snapshot/SnapshotInfo.java |  38 ---
 .../org/apache/hadoop/hbase/util/HBaseFsck.java |   3 +-
 .../hbase/zookeeper/SplitOrMergeTracker.java|  10 +-
 .../resources/hbase-webapps/master/snapshot.jsp |   2 +-
 .../resources/hbase-webapps/master/table.jsp|   2 +-
 .../hadoop/hbase/client/TestFromClientSide.java |   3 +-
 .../hbase/client/TestSnapshotFromClient.java|  33 +++---
 .../hbase/client/TestSplitOrMergeStatus.java|  32 +++---
 .../hbase/coprocessor/TestMasterObserver.java   |   5 +-
 .../master/TestDistributedLogSplitting.java |   5 +-
 .../hadoop/hbase/master/TestWarmupRegion.java   |   5 +-
 .../procedure/TestCloneSnapshotProcedure.java   |  10 +-
 .../procedure/TestRestoreSnapshotProcedure.java |   8 +-
 .../hbase/mob/compactions/TestMobCompactor.java |  13 +--
 .../hbase/regionserver/TestCompactionState.java |   4 +-
 .../hadoop/hbase/regionserver/TestTags.java |   2 +-
 .../security/access/TestAccessController.java   |   3 +-
 .../hbase/snapshot/SnapshotTestingUtils.java|  43 
 .../snapshot/TestFlushSnapshotFromClient.java   |  68 +++-
 .../TestRestoreFlushSnapshotFromClient.java |   8 +-
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   |  16 +--
 45 files changed, 611 insertions(+), 270 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c06a976a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 97356a2..51a26bc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -41,9 +41,6 @@ import 
org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.client.security.SecurityCapability;
 import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
-import org.apache.hadoop.hbase.protobuf.generated.AdminProtos;
-import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
-import org.apache.hadoop.hbase.protobuf.generated.MasterProtos;
 import org.apache.hadoop.hbase.quotas.QuotaFilter;
 import org.apache.hadoop.hbase.quotas.QuotaRetriever;
 import org.apache.hadoop.hbase.quotas.QuotaSettings;
@@ -1153,7 +1150,7 @@ public interface Admin extends Abortable, Closeable {
* @return the current compaction state
* @throws IOException if a remote or network exception occurs
*/
-  AdminProtos.GetRegionInfoResponse.CompactionState getCompactionState(final 
TableName tableName)
+  CompactionState 

[1/2] hbase git commit: HBASE-15607 Remove PB references from Admin for 2.0 (Ram)

2016-05-02 Thread ramkrishna
Repository: hbase
Updated Branches:
  refs/heads/master d77972ff1 -> c06a976a9


http://git-wip-us.apache.org/repos/asf/hbase/blob/c06a976a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClient.java
--
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 1b61147..8317376 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
@@ -36,7 +36,7 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
-import 
org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy;
 import org.apache.hadoop.hbase.snapshot.SnapshotCreationException;
 import org.apache.hadoop.hbase.snapshot.SnapshotDoesNotExistException;
@@ -212,18 +212,13 @@ public class TestSnapshotFromClient {
 final String SNAPSHOT_NAME = "offlineTableSnapshot";
 byte[] snapshot = Bytes.toBytes(SNAPSHOT_NAME);
 
-SnapshotDescription desc = SnapshotDescription.newBuilder()
-  .setType(SnapshotDescription.Type.DISABLED)
-  .setTable(STRING_TABLE_NAME)
-  .setName(SNAPSHOT_NAME)
-  .setVersion(SnapshotManifestV1.DESCRIPTOR_VERSION)
-  .build();
-admin.snapshot(desc);
+admin.snapshot(new SnapshotDescription(SNAPSHOT_NAME, STRING_TABLE_NAME,
+SnapshotType.DISABLED, null, -1, 
SnapshotManifestV1.DESCRIPTOR_VERSION));
 LOG.debug("Snapshot completed.");
 
 // make sure we have the snapshot
-List snapshots = 
SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
-  snapshot, TABLE_NAME);
+List snapshots =
+SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot, 
TABLE_NAME);
 
 // make sure its a valid snapshot
 FileSystem fs = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
@@ -231,9 +226,9 @@ public class TestSnapshotFromClient {
 LOG.debug("FS state after snapshot:");
 FSUtils.logFileSystemState(UTIL.getTestFileSystem(),
   FSUtils.getRootDir(UTIL.getConfiguration()), LOG);
-
-SnapshotTestingUtils.confirmSnapshotValid(snapshots.get(0), TABLE_NAME, 
TEST_FAM, rootDir,
-  admin, fs);
+SnapshotTestingUtils.confirmSnapshotValid(
+  ProtobufUtil.createHBaseProtosSnapshotDesc(snapshots.get(0)), 
TABLE_NAME, TEST_FAM,
+  rootDir, admin, fs);
 
 admin.deleteSnapshot(snapshot);
 snapshots = admin.listSnapshots();
@@ -292,8 +287,8 @@ public class TestSnapshotFromClient {
 LOG.debug("Snapshot completed.");
 
 // make sure we have the snapshot
-List snapshots = 
SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
-  snapshot, TABLE_NAME);
+List snapshots =
+SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot, 
TABLE_NAME);
 
 // make sure its a valid snapshot
 FileSystem fs = 
UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getFileSystem();
@@ -304,8 +299,9 @@ public class TestSnapshotFromClient {
 
 List emptyCfs = Lists.newArrayList(TEST_FAM); // no file in the 
region
 List nonEmptyCfs = Lists.newArrayList();
-SnapshotTestingUtils.confirmSnapshotValid(snapshots.get(0), TABLE_NAME, 
nonEmptyCfs, emptyCfs,
-  rootDir, admin, fs);
+SnapshotTestingUtils.confirmSnapshotValid(
+  ProtobufUtil.createHBaseProtosSnapshotDesc(snapshots.get(0)), 
TABLE_NAME, nonEmptyCfs,
+  emptyCfs, rootDir, admin, fs);
 
 admin.deleteSnapshot(snapshot);
 snapshots = admin.listSnapshots();
@@ -375,7 +371,8 @@ public class TestSnapshotFromClient {
   admin.snapshot(Bytes.toBytes(table2Snapshot1), TABLE_NAME);
   LOG.debug(table2Snapshot1 + " completed.");
 
-  List listTableSnapshots = 
admin.listTableSnapshots("test.*", "Table1.*");
+  List listTableSnapshots =
+  admin.listTableSnapshots("test.*", "Table1.*");
   List listTableSnapshotNames = new ArrayList();
   assertEquals(2, listTableSnapshots.size());
   for (SnapshotDescription s : listTableSnapshots) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/c06a976a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSplitOrMergeStatus.java
index e1ce63b..c5ca0b5 100644
--- 

hbase git commit: HBASE-15714 We are calling checkRow() twice in doMiniBatchMutation()

2016-05-02 Thread chenheng
Repository: hbase
Updated Branches:
  refs/heads/master 58c4c3d17 -> d77972ff1


HBASE-15714 We are calling checkRow() twice in doMiniBatchMutation()


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d77972ff
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d77972ff
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d77972ff

Branch: refs/heads/master
Commit: d77972ff16ef884b6cc5651a789597ae68bb
Parents: 58c4c3d
Author: chenheng 
Authored: Tue May 3 09:42:41 2016 +1000
Committer: chenheng 
Committed: Tue May 3 09:42:41 2016 +1000

--
 .../org/apache/hadoop/hbase/regionserver/HRegion.java | 14 +-
 .../hbase/regionserver/TestAtomicOperation.java   |  4 ++--
 2 files changed, 11 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/d77972ff/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
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 428541f..5676e15 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
@@ -3019,7 +3019,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 // If we haven't got any rows in our batch, we should block to get the 
next one.
 RowLock rowLock = null;
 try {
-  rowLock = getRowLock(mutation.getRow(), true);
+  rowLock = getRowLockInternal(mutation.getRow(), true);
 } catch (IOException ioe) {
   LOG.warn("Failed getting lock, row=" + 
Bytes.toStringBinary(mutation.getRow()), ioe);
 }
@@ -3423,7 +3423,8 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   checkFamily(family);
   get.addColumn(family, qualifier);
   // Lock row - note that doBatchMutate will relock this row if called
-  RowLock rowLock = getRowLock(get.getRow());
+  checkRow(row, "doCheckAndRowMutate");
+  RowLock rowLock = getRowLockInternal(get.getRow(), false);
   try {
 if (mutation != null && this.getCoprocessorHost() != null) {
   // Call coprocessor.
@@ -5107,8 +5108,11 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
*/
   @Override
   public RowLock getRowLock(byte[] row, boolean readLock) throws IOException {
-// Make sure the row is inside of this region before getting the lock for 
it.
 checkRow(row, "row lock");
+return getRowLockInternal(row, readLock);
+  }
+
+  protected RowLock getRowLockInternal(byte[] row, boolean readLock) throws 
IOException {
 // create an object to use a a key in the row lock map
 HashedBytes rowKey = new HashedBytes(row);
 
@@ -6827,7 +6831,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   for (byte[] row : rowsToLock) {
 // Attempt to lock all involved rows, throw if any lock times out
 // use a writer lock for mixed reads and writes
-acquiredRowLocks.add(getRowLock(row));
+acquiredRowLocks.add(getRowLockInternal(row, false));
   }
   // STEP 3. Region lock
   lock(this.updatesLock.readLock(), acquiredRowLocks.size() == 0 ? 1 : 
acquiredRowLocks.size());
@@ -7007,7 +7011,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 startRegionOperation(op);
 long accumulatedResultSize = 0;
 List results = returnResults? new ArrayList(mutation.size()): 
null;
-RowLock rowLock = getRowLock(mutation.getRow());
+RowLock rowLock = getRowLockInternal(mutation.getRow(), false);
 try {
   lock(this.updatesLock.readLock());
   try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/d77972ff/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
index 0626dce..11bd280 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
@@ -666,11 +666,11 @@ public class TestAtomicOperation {
 }
 
 @Override
-public RowLock getRowLock(final byte[] row, boolean readLock) throws 
IOException {
+public RowLock 

hbase git commit: HBASE-15720 Print row locks at the debug dump page, addendum

2016-05-02 Thread chenheng
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 891119501 -> a3e77bf36


HBASE-15720 Print row locks at the debug dump page, addendum


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a3e77bf3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a3e77bf3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a3e77bf3

Branch: refs/heads/branch-1.0
Commit: a3e77bf3664d361a5337ba6b584848eb65ceccbb
Parents: 8911195
Author: chenheng 
Authored: Tue May 3 09:31:45 2016 +1000
Committer: chenheng 
Committed: Tue May 3 09:31:45 2016 +1000

--
 .../java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a3e77bf3/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
index 56d0417..8fe6126 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
@@ -105,8 +105,7 @@ public class RSDumpServlet extends StateDumpServlet {
 
   public static void dumpRowLock(HRegionServer hrs, PrintWriter out) {
 StringBuilder sb = new StringBuilder();
-for (Region region : hrs.getOnlineRegionsLocalContext()) {
-  HRegion hRegion = (HRegion)region;
+for (HRegion hRegion : hrs.getOnlineRegionsLocalContext()) {
   if (hRegion.getLockedRows().size() > 0) {
 for (HRegion.RowLockContext rowLockContext : 
hRegion.getLockedRows().values()) {
   sb.setLength(0);



hbase git commit: HBASE-15720 Print row locks at the debug dump page; addendum

2016-05-02 Thread chenheng
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 23bd2275a -> bf1394159


HBASE-15720 Print row locks at the debug dump page; addendum


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bf139415
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bf139415
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bf139415

Branch: refs/heads/branch-1.2
Commit: bf13941592ab0c947ce76cf4c353696414fc1067
Parents: 23bd227
Author: chenheng 
Authored: Tue May 3 09:18:28 2016 +1000
Committer: chenheng 
Committed: Tue May 3 09:18:28 2016 +1000

--
 .../java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bf139415/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
index 0c69bd9..56d0417 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
@@ -105,7 +105,7 @@ public class RSDumpServlet extends StateDumpServlet {
 
   public static void dumpRowLock(HRegionServer hrs, PrintWriter out) {
 StringBuilder sb = new StringBuilder();
-for (Region region : hrs.getOnlineRegions()) {
+for (Region region : hrs.getOnlineRegionsLocalContext()) {
   HRegion hRegion = (HRegion)region;
   if (hRegion.getLockedRows().size() > 0) {
 for (HRegion.RowLockContext rowLockContext : 
hRegion.getLockedRows().values()) {



hbase git commit: HBASE-15703 Deadline scheduler needs to return to the client info about skipped calls, not just drop them

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 65eed7c54 -> 319ea27bd


HBASE-15703 Deadline scheduler needs to return to the client info about skipped 
calls, not just drop them


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/319ea27b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/319ea27b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/319ea27b

Branch: refs/heads/branch-1.3
Commit: 319ea27bd8f9c701c9ed5d2d94f880cdfc23dfe5
Parents: 65eed7c
Author: Mikhail Antonov 
Authored: Mon May 2 15:23:07 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 15:30:26 2016 -0700

--
 .../hadoop/hbase/CallDroppedException.java  | 43 
 .../hadoop/hbase/CallQueueTooBigException.java  |  2 +
 .../client/PreemptiveFastFailInterceptor.java   |  3 +-
 .../hbase/exceptions/ClientExceptionsUtil.java  | 15 ++-
 .../hbase/ipc/AdaptiveLifoCoDelCallQueue.java   | 42 ++-
 .../org/apache/hadoop/hbase/ipc/CallRunner.java | 38 +
 6 files changed, 112 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/319ea27b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
new file mode 100644
index 000..ed14153
--- /dev/null
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
@@ -0,0 +1,43 @@
+/**
+ * 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;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.classification.InterfaceStability;
+
+/**
+ * Returned to the clients when their request was discarded due to server 
being overloaded.
+ * Clients should retry upon receiving it.
+ */
+@SuppressWarnings("serial")
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class CallDroppedException extends IOException {
+  public CallDroppedException() {
+super();
+  }
+
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
+  public CallDroppedException(String message) {
+super(message);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/319ea27b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
index 95ca988..9f8b386 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
@@ -31,6 +31,8 @@ public class CallQueueTooBigException extends IOException {
 super();
   }
 
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
   public CallQueueTooBigException(String message) {
 super(message);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/319ea27b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
index c87d6c7..fed87c1 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
@@ -175,7 +175,8 

hbase git commit: HBASE-15703 Deadline scheduler needs to return to the client info about skipped calls, not just drop them

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/branch-1 36d634d35 -> 7e0e86072


HBASE-15703 Deadline scheduler needs to return to the client info about skipped 
calls, not just drop them


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7e0e8607
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7e0e8607
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7e0e8607

Branch: refs/heads/branch-1
Commit: 7e0e86072aa2f372184d017aa18555fafa4bd459
Parents: 36d634d
Author: Mikhail Antonov 
Authored: Mon May 2 15:23:07 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 15:27:13 2016 -0700

--
 .../hadoop/hbase/CallDroppedException.java  | 43 
 .../hadoop/hbase/CallQueueTooBigException.java  |  2 +
 .../client/PreemptiveFastFailInterceptor.java   |  3 +-
 .../hbase/exceptions/ClientExceptionsUtil.java  | 15 ++-
 .../hbase/ipc/AdaptiveLifoCoDelCallQueue.java   | 42 ++-
 .../org/apache/hadoop/hbase/ipc/CallRunner.java | 38 +
 6 files changed, 112 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7e0e8607/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
new file mode 100644
index 000..ed14153
--- /dev/null
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
@@ -0,0 +1,43 @@
+/**
+ * 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;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.classification.InterfaceStability;
+
+/**
+ * Returned to the clients when their request was discarded due to server 
being overloaded.
+ * Clients should retry upon receiving it.
+ */
+@SuppressWarnings("serial")
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class CallDroppedException extends IOException {
+  public CallDroppedException() {
+super();
+  }
+
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
+  public CallDroppedException(String message) {
+super(message);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/7e0e8607/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
index 95ca988..9f8b386 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
@@ -31,6 +31,8 @@ public class CallQueueTooBigException extends IOException {
 super();
   }
 
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
   public CallQueueTooBigException(String message) {
 super(message);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/7e0e8607/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
index c87d6c7..fed87c1 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
@@ -175,7 +175,8 @@ 

hbase git commit: HBASE-15703 Deadline scheduler needs to return to the client info about skipped calls, not just drop them

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/master bbc7b9033 -> 58c4c3d17


HBASE-15703 Deadline scheduler needs to return to the client info about skipped 
calls, not just drop them


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/58c4c3d1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/58c4c3d1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/58c4c3d1

Branch: refs/heads/master
Commit: 58c4c3d1748378960446af7f70f00c481c24b9f7
Parents: bbc7b90
Author: Mikhail Antonov 
Authored: Mon May 2 15:23:07 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 15:23:07 2016 -0700

--
 .../hadoop/hbase/CallDroppedException.java  | 43 
 .../hadoop/hbase/CallQueueTooBigException.java  |  2 +
 .../client/PreemptiveFastFailInterceptor.java   |  3 +-
 .../hbase/exceptions/ClientExceptionsUtil.java  | 15 ++-
 .../hbase/ipc/AdaptiveLifoCoDelCallQueue.java   | 42 ++-
 .../org/apache/hadoop/hbase/ipc/CallRunner.java | 38 +
 6 files changed, 112 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/58c4c3d1/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
new file mode 100644
index 000..ed14153
--- /dev/null
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallDroppedException.java
@@ -0,0 +1,43 @@
+/**
+ * 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;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.classification.InterfaceStability;
+
+/**
+ * Returned to the clients when their request was discarded due to server 
being overloaded.
+ * Clients should retry upon receiving it.
+ */
+@SuppressWarnings("serial")
+@InterfaceAudience.Public
+@InterfaceStability.Evolving
+public class CallDroppedException extends IOException {
+  public CallDroppedException() {
+super();
+  }
+
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
+  public CallDroppedException(String message) {
+super(message);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/58c4c3d1/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
index 95ca988..9f8b386 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/CallQueueTooBigException.java
@@ -31,6 +31,8 @@ public class CallQueueTooBigException extends IOException {
 super();
   }
 
+  // Absence of this constructor prevents proper unwrapping of
+  // remote exception on the client side
   public CallQueueTooBigException(String message) {
 super(message);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/58c4c3d1/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
index c87d6c7..fed87c1 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java
@@ -175,7 +175,8 @@ class 

hbase git commit: HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh Nishtala)

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 731293894 -> 65eed7c54


HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh 
Nishtala)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/65eed7c5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/65eed7c5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/65eed7c5

Branch: refs/heads/branch-1.3
Commit: 65eed7c54dad56b8269f27dcb9942731e9d7d85d
Parents: 7312938
Author: Mikhail Antonov 
Authored: Mon May 2 13:23:51 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 13:54:31 2016 -0700

--
 .../org/apache/hadoop/hbase/fs/HFileSystem.java | 27 ++--
 1 file changed, 25 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/65eed7c5/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
index fb58360..521bc57 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
@@ -101,11 +101,13 @@ public class HFileSystem extends FilterFileSystem {
 if (useHBaseChecksum && !(fs instanceof LocalFileSystem)) {
   conf = new Configuration(conf);
   conf.setBoolean("dfs.client.read.shortcircuit.skip.checksum", true);
-  this.noChecksumFs = newInstanceFileSystem(conf);
+  this.noChecksumFs = maybeWrapFileSystem(newInstanceFileSystem(conf), 
conf);
   this.noChecksumFs.setVerifyChecksum(false);
 } else {
-  this.noChecksumFs = fs;
+  this.noChecksumFs = maybeWrapFileSystem(fs, conf);
 }
+
+this.fs = maybeWrapFileSystem(this.fs, conf);
   }
 
   /**
@@ -191,6 +193,27 @@ public class HFileSystem extends FilterFileSystem {
 return fs;
   }
 
+  /**
+   * Returns an instance of Filesystem wrapped into the class specified in
+   * hbase.fs.wrapper property, if one is set in the configuration, returns
+   * unmodified FS instance passed in as an argument otherwise.
+   * @param base Filesystem instance to wrap
+   * @param conf Configuration
+   * @return wrapped instance of FS, or the same instance if no wrapping 
configured.
+   */
+  private FileSystem maybeWrapFileSystem(FileSystem base, Configuration conf) {
+try {
+  Class clazz = conf.getClass("hbase.fs.wrapper", null);
+  if (clazz != null) {
+return (FileSystem) clazz.getConstructor(FileSystem.class, 
Configuration.class)
+  .newInstance(base, conf);
+  }
+} catch (Exception e) {
+  LOG.error("Failed to wrap filesystem: " + e);
+}
+return base;
+  }
+
   public static boolean addLocationsOrderInterceptor(Configuration conf) 
throws IOException {
 return addLocationsOrderInterceptor(conf, new ReorderWALBlocks());
   }



hbase git commit: HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh Nishtala)

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/branch-1 57ca428c5 -> 36d634d35


HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh 
Nishtala)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/36d634d3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/36d634d3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/36d634d3

Branch: refs/heads/branch-1
Commit: 36d634d353c2193d87d60f6525647360d8a27379
Parents: 57ca428
Author: Mikhail Antonov 
Authored: Mon May 2 13:23:51 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 13:26:37 2016 -0700

--
 .../org/apache/hadoop/hbase/fs/HFileSystem.java | 27 ++--
 1 file changed, 25 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/36d634d3/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
index fb58360..521bc57 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
@@ -101,11 +101,13 @@ public class HFileSystem extends FilterFileSystem {
 if (useHBaseChecksum && !(fs instanceof LocalFileSystem)) {
   conf = new Configuration(conf);
   conf.setBoolean("dfs.client.read.shortcircuit.skip.checksum", true);
-  this.noChecksumFs = newInstanceFileSystem(conf);
+  this.noChecksumFs = maybeWrapFileSystem(newInstanceFileSystem(conf), 
conf);
   this.noChecksumFs.setVerifyChecksum(false);
 } else {
-  this.noChecksumFs = fs;
+  this.noChecksumFs = maybeWrapFileSystem(fs, conf);
 }
+
+this.fs = maybeWrapFileSystem(this.fs, conf);
   }
 
   /**
@@ -191,6 +193,27 @@ public class HFileSystem extends FilterFileSystem {
 return fs;
   }
 
+  /**
+   * Returns an instance of Filesystem wrapped into the class specified in
+   * hbase.fs.wrapper property, if one is set in the configuration, returns
+   * unmodified FS instance passed in as an argument otherwise.
+   * @param base Filesystem instance to wrap
+   * @param conf Configuration
+   * @return wrapped instance of FS, or the same instance if no wrapping 
configured.
+   */
+  private FileSystem maybeWrapFileSystem(FileSystem base, Configuration conf) {
+try {
+  Class clazz = conf.getClass("hbase.fs.wrapper", null);
+  if (clazz != null) {
+return (FileSystem) clazz.getConstructor(FileSystem.class, 
Configuration.class)
+  .newInstance(base, conf);
+  }
+} catch (Exception e) {
+  LOG.error("Failed to wrap filesystem: " + e);
+}
+return base;
+  }
+
   public static boolean addLocationsOrderInterceptor(Configuration conf) 
throws IOException {
 return addLocationsOrderInterceptor(conf, new ReorderWALBlocks());
   }



hbase git commit: HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh Nishtala)

2016-05-02 Thread antonov
Repository: hbase
Updated Branches:
  refs/heads/master d1130582d -> bbc7b9033


HBASE-15281 Allow the FileSystem inside HFileSystem to be wrapped (Rajesh 
Nishtala)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bbc7b903
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bbc7b903
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bbc7b903

Branch: refs/heads/master
Commit: bbc7b903350379b3aa50b9d105ff5d43cc166134
Parents: d113058
Author: Mikhail Antonov 
Authored: Mon May 2 13:23:51 2016 -0700
Committer: Mikhail Antonov 
Committed: Mon May 2 13:24:51 2016 -0700

--
 .../org/apache/hadoop/hbase/fs/HFileSystem.java | 27 ++--
 1 file changed, 25 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bbc7b903/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
index fb58360..521bc57 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
@@ -101,11 +101,13 @@ public class HFileSystem extends FilterFileSystem {
 if (useHBaseChecksum && !(fs instanceof LocalFileSystem)) {
   conf = new Configuration(conf);
   conf.setBoolean("dfs.client.read.shortcircuit.skip.checksum", true);
-  this.noChecksumFs = newInstanceFileSystem(conf);
+  this.noChecksumFs = maybeWrapFileSystem(newInstanceFileSystem(conf), 
conf);
   this.noChecksumFs.setVerifyChecksum(false);
 } else {
-  this.noChecksumFs = fs;
+  this.noChecksumFs = maybeWrapFileSystem(fs, conf);
 }
+
+this.fs = maybeWrapFileSystem(this.fs, conf);
   }
 
   /**
@@ -191,6 +193,27 @@ public class HFileSystem extends FilterFileSystem {
 return fs;
   }
 
+  /**
+   * Returns an instance of Filesystem wrapped into the class specified in
+   * hbase.fs.wrapper property, if one is set in the configuration, returns
+   * unmodified FS instance passed in as an argument otherwise.
+   * @param base Filesystem instance to wrap
+   * @param conf Configuration
+   * @return wrapped instance of FS, or the same instance if no wrapping 
configured.
+   */
+  private FileSystem maybeWrapFileSystem(FileSystem base, Configuration conf) {
+try {
+  Class clazz = conf.getClass("hbase.fs.wrapper", null);
+  if (clazz != null) {
+return (FileSystem) clazz.getConstructor(FileSystem.class, 
Configuration.class)
+  .newInstance(base, conf);
+  }
+} catch (Exception e) {
+  LOG.error("Failed to wrap filesystem: " + e);
+}
+return base;
+  }
+
   public static boolean addLocationsOrderInterceptor(Configuration conf) 
throws IOException {
 return addLocationsOrderInterceptor(conf, new ReorderWALBlocks());
   }



hbase git commit: HBASE-15748 Don't link in static libunwind.

2016-05-02 Thread eclark
Repository: hbase
Updated Branches:
  refs/heads/HBASE-14850 c502464e9 -> 80ac49e91


HBASE-15748 Don't link in static libunwind.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/80ac49e9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/80ac49e9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/80ac49e9

Branch: refs/heads/HBASE-14850
Commit: 80ac49e918280b8166737d54732f175ebdf42ae5
Parents: c502464
Author: Elliott Clark 
Authored: Mon May 2 11:41:02 2016 -0700
Committer: Elliott Clark 
Committed: Mon May 2 11:47:20 2016 -0700

--
 hbase-native-client/third-party/BUCK | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/80ac49e9/hbase-native-client/third-party/BUCK
--
diff --git a/hbase-native-client/third-party/BUCK 
b/hbase-native-client/third-party/BUCK
index 4327530..6561b2a 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -51,7 +51,7 @@ def add_dynamic_libs(names=[]):
 return rules
 
 
-system_libs = ["unwind", "lzma", "event", ]
+system_libs = ["lzma", "event", ]
 local_libs = [
 "double-conversion",
 "boost_regex",
@@ -65,7 +65,7 @@ local_libs = [
 "glog",
 "protobuf",
 ]
-dynamic_libs = ["stdc++", "pthread", "ssl", "crypto", "dl", "atomic", ]
+dynamic_libs = ["stdc++", "pthread", "ssl", "crypto", "dl", "atomic", "unwind"]
 dynamic_rules = add_dynamic_libs(dynamic_libs)
 tp_dep_rules =  add_system_libs(system_libs,) \
   + add_system_libs(local_libs, lib_dir = "/usr/local/lib") \



hbase git commit: HBASE-15739 Add region location lookup from meta

2016-05-02 Thread eclark
Repository: hbase
Updated Branches:
  refs/heads/HBASE-14850 2e3a0c9ca -> c502464e9


HBASE-15739 Add region location lookup from meta

Summary:
Add the ability for location-cache to read from meta.
There's still no cache. Or any parsing.

Test Plan: Needs tests.

Differential Revision: https://reviews.facebook.net/D57489


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c502464e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c502464e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c502464e

Branch: refs/heads/HBASE-14850
Commit: c502464e942fb35edabe09fa2cd9ca09b20a823f
Parents: 2e3a0c9
Author: Elliott Clark 
Authored: Sat Apr 30 17:12:11 2016 -0700
Committer: Elliott Clark 
Committed: Mon May 2 11:38:24 2016 -0700

--
 hbase-native-client/connection/BUCK |  1 +
 .../connection/client-dispatcher.cc |  2 +
 .../connection/client-dispatcher.h  |  3 +-
 .../connection/client-handler.cc|  5 +-
 hbase-native-client/connection/client-handler.h |  2 +-
 .../connection/connection-factory.cc|  2 +-
 .../connection/connection-factory.h |  1 +
 .../connection/connection-pool.cc   | 14 ++---
 hbase-native-client/connection/pipeline.cc  |  2 +
 hbase-native-client/connection/pipeline.h   |  1 +
 hbase-native-client/connection/response.h   |  6 ++-
 hbase-native-client/core/BUCK   |  3 +-
 hbase-native-client/core/location-cache.cc  | 37 --
 hbase-native-client/core/location-cache.h   | 19 ++-
 hbase-native-client/core/meta-utils.cc  | 54 +++-
 hbase-native-client/core/meta-utils.h   |  9 +++-
 hbase-native-client/core/region-location.h  | 45 
 hbase-native-client/core/simple-client.cc   | 48 ++---
 hbase-native-client/core/table-name-test.cc | 28 +-
 hbase-native-client/core/table-name.cc  | 34 
 hbase-native-client/core/table-name.h   | 35 ++---
 hbase-native-client/serde/BUCK  |  1 +
 hbase-native-client/utils/BUCK  |  7 +--
 hbase-native-client/utils/user-util.cc  |  2 +
 hbase-native-client/utils/user-util.h   |  3 +-
 25 files changed, 231 insertions(+), 133 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c502464e/hbase-native-client/connection/BUCK
--
diff --git a/hbase-native-client/connection/BUCK 
b/hbase-native-client/connection/BUCK
index 96f2136..39b8be5 100644
--- a/hbase-native-client/connection/BUCK
+++ b/hbase-native-client/connection/BUCK
@@ -43,6 +43,7 @@ cxx_library(name="connection",
 "//third-party:folly",
 "//third-party:wangle",
 ],
+compiler_flags=['-Weffc++'],
 visibility=['//core/...', ], )
 cxx_test(name="connection-pool-test",
  srcs=["connection-pool-test.cc", ],

http://git-wip-us.apache.org/repos/asf/hbase/blob/c502464e/hbase-native-client/connection/client-dispatcher.cc
--
diff --git a/hbase-native-client/connection/client-dispatcher.cc 
b/hbase-native-client/connection/client-dispatcher.cc
index eea0a17..817adc1 100644
--- a/hbase-native-client/connection/client-dispatcher.cc
+++ b/hbase-native-client/connection/client-dispatcher.cc
@@ -22,6 +22,8 @@ using namespace folly;
 using namespace hbase;
 using namespace wangle;
 
+ClientDispatcher::ClientDispatcher() : requests_(), current_call_id_(9) {}
+
 void ClientDispatcher::read(Context *ctx, Response in) {
   auto call_id = in.call_id();
   auto search = requests_.find(call_id);

http://git-wip-us.apache.org/repos/asf/hbase/blob/c502464e/hbase-native-client/connection/client-dispatcher.h
--
diff --git a/hbase-native-client/connection/client-dispatcher.h 
b/hbase-native-client/connection/client-dispatcher.h
index 877e877..826fc6a 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -30,6 +30,7 @@ class ClientDispatcher
 : public wangle::ClientDispatcherBase {
 public:
+  ClientDispatcher();
   void read(Context *ctx, Response in) override;
   folly::Future operator()(std::unique_ptr arg) override;
   folly::Future close(Context *ctx) override;
@@ -45,6 +46,6 @@ private:
   //
   // uint32_t has a max of 4Billion so 10 more or less is
   // not a big deal.
-  uint32_t current_call_id_ = 10;
+  uint32_t current_call_id_;
 };
 }