hbase git commit: HBASE-15805 Canary test timeout if there is failed or shutdown zookeeper node in a quorum (Vishal Khandelwal)

2016-05-18 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 8dfbdc9e1 -> b8cb2e43d


HBASE-15805 Canary test timeout if there is failed or shutdown zookeeper node 
in a quorum (Vishal Khandelwal)


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

Branch: refs/heads/0.98
Commit: b8cb2e43db10be501cf9a5263b7cb6ab184bc0c2
Parents: 8dfbdc9
Author: Andrew Purtell 
Authored: Wed May 18 19:49:15 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 19:49:15 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java| 23 
 1 file changed, 9 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b8cb2e43/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 b3a858a..cfb9860 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
@@ -885,7 +885,7 @@ public final class Canary implements Tool {
   }
   List> taskFutures = new LinkedList>();
   for (HTableDescriptor table : admin.listTables()) {
-if (admin.isTableEnabled(table.getTableName())
+if (connection.isTableEnabled(table.getTableName())
 && (!table.getTableName().equals(writeTableName))) {
   taskFutures.addAll(Canary.sniff(connection, sink, 
table.getTableName(), executor,
 taskType));
@@ -895,7 +895,7 @@ public final class Canary implements Tool {
 }
 
 private void checkWriteTableDistribution() throws IOException, 
ServiceException {
-  if (!admin.tableExists(writeTableName)) {
+  if (Arrays.binarySearch(connection.listTableNames(), writeTableName) == 
-1) {
 int numberOfServers = admin.getClusterStatus().getServers().size();
 if (numberOfServers == 0) {
   throw new IllegalStateException("No live regionservers");
@@ -903,7 +903,7 @@ public final class Canary implements Tool {
 createWriteTable(numberOfServers);
   }
 
-  if (!admin.isTableEnabled(writeTableName)) {
+  if (!connection.isTableEnabled(writeTableName)) {
 admin.enableTable(writeTableName);
   }
 
@@ -968,18 +968,13 @@ public final class Canary implements Tool {
   LOG.debug(String.format("checking table is enabled and getting table 
descriptor for table %s",
 tableName));
 }
-HBaseAdmin admin = new HBaseAdmin(connection);
-try {
-  if (admin.isTableEnabled(TableName.valueOf(tableName))) {
-return Canary.sniff(connection, sink, TableName.valueOf(tableName), 
executor,
-  taskType);
-  } else {
-LOG.warn(String.format("Table %s is not enabled", tableName));
-  }
-  return new LinkedList>();
-} finally {
-  admin.close();
+if (connection.isTableEnabled(TableName.valueOf(tableName))) {
+  return Canary.sniff(connection, sink, TableName.valueOf(tableName), 
executor,
+taskType);
+} else {
+  LOG.warn(String.format("Table %s is not enabled", tableName));
 }
+return new LinkedList>();
   }
 
   /*



hbase git commit: HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

2016-05-18 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 4b1221398 -> 1eb004d88


HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

Signed-off-by: Andrew Purtell 


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

Branch: refs/heads/branch-1.3
Commit: 1eb004d88b28e74ebb0922cf082b9d07676a3f0b
Parents: 4b12213
Author: Vincent 
Authored: Mon May 2 17:30:16 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 19:21:56 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java|  12 +-
 .../hadoop/hbase/tool/TestCanaryTool.java   | 141 +++
 2 files changed, 152 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1eb004d8/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 e6c830d..731942c 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
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -1167,7 +1168,9 @@ public final class Canary implements Tool {
 String serverName = entry.getKey();
 AtomicLong successes = new AtomicLong(0);
 successMap.put(serverName, successes);
-if (this.allRegions) {
+if (entry.getValue().isEmpty()) {
+  LOG.error(String.format("Regionserver not serving any regions - %s", 
serverName));
+} else if (this.allRegions) {
   for (HRegionInfo region : entry.getValue()) {
 tasks.add(new RegionServerTask(this.connection,
 serverName,
@@ -1243,6 +1246,13 @@ public final class Canary implements Tool {
   table.close();
 }
 
+//get any live regionservers not serving any regions
+for (ServerName rs : this.admin.getClusterStatus().getServers()) {
+  String rsName = rs.getHostname();
+  if (!rsAndRMap.containsKey(rsName)) {
+rsAndRMap.put(rsName, Collections.emptyList());
+  }
+}
   } catch (IOException e) {
 String msg = "Get HTables info failed";
 LOG.error(msg, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1eb004d8/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
new file mode 100644
index 000..efca102
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
@@ -0,0 +1,141 @@
+/**
+ *
+ * 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.tool;
+
+import org.apache.hadoop.conf.Configuration;
+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.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.util.T

[4/4] hbase git commit: HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

2016-05-18 Thread apurtell
HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

Signed-off-by: Andrew Purtell 


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

Branch: refs/heads/branch-1.2
Commit: 8108fc8643eef1b11fbaefee98b03651fff38bd0
Parents: 5813194
Author: Vincent 
Authored: Mon May 2 17:30:16 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 19:01:25 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java|  12 +-
 .../hadoop/hbase/tool/TestCanaryTool.java   | 141 +++
 2 files changed, 152 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8108fc86/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 0bc2a65..cf89164 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
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -1120,7 +1121,9 @@ public final class Canary implements Tool {
 String serverName = entry.getKey();
 AtomicLong successes = new AtomicLong(0);
 successMap.put(serverName, successes);
-if (this.allRegions) {
+if (entry.getValue().isEmpty()) {
+  LOG.error(String.format("Regionserver not serving any regions - %s", 
serverName));
+} else if (this.allRegions) {
   for (HRegionInfo region : entry.getValue()) {
 tasks.add(new RegionServerTask(this.connection,
 serverName,
@@ -1193,6 +1196,13 @@ public final class Canary implements Tool {
   table.close();
 }
 
+//get any live regionservers not serving any regions
+for (ServerName rs : this.admin.getClusterStatus().getServers()) {
+  String rsName = rs.getHostname();
+  if (!rsAndRMap.containsKey(rsName)) {
+rsAndRMap.put(rsName, Collections.emptyList());
+  }
+}
   } catch (IOException e) {
 String msg = "Get HTables info failed";
 LOG.error(msg, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/8108fc86/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
new file mode 100644
index 000..efca102
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
@@ -0,0 +1,141 @@
+/**
+ *
+ * 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.tool;
+
+import org.apache.hadoop.conf.Configuration;
+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.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.util.ToolRunner;
+import org.apache.log4j.Appender;
+import org.apache.log4j.LogManager;
+i

[3/4] hbase git commit: HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

2016-05-18 Thread apurtell
HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

Signed-off-by: Andrew Purtell 

Conflicts:
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java


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

Branch: refs/heads/0.98
Commit: 8dfbdc9e155ebe987ed1855b3192f8cc0fbedd9d
Parents: 95df62b
Author: Vincent 
Authored: Mon May 2 17:30:16 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 18:53:02 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java|  18 ++-
 .../hadoop/hbase/tool/TestCanaryTool.java   | 132 +++
 2 files changed, 147 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8dfbdc9e/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 2335ec5..b3a858a 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
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -1125,9 +1126,13 @@ public final class Canary implements Tool {
   // monitor one region on every region server
   for (Map.Entry> entry : rsAndRMap.entrySet()) {
 String serverName = entry.getKey();
-// random select a region
-HRegionInfo region = 
entry.getValue().get(rand.nextInt(entry.getValue().size()));
-tasks.add(new RegionServerTask(this.connection, serverName, region, 
getSink()));
+if (entry.getValue().isEmpty()) {
+  LOG.error(String.format("Regionserver not serving any regions - %s", 
serverName));
+} else {
+  // random select a region
+  HRegionInfo region = 
entry.getValue().get(rand.nextInt(entry.getValue().size()));
+  tasks.add(new RegionServerTask(this.connection, serverName, region, 
getSink()));
+}
   }
   try {
 for (Future future : this.executor.invokeAll(tasks)) {
@@ -1177,6 +1182,13 @@ public final class Canary implements Tool {
   table.close();
 }
 
+//get any live regionservers not serving any regions
+for (ServerName rs : this.admin.getClusterStatus().getServers()) {
+  String rsName = rs.getHostname();
+  if (!rsAndRMap.containsKey(rsName)) {
+rsAndRMap.put(rsName, Collections.emptyList());
+  }
+}
   } catch (IOException e) {
 String msg = "Get HTables info failed";
 LOG.error(msg, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/8dfbdc9e/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
new file mode 100644
index 000..b765177
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
@@ -0,0 +1,132 @@
+/**
+ *
+ * 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.tool;
+
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.ha

[2/4] hbase git commit: HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

2016-05-18 Thread apurtell
HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

Signed-off-by: Andrew Purtell 


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

Branch: refs/heads/branch-1
Commit: 5eed14272b0845d75240ad530a7e697d82cc80e6
Parents: e5eea96
Author: Vincent 
Authored: Mon May 2 17:30:16 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 18:42:17 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java|  12 +-
 .../hadoop/hbase/tool/TestCanaryTool.java   | 141 +++
 2 files changed, 152 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/5eed1427/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 e6c830d..731942c 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
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -1167,7 +1168,9 @@ public final class Canary implements Tool {
 String serverName = entry.getKey();
 AtomicLong successes = new AtomicLong(0);
 successMap.put(serverName, successes);
-if (this.allRegions) {
+if (entry.getValue().isEmpty()) {
+  LOG.error(String.format("Regionserver not serving any regions - %s", 
serverName));
+} else if (this.allRegions) {
   for (HRegionInfo region : entry.getValue()) {
 tasks.add(new RegionServerTask(this.connection,
 serverName,
@@ -1243,6 +1246,13 @@ public final class Canary implements Tool {
   table.close();
 }
 
+//get any live regionservers not serving any regions
+for (ServerName rs : this.admin.getClusterStatus().getServers()) {
+  String rsName = rs.getHostname();
+  if (!rsAndRMap.containsKey(rsName)) {
+rsAndRMap.put(rsName, Collections.emptyList());
+  }
+}
   } catch (IOException e) {
 String msg = "Get HTables info failed";
 LOG.error(msg, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/5eed1427/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
new file mode 100644
index 000..efca102
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
@@ -0,0 +1,141 @@
+/**
+ *
+ * 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.tool;
+
+import org.apache.hadoop.conf.Configuration;
+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.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
+import org.apache.hadoop.util.ToolRunner;
+import org.apache.log4j.Appender;
+import org.apache.log4j.LogManager;
+imp

[1/4] hbase git commit: HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

2016-05-18 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 95df62b20 -> 8dfbdc9e1
  refs/heads/branch-1 e5eea96ca -> 5eed14272
  refs/heads/branch-1.2 58131946d -> 8108fc864
  refs/heads/master 8aa8abfcb -> 460b41c80


HBASE-15617 Canary in regionserver mode might not enumerate all regionservers

Signed-off-by: Andrew Purtell 


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

Branch: refs/heads/master
Commit: 460b41c80012eff4ba59be95a86037d3b9c736b4
Parents: 8aa8abf
Author: Vincent 
Authored: Mon May 2 17:30:16 2016 -0700
Committer: Andrew Purtell 
Committed: Wed May 18 16:25:29 2016 -0700

--
 .../org/apache/hadoop/hbase/tool/Canary.java|  12 +-
 .../hadoop/hbase/tool/TestCanaryTool.java   | 141 +++
 2 files changed, 152 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/460b41c8/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
--
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 9ad7242..ab9971d 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
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -1106,7 +1107,9 @@ public final class Canary implements Tool {
 String serverName = entry.getKey();
 AtomicLong successes = new AtomicLong(0);
 successMap.put(serverName, successes);
-if (this.allRegions) {
+if (entry.getValue().isEmpty()) {
+  LOG.error(String.format("Regionserver not serving any regions - %s", 
serverName));
+} else if (this.allRegions) {
   for (HRegionInfo region : entry.getValue()) {
 tasks.add(new RegionServerTask(this.connection,
 serverName,
@@ -1182,6 +1185,13 @@ public final class Canary implements Tool {
   table.close();
 }
 
+//get any live regionservers not serving any regions
+for (ServerName rs : this.admin.getClusterStatus().getServers()) {
+  String rsName = rs.getHostname();
+  if (!rsAndRMap.containsKey(rsName)) {
+rsAndRMap.put(rsName, Collections.emptyList());
+  }
+}
   } catch (IOException e) {
 String msg = "Get HTables info failed";
 LOG.error(msg, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/460b41c8/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
new file mode 100644
index 000..efca102
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
@@ -0,0 +1,141 @@
+/**
+ *
+ * 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.tool;
+
+import org.apache.hadoop.conf.Configuration;
+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.ServerName;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apach

[13/42] hbase git commit: HBASE-14853 Add on protobuf to c++ chain

2016-05-18 Thread eclark
http://git-wip-us.apache.org/repos/asf/hbase/blob/2c911aeb/hbase-native-client/if/Master.proto
--
diff --git a/hbase-native-client/if/Master.proto 
b/hbase-native-client/if/Master.proto
new file mode 100644
index 000..4d3a2e1
--- /dev/null
+++ b/hbase-native-client/if/Master.proto
@@ -0,0 +1,778 @@
+/**
+ * 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.
+ */
+
+// All to do with the Master.  Includes schema management since these
+// changes are run by the Master process.
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "HBase.proto";
+import "Client.proto";
+import "ClusterStatus.proto";
+import "ErrorHandling.proto";
+import "Procedure.proto";
+import "Quota.proto";
+
+/* Column-level protobufs */
+
+message AddColumnRequest {
+  required TableName table_name = 1;
+  required ColumnFamilySchema column_families = 2;
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message AddColumnResponse {
+  optional uint64 proc_id = 1;
+}
+
+message DeleteColumnRequest {
+  required TableName table_name = 1;
+  required bytes column_name = 2;
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message DeleteColumnResponse {
+  optional uint64 proc_id = 1;
+}
+
+message ModifyColumnRequest {
+  required TableName table_name = 1;
+  required ColumnFamilySchema column_families = 2;
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message ModifyColumnResponse {
+  optional uint64 proc_id = 1;
+}
+
+/* Region-level Protos */
+
+message MoveRegionRequest {
+  required RegionSpecifier region = 1;
+  optional ServerName dest_server_name = 2;
+}
+
+message MoveRegionResponse {
+}
+
+/**
+ * Dispatch merging the specified regions.
+ */
+message DispatchMergingRegionsRequest {
+  required RegionSpecifier region_a = 1;
+  required RegionSpecifier region_b = 2;
+  optional bool forcible = 3 [default = false];
+}
+
+message DispatchMergingRegionsResponse {
+}
+
+message AssignRegionRequest {
+  required RegionSpecifier region = 1;
+}
+
+message AssignRegionResponse {
+}
+
+message UnassignRegionRequest {
+  required RegionSpecifier region = 1;
+  optional bool force = 2 [default = false];
+}
+
+message UnassignRegionResponse {
+}
+
+message OfflineRegionRequest {
+  required RegionSpecifier region = 1;
+}
+
+message OfflineRegionResponse {
+}
+
+/* Table-level protobufs */
+
+message CreateTableRequest {
+  required TableSchema table_schema = 1;
+  repeated bytes split_keys = 2;
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message CreateTableResponse {
+  optional uint64 proc_id = 1;
+}
+
+message DeleteTableRequest {
+  required TableName table_name = 1;
+  optional uint64 nonce_group = 2 [default = 0];
+  optional uint64 nonce = 3 [default = 0];
+}
+
+message DeleteTableResponse {
+  optional uint64 proc_id = 1;
+}
+
+message TruncateTableRequest {
+  required TableName tableName = 1;
+  optional bool preserveSplits = 2 [default = false];
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message TruncateTableResponse {
+  optional uint64 proc_id = 1;
+}
+
+message EnableTableRequest {
+  required TableName table_name = 1;
+  optional uint64 nonce_group = 2 [default = 0];
+  optional uint64 nonce = 3 [default = 0];
+}
+
+message EnableTableResponse {
+  optional uint64 proc_id = 1;
+}
+
+message DisableTableRequest {
+  required TableName table_name = 1;
+  optional uint64 nonce_group = 2 [default = 0];
+  optional uint64 nonce = 3 [default = 0];
+}
+
+message DisableTableResponse {
+  optional uint64 proc_id = 1;
+}
+
+message ModifyTableRequest {
+  required TableName table_name = 1;
+  required TableSchema table_schema = 2;
+  optional uint64 nonce_group = 3 [default = 0];
+  optional uint64 nonce = 4 [default = 0];
+}
+
+message ModifyTableResponse {

[07/42] hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread eclark
HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/HBASE-14850
Commit: 8aa8abfcb672e4b905c487a10f1511db431f7006
Parents: 5ac54e6
Author: Stephen Yuan Jiang 
Authored: Wed May 18 09:41:13 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 13:22:41 2016 -0700

--
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8aa8abfc/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
index 165fea6..57bc77e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
@@ -1472,7 +1472,8 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck 
{
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] 
{HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
+assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 final CountDownLatch latch = new CountDownLatch(1);
 new Thread() {
@@ -1496,24 +1497,27 @@ public class TestHBaseFsckOneRS extends 
BaseTestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
+// still one expired, one not-expired
 assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
-HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // still one 
expired, one not-expired
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] 
{HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
+assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
 HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are 
expired
 
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
+Configuration localConf = new Configuration(conf);
 // reaping from ZKInterProcessWriteLock uses znode cTime,
 // which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



[18/42] hbase git commit: HBASE-14854 Read meta location from zk

2016-05-18 Thread eclark
HBASE-14854 Read meta location from zk


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

Branch: refs/heads/HBASE-14850
Commit: b9881d21beedc1354094d558eb6458ecfdd51cc1
Parents: dd8bb5c
Author: Elliott Clark 
Authored: Sat Mar 5 00:09:08 2016 -0800
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Dockerfile  |  20 ++-
 hbase-native-client/bin/start-docker.sh |   5 +-
 hbase-native-client/core/BUCK   | 106 +++---
 .../core/HBaseNativeClientTestEnv.cc|  42 --
 .../core/SampleNativeClientTest.cc  |  28 
 hbase-native-client/core/location-cache-test.cc |  14 ++
 hbase-native-client/core/location-cache.cc  |  67 +
 hbase-native-client/core/location-cache.h   |  35 +
 .../core/native-client-test-env.cc  |  42 ++
 .../core/simple-native-client-test.cc   |  28 
 hbase-native-client/core/test_env.h |   2 +
 hbase-native-client/if/BUCK |   1 +
 hbase-native-client/third-party/BUCK| 138 ++-
 13 files changed, 339 insertions(+), 189 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b9881d21/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 1364d22..36959a5 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM cpp_update 
+FROM pjameson/buck-folly-watchman
 
 ARG CC=/usr/bin/gcc-5
 ARG CXX=/usr/bin/g++-5
@@ -25,20 +25,26 @@ ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g 
-fno-omit-frame-pointer -O3 -p
 RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping
 RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git 
/usr/src/protobuf && \
   cd /usr/src/protobuf/ && \
+  ldconfig && \
   ./autogen.sh && \
-  ./configure --disable-shared && \
+  ./configure && \
   make && \
-  make check && \
-  make install
+  make install && \ 
+  make clean && \
+  rm -rf .git
+
 RUN cd /usr/src && \
   wget 
http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz 
&& \ 
   tar zxf zookeeper-3.4.8.tar.gz && \ 
   rm -rf zookeeper-3.4.8.tar.gz && \
   cd zookeeper-3.4.8 && \
   cd src/c && \
-  ./configure --disable-shared && \
+  ldconfig && \
+  ./configure && \
   make && \
   make install && \
-  make clean 
+  make clean
+
+RUN ldconfig
 
-WORKDIR /usr/local/src/hbase/hbase-native-client
+WORKDIR /usr/src/hbase/hbase-native-client

http://git-wip-us.apache.org/repos/asf/hbase/blob/b9881d21/hbase-native-client/bin/start-docker.sh
--
diff --git a/hbase-native-client/bin/start-docker.sh 
b/hbase-native-client/bin/start-docker.sh
index 4426705..725ed6a 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -19,8 +19,11 @@
 set -e
 set -x
 
+# Try out some standard docker machine names that could work
 eval "$(docker-machine env docker-vm)"
 eval "$(docker-machine env dinghy)"
+
+# Build the image
 docker build -t hbase_native .
 
 
@@ -36,6 +39,6 @@ fi;
 
 docker run -p 16010:16010/tcp \
-e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
-   -v ${PWD}/..:/usr/local/src/hbase \
+   -v ${PWD}/..:/usr/src/hbase \
-v ~/.m2:/root/.m2 \
-it hbase_native  /bin/bash

http://git-wip-us.apache.org/repos/asf/hbase/blob/b9881d21/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index ef027a1..817b5a0 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -15,52 +15,62 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+cxx_library(name="core",
+headers=[
+"admin.h",
+"client.h",
+"connection.h",
+"connection_attr.h",
+"delete.h",
+"get.h",
+"hbase_macros.h",
+"mutation.h",
+"put.h",
+"scanner.h",
+"location-cache.h",
+],
+srcs=[
+"admin.cc",
+"client.cc",
+"connection.cc",
+"get.cc

[20/42] hbase git commit: HBASE-15604 Add a good readme on the build.

2016-05-18 Thread eclark
HBASE-15604 Add a good readme on the build.


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

Branch: refs/heads/HBASE-14850
Commit: 711b6619314b6e8581d28a551b4d3b54c1bc8fb4
Parents: 80977a6
Author: Elliott Clark 
Authored: Fri Apr 8 13:44:45 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/BUILDING.md | 63 
 1 file changed, 63 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/711b6619/hbase-native-client/BUILDING.md
--
diff --git a/hbase-native-client/BUILDING.md b/hbase-native-client/BUILDING.md
new file mode 100644
index 000..20ef2a0
--- /dev/null
+++ b/hbase-native-client/BUILDING.md
@@ -0,0 +1,63 @@
+
+
+#Building HBase native client
+
+The HBase native client build using buck and produces a linux library.
+
+
+# Dependencies
+
+The easiest way to build hbase-native-client is to
+use [Docker](https://www.docker.com/). This will mean that any platform
+with docker can be used to build the hbase-native-client. It will also
+mean that you're building with the same versions of all dependencies that
+the client is tested with.
+
+On OSX the current boot2docker solution will work however it's pretty
+slow. If things get too slow using 
[dinghy](https://github.com/codekitchen/dinghy)
+can help speed things up by using nfs.
+
+If possible pairing virtual box with dinghy will result in the fastest,
+most stable docker environment. However none of it is needed.
+
+# Building using docker
+
+To start with make sure that you have built the java project using
+`mvn package -DskipTests`. That will allow all tests to spin up a standalone
+hbase instance from the jar's created.
+
+Then go into the hbase-native-client directory and run `./bin/start-docker.sh`
+that will build the docker development environment and when complete will
+drop you into a shell on a linux vm with all the tools needed installed.
+
+# Buck
+
+From then on we can use [buck](https://buckbuild.com/) to build everything.
+For example:
+```
+buck build //core:core
+buck test --all
+buck build //core:simple-client
+```
+
+That will build the library, then build and test everything, then build
+the simple-client binary. Buck will find all modules used, and compile 
+them in parallel, caching the results. Output from buck is in the buck-out
+foulder. Generated binaries are in buck-out/gen logs are in buck-out/logs



[33/42] hbase git commit: HBASE-15748 Don't link in static libunwind.

2016-05-18 Thread eclark
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/39154784
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/39154784
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/39154784

Branch: refs/heads/HBASE-14850
Commit: 39154784f2eafaf7dfe07cad5a1f321c9fa3b7e2
Parents: a7225e4
Author: Elliott Clark 
Authored: Mon May 2 11:41:02 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 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/39154784/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") \



[22/42] hbase git commit: HBASE-15045 Keep hbase-native-client/if and hbase-protocol in sync.

2016-05-18 Thread eclark
HBASE-15045 Keep hbase-native-client/if and hbase-protocol in sync.

Summary: On every start of docker make sure that protos are up to date.

Test Plan: Added the script and it updated the protos, but didn't delete BUCK.

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


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

Branch: refs/heads/HBASE-14850
Commit: f3442379616c5874504695d5702e2d701ab3c512
Parents: 17185fe
Author: Elliott Clark 
Authored: Wed Apr 13 15:59:13 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/bin/copy-protobuf.sh |   8 ++
 hbase-native-client/bin/start-docker.sh  |  22 +++-
 hbase-native-client/if/Admin.proto   |   1 +
 hbase-native-client/if/Client.proto  |   8 +-
 hbase-native-client/if/ClusterStatus.proto   |   3 +
 hbase-native-client/if/Filter.proto  |   1 +
 hbase-native-client/if/Master.proto  |  47 +++-
 hbase-native-client/if/MasterProcedure.proto |  40 +++
 hbase-native-client/if/RSGroup.proto |  34 ++
 hbase-native-client/if/RSGroupAdmin.proto| 136 ++
 hbase-native-client/if/ZooKeeper.proto   |  13 +++
 11 files changed, 304 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f3442379/hbase-native-client/bin/copy-protobuf.sh
--
diff --git a/hbase-native-client/bin/copy-protobuf.sh 
b/hbase-native-client/bin/copy-protobuf.sh
new file mode 100755
index 000..c9e70f2
--- /dev/null
+++ b/hbase-native-client/bin/copy-protobuf.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+set -euo pipefail
+IFS=$'\n\t'
+
+BIN_DIR=$(dirname "$0")
+PB_SOURCE_DIR="${BIN_DIR}/../../hbase-protocol/src/main/protobuf/"
+PB_DEST_DIR="${BIN_DIR}/../if/"
+rsync -r --delete --exclude BUCK ${PB_SOURCE_DIR} ${PB_DEST_DIR}

http://git-wip-us.apache.org/repos/asf/hbase/blob/f3442379/hbase-native-client/bin/start-docker.sh
--
diff --git a/hbase-native-client/bin/start-docker.sh 
b/hbase-native-client/bin/start-docker.sh
index 725ed6a..9cbd8b7 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -23,22 +23,38 @@ set -x
 eval "$(docker-machine env docker-vm)"
 eval "$(docker-machine env dinghy)"
 
-# Build the image
-docker build -t hbase_native .
+BIN_DIR=$(pushd `dirname "$0"` 2>&1 > /dev/null && pwd && popd  2>&1 > 
/dev/null)
+BASE_DIR=$(pushd "${BIN_DIR}/../" 2>&1 > /dev/null && pwd && popd  2>&1 > 
/dev/null)
 
+${BIN_DIR}/copy-protobuf.sh
 
+# Go into the base dir. This just makes things cleaner.
+pushd ${BASE_DIR}
+
+# Make sure that there is a thrid-party dir.
 mkdir third-party || true
+
+# Get gtest
+# TODO(eclark): Remove this ( see HBASE-15427 )
 if [[ ! -d third-party/googletest ]]; then
 git clone https://github.com/google/googletest.git 
third-party/googletest
 fi
 
+# We don't want to have to re-download all the jars in docker if we can help it
 if [[ ! -d ~/.m2 ]]; then
 echo "~/.m2 directory doesn't exist. Check Apache Maven is installed."
 exit 1
 fi;
 
+# Build the image
+# 
+# This shouldn't be needed after the development environment is a little more 
stable.
+docker build -t hbase_native .
+
+# After the image is built run the thing
 docker run -p 16010:16010/tcp \
-e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
-   -v ${PWD}/..:/usr/src/hbase \
+   -v ${BASE_DIR}/..:/usr/src/hbase \
-v ~/.m2:/root/.m2 \
-it hbase_native  /bin/bash
+popd

http://git-wip-us.apache.org/repos/asf/hbase/blob/f3442379/hbase-native-client/if/Admin.proto
--
diff --git a/hbase-native-client/if/Admin.proto 
b/hbase-native-client/if/Admin.proto
index e905340..a1905a4 100644
--- a/hbase-native-client/if/Admin.proto
+++ b/hbase-native-client/if/Admin.proto
@@ -25,6 +25,7 @@ option java_generic_services = true;
 option java_generate_equals_and_hash = true;
 option optimize_for = SPEED;
 
+import "Client.proto";
 import "HBase.proto";
 import "WAL.proto";
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/f3442379/hbase-native-client/if/Client.proto
--
diff --git a/hbase-native-client/if/Client.proto 
b/hbase-native-client/if/Client.proto
index ca9abdc..8a4d459 100644
--- a/hbase-native-client/if/Client.proto
+++ b/hbase-native-client/if/Client.proto
@@ -402,6 +402,11 @@ message RegionLoadStats {
   optional int32 compac

[42/42] hbase git commit: HBASE-15718 Add on TableName implementation and tests

2016-05-18 Thread eclark
HBASE-15718 Add on TableName implementation and tests

Summary:
Table name will be needed to look up a row in meta. So this
patch adds on the implementation for creating that lookup
row. It also adds tests for TableName

Test Plan: Added on a unit test

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


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

Branch: refs/heads/HBASE-14850
Commit: a6a2878cf6bb228395ac64d420717739e92b9c63
Parents: 65cd2da
Author: Elliott Clark 
Authored: Tue Apr 26 14:51:06 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/client-handler.cc|  1 -
 hbase-native-client/core/BUCK   | 69 +++-
 hbase-native-client/core/meta-utils.cc  | 31 +
 hbase-native-client/core/meta-utils.h   | 30 +
 hbase-native-client/core/simple-client.cc   |  4 +-
 hbase-native-client/core/table-name-test.cc | 50 ++
 hbase-native-client/core/table-name.cc  | 15 +
 hbase-native-client/core/table-name.h   | 25 ++-
 hbase-native-client/if/Master.proto | 13 
 hbase-native-client/if/ZooKeeper.proto  | 10 ++-
 10 files changed, 211 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a6a2878c/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index 7b7794d..205993a7 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -60,7 +60,6 @@ void ClientHandler::read(Context *ctx, std::unique_ptr 
buf) {
   }
 }
 
-
 // TODO(eclark): Figure out how to handle the
 // network errors that are going to come.
 Future ClientHandler::write(Context *ctx, Request r) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/a6a2878c/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 195fc5c..9db6fda 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -16,44 +16,49 @@
 # limitations under the License.
 
 # This is the main library.
-cxx_library(name="core",
-exported_headers=[
-"client.h",
-"connection.h",
-"get-request.h",
-"get-result.h",
-"hbase_macros.h",
-"location-cache.h",
-"table-name.h",
-],
-srcs=[
-"client.cc",
-"get-request.cc",
-"get-result.cc",
-"location-cache.cc",
-"table-name.cc",
-],
-deps=[
-"//connection:connection",
-"//if:if",
-"//serde:serde",
-"//third-party:folly",
-"//third-party:wangle",
-"//third-party:zookeeper_mt",
-],
-visibility=[
-'PUBLIC',
-], )
-
+cxx_library(
+name="core",
+exported_headers=[
+"client.h",
+"connection.h",
+"get-request.h",
+"get-result.h",
+"hbase_macros.h",
+"location-cache.h",
+"table-name.h",
+# TODO: move this out of exported
+# Once meta lookup works
+"meta-utils.h",
+],
+srcs=[
+"client.cc",
+"get-request.cc",
+"get-result.cc",
+"location-cache.cc",
+"meta-utils.cc",
+"table-name.cc",
+],
+deps=[
+"//connection:connection",
+"//if:if",
+"//serde:serde",
+"//third-party:folly",
+"//third-party:wangle",
+"//third-party:zookeeper_mt",
+],
+visibility=[
+'PUBLIC',
+], )
 cxx_test(name="location-cache-test",
  srcs=[
  "test-env.cc",
  "location-cache-test.cc",
  ],
- deps=[
- ":core",
- ],
+ deps=[":core", ],
  run_test_separately=True, )
+cxx_test(name="table-name-test",
+ srcs=["table-name-test.cc", ],
+ deps=[":core", ], )
 cxx_binary(name="simple-client",
srcs=["simple-client.cc", ],
deps=[":core", "//connection:connection"], )

http://git-wip-us.apache.org/repos/asf/hbase/blob/a6a2878c/hbase-native-client/core/meta-utils.cc
-

[37/42] hbase git commit: HBASE-15777 Fix needs header in client handler

2016-05-18 Thread eclark
HBASE-15777 Fix needs header in client handler


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

Branch: refs/heads/HBASE-14850
Commit: 7d7bc06e6a69874133be67107cc712c93faf66ce
Parents: 285b114
Author: Elliott Clark 
Authored: Thu May 5 13:51:18 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/client-handler.cc| 31 
 hbase-native-client/connection/client-handler.h | 19 +++-
 2 files changed, 36 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7d7bc06e/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index b92ad89..4fdb7ae 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -37,7 +37,7 @@ using hbase::pb::GetResponse;
 using google::protobuf::Message;
 
 ClientHandler::ClientHandler(std::string user_name)
-: user_name_(user_name), need_send_header_(true), serde_(),
+: user_name_(user_name), serde_(), header_info_(),
   resp_msgs_(
   make_unique>>(5000)) {}
@@ -81,22 +81,27 @@ void ClientHandler::read(Context *ctx, 
std::unique_ptr buf) {
   }
 }
 
-// TODO(eclark): Figure out how to handle the
-// network errors that are going to come.
 Future ClientHandler::write(Context *ctx, std::unique_ptr r) {
   // Keep track of if we have sent the header.
-  if (UNLIKELY(need_send_header_)) {
-need_send_header_ = false;
+  //
+  // even though the bool is atomic we can load it lazily here.
+  if (UNLIKELY(header_info_->need_.load(std::memory_order_relaxed))) {
 
-// Should we be sending just one fireWrite?
-// Right now we're sending one for the header
-// and one for the request.
+// Grab the lock.
+// We need to make sure that no one gets past here without there being a
+// hearder sent.
+std::lock_guard lock(header_info_->mutex_);
+
+// Now see if we are the first thread to get through.
 //
-// That doesn't seem like too bad, but who knows.
-auto pre = serde_.Preamble();
-auto header = serde_.Header(user_name_);
-pre->appendChain(std::move(header));
-ctx->fireWrite(std::move(pre));
+// If this is the first thread to get through then the
+// need_send_header will have been true before this.
+if (header_info_->need_.exchange(false)) {
+  auto pre = serde_.Preamble();
+  auto header = serde_.Header(user_name_);
+  pre->appendChain(std::move(header));
+  ctx->fireWrite(std::move(pre));
+}
   }
 
   resp_msgs_->insert(r->call_id(), r->resp_msg());

http://git-wip-us.apache.org/repos/asf/hbase/blob/7d7bc06e/hbase-native-client/connection/client-handler.h
--
diff --git a/hbase-native-client/connection/client-handler.h 
b/hbase-native-client/connection/client-handler.h
index be5143c..1a4275f 100644
--- a/hbase-native-client/connection/client-handler.h
+++ b/hbase-native-client/connection/client-handler.h
@@ -21,6 +21,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 
 #include "serde/rpc.h"
@@ -29,6 +31,7 @@
 namespace hbase {
 class Request;
 class Response;
+class HeaderInfo;
 }
 namespace google {
 namespace protobuf {
@@ -37,6 +40,7 @@ class Message;
 }
 
 namespace hbase {
+
 class ClientHandler : public wangle::Handler,
  Response, 
std::unique_ptr,
  std::unique_ptr> {
@@ -47,7 +51,7 @@ public:
std::unique_ptr r) override;
 
 private:
-  bool need_send_header_;
+  std::unique_ptr header_info_;
   std::string user_name_;
   RpcSerde serde_;
 
@@ -56,4 +60,17 @@ private:
   uint32_t, std::shared_ptr>>
   resp_msgs_;
 };
+
+/**
+ * Class to contain the info about if the connection header and preamble has
+ * been sent.
+ *
+ * We use a serperate class here so that ClientHandler is relocatable.
+ */
+class HeaderInfo {
+public:
+  HeaderInfo() : need_(true), mutex_() {}
+  std::atomic need_;
+  std::mutex mutex_;
+};
 } // namespace hbase



[19/42] hbase git commit: HBASE-15418 Clean up un-used warning in test util

2016-05-18 Thread eclark
HBASE-15418 Clean up un-used warning in test util


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

Branch: refs/heads/HBASE-14850
Commit: 80977a673d7d8cfa0a85cf8ee9947c6d75dc5677
Parents: b9881d2
Author: Elliott Clark 
Authored: Fri Mar 25 15:44:06 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../bin/start_local_hbase_and_wait.sh   |  9 +-
 .../bin/stop_local_hbase_and_wait.sh|  2 +-
 hbase-native-client/core/BUCK   |  6 
 .../core/native-client-test-env.cc  |  9 --
 hbase-native-client/core/test_env.h | 32 
 5 files changed, 15 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/80977a67/hbase-native-client/bin/start_local_hbase_and_wait.sh
--
diff --git a/hbase-native-client/bin/start_local_hbase_and_wait.sh 
b/hbase-native-client/bin/start_local_hbase_and_wait.sh
index 64d0b68..cfc71f9 100755
--- a/hbase-native-client/bin/start_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/start_local_hbase_and_wait.sh
@@ -17,10 +17,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# Clean up from any other tests.
+rm -rf /tmp/hbase-*
+
+# Start the master/regionservers.
 $PWD/../bin/start-hbase.sh
 
-until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == 
"200" ]
+until [ $(curl -s -o /dev/null -I -w "%{http_code}" 
http://localhost:16010/jmx) == "200" ]
 do
  printf "Waiting for local HBase cluster to start\n"
  sleep 1
 done
+
+# This sucks, but master can easily be up and meta not be assigned yet.
+sleep 30

http://git-wip-us.apache.org/repos/asf/hbase/blob/80977a67/hbase-native-client/bin/stop_local_hbase_and_wait.sh
--
diff --git a/hbase-native-client/bin/stop_local_hbase_and_wait.sh 
b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
index 4e89334..761412a 100755
--- a/hbase-native-client/bin/stop_local_hbase_and_wait.sh
+++ b/hbase-native-client/bin/stop_local_hbase_and_wait.sh
@@ -17,7 +17,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-$PWD/../bin/stop-hbase.sh
+ps aux | grep proc_master | awk '{print $2}' | xargs kill -9
 
 while [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == 
"200" ]
 do

http://git-wip-us.apache.org/repos/asf/hbase/blob/80977a67/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 817b5a0..d1e89d1 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -51,9 +51,6 @@ cxx_library(name="core",
 ], )
 
 cxx_test(name="simple-test",
- headers=[
- "test_env.h",
- ],
  srcs=[
  "native-client-test-env.cc",
  "simple-native-client-test.cc",
@@ -63,9 +60,6 @@ cxx_test(name="simple-test",
  ],
  run_test_separately=True, )
 cxx_test(name="location-cache-test",
- headers=[
- "test_env.h",
- ],
  srcs=[
  "native-client-test-env.cc",
  "location-cache-test.cc",

http://git-wip-us.apache.org/repos/asf/hbase/blob/80977a67/hbase-native-client/core/native-client-test-env.cc
--
diff --git a/hbase-native-client/core/native-client-test-env.cc 
b/hbase-native-client/core/native-client-test-env.cc
index a86961f..07f30a6 100644
--- a/hbase-native-client/core/native-client-test-env.cc
+++ b/hbase-native-client/core/native-client-test-env.cc
@@ -18,18 +18,21 @@
  */
 
 #include 
-#include 
 
 namespace {
 
 class NativeClientTestEnv : public ::testing::Environment {
  public:
   void SetUp() override {
-init_test_env();
+// start local HBase cluster to be reused by all tests
+auto result = system("bin/start_local_hbase_and_wait.sh");
+ASSERT_EQ(0, result);
   }
 
   void TearDown() override {
-clean_test_env();
+// shutdown local HBase cluster
+auto result = system("bin/stop_local_hbase_and_wait.sh");
+ASSERT_EQ(0, result);
   }
 };
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/80977a67/hbase-native-client/core/test_env.h
--
diff --git a/hbase-native-client/core/test_env.h 
b/hbase-native-client/core/test_env.h
d

[39/42] hbase git commit: HBASE-15821 Document TestUtil

2016-05-18 Thread eclark
HBASE-15821 Document TestUtil


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

Branch: refs/heads/HBASE-14850
Commit: f49f262f3c7efcae228713d3371df69d7c49efce
Parents: 616405a
Author: Elliott Clark 
Authored: Fri May 13 09:17:49 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/bin/format-code.sh  |  2 +-
 .../connection/connection-pool.h|  4 ++--
 hbase-native-client/core/location-cache.cc  |  2 +-
 hbase-native-client/core/location-cache.h   |  2 +-
 hbase-native-client/test-util/test-util.cc  | 20 +---
 hbase-native-client/test-util/test-util.h   | 20 +++-
 6 files changed, 33 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f49f262f/hbase-native-client/bin/format-code.sh
--
diff --git a/hbase-native-client/bin/format-code.sh 
b/hbase-native-client/bin/format-code.sh
index 36a114d..cc8b368 100755
--- a/hbase-native-client/bin/format-code.sh
+++ b/hbase-native-client/bin/format-code.sh
@@ -19,5 +19,5 @@ set -euo pipefail
 IFS=$'\n\t'
 
 
-find core connection serde utils -name "*.h" -or -name "*.cc" | xargs -P8 
clang-format -i
+find core connection serde utils test-util -name "*.h" -or -name "*.cc" | 
xargs -P8 clang-format -i
 find core connection serde utils third-party -name "BUCK" | xargs -P8 yapf -i

http://git-wip-us.apache.org/repos/asf/hbase/blob/f49f262f/hbase-native-client/connection/connection-pool.h
--
diff --git a/hbase-native-client/connection/connection-pool.h 
b/hbase-native-client/connection/connection-pool.h
index 605a81b..b8c950b 100644
--- a/hbase-native-client/connection/connection-pool.h
+++ b/hbase-native-client/connection/connection-pool.h
@@ -88,8 +88,8 @@ public:
   void Close(const hbase::pb::ServerName &sn);
 
 private:
-  std::shared_ptr GetCached(const hbase::pb::ServerName& sn);
-  std::shared_ptr GetNew(const hbase::pb::ServerName& sn);
+  std::shared_ptr GetCached(const hbase::pb::ServerName &sn);
+  std::shared_ptr GetNew(const hbase::pb::ServerName &sn);
   std::unordered_map,
  ServerNameHash, ServerNameEquals>
   connections_;

http://git-wip-us.apache.org/repos/asf/hbase/blob/f49f262f/hbase-native-client/core/location-cache.cc
--
diff --git a/hbase-native-client/core/location-cache.cc 
b/hbase-native-client/core/location-cache.cc
index 6ba8add..efd2210 100644
--- a/hbase-native-client/core/location-cache.cc
+++ b/hbase-native-client/core/location-cache.cc
@@ -116,7 +116,7 @@ LocationCache::LocateFromMeta(const TableName &tn, const 
string &row) {
   return this->LocateMeta()
   .via(cpu_executor_.get())
   .then([this](ServerName sn) { return this->cp_.Get(sn); })
-.then([tn, row, this](std::shared_ptr service) {
+  .then([tn, row, this](std::shared_ptr service) {
 return (*service)(std::move(meta_util_.MetaRequest(tn, row)));
   })
   .then([this](Response resp) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f49f262f/hbase-native-client/core/location-cache.h
--
diff --git a/hbase-native-client/core/location-cache.h 
b/hbase-native-client/core/location-cache.h
index d435530..830cd96 100644
--- a/hbase-native-client/core/location-cache.h
+++ b/hbase-native-client/core/location-cache.h
@@ -55,7 +55,7 @@ public:
* @param io_executor executor used to talk to the network
*/
   LocationCache(std::string quorum_spec,
-std::shared_ptr cpu_exector,
+std::shared_ptr cpu_executor,
 std::shared_ptr io_executor);
   /**
* Destructor.

http://git-wip-us.apache.org/repos/asf/hbase/blob/f49f262f/hbase-native-client/test-util/test-util.cc
--
diff --git a/hbase-native-client/test-util/test-util.cc 
b/hbase-native-client/test-util/test-util.cc
index e5fba48..88ce7c8 100644
--- a/hbase-native-client/test-util/test-util.cc
+++ b/hbase-native-client/test-util/test-util.cc
@@ -24,13 +24,18 @@
 using hbase::TestUtil;
 using folly::Random;
 
-const static int STR_LEN = 32;
-
-std::string TestUtil::RandString() {
-  auto s = std::string(STR_LEN, 'z');
-
-  for (int i = 0; i < STR_LEN; i++) {
+std::string TestUtil::RandString(int len) {
+  // Create the whole string.
+  // Filling everything with z's
+  auto s = std::string(len, 'z');
+
+

[40/42] hbase git commit: HBASE-15655 Set up doxygen for documentation

2016-05-18 Thread eclark
HBASE-15655 Set up doxygen for documentation

Summary:
Add on doxygen config.
It outputs to the docs folder.
Added on a makefile

Test Plan:
doxygen hbase.doxygen

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


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

Branch: refs/heads/HBASE-14850
Commit: 52719872e25108111cc8c7a33a13ba5f316e34ce
Parents: 6b4d759
Author: Elliott Clark 
Authored: Wed May 4 18:19:33 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .gitignore|   1 +
 hbase-native-client/Dockerfile|   2 +-
 hbase-native-client/Makefile  |  20 +++
 hbase-native-client/hbase.doxygen | 319 +
 4 files changed, 341 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/52719872/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 626a4d0..1b1e9d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ hbase-*/test
 *.ipr
 patchprocess/
 dependency-reduced-pom.xml
+docs/

http://git-wip-us.apache.org/repos/asf/hbase/blob/52719872/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 8e33e74..be0cbc6 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -24,7 +24,7 @@ ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g 
-fno-omit-frame-pointer -O2 -p
 
 ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
 
-RUN apt-get install -y vim maven inetutils-ping python-pip && \
+RUN apt-get install -y vim maven inetutils-ping python-pip doxygen graphviz && 
\
   pip install yapf && \
   apt-get -qq clean && \
   apt-get -y -qq autoremove && \

http://git-wip-us.apache.org/repos/asf/hbase/blob/52719872/hbase-native-client/Makefile
--
diff --git a/hbase-native-client/Makefile b/hbase-native-client/Makefile
new file mode 100644
index 000..90ec6ea
--- /dev/null
+++ b/hbase-native-client/Makefile
@@ -0,0 +1,20 @@
+build:
+   $(shell buck build core/... )
+
+check:
+   $(shell buck test --all --no-results-cache )
+
+doc:
+   $(shell doxygen hbase.doxygen > /dev/null )
+
+clean:
+   $(shell rm -rf docs )
+
+help:
+   @echo "Available targets:"
+   @echo ""
+   @echo " build : will build everything."
+   @echo " clean : will remove the docs folder"
+   @echo " check : will test everything."
+
+all: build doc check

http://git-wip-us.apache.org/repos/asf/hbase/blob/52719872/hbase-native-client/hbase.doxygen
--
diff --git a/hbase-native-client/hbase.doxygen 
b/hbase-native-client/hbase.doxygen
new file mode 100644
index 000..22e2d21
--- /dev/null
+++ b/hbase-native-client/hbase.doxygen
@@ -0,0 +1,319 @@
+# Doxyfile 1.8.11
+
+#---
+# Project related configuration options
+#---
+DOXYFILE_ENCODING  = UTF-8
+PROJECT_NAME   = "HBase Native Client"
+PROJECT_NUMBER =
+PROJECT_BRIEF  =
+PROJECT_LOGO   = 
../hbase-server/src/main/resources/hbase-webapps/static/hbase_logo_small.png
+OUTPUT_DIRECTORY   = docs
+CREATE_SUBDIRS = YES
+ALLOW_UNICODE_NAMES= NO
+OUTPUT_LANGUAGE= English
+BRIEF_MEMBER_DESC  = YES
+REPEAT_BRIEF   = YES
+ABBREVIATE_BRIEF   =
+ALWAYS_DETAILED_SEC= NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES= NO
+STRIP_FROM_PATH=
+STRIP_FROM_INC_PATH=
+SHORT_NAMES= NO
+JAVADOC_AUTOBRIEF  = NO
+QT_AUTOBRIEF   = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS   = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE   = 4
+ALIASES=
+TCL_SUBST  =
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+EXTENSION_MAPPING  =
+MARKDOWN_SUPPORT   = YES
+AUTOLINK_SUPPORT   = YES
+BUILTIN_STL_SUPPORT= NO
+CPP_CLI_SUPPORT= NO
+SIP_SUPPORT= NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING= YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS  = NO
+TYPEDEF_HIDES_STRUCT   = NO
+LOOKUP_CACHE_SIZE  = 0
+#--

[15/42] hbase git commit: HBASE-14852 Update build env

2016-05-18 Thread eclark
http://git-wip-us.apache.org/repos/asf/hbase/blob/369fb30d/hbase-native-client/src/async/hbase_result.h
--
diff --git a/hbase-native-client/src/async/hbase_result.h 
b/hbase-native-client/src/async/hbase_result.h
deleted file mode 100644
index eecbbb3..000
--- a/hbase-native-client/src/async/hbase_result.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef ASYNC_HBASE_RESULT_H_
-#define ASYNC_HBASE_RESULT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "core/hbase_macros.h"
-#include "core/hbase_types.h"
-
-HBASE_API int32_t hb_result_destroy(hb_result_t result);
-
-HBASE_API int32_t hb_result_get_cells(hb_result_t result,
-hb_cell_t ** cell_ptr, size_t * num_cells);
-
-HBASE_API int32_t hb_result_get_table(hb_result_t result,
-char ** table, size_t * table_length);
-HBASE_API int32_t hb_result_get_namespace(hb_result_t result,
-char ** name_space, size_t * name_space_length);
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif  // __cplusplus
-
-#endif  // ASYNC_HBASE_RESULT_H_

http://git-wip-us.apache.org/repos/asf/hbase/blob/369fb30d/hbase-native-client/src/async/hbase_scanner.cc
--
diff --git a/hbase-native-client/src/async/hbase_scanner.cc 
b/hbase-native-client/src/async/hbase_scanner.cc
deleted file mode 100644
index 5a8e555..000
--- a/hbase-native-client/src/async/hbase_scanner.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include "async/hbase_scanner.h"
-
-#include 
-
-#include "core/hbase_types.h"
-#include "core/scanner.h"
-
-int32_t hb_scanner_create(hb_scanner_t * scanner_ptr) {
-  (*scanner_ptr) = reinterpret_cast(new Scanner());
-  return (*scanner_ptr != NULL)?0:1;
-}
-
-HBASE_API int32_t hb_scanner_set_table(hb_scanner_t scanner,
-char * table, size_t table_length) {
-  return 0;
-}
-
-HBASE_API int32_t hb_scanner_set_namespace(hb_scanner_t scanner,
-char * name_space, size_t name_space_length) {
-  return 0;
-}
-
-int32_t hb_scanner_set_start_row(hb_scanner_t scanner,
-unsigned char * start_row, size_t start_row_length) {
-  return 0;
-}
-
-int32_t hb_scanner_set_end_row(hb_scanner_t scanner,
-unsigned char * end_row, size_t end_row_length) {
-  return 0;
-}
-
-int32_t hb_scanner_set_cache_size(hb_scanner_t scanner,
-size_t cache_size) {
-  return 0;
-}
-
-int32_t hb_scanner_set_num_versions(hb_scanner_t scanner,
-int8_t num_versions) {
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/hbase/blob/369fb30d/hbase-native-client/src/async/hbase_scanner.h
--
diff --git a/hbase-native-client/src/async/hbase_scanner.h 
b/hbase-native-client/src/async/hbase_scanner.h
deleted file mode 100644
index cd3f544..000
--- a/hbase-native-client/src/async/hbase_scanner.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http

[28/42] hbase git commit: HBASE-15774 Fix Upgrade lock usage in connection pool.

2016-05-18 Thread eclark
HBASE-15774 Fix Upgrade lock usage in connection pool.

Summary:
Use upgrade lock better.
Fix a clang warning around initializing the UpgradeHolder incorrectly.
Remove dead code. ( We'l need to add it back when there's a better plan)
Add on more comments.

Test Plan: buck test --all

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


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

Branch: refs/heads/HBASE-14850
Commit: aac4e43040119e16047d217d812a6750a01d8476
Parents: 2b0fb0b
Author: Elliott Clark 
Authored: Tue May 10 17:44:41 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/connection-pool-test.cc  | 12 ++--
 .../connection/connection-pool.cc   | 47 +++---
 .../connection/connection-pool.h|  6 +-
 hbase-native-client/core/client.h   |  2 +-
 hbase-native-client/core/location-cache.cc  | 68 
 5 files changed, 62 insertions(+), 73 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/aac4e430/hbase-native-client/connection/connection-pool-test.cc
--
diff --git a/hbase-native-client/connection/connection-pool-test.cc 
b/hbase-native-client/connection/connection-pool-test.cc
index c0c346f..bd2d585 100644
--- a/hbase-native-client/connection/connection-pool-test.cc
+++ b/hbase-native-client/connection/connection-pool-test.cc
@@ -79,9 +79,9 @@ TEST(TestConnectionPool, TestOnlyCreateOnce) {
   sn.set_host_name(hostname);
   sn.set_port(port);
 
-  auto result = cp.get(sn);
+  auto result = cp.Get(sn);
   ASSERT_TRUE(result != nullptr);
-  result = cp.get(sn);
+  result = cp.Get(sn);
 }
 
 TEST(TestConnectionPool, TestOnlyCreateMultipleDispose) {
@@ -102,13 +102,13 @@ TEST(TestConnectionPool, TestOnlyCreateMultipleDispose) {
   ConnectionPool cp{mock_cf};
 
   {
-auto result_one = cp.get(folly::to(
+auto result_one = cp.Get(folly::to(
 hostname_one + ":" + folly::to(port)));
-auto result_two = cp.get(folly::to(
+auto result_two = cp.Get(folly::to(
 hostname_two + ":" + folly::to(port)));
   }
-  auto result_one = cp.get(
+  auto result_one = cp.Get(
   folly::to(hostname_one + ":" + 
folly::to(port)));
-  auto result_two = cp.get(
+  auto result_two = cp.Get(
   folly::to(hostname_two + ":" + 
folly::to(port)));
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/aac4e430/hbase-native-client/connection/connection-pool.cc
--
diff --git a/hbase-native-client/connection/connection-pool.cc 
b/hbase-native-client/connection/connection-pool.cc
index 90e2056..aa3d094 100644
--- a/hbase-native-client/connection/connection-pool.cc
+++ b/hbase-native-client/connection/connection-pool.cc
@@ -48,25 +48,54 @@ ConnectionPool::~ConnectionPool() {
   clients_.clear();
 }
 
-std::shared_ptr ConnectionPool::get(const ServerName &sn) {
-  // Create a read lock.
-  SharedMutexWritePriority::UpgradeHolder holder(map_mutex_);
+std::shared_ptr ConnectionPool::Get(const ServerName &sn) {
+  // Try and get th cached connection.
+  auto found_ptr = GetCached(sn);
 
+  // If there's no connection then create it.
+  if (found_ptr == nullptr) {
+found_ptr = GetNew(sn);
+  }
+  return found_ptr;
+}
+
+std::shared_ptr ConnectionPool::GetCached(const ServerName &sn) {
+  SharedMutexWritePriority::ReadHolder holder(map_mutex_);
   auto found = connections_.find(sn);
-  if (found == connections_.end() || found->second == nullptr) {
-// Move the upgradable lock into the write lock if the connection
-// hasn't been found.
-SharedMutexWritePriority::WriteHolder holder(std::move(holder));
+  if (found == connections_.end()) {
+return nullptr;
+  }
+  return found->second;
+}
+
+std::shared_ptr ConnectionPool::GetNew(const ServerName &sn) {
+  // Grab the upgrade lock. While we are double checking other readers can
+  // continue on
+  SharedMutexWritePriority::UpgradeHolder u_holder{map_mutex_};
+
+  // Now check if someone else created the connection before we got the lock
+  // This is safe since we hold the upgrade lock.
+  // upgrade lock is more power than the reader lock.
+  auto found = connections_.find(sn);
+  if (found != connections_.end() && found->second != nullptr) {
+return found->second;
+  } else {
+// Yeah it looks a lot like there's no connection
+SharedMutexWritePriority::WriteHolder w_holder{std::move(u_holder)};
+
+// Make double sure there are not stale connections hanging around.
+connections_.erase(sn);
+
+// Nope w

[17/42] hbase git commit: HBASE-15401 Add Zookeeper to third party

2016-05-18 Thread eclark
HBASE-15401 Add Zookeeper to third party


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

Branch: refs/heads/HBASE-14850
Commit: dd8bb5ccdb0bc986d748ea69385f918071fbb38e
Parents: 2c911ae
Author: Elliott Clark 
Authored: Mon Mar 7 14:58:21 2016 -0800
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Dockerfile   | 26 -
 hbase-native-client/third-party/BUCK | 96 ++-
 2 files changed, 68 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/dd8bb5cc/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 5f17f04..1364d22 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,8 +15,30 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM pjameson/buck-folly-watchman
+FROM cpp_update 
 
-RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim 
maven inetutils-ping
+ARG CC=/usr/bin/gcc-5
+ARG CXX=/usr/bin/g++-5
+ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
+ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
+
+RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping
+RUN git clone --depth 1 --branch v2.6.1 https://github.com/google/protobuf.git 
/usr/src/protobuf && \
+  cd /usr/src/protobuf/ && \
+  ./autogen.sh && \
+  ./configure --disable-shared && \
+  make && \
+  make check && \
+  make install
+RUN cd /usr/src && \
+  wget 
http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz 
&& \ 
+  tar zxf zookeeper-3.4.8.tar.gz && \ 
+  rm -rf zookeeper-3.4.8.tar.gz && \
+  cd zookeeper-3.4.8 && \
+  cd src/c && \
+  ./configure --disable-shared && \
+  make && \
+  make install && \
+  make clean 
 
 WORKDIR /usr/local/src/hbase/hbase-native-client

http://git-wip-us.apache.org/repos/asf/hbase/blob/dd8bb5cc/hbase-native-client/third-party/BUCK
--
diff --git a/hbase-native-client/third-party/BUCK 
b/hbase-native-client/third-party/BUCK
index b7baa86..e577a5f 100644
--- a/hbase-native-client/third-party/BUCK
+++ b/hbase-native-client/third-party/BUCK
@@ -15,68 +15,60 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-def add_system_libs(names = []):
+def add_system_libs(names = [], lib_dir = "/usr/lib/x86_64-linux-gnu", deps = 
[], exported_linker_flags = []):
 rules = []
 for name in names:
-prebuilt_cxx_library(
-name = name,
-lib_name = name,
-lib_dir = "/usr/lib/x86_64-linux-gnu",
-visibility = [ 'PUBLIC', ],
-)
-rules.append(":" + name)
-
+gen_rule_name = "gen_lib{}".format(name)
+genrule(
+  name = gen_rule_name,
+  out = gen_rule_name,
+  bash = "mkdir -p $OUT && cp {}/lib{}.* 
$OUT".format(lib_dir,name),
+)
+prebuilt_cxx_library(
+  name = name,
+  lib_name = name,
+  lib_dir = '$(location :{})'.format(gen_rule_name),
+  force_static = True,
+  deps = deps,
+  visibility = [ 'PUBLIC' ],
+  exported_linker_flags = exported_linker_flags,
+)
+rules.append(":" + name)
 return rules
 
 system_libs = [
+"unwind",
+"lzma",
+]
+local_libs = [
 "double-conversion",
 "glog",
-"protobuf",
 "gflags",
-"unwind",
-"lzma",
+"protobuf",
+"zookeeper_mt",
 "boost_regex",
 ]
-tp_dep_rules = add_system_libs(system_libs)
-prebuilt_cxx_library(
-name = "folly",
-lib_name = "folly",
-lib_dir = "/usr/local/lib",
-deps = tp_dep_rules,
-exported_linker_flags = [
-"-pthread",
-"-lstdc++",
-],
-visibility = [
-'PUBLIC',
-]
-)
-prebuilt_cxx_library(
-name = "follybenchmark",
-lib_name = "follybenchmark",
-lib_dir = "/usr/local/lib",
-deps = tp_dep_rules + [":folly"],
-exported_linker_flags = [
-"-pthread",
-"-lstdc++",
-],
-visibility = [
-'PUBLIC',
-   

[11/42] hbase git commit: HBASE-15078 Added ability to start/stop hbase local cluster for tests, global test_env for gtest, small changes to dockerfile and docker run.

2016-05-18 Thread eclark
HBASE-15078 Added ability to start/stop hbase local cluster for tests, global 
test_env for gtest, small changes to dockerfile and docker run.

Added check ~/.m2 folder exists; moved scripts to ./bin


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

Branch: refs/heads/HBASE-14850
Commit: e1a422f1f05151045e2ae8323c13464370ec165f
Parents: 369fb30
Author: Mikhail Antonov 
Authored: Wed Jan 6 15:08:21 2016 -0800
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/.buckconfig |  2 +-
 hbase-native-client/Dockerfile  |  2 +-
 hbase-native-client/bin/start-docker.sh | 10 -
 .../bin/start_local_hbase_and_wait.sh   | 26 
 .../bin/stop_local_hbase_and_wait.sh| 26 
 hbase-native-client/core/BUCK   | 15 +++
 .../core/HBaseNativeClientTestEnv.cc| 42 
 .../core/SampleNativeClientTest.cc  | 28 +
 hbase-native-client/core/test_env.h | 30 ++
 9 files changed, 178 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e1a422f1/hbase-native-client/.buckconfig
--
diff --git a/hbase-native-client/.buckconfig b/hbase-native-client/.buckconfig
index 3227a2a..402ef27 100644
--- a/hbase-native-client/.buckconfig
+++ b/hbase-native-client/.buckconfig
@@ -1,2 +1,2 @@
 [cxx]
-  gtest_dep = //third-party/googletest/googletest:google-test
+  gtest_dep = //third-party:google-test

http://git-wip-us.apache.org/repos/asf/hbase/blob/e1a422f1/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 70e823b..5f17f04 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -17,6 +17,6 @@
 
 FROM pjameson/buck-folly-watchman
 
-RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim
+RUN apt-get install -y libprotobuf-dev protobuf-compiler clang-format-3.7 vim 
maven inetutils-ping
 
 WORKDIR /usr/local/src/hbase/hbase-native-client

http://git-wip-us.apache.org/repos/asf/hbase/blob/e1a422f1/hbase-native-client/bin/start-docker.sh
--
diff --git a/hbase-native-client/bin/start-docker.sh 
b/hbase-native-client/bin/start-docker.sh
index 1c9b02e..bf38912 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -28,5 +28,13 @@ if [[ ! -d third-party/googletest ]]; then
 git clone https://github.com/google/googletest.git 
third-party/googletest
 fi
 
+if [[ ! -d ~/.m2 ]]; then
+echo "~/.m2 directory doesn't exist. Check Apache Maven is installed."
+exit 1
+fi;
 
-docker run -v ${PWD}/..:/usr/local/src/hbase -it hbase_native  /bin/bash
+docker run -p 16010:16010/tcp \
+   -e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
+   -v ${PWD}/..:/usr/local/src/hbase \
+   -v ~/.m2:/root/.m2 \
+   -it hbase_native  /bin/bash

http://git-wip-us.apache.org/repos/asf/hbase/blob/e1a422f1/hbase-native-client/bin/start_local_hbase_and_wait.sh
--
diff --git a/hbase-native-client/bin/start_local_hbase_and_wait.sh 
b/hbase-native-client/bin/start_local_hbase_and_wait.sh
new file mode 100755
index 000..64d0b68
--- /dev/null
+++ b/hbase-native-client/bin/start_local_hbase_and_wait.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+##
+# 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.
+
+$PWD/../bin/start-hbase.sh
+
+until [ $(curl -s -o /dev/null -I -w "%{http_code}" http://localhost:16010) == 
"200" ]
+do
+ printf "Waiting for local HBase cluster to start\n"
+ sleep 1
+done

ht

[12/42] hbase git commit: HBASE-15730 Add on script to format all .h, .cc, and BUCK files.

2016-05-18 Thread eclark
HBASE-15730 Add on script to format all .h,.cc, and BUCK files.


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

Branch: refs/heads/HBASE-14850
Commit: 74ff76aa533a85f5dea2bd9c1159d4c84249b303
Parents: 3a98ebe
Author: Elliott Clark 
Authored: Wed Apr 27 15:52:27 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/bin/format-code.sh  |  7 +++
 hbase-native-client/connection/request.cc   | 14 +++---
 hbase-native-client/utils/BUCK  |  8 
 hbase-native-client/utils/user-util-test.cc |  2 +-
 hbase-native-client/utils/user-util.cc  |  4 ++--
 hbase-native-client/utils/user-util.h   |  2 +-
 6 files changed, 22 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/74ff76aa/hbase-native-client/bin/format-code.sh
--
diff --git a/hbase-native-client/bin/format-code.sh 
b/hbase-native-client/bin/format-code.sh
new file mode 100755
index 000..24d6515
--- /dev/null
+++ b/hbase-native-client/bin/format-code.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+set -euo pipefail
+IFS=$'\n\t'
+
+
+find core connection serde utils -name "*.h" -or -name "*.cc" | xargs -P8 
clang-format -i
+find core connection serde utils third-party -name "BUCK" | xargs -P8 yapf -i

http://git-wip-us.apache.org/repos/asf/hbase/blob/74ff76aa/hbase-native-client/connection/request.cc
--
diff --git a/hbase-native-client/connection/request.cc 
b/hbase-native-client/connection/request.cc
index 50ea029..d4a4603 100644
--- a/hbase-native-client/connection/request.cc
+++ b/hbase-native-client/connection/request.cc
@@ -30,16 +30,16 @@ Request::Request(std::shared_ptr 
req,
 
 std::unique_ptr Request::get() {
   return std::make_unique(std::make_shared(),
-  std::make_shared(),
-  "Get");
+   std::make_shared(),
+   "Get");
 }
 std::unique_ptr Request::mutate() {
-  return 
std::make_unique(std::make_shared(),
-  
std::make_shared(),
-  "Mutate");
+  return std::make_unique(
+  std::make_shared(),
+  std::make_shared(), "Mutate");
 }
 std::unique_ptr Request::scan() {
   return std::make_unique(std::make_shared(),
-  std::make_shared(),
-  "Scan");
+   std::make_shared(),
+   "Scan");
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/74ff76aa/hbase-native-client/utils/BUCK
--
diff --git a/hbase-native-client/utils/BUCK b/hbase-native-client/utils/BUCK
index 2b65b12..ad12f7d 100644
--- a/hbase-native-client/utils/BUCK
+++ b/hbase-native-client/utils/BUCK
@@ -23,18 +23,18 @@ cxx_library(name="utils",
 "user-util.cc",
 ],
 deps=[
-  '//third-party:folly',
+'//third-party:folly',
 ],
 visibility=[
 'PUBLIC',
 ],
 tests=[
-  ":user-util-test"
-],)
+":user-util-test"
+], )
 cxx_test(name="user-util-test",
  srcs=[
  "user-util-test.cc",
  ],
  deps=[
  ":utils",
- ],)
+ ], )

http://git-wip-us.apache.org/repos/asf/hbase/blob/74ff76aa/hbase-native-client/utils/user-util-test.cc
--
diff --git a/hbase-native-client/utils/user-util-test.cc 
b/hbase-native-client/utils/user-util-test.cc
index 1e72bcc..7c11d8c 100644
--- a/hbase-native-client/utils/user-util-test.cc
+++ b/hbase-native-client/utils/user-util-test.cc
@@ -17,9 +17,9 @@
  *
  */
 
+#include 
 #include 
 #include 
-#include 
 
 #include "utils/user-util.h"
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/74ff76aa/hbase-native-client/utils/user-util.cc
--
diff --git a/hbase-native-client/utils/user-util.cc 
b/hbase-native-client/utils/user-util.cc
index c4427e3..b801537 100644
--- a/hbase-native-client/utils/user-util.cc
+++ b/hbase-native-client/utils/user-util.cc
@@ -19,10 +19,10 @@
 
 #include "utils/user-util.h"
 
+#include 
 #include 
-#include 
 #include 
-#include 
+#include 
 
 using namespace hbase;
 using namespace std;

htt

[24/42] hbase git commit: HBASE-15690 Add utility to get current username

2016-05-18 Thread eclark
HBASE-15690 Add utility to get current username

Summary:
Add a class to fine the username of the current process.
It will only call out once and is multithread safe

Test Plan: Unit Test

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


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

Branch: refs/heads/HBASE-14850
Commit: de5149269d2ea4dceb4ad2d7d75fc9a09954d95b
Parents: 0ec0a25
Author: Elliott Clark 
Authored: Thu Apr 21 21:17:11 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/utils/BUCK  | 40 +
 hbase-native-client/utils/user-util-test.cc | 34 +++
 hbase-native-client/utils/user-util.cc  | 55 
 hbase-native-client/utils/user-util.h   | 37 
 4 files changed, 166 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/de514926/hbase-native-client/utils/BUCK
--
diff --git a/hbase-native-client/utils/BUCK b/hbase-native-client/utils/BUCK
new file mode 100644
index 000..2b65b12
--- /dev/null
+++ b/hbase-native-client/utils/BUCK
@@ -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.
+
+cxx_library(name="utils",
+exported_headers=[
+"user-util.h",
+],
+srcs=[
+"user-util.cc",
+],
+deps=[
+  '//third-party:folly',
+],
+visibility=[
+'PUBLIC',
+],
+tests=[
+  ":user-util-test"
+],)
+cxx_test(name="user-util-test",
+ srcs=[
+ "user-util-test.cc",
+ ],
+ deps=[
+ ":utils",
+ ],)

http://git-wip-us.apache.org/repos/asf/hbase/blob/de514926/hbase-native-client/utils/user-util-test.cc
--
diff --git a/hbase-native-client/utils/user-util-test.cc 
b/hbase-native-client/utils/user-util-test.cc
new file mode 100644
index 000..2a7434f
--- /dev/null
+++ b/hbase-native-client/utils/user-util-test.cc
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ */
+
+#include 
+#include 
+#include 
+
+#include "utils/user-util.h"
+
+using namespace std;
+using namespace hbase;
+
+TEST(TestUserUtil, TestGetSomething) {
+  UserUtil u_util;
+  string name = u_util.user_name();
+
+  ASSERT_GT(name.length(), 0);
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/de514926/hbase-native-client/utils/user-util.cc
--
diff --git a/hbase-native-client/utils/user-util.cc 
b/hbase-native-client/utils/user-util.cc
new file mode 100644
index 000..c4427e3
--- /dev/null
+++ b/hbase-native-client/utils/user-util.cc
@@ -0,0 +1,55 @@
+/*
+ * 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 licens

[35/42] hbase git commit: HBASE-14855 Connect to regionserver

2016-05-18 Thread eclark
HBASE-14855 Connect to regionserver

Summary:
* Client dispatcher to put request and response together with call id. Though 
right now this is a pretty empty version of that.
* pipeline. The Serialization pipeline.
* client-serilization-handler.h This does the work of sending the preamable, 
the connection header, and length prepending data. This will obviously need to 
be split up into h and cc files

Test Plan: Use simple-client to connect to a standalone server

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


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

Branch: refs/heads/HBASE-14850
Commit: 0ec0a25cc08c3166f70032e6385819024567488b
Parents: f344237
Author: Elliott Clark 
Authored: Mon Apr 4 13:52:05 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/core/BUCK   |  30 +-
 hbase-native-client/core/client-dispatcher.cc   |  54 ++
 hbase-native-client/core/client-dispatcher.h|  42 
 .../core/client-serialize-handler.cc| 104 ++
 .../core/client-serialize-handler.h |  44 
 hbase-native-client/core/client.cc  |  16 ++-
 hbase-native-client/core/client.h   |  18 +++-
 hbase-native-client/core/connection-factory.cc  |  57 ++
 hbase-native-client/core/connection-factory.h   |  41 
 hbase-native-client/core/get-request.cc |  19 
 hbase-native-client/core/get-request.h  |  35 +++
 hbase-native-client/core/get-result.cc  |  19 
 hbase-native-client/core/get-result.h   |  32 ++
 hbase-native-client/core/location-cache-test.cc |  25 -
 hbase-native-client/core/location-cache.cc  |  62 +--
 hbase-native-client/core/location-cache.h   |  29 -
 .../core/native-client-test-env.cc  |   6 +-
 hbase-native-client/core/pipeline.cc|  42 
 hbase-native-client/core/pipeline.h |  34 ++
 hbase-native-client/core/request.h  |  33 ++
 hbase-native-client/core/response.h |  34 ++
 hbase-native-client/core/service.h  |  26 +
 hbase-native-client/core/simple-client.cc   |  57 ++
 .../core/simple-native-client-test.cc   |   5 +-
 hbase-native-client/core/table-name.cc  |  19 
 hbase-native-client/core/table-name.h   |  32 ++
 hbase-native-client/if/BUCK |  24 -
 hbase-native-client/third-party/BUCK| 105 +--
 28 files changed, 948 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/0ec0a25c/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index d1e89d1..2b00d66 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -16,35 +16,52 @@
 # limitations under the License.
 
 cxx_library(name="core",
-headers=[
+exported_headers=[
 "admin.h",
+"client-dispatcher.h",
+"client-serialize-handler.h",
 "client.h",
+"connection-factory.h",
 "connection.h",
 "connection_attr.h",
 "delete.h",
+"get-request.h",
+"get-result.h",
 "get.h",
 "hbase_macros.h",
+"location-cache.h",
 "mutation.h",
+"pipeline.h",
 "put.h",
+"request.h",
+"response.h",
 "scanner.h",
-"location-cache.h",
+"service.h",
+"table-name.h",
 ],
 srcs=[
 "admin.cc",
+"client-dispatcher.cc",
+"client-serialize-handler.cc",
 "client.cc",
+"connection-factory.cc",
 "connection.cc",
+"delete.cc",
+"get-request.cc",
+"get-result.cc",
 "get.cc",
+"location-cache.cc",
 "mutation.cc",
+"pipeline.cc",
 "put.cc",
-"delete.cc",
 "scanner.cc",
-"location-cache.cc",
+"table-name.cc",
 ],
 deps=[
 "//if:if",
-"//third-party:zookeeper_mt",
 "//third-party:folly",

[30/42] hbase git commit: HBASE-15823 Use call once for user util

2016-05-18 Thread eclark
HBASE-15823 Use call once for user util


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

Branch: refs/heads/HBASE-14850
Commit: 616405a69a3ad9c4c9ac0d7baa0f065a7a2efb33
Parents: 6bc1ab3
Author: Elliott Clark 
Authored: Fri May 13 13:07:03 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/utils/user-util.cc | 13 ++---
 hbase-native-client/utils/user-util.h  |  6 ++
 2 files changed, 4 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/616405a6/hbase-native-client/utils/user-util.cc
--
diff --git a/hbase-native-client/utils/user-util.cc 
b/hbase-native-client/utils/user-util.cc
index 3d963b3..9e170e0 100644
--- a/hbase-native-client/utils/user-util.cc
+++ b/hbase-native-client/utils/user-util.cc
@@ -27,22 +27,14 @@
 using namespace hbase;
 using namespace std;
 
-UserUtil::UserUtil() : init_{false}, user_name_{"drwho"}, m_() {}
+UserUtil::UserUtil() : once_flag_{}, user_name_{"drwho"} {}
 
 string UserUtil::user_name() {
-  if (!init_) {
-compute_user_name();
-  }
+  std::call_once(once_flag_, [this]() { compute_user_name(); });
   return user_name_;
 }
 
 void UserUtil::compute_user_name() {
-  lock_guard lock(m_);
-
-  if (init_) {
-return;
-  }
-
   // According to the man page of getpwuid
   // this should never be free'd
   //
@@ -52,6 +44,5 @@ void UserUtil::compute_user_name() {
   // make sure that we got something.
   if (passwd && passwd->pw_name) {
 user_name_ = string{passwd->pw_name};
-init_ = true;
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/616405a6/hbase-native-client/utils/user-util.h
--
diff --git a/hbase-native-client/utils/user-util.h 
b/hbase-native-client/utils/user-util.h
index 0b4cc73..fdfc0c8 100644
--- a/hbase-native-client/utils/user-util.h
+++ b/hbase-native-client/utils/user-util.h
@@ -19,8 +19,7 @@
 
 #pragma once
 
-#include 
-#include 
+#include 
 #include 
 
 namespace hbase {
@@ -49,8 +48,7 @@ private:
* Compute the username. This will block.
*/
   void compute_user_name();
-  std::atomic init_;
+  std::once_flag once_flag_;
   std::string user_name_;
-  std::mutex m_;
 };
 } // namespace hbase



[06/42] hbase git commit: HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set

2016-05-18 Thread eclark
HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set


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

Branch: refs/heads/HBASE-14850
Commit: 5ac54e6abb4e14f3d2fb2e013a7688d7043a60d3
Parents: 393bcd6
Author: Matteo Bertozzi 
Authored: Wed May 18 12:48:26 2016 -0700
Committer: Matteo Bertozzi 
Committed: Wed May 18 12:48:26 2016 -0700

--
 .../org/apache/hadoop/hbase/ClusterStatus.java  |  9 ++--
 .../hadoop/hbase/protobuf/ProtobufUtil.java | 15 +++
 .../hbase/rsgroup/RSGroupAdminServer.java   |  2 +-
 .../master/AssignmentManagerStatusTmpl.jamon| 43 +--
 .../hadoop/hbase/master/AssignmentManager.java  |  8 ++--
 .../org/apache/hadoop/hbase/master/HMaster.java |  4 +-
 .../hadoop/hbase/master/MasterDumpServlet.java  |  9 ++--
 .../hadoop/hbase/master/RegionStates.java   | 44 +---
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 14 +++
 .../hadoop/hbase/util/HBaseFsckRepair.java  | 12 --
 .../hbase/coprocessor/TestMasterObserver.java   |  6 +--
 .../hbase/master/TestMasterStatusServlet.java   | 19 -
 .../TestRegionMergeTransactionOnCluster.java|  2 +-
 .../TestSplitTransactionOnCluster.java  |  8 ++--
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   | 17 
 hbase-shell/src/main/ruby/hbase/admin.rb|  2 +-
 16 files changed, 103 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/5ac54e6a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
index bc97a95..ffeb51a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
@@ -80,7 +81,7 @@ public class ClusterStatus extends VersionedWritable {
   private Collection deadServers;
   private ServerName master;
   private Collection backupMasters;
-  private Map intransition;
+  private Set intransition;
   private String clusterId;
   private String[] masterCoprocessors;
   private Boolean balancerOn;
@@ -90,7 +91,7 @@ public class ClusterStatus extends VersionedWritable {
   final Collection deadServers,
   final ServerName master,
   final Collection backupMasters,
-  final Map rit,
+  final Set rit,
   final String[] masterCoprocessors,
   final Boolean balancerOn) {
 this.hbaseVersion = hbaseVersion;
@@ -261,7 +262,7 @@ public class ClusterStatus extends VersionedWritable {
   }
 
   @InterfaceAudience.Private
-  public Map getRegionsInTransition() {
+  public Set getRegionsInTransition() {
 return this.intransition;
   }
 
@@ -340,7 +341,7 @@ public class ClusterStatus extends VersionedWritable {
 int ritSize = (intransition != null) ? intransition.size() : 0;
 sb.append("\nNumber of regions in transition: " + ritSize);
 if (ritSize > 0) {
-  for (RegionState state: intransition.values()) {
+  for (RegionState state: intransition) {
 sb.append("\n  " + state.toDescriptiveString());
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5ac54e6a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
index bbc13ab..e16a3a3 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
@@ -31,10 +31,12 @@ import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.NavigableSet;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hadoop.conf.Configuration;
@@ -3528,12 +3530,11 @@ public final class ProtobufUtil {
   backupMasters.add(ProtobufUtil.toServerName(sn));
 }
 
-

[02/42] hbase git commit: HBASE-15784 Misuse core/maxPoolSize of LinkedBlockingQueue in ThreadPoolExecutor (Jingcheng Du)

2016-05-18 Thread eclark
HBASE-15784 Misuse core/maxPoolSize of LinkedBlockingQueue in
ThreadPoolExecutor (Jingcheng Du)


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

Branch: refs/heads/HBASE-14850
Commit: 7b5d5394c08e4d5a18c8f9fc62b45930bf892f41
Parents: b2b3b1f
Author: Ramkrishna 
Authored: Wed May 18 12:40:43 2016 +0530
Committer: Ramkrishna 
Committed: Wed May 18 12:40:43 2016 +0530

--
 .../hadoop/hbase/client/ConnectionImplementation.java | 10 ++
 hbase-client/src/test/resources/hbase-site.xml|  4 
 .../hbase/replication/regionserver/HFileReplicator.java   |  2 +-
 .../regionserver/RegionReplicaReplicationEndpoint.java|  6 +-
 .../org/apache/hadoop/hbase/util/MultiHConnection.java|  6 +-
 .../org/apache/hadoop/hbase/util/TestHBaseFsckMOB.java|  1 -
 .../org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java  |  1 -
 .../apache/hadoop/hbase/util/TestHBaseFsckReplicas.java   |  1 -
 .../org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java  |  1 -
 hbase-server/src/test/resources/hbase-site.xml|  4 
 .../hadoop/hbase/thrift/TBoundedThreadPoolServer.java | 10 +++---
 .../apache/hadoop/hbase/thrift/ThriftServerRunner.java|  6 --
 12 files changed, 20 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
index 9a7dfc7..429e47d 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
@@ -352,8 +352,8 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
 if (batchPool == null) {
   synchronized (this) {
 if (batchPool == null) {
-  this.batchPool = 
getThreadPool(conf.getInt("hbase.hconnection.threads.max", 256),
-  conf.getInt("hbase.hconnection.threads.core", 256), "-shared", 
null);
+  int threads = conf.getInt("hbase.hconnection.threads.max", 256);
+  this.batchPool = getThreadPool(threads, threads, "-shared", null);
   this.cleanupPool = true;
 }
   }
@@ -377,6 +377,7 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
 new LinkedBlockingQueue(maxThreads *
 conf.getInt(HConstants.HBASE_CLIENT_MAX_TOTAL_TASKS,
 HConstants.DEFAULT_HBASE_CLIENT_MAX_TOTAL_TASKS));
+  coreThreads = maxThreads;
 }
 ThreadPoolExecutor tpe = new ThreadPoolExecutor(
 coreThreads,
@@ -397,9 +398,10 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
   //To start with, threads.max.core threads can hit the meta 
(including replicas).
   //After that, requests will get queued up in the passed queue, and 
only after
   //the queue is full, a new thread will be started
+  int threads = 
conf.getInt("hbase.hconnection.meta.lookup.threads.max", 128);
   this.metaLookupPool = getThreadPool(
- conf.getInt("hbase.hconnection.meta.lookup.threads.max", 128),
- conf.getInt("hbase.hconnection.meta.lookup.threads.core", 10),
+ threads,
+ threads,
  "-metaLookup-shared-", new LinkedBlockingQueue());
 }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-client/src/test/resources/hbase-site.xml
--
diff --git a/hbase-client/src/test/resources/hbase-site.xml 
b/hbase-client/src/test/resources/hbase-site.xml
index 5788238..99d2ab8 100644
--- a/hbase-client/src/test/resources/hbase-site.xml
+++ b/hbase-client/src/test/resources/hbase-site.xml
@@ -26,10 +26,6 @@
 true
   
   
-hbase.hconnection.meta.lookup.threads.core
-4
-  
-  
 hbase.hconnection.threads.keepalivetime
 3
   

http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java
index 1a1

[04/42] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread eclark
HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/HBASE-14850
Commit: c1ada0a373561132a3359b48a27975b2e85978da
Parents: 3bd9220
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:36:10 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1ada0a3/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index 8b16a5b..84367b0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -144,9 +144,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -450,4 +447,4 @@ public class LocalHBaseCluster {
 connection.close();
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1ada0a3/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index 002bdb2..f788bed 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -86,6 +86,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



[25/42] hbase git commit: HBASE-15620 Add on Call serialization

2016-05-18 Thread eclark
http://git-wip-us.apache.org/repos/asf/hbase/blob/eabb5684/hbase-native-client/serde/BUCK
--
diff --git a/hbase-native-client/serde/BUCK b/hbase-native-client/serde/BUCK
new file mode 100644
index 000..207607f
--- /dev/null
+++ b/hbase-native-client/serde/BUCK
@@ -0,0 +1,54 @@
+##
+# 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.
+
+cxx_library(name="serde",
+exported_headers=[
+"client-serializer.h",
+"client-deserializer.h",
+],
+srcs=[
+"client-serializer.cc",
+"client-deserializer.cc",
+],
+deps=[
+"//if:if",
+"//third-party:folly",
+],
+tests=[
+":client-serializer-test",
+":client-deserializer-test",
+],
+visibility=[
+'PUBLIC',
+], )
+
+cxx_test(name="client-serializer-test",
+ srcs=[
+ "client-serializer-test.cc",
+ ],
+ deps=[
+ ":serde",
+ "//if:if",
+ ], )
+cxx_test(name="client-deserializer-test",
+ srcs=[
+ "client-deserializer-test.cc",
+ ],
+ deps=[
+ ":serde",
+ "//if:if",
+ ], )

http://git-wip-us.apache.org/repos/asf/hbase/blob/eabb5684/hbase-native-client/serde/client-deserializer-test.cc
--
diff --git a/hbase-native-client/serde/client-deserializer-test.cc 
b/hbase-native-client/serde/client-deserializer-test.cc
new file mode 100644
index 000..bb57e50
--- /dev/null
+++ b/hbase-native-client/serde/client-deserializer-test.cc
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ *
+ */
+
+#include 
+#include 
+
+#include "serde/client-deserializer.h"
+#include "serde/client-serializer.h"
+#include "if/Client.pb.h"
+
+using namespace hbase;
+using folly::IOBuf;
+using hbase::pb::GetRequest;
+using hbase::pb::RegionSpecifier;
+using hbase::pb::RegionSpecifier_RegionSpecifierType;
+
+TEST(TestClientDeserializer, TestReturnFalseOnNullPtr) {
+  ClientDeserializer deser;
+  ASSERT_LT(deser.parse_delimited(nullptr, nullptr), 0);
+}
+
+TEST(TestClientDeserializer, TestReturnFalseOnBadInput) {
+  ClientDeserializer deser;
+  auto buf = IOBuf::copyBuffer("test");
+  GetRequest gr;
+
+  ASSERT_LT(deser.parse_delimited(buf.get(), &gr), 0);
+}
+
+TEST(TestClientDeserializer, TestGoodGetRequestFullRoundTrip) {
+  GetRequest in;
+  ClientSerializer ser;
+  ClientDeserializer deser;
+
+  // fill up the GetRequest.
+  in.mutable_region()->set_value("test_region_id");
+  in.mutable_region()->set_type(
+  RegionSpecifier_RegionSpecifierType::
+  RegionSpecifier_RegionSpecifierType_ENCODED_REGION_NAME);
+  in.mutable_get()->set_row("test_row");
+
+  // Create the buffer
+  auto buf = ser.serialize_delimited(in);
+
+  GetRequest out;
+
+  int used_bytes = deser.parse_delimited(buf.get(), &out);
+
+  ASSERT_GT(used_bytes, 0);
+  ASSERT_EQ(used_bytes, buf->length());
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/eabb5684/hbase-native-client/serde/client-deserializer.cc
--
diff --git a/hbase-native-client/serde/client-deserializer.cc 
b/hbase-native-client/serde/client-deserializer.cc
new f

[32/42] hbase git commit: HBASE-15771 Document all the public classes

2016-05-18 Thread eclark
HBASE-15771 Document all the public classes

Summary: Add on a bunch of documentation around implementation so far.

Test Plan:
make doc
Doxygen has no warnings

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


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

Branch: refs/heads/HBASE-14850
Commit: 361a395299d5fc2affc96694a3861474a3f5ed17
Parents: 7d7bc06
Author: Elliott Clark 
Authored: Thu May 5 13:14:20 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/BUILDING.md | 18 +-
 .../connection/client-dispatcher.h  | 11 +++-
 .../connection/client-handler.cc| 37 +---
 hbase-native-client/connection/client-handler.h | 36 +++-
 .../connection/connection-factory.h | 18 ++
 .../connection/connection-pool.cc   |  5 +-
 .../connection/connection-pool.h| 44 +-
 hbase-native-client/connection/pipeline.h   | 18 ++
 hbase-native-client/connection/request.h| 32 ++
 hbase-native-client/connection/response.h   | 33 +--
 hbase-native-client/core/BUCK   |  1 -
 hbase-native-client/core/client.h   | 12 
 hbase-native-client/core/connection.cc  | 20 ---
 hbase-native-client/core/connection.h   | 26 -
 hbase-native-client/core/location-cache.cc  | 14 -
 hbase-native-client/core/location-cache.h   | 36 ++--
 hbase-native-client/core/meta-utils.h   | 12 
 hbase-native-client/core/put.cc | 21 ---
 hbase-native-client/core/put.h  | 27 -
 hbase-native-client/core/region-location.h  | 41 +
 hbase-native-client/serde/rpc.cc|  1 -
 hbase-native-client/serde/rpc.h | 61 +++-
 hbase-native-client/serde/zk.h  | 14 +
 hbase-native-client/utils/user-util.h   | 18 ++
 24 files changed, 387 insertions(+), 169 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/361a3952/hbase-native-client/BUILDING.md
--
diff --git a/hbase-native-client/BUILDING.md b/hbase-native-client/BUILDING.md
index 20ef2a0..4c06776 100644
--- a/hbase-native-client/BUILDING.md
+++ b/hbase-native-client/BUILDING.md
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-#Building HBase native client
+# Building HBase native client
 
 The HBase native client build using buck and produces a linux library.
 
@@ -58,6 +58,20 @@ buck build //core:simple-client
 ```
 
 That will build the library, then build and test everything, then build
-the simple-client binary. Buck will find all modules used, and compile 
+the simple-client binary. Buck will find all modules used, and compile
 them in parallel, caching the results. Output from buck is in the buck-out
 foulder. Generated binaries are in buck-out/gen logs are in buck-out/logs
+
+
+# Make
+
+If learning buck isn't your thing there is a Makefile wrapper for your
+convenience.
+
+```
+make help
+make check
+make clean
+make all
+make build
+```

http://git-wip-us.apache.org/repos/asf/hbase/blob/361a3952/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 4435a1b..4bfb35d 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -30,17 +30,22 @@
 #include "connection/response.h"
 
 namespace hbase {
+/**
+ * Dispatcher that assigns a call_id and then routes the response back to the 
future.
+ */
 class ClientDispatcher
 : public wangle::ClientDispatcherBase, Response> {
 public:
+  /** Create a new ClientDispatcher */
   ClientDispatcher();
-  ~ClientDispatcher() {
-LOG(ERROR) << "Killing ClientDispatcher call_id = " << current_call_id_;
-  }
+  /** Read a response off the pipeline. */
   void read(Context *ctx, Response in) override;
+  /** Take a request as a call and send it down the pipeline. */
   folly::Future operator()(std::unique_ptr arg) override;
+  /** Close the dispatcher and the associated pipeline. */
   folly::Future close(Context *ctx) override;
+  /** Close the dispatcher and the associated pipeline. */
   folly::Future close() override;
 
 private:

http://git-wip-us.apache.org/repos/asf/hbase/blob/361a3952/hbase-native-client/connec

[23/42] hbase git commit: HBASE-15687 Allow decoding more than GetResponse from the server

2016-05-18 Thread eclark
HBASE-15687 Allow decoding more than GetResponse from the server

Summary:
We'll need more than get's for the client to be usable. So now the
Request class contains the protobufs needed to encode and decode
rpc's.

I also added some helper methods to create initial requests.

Test Plan: It compiles and still gets data from HBase meta

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


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

Branch: refs/heads/HBASE-14850
Commit: 3a98ebe7d8073c8eb2e2835b3ec8dc97e8d692ad
Parents: fef51e2
Author: Elliott Clark 
Authored: Wed Apr 27 15:27:09 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/connection/BUCK |  1 +
 .../connection/client-dispatcher.cc |  6 +--
 .../connection/client-dispatcher.h  |  6 +--
 .../connection/client-handler.cc| 30 ++---
 hbase-native-client/connection/client-handler.h | 18 ++--
 .../connection/connection-factory.cc|  6 +--
 .../connection/connection-factory.h |  2 +-
 hbase-native-client/connection/pipeline.h   |  3 +-
 hbase-native-client/connection/request.cc   | 45 
 hbase-native-client/connection/request.h| 25 +--
 hbase-native-client/core/simple-client.cc   | 13 +++---
 11 files changed, 123 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3a98ebe7/hbase-native-client/connection/BUCK
--
diff --git a/hbase-native-client/connection/BUCK 
b/hbase-native-client/connection/BUCK
index 5067708..d393885 100644
--- a/hbase-native-client/connection/BUCK
+++ b/hbase-native-client/connection/BUCK
@@ -32,6 +32,7 @@ cxx_library(name="connection",
 "client-handler.cc",
 "connection-factory.cc",
 "pipeline.cc",
+"request.cc",
 ],
 deps=[
 "//if:if",

http://git-wip-us.apache.org/repos/asf/hbase/blob/3a98ebe7/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 25cff7d..eea0a17 100644
--- a/hbase-native-client/connection/client-dispatcher.cc
+++ b/hbase-native-client/connection/client-dispatcher.cc
@@ -35,16 +35,16 @@ void ClientDispatcher::read(Context *ctx, Response in) {
   p.setValue(in);
 }
 
-Future ClientDispatcher::operator()(Request arg) {
+Future ClientDispatcher::operator()(std::unique_ptr arg) {
   auto call_id = ++current_call_id_;
 
-  arg.set_call_id(call_id);
+  arg->set_call_id(call_id);
   auto &p = requests_[call_id];
   auto f = p.getFuture();
   p.setInterruptHandler([call_id, this](const folly::exception_wrapper &e) {
 this->requests_.erase(call_id);
   });
-  this->pipeline_->write(arg);
+  this->pipeline_->write(std::move(arg));
 
   return f;
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3a98ebe7/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 89c7119..877e877 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -27,11 +27,11 @@
 
 namespace hbase {
 class ClientDispatcher
-: public wangle::ClientDispatcherBase {
+: public wangle::ClientDispatcherBase, Response> {
 public:
   void read(Context *ctx, Response in) override;
-  folly::Future operator()(Request arg) override;
+  folly::Future operator()(std::unique_ptr arg) override;
   folly::Future close(Context *ctx) override;
   folly::Future close() override;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/3a98ebe7/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index 205993a7..abcf5c1 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -47,14 +47,30 @@ void ClientHandler::read(Context *ctx, 
std::unique_ptr buf) {
 LOG(INFO) << "Read ResponseHeader size=" << used_bytes
   << " call_id=" << header.call_id()
   << " has_exception=" << header.has_exception();
+
+// Get the respo

[27/42] hbase git commit: HBASE-15696 Move region location cache serialization into serde

2016-05-18 Thread eclark
HBASE-15696 Move region location cache serialization into serde

Summary: Use IOBuf for zk

Test Plan: Added a unit test

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


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

Branch: refs/heads/HBASE-14850
Commit: 65cd2da5f2a81f66635110deba17ccdfa774b3aa
Parents: eabb568
Author: Elliott Clark 
Authored: Fri Apr 22 22:21:45 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Dockerfile  |   7 +-
 .../connection/client-dispatcher.h  |   8 ++
 .../connection/client-handler.cc|   7 +-
 hbase-native-client/connection/client-handler.h |   2 +-
 hbase-native-client/connection/pipeline.h   |   2 +-
 hbase-native-client/core/client.cc  |   4 +-
 hbase-native-client/core/client.h   |   4 +-
 hbase-native-client/core/location-cache-test.cc |   2 +-
 hbase-native-client/core/location-cache.cc  |  48 +++-
 hbase-native-client/core/location-cache.h   |   4 +-
 hbase-native-client/core/simple-client.cc   |   6 +-
 hbase-native-client/serde/BUCK  |  10 ++
 .../serde/client-deserializer-test.cc   |   4 +-
 .../serde/client-deserializer.cc|   4 +-
 .../serde/client-serializer-test.cc |   2 +-
 hbase-native-client/serde/client-serializer.cc  |   2 +-
 hbase-native-client/serde/client-serializer.h   |   2 +-
 .../serde/zk-deserializer-test.cc   | 123 +++
 hbase-native-client/serde/zk-deserializer.cc|  78 
 hbase-native-client/serde/zk-deserializer.h |  35 ++
 hbase-native-client/utils/user-util-test.cc |   1 +
 21 files changed, 297 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/65cd2da5/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 9ccc0d3..1524c56 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -19,12 +19,11 @@ FROM pjameson/buck-folly-watchman
 
 ARG CC=/usr/bin/gcc-5
 ARG CXX=/usr/bin/g++-5
-ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
-ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
+ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O2 
-pthread"
+ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O2 
-pthread"
 
-RUN apt-get install -y clang-format-3.7 vim maven inetutils-ping python-pip && 
\
+RUN apt-get install -y vim maven inetutils-ping python-pip && \
   pip install yapf && \
-  ln -sf /usr/bin/clang-format-3.7 /usr/bin/clang-format && \
   apt-get -qq clean && \
   apt-get -y -qq autoremove && \
   rm -rf /var/lib/{apt,dpkg,cache,log}/ && \

http://git-wip-us.apache.org/repos/asf/hbase/blob/65cd2da5/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 c3987c9..89c7119 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -37,6 +37,14 @@ public:
 
 private:
   std::unordered_map> requests_;
+  // Start at some number way above what could
+  // be there for un-initialized call id counters.
+  //
+  // This makes it easier to make sure that the're are
+  // no access to un-initialized variables.
+  //
+  // uint32_t has a max of 4Billion so 10 more or less is
+  // not a big deal.
   uint32_t current_call_id_ = 10;
 };
 } // namespace hbase

http://git-wip-us.apache.org/repos/asf/hbase/blob/65cd2da5/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index 74b23ef..7b7794d 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -19,15 +19,15 @@
 
 #include "connection/client-handler.h"
 
-#include 
 #include 
+#include 
 
 #include 
 
 #include "connection/request.h"
 #include "connection/response.h"
-#include "if/RPC.pb.h"
 #include "if/Client.pb.h"
+#include "if/RPC.pb.h"
 
 using namespace hbase;
 using namespace folly;
@@ -60,6 +60,9 @@ void ClientHandler::read(Context *ctx, std::unique_ptr 
buf) {
   }
 }
 
+
+// TOD

[36/42] hbase git commit: HBASE-15766 Show working puts

2016-05-18 Thread eclark
HBASE-15766 Show working puts

Summary:
Add on showing how a set of puts to a single connection will work.
This still needs retries and looking up what region each request is going to

Test Plan:
./buck-out/gen/core/simple-client -columns 100
../bin/hbase shell
count 't'
100 row(s) in 0.2470 seconds

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


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

Branch: refs/heads/HBASE-14850
Commit: 285b114ce8bbaf42d2d9d06c71fbe4674cbb33e5
Parents: 5271987
Author: Elliott Clark 
Authored: Wed May 4 01:54:21 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/client-dispatcher.cc |  9 +--
 .../connection/client-dispatcher.h  | 11 ++-
 .../connection/client-handler.cc| 13 ++--
 hbase-native-client/connection/client-handler.h |  4 +-
 .../connection/connection-factory.cc| 46 ++--
 .../connection/connection-factory.h | 11 ++-
 .../connection/connection-pool-test.cc  | 54 +++---
 .../connection/connection-pool.cc   | 33 +++--
 .../connection/connection-pool.h| 10 ++-
 hbase-native-client/core/client.cc  |  6 +-
 hbase-native-client/core/location-cache.cc  | 25 +++
 hbase-native-client/core/location-cache.h   |  6 +-
 hbase-native-client/core/meta-utils.cc  |  6 +-
 hbase-native-client/core/meta-utils.h   |  4 +-
 hbase-native-client/core/region-location.h  |  8 ++-
 hbase-native-client/core/simple-client.cc   | 76 +---
 .../serde/region-info-deserializer-test.cc  |  1 -
 hbase-native-client/serde/region-info.h |  6 +-
 18 files changed, 231 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/285b114c/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 6e2dc54..655d765 100644
--- a/hbase-native-client/connection/client-dispatcher.cc
+++ b/hbase-native-client/connection/client-dispatcher.cc
@@ -22,10 +22,11 @@ using namespace folly;
 using namespace hbase;
 using namespace wangle;
 
-ClientDispatcher::ClientDispatcher() : requests_(), current_call_id_(9) {}
+ClientDispatcher::ClientDispatcher() : requests_(5000), current_call_id_(9) {}
 
 void ClientDispatcher::read(Context *ctx, Response in) {
   auto call_id = in.call_id();
+
   auto search = requests_.find(call_id);
   CHECK(search != requests_.end());
   auto p = std::move(search->second);
@@ -38,10 +39,10 @@ void ClientDispatcher::read(Context *ctx, Response in) {
 }
 
 Future ClientDispatcher::operator()(std::unique_ptr arg) {
-  auto call_id = ++current_call_id_;
-
+  auto call_id = current_call_id_++;
   arg->set_call_id(call_id);
-  auto &p = requests_[call_id];
+  requests_.insert(call_id, Promise{});
+  auto &p = requests_.find(call_id)->second;
   auto f = p.getFuture();
   p.setInterruptHandler([call_id, this](const folly::exception_wrapper &e) {
 LOG(ERROR) << "e = " << call_id;

http://git-wip-us.apache.org/repos/asf/hbase/blob/285b114c/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 826fc6a..4435a1b 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -19,8 +19,12 @@
 
 #pragma once
 
+#include 
+#include 
 #include 
 
+#include 
+
 #include "connection/pipeline.h"
 #include "connection/request.h"
 #include "connection/response.h"
@@ -31,13 +35,16 @@ class ClientDispatcher
   std::unique_ptr, Response> {
 public:
   ClientDispatcher();
+  ~ClientDispatcher() {
+LOG(ERROR) << "Killing ClientDispatcher call_id = " << current_call_id_;
+  }
   void read(Context *ctx, Response in) override;
   folly::Future operator()(std::unique_ptr arg) override;
   folly::Future close(Context *ctx) override;
   folly::Future close() override;
 
 private:
-  std::unordered_map> requests_;
+  folly::AtomicHashMap> requests_;
   // Start at some number way above what could
   // be there for un-initialized call id counters.
   //
@@ -46,6 +53,6 @@ private:
   //
   // uint32_t has a max of 4Billion so 10 more or less is
   // not a big deal.
-  uint32_t current_call_id_;
+  std::atomic curr

[16/42] hbase git commit: HBASE-14852 Update build env

2016-05-18 Thread eclark
HBASE-14852 Update build env

Also includes HBASE-14858 Clean up so core is ready for development on a recent 
version of c++


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

Branch: refs/heads/HBASE-14850
Commit: 369fb30d3abeb4e64006b127cbb2077639dbcc11
Parents: 8aa8abf
Author: Elliott Clark 
Authored: Thu Nov 19 16:28:11 2015 -0800
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/.buckconfig |   2 +
 hbase-native-client/.gitignore  |  23 +--
 hbase-native-client/CMakeLists.txt  | 157 ---
 hbase-native-client/Dockerfile  |  22 +++
 hbase-native-client/README.md   |  15 +-
 hbase-native-client/bin/build-all.sh|  41 -
 hbase-native-client/bin/build-thirdparty.sh |  64 
 hbase-native-client/bin/download-thirdparty.sh  |  70 -
 hbase-native-client/bin/hbase-client-env.sh |  47 --
 hbase-native-client/bin/start-docker.sh |  32 
 .../cmake_modules/FindGTest.cmake   |  53 ---
 .../cmake_modules/FindLibEv.cmake   |  47 --
 hbase-native-client/core/BUCK   |  50 ++
 hbase-native-client/core/admin.cc   |  20 +++
 hbase-native-client/core/admin.h|  22 +++
 hbase-native-client/core/client.cc  |  38 +
 hbase-native-client/core/client.h   |  24 +++
 hbase-native-client/core/connection.cc  |  20 +++
 hbase-native-client/core/connection.h   |  26 +++
 hbase-native-client/core/connection_attr.h  |  24 +++
 hbase-native-client/core/delete.cc  |  21 +++
 hbase-native-client/core/delete.h   |  27 
 hbase-native-client/core/get.cc |  20 +++
 hbase-native-client/core/get.h  |  22 +++
 hbase-native-client/core/hbase_macros.h |  56 +++
 hbase-native-client/core/mutation.cc|  41 +
 hbase-native-client/core/mutation.h |  58 +++
 hbase-native-client/core/put.cc |  21 +++
 hbase-native-client/core/put.h  |  27 
 hbase-native-client/core/scanner.cc |  20 +++
 hbase-native-client/core/scanner.h  |  22 +++
 hbase-native-client/rpc/CMakeLists.txt  |  17 ++
 hbase-native-client/src/async/CMakeLists.txt|  32 
 hbase-native-client/src/async/get-test.cc   |  59 ---
 hbase-native-client/src/async/hbase_admin.cc|  57 ---
 hbase-native-client/src/async/hbase_admin.h |  69 
 hbase-native-client/src/async/hbase_client.cc   |  47 --
 hbase-native-client/src/async/hbase_client.h|  60 ---
 .../src/async/hbase_connection.cc   |  37 -
 .../src/async/hbase_connection.h|  52 --
 hbase-native-client/src/async/hbase_errno.h |  23 ---
 hbase-native-client/src/async/hbase_get.cc  |  61 ---
 hbase-native-client/src/async/hbase_get.h   |  73 -
 .../src/async/hbase_mutations.cc| 111 -
 hbase-native-client/src/async/hbase_mutations.h | 119 --
 hbase-native-client/src/async/hbase_result.cc   |  37 -
 hbase-native-client/src/async/hbase_result.h|  44 --
 hbase-native-client/src/async/hbase_scanner.cc  |  59 ---
 hbase-native-client/src/async/hbase_scanner.h   |  80 --
 hbase-native-client/src/async/mutations-test.cc | 102 
 hbase-native-client/src/core/CMakeLists.txt |  31 
 hbase-native-client/src/core/admin.cc   |  20 ---
 hbase-native-client/src/core/admin.h|  25 ---
 hbase-native-client/src/core/client.cc  |  20 ---
 hbase-native-client/src/core/client.h   |  25 ---
 hbase-native-client/src/core/connection.cc  |  22 ---
 hbase-native-client/src/core/connection.h   |  26 ---
 hbase-native-client/src/core/connection_attr.h  |  30 
 hbase-native-client/src/core/delete.cc  |  22 ---
 hbase-native-client/src/core/delete.h   |  29 
 hbase-native-client/src/core/get.cc |  20 ---
 hbase-native-client/src/core/get.h  |  26 ---
 .../src/core/hbase_connection_attr.cc   |  41 -
 .../src/core/hbase_connection_attr.h|  51 --
 hbase-native-client/src/core/hbase_macros.h |  60 ---
 hbase-native-client/src/core/hbase_types.h  |  83 --
 hbase-native-client/src/core/mutation.cc|  42 -
 hbase-native-client/src/core/mutation.h |  48 --
 hbase-native-client/src/core/put.cc |  22 ---
 hbase-native-client/src/core/put.h  |  29 
 hbase-native-client/

[38/42] hbase git commit: HBASE-15770 Stop using wangle's global executor

2016-05-18 Thread eclark
HBASE-15770 Stop using wangle's global executor

Summary: Connection pool and connection factory now get thread pools through 
their constructor. This means that the client has the whole control over the 
threads.

Test Plan: simple-client still writes.

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


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

Branch: refs/heads/HBASE-14850
Commit: fe16ac8d6a5b91c10a299683a8d82e359f608248
Parents: 35b32b0
Author: Elliott Clark 
Authored: Fri May 6 14:32:16 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/client-dispatcher.h  |  3 ++-
 .../connection/client-handler.cc|  2 +-
 .../connection/connection-factory.cc|  8 +++---
 .../connection/connection-factory.h |  2 +-
 .../connection/connection-pool-test.cc  |  1 +
 .../connection/connection-pool.cc   |  7 ++---
 .../connection/connection-pool.h|  2 +-
 hbase-native-client/core/client.cc  | 23 +++-
 hbase-native-client/core/client.h   |  9 +--
 hbase-native-client/core/location-cache-test.cc |  5 ++--
 hbase-native-client/core/location-cache.cc  | 28 +++-
 hbase-native-client/core/location-cache.h   |  8 --
 hbase-native-client/core/simple-client.cc   |  8 +++---
 hbase-native-client/serde/server-name-test.cc   |  1 -
 14 files changed, 63 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/fe16ac8d/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 4bfb35d..2497cc7 100644
--- a/hbase-native-client/connection/client-dispatcher.h
+++ b/hbase-native-client/connection/client-dispatcher.h
@@ -31,7 +31,8 @@
 
 namespace hbase {
 /**
- * Dispatcher that assigns a call_id and then routes the response back to the 
future.
+ * Dispatcher that assigns a call_id and then routes the response back to the
+ * future.
  */
 class ClientDispatcher
 : public wangle::ClientDispatcherBasehttp://git-wip-us.apache.org/repos/asf/hbase/blob/fe16ac8d/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index cae03c7..2e3fcd3 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -37,7 +37,7 @@ using hbase::pb::GetResponse;
 using google::protobuf::Message;
 
 ClientHandler::ClientHandler(std::string user_name)
-: user_name_(user_name), serde_(), once_flag_(),
+: user_name_(user_name), serde_(), 
once_flag_(std::make_unique()),
   resp_msgs_(
   make_unique>>(5000)) {}

http://git-wip-us.apache.org/repos/asf/hbase/blob/fe16ac8d/hbase-native-client/connection/connection-factory.cc
--
diff --git a/hbase-native-client/connection/connection-factory.cc 
b/hbase-native-client/connection/connection-factory.cc
index 635d12d..beec6d5 100644
--- a/hbase-native-client/connection/connection-factory.cc
+++ b/hbase-native-client/connection/connection-factory.cc
@@ -19,8 +19,6 @@
 
 #include "connection/connection-factory.h"
 
-#include 
-
 #include "connection/client-dispatcher.h"
 #include "connection/pipeline.h"
 #include "connection/service.h"
@@ -28,9 +26,9 @@
 using namespace folly;
 using namespace hbase;
 
-ConnectionFactory::ConnectionFactory()
-: io_pool_(std::static_pointer_cast(
-  wangle::getIOExecutor())),
+ConnectionFactory::ConnectionFactory(
+std::shared_ptr io_pool)
+: io_pool_(io_pool),
   pipeline_factory_(std::make_shared()) {}
 
 std::shared_ptr>

http://git-wip-us.apache.org/repos/asf/hbase/blob/fe16ac8d/hbase-native-client/connection/connection-factory.h
--
diff --git a/hbase-native-client/connection/connection-factory.h 
b/hbase-native-client/connection/connection-factory.h
index 8b6d8d8..fb5d9fe 100644
--- a/hbase-native-client/connection/connection-factory.h
+++ b/hbase-native-client/connection/connection-factory.h
@@ -39,7 +39,7 @@ public:
* Constructor.
* There should only be one ConnectionFactory per client.
*/
-  ConnectionFactory();
+  ConnectionFactory(std::shared_ptr io_pool);
   /** Default Desctructor */
  

[26/42] hbase git commit: HBASE-15620 Add on Call serialization

2016-05-18 Thread eclark
HBASE-15620 Add on Call serialization

Summary: Add on delimited serialization so that request headers and request 
payloads can be serialized.

Test Plan: Add a unit test.

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


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

Branch: refs/heads/HBASE-14850
Commit: eabb56848333ad6d0fcde0259ed8a9885c3c3e6d
Parents: de51492
Author: Elliott Clark 
Authored: Tue Apr 12 12:03:52 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Dockerfile  |  19 ++-
 hbase-native-client/bin/start-local-hbase.sh|  33 +
 .../bin/start_local_hbase_and_wait.sh   |  33 -
 hbase-native-client/bin/stop-local-hbase.sh |  26 
 .../bin/stop_local_hbase_and_wait.sh|  26 
 hbase-native-client/connection/BUCK |  43 ++
 .../connection/client-dispatcher.cc |  56 
 .../connection/client-dispatcher.h  |  42 ++
 .../connection/client-handler.cc|  80 +++
 hbase-native-client/connection/client-handler.h |  49 +++
 .../connection/connection-factory.cc|  58 
 .../connection/connection-factory.h |  40 ++
 hbase-native-client/connection/pipeline.cc  |  42 ++
 hbase-native-client/connection/pipeline.h   |  39 ++
 hbase-native-client/connection/request.h|  42 ++
 hbase-native-client/connection/response.h   |  46 ++
 hbase-native-client/connection/service.h|  26 
 hbase-native-client/core/BUCK   |  41 +-
 hbase-native-client/core/admin.cc   |  20 ---
 hbase-native-client/core/admin.h|  22 ---
 hbase-native-client/core/client-dispatcher.cc   |  54 ---
 hbase-native-client/core/client-dispatcher.h|  42 --
 .../core/client-serialize-handler.cc| 104 --
 .../core/client-serialize-handler.h |  44 --
 hbase-native-client/core/client.h   |   2 +-
 hbase-native-client/core/connection-factory.cc  |  57 
 hbase-native-client/core/connection-factory.h   |  41 --
 hbase-native-client/core/connection_attr.h  |  24 
 hbase-native-client/core/delete.cc  |  21 ---
 hbase-native-client/core/delete.h   |  27 
 hbase-native-client/core/get-request.h  |   2 +-
 hbase-native-client/core/get-result.h   |   2 +-
 hbase-native-client/core/location-cache.cc  |   3 +-
 hbase-native-client/core/location-cache.h   |   2 +-
 hbase-native-client/core/mutation.cc|  41 --
 hbase-native-client/core/mutation.h |  58 
 .../core/native-client-test-env.cc  |  45 --
 hbase-native-client/core/pipeline.cc|  42 --
 hbase-native-client/core/pipeline.h |  34 -
 hbase-native-client/core/request.h  |  33 -
 hbase-native-client/core/response.h |  34 -
 hbase-native-client/core/scanner.cc |  20 ---
 hbase-native-client/core/scanner.h  |  22 ---
 hbase-native-client/core/service.h  |  26 
 hbase-native-client/core/simple-client.cc   |  45 +-
 .../core/simple-native-client-test.cc   |  25 
 hbase-native-client/core/table-name.h   |   2 +-
 hbase-native-client/core/test-env.cc|  45 ++
 hbase-native-client/if/BUCK |  53 ---
 hbase-native-client/serde/BUCK  |  54 +++
 .../serde/client-deserializer-test.cc   |  67 +
 .../serde/client-deserializer.cc|  68 +
 hbase-native-client/serde/client-deserializer.h |  36 +
 .../serde/client-serializer-test.cc |  75 ++
 hbase-native-client/serde/client-serializer.cc  | 139 +++
 hbase-native-client/serde/client-serializer.h   |  55 
 56 files changed, 1248 insertions(+), 979 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/eabb5684/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 36959a5..9ccc0d3 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -22,7 +22,14 @@ ARG CXX=/usr/bin/g++-5
 ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
 ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O3 
-pthread"
 
-RUN apt-get install -y clang-format-3.7 vim maven 

[08/42] hbase git commit: HBASE-15826 Clean up ASF license issues

2016-05-18 Thread eclark
HBASE-15826 Clean up ASF license issues


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

Branch: refs/heads/HBASE-14850
Commit: 6bc1ab39e89f1d43dc6501e9127b55f9165b77cd
Parents: aac4e43
Author: Elliott Clark 
Authored: Fri May 13 14:53:47 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Makefile | 17 +
 hbase-native-client/bin/copy-protobuf.sh | 16 
 hbase-native-client/bin/format-code.sh   | 16 
 hbase-native-client/bin/start-local-hbase.sh |  1 -
 hbase-native-client/hbase.doxygen| 22 +++---
 hbase-native-client/serde/server-name.h  | 19 +++
 6 files changed, 87 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6bc1ab39/hbase-native-client/Makefile
--
diff --git a/hbase-native-client/Makefile b/hbase-native-client/Makefile
index 90ec6ea..826233f 100644
--- a/hbase-native-client/Makefile
+++ b/hbase-native-client/Makefile
@@ -1,3 +1,20 @@
+##
+# 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.
+
 build:
$(shell buck build core/... )
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/6bc1ab39/hbase-native-client/bin/copy-protobuf.sh
--
diff --git a/hbase-native-client/bin/copy-protobuf.sh 
b/hbase-native-client/bin/copy-protobuf.sh
index c9e70f2..36541cf 100755
--- a/hbase-native-client/bin/copy-protobuf.sh
+++ b/hbase-native-client/bin/copy-protobuf.sh
@@ -1,4 +1,20 @@
 #!/usr/bin/env bash
+##
+# 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.
 set -euo pipefail
 IFS=$'\n\t'
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/6bc1ab39/hbase-native-client/bin/format-code.sh
--
diff --git a/hbase-native-client/bin/format-code.sh 
b/hbase-native-client/bin/format-code.sh
index 24d6515..36a114d 100755
--- a/hbase-native-client/bin/format-code.sh
+++ b/hbase-native-client/bin/format-code.sh
@@ -1,4 +1,20 @@
 #!/usr/bin/env bash
+##
+# 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.
 set -euo pipefail
 IFS=$'\n\t'
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/6bc1ab39/hbase-native-client/bin/start-local-hbase.sh
---

[29/42] hbase git commit: HBASE-15724 Use explicit docker image

2016-05-18 Thread eclark
HBASE-15724 Use explicit docker image

Summary:
Set the tag for cpp docker image
Don't set the env on command line

Test Plan: Build it.

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


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

Branch: refs/heads/HBASE-14850
Commit: fef51e2a2ec7fd4768e7d626b2dc74d9b99acde8
Parents: a6a2878
Author: Elliott Clark 
Authored: Wed Apr 27 10:51:05 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/Dockerfile  | 4 +++-
 hbase-native-client/bin/start-docker.sh | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/fef51e2a/hbase-native-client/Dockerfile
--
diff --git a/hbase-native-client/Dockerfile b/hbase-native-client/Dockerfile
index 1524c56..8e33e74 100644
--- a/hbase-native-client/Dockerfile
+++ b/hbase-native-client/Dockerfile
@@ -15,13 +15,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM pjameson/buck-folly-watchman
+FROM pjameson/buck-folly-watchman:20160425
 
 ARG CC=/usr/bin/gcc-5
 ARG CXX=/usr/bin/g++-5
 ARG CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O2 
-pthread"
 ARG CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -g -fno-omit-frame-pointer -O2 
-pthread"
 
+ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
+
 RUN apt-get install -y vim maven inetutils-ping python-pip && \
   pip install yapf && \
   apt-get -qq clean && \

http://git-wip-us.apache.org/repos/asf/hbase/blob/fef51e2a/hbase-native-client/bin/start-docker.sh
--
diff --git a/hbase-native-client/bin/start-docker.sh 
b/hbase-native-client/bin/start-docker.sh
index 9cbd8b7..5c03eb9 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -53,7 +53,6 @@ docker build -t hbase_native .
 
 # After the image is built run the thing
 docker run -p 16010:16010/tcp \
-   -e "JAVA_HOME=/usr/lib/jvm/java-8-oracle" \
-v ${BASE_DIR}/..:/usr/src/hbase \
-v ~/.m2:/root/.m2 \
-it hbase_native  /bin/bash



[10/42] hbase git commit: HBASE-15731 Add on a connection pool

2016-05-18 Thread eclark
HBASE-15731 Add on a connection pool

Summary:
Add on a connection pool protected by read write mutex.
Add on a service filter that will remove a connection from a connection pool 
when closed

Test Plan: Need to add on tests.

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


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

Branch: refs/heads/HBASE-14850
Commit: 59f961237233384399d6d65736579f48fed63cd5
Parents: 74ff76a
Author: Elliott Clark 
Authored: Thu Apr 28 19:53:42 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/connection/BUCK |   5 +
 .../connection/connection-factory.cc|   4 +-
 .../connection/connection-factory.h |   5 +-
 .../connection/connection-pool-test.cc  |  77 ++
 .../connection/connection-pool.cc   |  89 
 .../connection/connection-pool.h|  59 +++
 hbase-native-client/connection/service.h|   4 +-
 hbase-native-client/core/BUCK   |   4 -
 hbase-native-client/core/client.h   |   3 -
 hbase-native-client/core/get-request.cc |  19 
 hbase-native-client/core/get-request.h  |  35 ---
 hbase-native-client/core/get-result.cc  |  19 
 hbase-native-client/core/get-result.h   |  32 --
 hbase-native-client/core/location-cache.cc  |   1 -
 hbase-native-client/core/simple-client.cc   | 105 +++
 15 files changed, 297 insertions(+), 164 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/59f96123/hbase-native-client/connection/BUCK
--
diff --git a/hbase-native-client/connection/BUCK 
b/hbase-native-client/connection/BUCK
index d393885..96f2136 100644
--- a/hbase-native-client/connection/BUCK
+++ b/hbase-native-client/connection/BUCK
@@ -22,6 +22,7 @@ cxx_library(name="connection",
 "client-dispatcher.h",
 "client-handler.h",
 "connection-factory.h",
+"connection-pool.h",
 "pipeline.h",
 "request.h",
 "response.h",
@@ -31,6 +32,7 @@ cxx_library(name="connection",
 "client-dispatcher.cc",
 "client-handler.cc",
 "connection-factory.cc",
+"connection-pool.cc",
 "pipeline.cc",
 "request.cc",
 ],
@@ -42,3 +44,6 @@ cxx_library(name="connection",
 "//third-party:wangle",
 ],
 visibility=['//core/...', ], )
+cxx_test(name="connection-pool-test",
+ srcs=["connection-pool-test.cc", ],
+ deps=[":connection", ], )

http://git-wip-us.apache.org/repos/asf/hbase/blob/59f96123/hbase-native-client/connection/connection-factory.cc
--
diff --git a/hbase-native-client/connection/connection-factory.cc 
b/hbase-native-client/connection/connection-factory.cc
index 7073f9d..b546269 100644
--- a/hbase-native-client/connection/connection-factory.cc
+++ b/hbase-native-client/connection/connection-factory.cc
@@ -45,8 +45,8 @@ ConnectionFactory::ConnectionFactory() {
   bootstrap_.pipelineFactory(std::make_shared());
 }
 
-std::shared_ptr, Response>>
-ConnectionFactory::make_connection(std::string host, int port) {
+std::shared_ptr
+ConnectionFactory::make_connection(const std::string &host, int port) {
   // Connect to a given server
   // Then when connected create a ClientDispactcher.
   auto pipeline = bootstrap_.connect(SocketAddress(host, port, true)).get();

http://git-wip-us.apache.org/repos/asf/hbase/blob/59f96123/hbase-native-client/connection/connection-factory.h
--
diff --git a/hbase-native-client/connection/connection-factory.h 
b/hbase-native-client/connection/connection-factory.h
index 8d1d2f0..5a45316 100644
--- a/hbase-native-client/connection/connection-factory.h
+++ b/hbase-native-client/connection/connection-factory.h
@@ -31,8 +31,9 @@ namespace hbase {
 class ConnectionFactory {
 public:
   ConnectionFactory();
-  std::shared_ptr, Response>>
-  make_connection(std::string host, int port);
+
+  virtual std::shared_ptr make_connection(const std::string 
&host,
+int port);
 
 private:
   wangle::ClientBootstrap bootstrap_;

http://git-wip-us.apache.org/repos/asf/hbase/blob/59f96123/hbase-native-client/connection/connection-pool-test.cc

[34/42] hbase git commit: HBASE-15750 Add on meta deserialization

2016-05-18 Thread eclark
HBASE-15750 Add on meta deserialization

Summary: Add on meta region info deserialization

Test Plan:
Unit tests.
Simple client connects.

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


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

Branch: refs/heads/HBASE-14850
Commit: 6b4d75995a52f079a87334951f8cfe20418db25c
Parents: 3915478
Author: Elliott Clark 
Authored: Tue May 3 12:17:07 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 .../connection/client-dispatcher.cc |   1 +
 .../connection/client-handler.cc|  13 +-
 hbase-native-client/connection/client-handler.h |   6 +-
 .../connection/connection-pool.cc   |  36 +---
 .../connection/connection-pool.h|   8 +-
 hbase-native-client/core/BUCK   |   4 -
 hbase-native-client/core/location-cache-test.cc |   1 +
 hbase-native-client/core/location-cache.cc  |  73 +++-
 hbase-native-client/core/location-cache.h   |   7 +-
 hbase-native-client/core/meta-utils.cc  |   9 +-
 hbase-native-client/core/meta-utils.h   |   7 +-
 hbase-native-client/core/region-location.h  |   5 +-
 hbase-native-client/core/simple-client.cc   |   6 +-
 hbase-native-client/core/table-name-test.cc |  54 --
 hbase-native-client/core/table-name.h   |  50 -
 hbase-native-client/serde/BUCK  |  56 +++---
 .../serde/client-deserializer-test.cc   |  25 ++-
 .../serde/client-deserializer.cc|  68 ---
 hbase-native-client/serde/client-deserializer.h |  36 
 .../serde/client-serializer-test.cc |  26 +--
 hbase-native-client/serde/client-serializer.cc  | 139 --
 hbase-native-client/serde/client-serializer.h   |  55 --
 .../serde/region-info-deserializer-test.cc  |  54 ++
 hbase-native-client/serde/region-info.h |  41 +
 hbase-native-client/serde/rpc.cc| 181 +++
 hbase-native-client/serde/rpc.h |  58 ++
 hbase-native-client/serde/server-name-test.cc   |  32 
 hbase-native-client/serde/server-name.h |  21 +++
 hbase-native-client/serde/table-name-test.cc|  54 ++
 hbase-native-client/serde/table-name.h  |  54 ++
 .../serde/zk-deserializer-test.cc   |   8 +-
 hbase-native-client/serde/zk-deserializer.cc|  78 
 hbase-native-client/serde/zk-deserializer.h |  35 
 hbase-native-client/serde/zk.cc |  78 
 hbase-native-client/serde/zk.h  |  35 
 35 files changed, 761 insertions(+), 653 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6b4d7599/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 817adc1..6e2dc54 100644
--- a/hbase-native-client/connection/client-dispatcher.cc
+++ b/hbase-native-client/connection/client-dispatcher.cc
@@ -44,6 +44,7 @@ Future 
ClientDispatcher::operator()(std::unique_ptr arg) {
   auto &p = requests_[call_id];
   auto f = p.getFuture();
   p.setInterruptHandler([call_id, this](const folly::exception_wrapper &e) {
+LOG(ERROR) << "e = " << call_id;
 this->requests_.erase(call_id);
   });
   this->pipeline_->write(std::move(arg));

http://git-wip-us.apache.org/repos/asf/hbase/blob/6b4d7599/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index 3180f4e..496e4f2 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -37,8 +37,7 @@ using hbase::pb::GetResponse;
 using google::protobuf::Message;
 
 ClientHandler::ClientHandler(std::string user_name)
-: user_name_(user_name), need_send_header_(true), ser_(), deser_(),
-  resp_msgs_() {}
+: user_name_(user_name), need_send_header_(true), serde_(), resp_msgs_() {}
 
 void ClientHandler::read(Context *ctx, std::unique_ptr buf) {
   if (LIKELY(buf != nullptr)) {
@@ -46,7 +45,7 @@ void ClientHandler::read(Context *ctx, std::unique_ptr 
buf) {
 Response received;
 ResponseHeader header;
 
-int used_bytes = deser_.parse_delimited(buf.get(), &header);
+int used_bytes = serde_.ParseDelimited(buf.get(), &header);
 LOG(INFO) << "Read ResponseHeader size=" << used_bytes
   << " call_

[14/42] hbase git commit: HBASE-14853 Add on protobuf to c++ chain

2016-05-18 Thread eclark
HBASE-14853 Add on protobuf to c++ chain


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

Branch: refs/heads/HBASE-14850
Commit: 2c911aebd5055981c28879134270426bf49eb646
Parents: e1a422f
Author: Elliott Clark 
Authored: Mon Dec 28 15:33:52 2015 -0800
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/bin/start-docker.sh |   1 +
 hbase-native-client/core/BUCK   |   1 +
 hbase-native-client/core/client.cc  |   4 +
 hbase-native-client/core/client.h   |   2 +
 hbase-native-client/if/AccessControl.proto  | 123 +++
 hbase-native-client/if/Admin.proto  | 309 
 hbase-native-client/if/Aggregate.proto  |  63 ++
 hbase-native-client/if/Authentication.proto |  82 ++
 hbase-native-client/if/BUCK |  36 +
 hbase-native-client/if/Cell.proto   |  67 ++
 hbase-native-client/if/Client.proto | 472 +++
 hbase-native-client/if/ClusterId.proto  |  34 +
 hbase-native-client/if/ClusterStatus.proto  | 224 ++
 hbase-native-client/if/Comparator.proto |  74 ++
 hbase-native-client/if/Encryption.proto |  33 +
 hbase-native-client/if/ErrorHandling.proto  |  58 ++
 hbase-native-client/if/FS.proto |  45 ++
 hbase-native-client/if/Filter.proto | 170 
 hbase-native-client/if/HBase.proto  | 258 ++
 hbase-native-client/if/HFile.proto  |  49 ++
 hbase-native-client/if/LoadBalancer.proto   |  29 +
 hbase-native-client/if/MapReduce.proto  |  37 +
 hbase-native-client/if/Master.proto | 778 +++
 hbase-native-client/if/MasterProcedure.proto| 245 ++
 hbase-native-client/if/MultiRowMutation.proto   |  45 ++
 hbase-native-client/if/Procedure.proto  | 119 +++
 hbase-native-client/if/Quota.proto  |  76 ++
 hbase-native-client/if/RPC.proto| 136 
 hbase-native-client/if/RegionNormalizer.proto   |  28 +
 hbase-native-client/if/RegionServerStatus.proto | 158 
 hbase-native-client/if/RowProcessor.proto   |  45 ++
 hbase-native-client/if/SecureBulkLoad.proto |  72 ++
 hbase-native-client/if/Snapshot.proto   |  66 ++
 hbase-native-client/if/Tracing.proto|  33 +
 hbase-native-client/if/VisibilityLabels.proto   |  83 ++
 hbase-native-client/if/WAL.proto| 172 
 hbase-native-client/if/ZooKeeper.proto  | 155 
 hbase-native-client/rpc/CMakeLists.txt  |  17 -
 hbase-native-client/third-party/BUCK|   4 +-
 39 files changed, 4385 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/2c911aeb/hbase-native-client/bin/start-docker.sh
--
diff --git a/hbase-native-client/bin/start-docker.sh 
b/hbase-native-client/bin/start-docker.sh
index bf38912..4426705 100755
--- a/hbase-native-client/bin/start-docker.sh
+++ b/hbase-native-client/bin/start-docker.sh
@@ -20,6 +20,7 @@ set -e
 set -x
 
 eval "$(docker-machine env docker-vm)"
+eval "$(docker-machine env dinghy)"
 docker build -t hbase_native .
 
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2c911aeb/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 2e4e755..ef027a1 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -41,6 +41,7 @@ cxx_binary(
   "scanner.cc",
],
deps = [
+   "//if:if",
"//third-party:folly",
"//third-party:wangle",
],

http://git-wip-us.apache.org/repos/asf/hbase/blob/2c911aeb/hbase-native-client/core/client.cc
--
diff --git a/hbase-native-client/core/client.cc 
b/hbase-native-client/core/client.cc
index 98cf38a..a04daee 100644
--- a/hbase-native-client/core/client.cc
+++ b/hbase-native-client/core/client.cc
@@ -24,9 +24,13 @@
 #include 
 #include 
 
+#include "if/ZooKeeper.pb.h"
+
 using namespace folly;
+using namespace hbase::pb;
 
 int main(int argc, char *argv[]) {
+  MetaRegionServer mrs;
   google::ParseCommandLineFlags(&argc, &argv, true);
   google::InitGoogleLogging(argv[0]);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2c911aeb/hbase-native-client/core/client.h
--
diff --git a/hbase-native-client/core/client.h 
b/hbase-native-client/core

[41/42] hbase git commit: HBASE-15792 Add on a test for locating a region

2016-05-18 Thread eclark
HBASE-15792 Add on a test for locating a region

Summary:
Add on a TestUtil class that will start a cluster.
Add on the ability to run a shell command in a cluster.
Throw an exception if the table isn't the correct table when looking up a 
region.
Add a test to test that getting a region throws when the table doesn't exist.
Add a test to make sure that getting a region location works when the table 
does exist.

Test Plan:
Added unit tests.
Changed unit tests.

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


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

Branch: refs/heads/HBASE-14850
Commit: 2b0fb0b2d380e6553036dec0d2c60e0e331e71ca
Parents: fe16ac8
Author: Elliott Clark 
Authored: Mon May 9 12:06:54 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/bin/start-local-hbase.sh|  5 +-
 .../connection/client-handler.cc|  3 +-
 hbase-native-client/core/BUCK   |  4 +-
 hbase-native-client/core/client.cc  |  1 +
 hbase-native-client/core/location-cache-test.cc | 29 ++-
 hbase-native-client/core/location-cache.cc  | 10 +++-
 hbase-native-client/core/location-cache.h   | 10 +++-
 hbase-native-client/core/test-env.cc| 45 
 hbase-native-client/test-util/BUCK  | 29 +++
 hbase-native-client/test-util/test-util.cc  | 54 
 hbase-native-client/test-util/test-util.h   | 51 ++
 11 files changed, 187 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/2b0fb0b2/hbase-native-client/bin/start-local-hbase.sh
--
diff --git a/hbase-native-client/bin/start-local-hbase.sh 
b/hbase-native-client/bin/start-local-hbase.sh
index cfc71f9..49637d6 100755
--- a/hbase-native-client/bin/start-local-hbase.sh
+++ b/hbase-native-client/bin/start-local-hbase.sh
@@ -21,7 +21,8 @@
 rm -rf /tmp/hbase-*
 
 # Start the master/regionservers.
-$PWD/../bin/start-hbase.sh
+T_DIR=${1:-"/tmp/hbase-testing"}
+$PWD/../bin/start-hbase.sh -Dhbase.tmp.dir="${T_DIR}"
 
 until [ $(curl -s -o /dev/null -I -w "%{http_code}" 
http://localhost:16010/jmx) == "200" ]
 do
@@ -30,4 +31,4 @@ do
 done
 
 # This sucks, but master can easily be up and meta not be assigned yet.
-sleep 30
+sleep 10

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b0fb0b2/hbase-native-client/connection/client-handler.cc
--
diff --git a/hbase-native-client/connection/client-handler.cc 
b/hbase-native-client/connection/client-handler.cc
index 2e3fcd3..3409b80 100644
--- a/hbase-native-client/connection/client-handler.cc
+++ b/hbase-native-client/connection/client-handler.cc
@@ -37,7 +37,8 @@ using hbase::pb::GetResponse;
 using google::protobuf::Message;
 
 ClientHandler::ClientHandler(std::string user_name)
-: user_name_(user_name), serde_(), 
once_flag_(std::make_unique()),
+: user_name_(user_name), serde_(),
+  once_flag_(std::make_unique()),
   resp_msgs_(
   make_unique>>(5000)) {}

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b0fb0b2/hbase-native-client/core/BUCK
--
diff --git a/hbase-native-client/core/BUCK b/hbase-native-client/core/BUCK
index 485f9ba..1c926e3 100644
--- a/hbase-native-client/core/BUCK
+++ b/hbase-native-client/core/BUCK
@@ -46,10 +46,10 @@ cxx_library(
 ], )
 cxx_test(name="location-cache-test",
  srcs=[
- "test-env.cc",
  "location-cache-test.cc",
  ],
- deps=[":core", ],
+ deps=[":core",
+   "//test-util:test-util", ],
  run_test_separately=True, )
 cxx_binary(name="simple-client",
srcs=["simple-client.cc", ],

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b0fb0b2/hbase-native-client/core/client.cc
--
diff --git a/hbase-native-client/core/client.cc 
b/hbase-native-client/core/client.cc
index 1e80998..82ecd22 100644
--- a/hbase-native-client/core/client.cc
+++ b/hbase-native-client/core/client.cc
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 using namespace folly;
 using namespace std;

http://git-wip-us.apache.org/repos/asf/hbase/blob/2b0fb0b2/hbase-native-client/core/location-cache-test.cc
--
diff --git a/hbase-native-client/core/location-cache-test.cc 
b/hbase-native-client/core/location-cache-test.cc
in

[31/42] hbase git commit: HBASE-15739 Add region location lookup from meta

2016-05-18 Thread eclark
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/a7225e42
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a7225e42
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a7225e42

Branch: refs/heads/HBASE-14850
Commit: a7225e4248d2e883143ebf8cc33a269101e3dba4
Parents: 59f9612
Author: Elliott Clark 
Authored: Sat Apr 30 17:12:11 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 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/a7225e42/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/a7225e42/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/a7225e42/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, Response> {
 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_;
 };
 } // namespace hbase

http://git-wip-us.apache.org/repos/asf/hbase/blob/a7225e42/hbase-native-client/connection/client-handler.cc
--
dif

[21/42] hbase git commit: HBASE-15649 Ignore buck-out when building docker image

2016-05-18 Thread eclark
HBASE-15649 Ignore buck-out when building docker image


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

Branch: refs/heads/HBASE-14850
Commit: 17185fe09d5f4bed1b60936ec2d1ffe01302af14
Parents: 711b661
Author: Elliott Clark 
Authored: Wed Apr 13 17:02:38 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/.dockerignore | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/17185fe0/hbase-native-client/.dockerignore
--
diff --git a/hbase-native-client/.dockerignore 
b/hbase-native-client/.dockerignore
new file mode 100644
index 000..2cfffb7
--- /dev/null
+++ b/hbase-native-client/.dockerignore
@@ -0,0 +1,2 @@
+buck-out
+.buckd



[09/42] hbase git commit: HBASE-15761 Add on more server name tests

2016-05-18 Thread eclark
HBASE-15761 Add on more server name tests


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

Branch: refs/heads/HBASE-14850
Commit: 35b32b049bec24407e095afa2413b0cd92caf674
Parents: 361a395
Author: Elliott Clark 
Authored: Wed May 4 12:04:18 2016 -0700
Committer: Elliott Clark 
Committed: Wed May 18 15:48:52 2016 -0700

--
 hbase-native-client/serde/server-name-test.cc | 18 ++
 hbase-native-client/serde/server-name.h   |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/35b32b04/hbase-native-client/serde/server-name-test.cc
--
diff --git a/hbase-native-client/serde/server-name-test.cc 
b/hbase-native-client/serde/server-name-test.cc
index 35dcbc1..2281fa2 100644
--- a/hbase-native-client/serde/server-name-test.cc
+++ b/hbase-native-client/serde/server-name-test.cc
@@ -30,3 +30,21 @@ TEST(TestServerName, TestMakeServerName) {
   ASSERT_EQ("test", sn.host_name());
   ASSERT_EQ(123, sn.port());
 }
+
+TEST(TestServerName, TestIps) {
+  auto sn = folly::to("127.0.0.1:999");
+  ASSERT_EQ("127.0.0.1", sn.host_name());
+  ASSERT_EQ(999, sn.port());
+}
+
+TEST(TestServerName, TestThrow) {
+  ASSERT_ANY_THROW(folly::to("Ther's no colon here"));
+}
+
+TEST(TestServerName, TestIPV6) {
+  auto sn = folly::to("[1]:123");
+
+  ASSERT_EQ("[1]", sn.host_name());
+  ASSERT_EQ(123, sn.port());
+
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/35b32b04/hbase-native-client/serde/server-name.h
--
diff --git a/hbase-native-client/serde/server-name.h 
b/hbase-native-client/serde/server-name.h
index bdba087..9844465 100644
--- a/hbase-native-client/serde/server-name.h
+++ b/hbase-native-client/serde/server-name.h
@@ -12,7 +12,9 @@ template  void parseTo(String in, ServerName 
&out) {
   std::string s = folly::to(in);
 
   auto delim = s.rfind(":");
-  DCHECK(delim != std::string::npos);
+  if (delim == std::string::npos) {
+throw std::runtime_error("Couldn't parse server name");
+  }
   out.set_host_name(s.substr(0, delim));
   // Now keep everything after the : (delim + 1) to the end.
   out.set_port(folly::to(s.substr(delim + 1)));



[05/42] hbase git commit: HBASE-15841 Performance Evaluation tool total rows may not be set correctly

2016-05-18 Thread eclark
HBASE-15841 Performance Evaluation tool total rows may not be set correctly


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

Branch: refs/heads/HBASE-14850
Commit: 393bcd69f9a6088e2af7751619f973a43671b7aa
Parents: c1ada0a
Author: Jerry He 
Authored: Wed May 18 12:09:13 2016 -0700
Committer: Jerry He 
Committed: Wed May 18 12:09:13 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/393bcd69/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 02b994a..c85607d 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2143,8 +2143,7 @@ public class PerformanceEvaluation extends Configured 
implements Tool {
   // total size in GB specified
   opts.totalRows = (int) opts.size * rowsPerGB;
   opts.perClientRunRows = opts.totalRows / opts.numClientThreads;
-} else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) {
-  // number of rows specified
+} else {
   opts.totalRows = opts.perClientRunRows * opts.numClientThreads;
   opts.size = opts.totalRows / rowsPerGB;
 }



[03/42] hbase git commit: HBASE-15593 Time limit of scanning should be offered by client

2016-05-18 Thread eclark
HBASE-15593 Time limit of scanning should be offered by client

Signed-off-by: zhangduo 


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

Branch: refs/heads/HBASE-14850
Commit: 3bd9220f0ca315822ba2f5652add772b8c518f71
Parents: 7b5d539
Author: Phil Yang 
Authored: Wed May 18 13:25:15 2016 +0800
Committer: zhangduo 
Committed: Wed May 18 19:13:15 2016 +0800

--
 .../hadoop/hbase/ipc/AsyncRpcChannelImpl.java   |   2 +
 .../apache/hadoop/hbase/ipc/RpcClientImpl.java  |   1 +
 .../hbase/protobuf/generated/RPCProtos.java | 106 +--
 hbase-protocol/src/main/protobuf/RPC.proto  |   1 +
 .../org/apache/hadoop/hbase/ipc/CallRunner.java |   2 +-
 .../org/apache/hadoop/hbase/ipc/RpcServer.java  |  43 ++--
 .../hadoop/hbase/ipc/RpcServerInterface.java|   5 +
 .../hbase/regionserver/RSRpcServices.java   |   9 ++
 .../TestScannerHeartbeatMessages.java   |  19 ++--
 9 files changed, 161 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
index cd61b61..2b9000a 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
@@ -397,6 +397,8 @@ public class AsyncRpcChannelImpl implements AsyncRpcChannel 
{
   if (call.getPriority() != PayloadCarryingRpcController.PRIORITY_UNSET) {
 requestHeaderBuilder.setPriority(call.getPriority());
   }
+  requestHeaderBuilder.setTimeout(call.rpcTimeout > Integer.MAX_VALUE ?
+  Integer.MAX_VALUE : (int)call.rpcTimeout);
 
   RPCProtos.RequestHeader rh = requestHeaderBuilder.build();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
index a5d2482..00eea7a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
@@ -907,6 +907,7 @@ public class RpcClientImpl extends AbstractRpcClient {
   if (priority != PayloadCarryingRpcController.PRIORITY_UNSET) {
 builder.setPriority(priority);
   }
+  builder.setTimeout(call.timeout);
   RequestHeader requestHeader = builder.build();
 
   setupIOstreams();

http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
--
diff --git 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
index 2d4a430..d05eb57 100644
--- 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
+++ 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
@@ -3895,6 +3895,16 @@ public final class RPCProtos {
  * 
  */
 int getPriority();
+
+// optional uint32 timeout = 7;
+/**
+ * optional uint32 timeout = 7;
+ */
+boolean hasTimeout();
+/**
+ * optional uint32 timeout = 7;
+ */
+int getTimeout();
   }
   /**
* Protobuf type {@code hbase.pb.RequestHeader}
@@ -3997,6 +4007,11 @@ public final class RPCProtos {
   priority_ = input.readUInt32();
   break;
 }
+case 56: {
+  bitField0_ |= 0x0040;
+  timeout_ = input.readUInt32();
+  break;
+}
   }
 }
   } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -4210,6 +4225,22 @@ public final class RPCProtos {
   return priority_;
 }
 
+// optional uint32 timeout = 7;
+public static final int TIMEOUT_FIELD_NUMBER = 7;
+private int timeout_;
+/**
+ * optional uint32 timeout = 7;
+ */
+public boolean hasTimeout() {
+  return ((bitField0_ & 0x0040) == 0x0040);
+}
+/**
+ * optional uint32 timeout = 7;
+ */

[01/42] hbase git commit: Revert "HBASE-15593 Time limit of scanning should be offered by client (Phil Yang)" [Forced Update!]

2016-05-18 Thread eclark
Repository: hbase
Updated Branches:
  refs/heads/HBASE-14850 eb4b234a1 -> f49f262f3 (forced update)


Revert "HBASE-15593 Time limit of scanning should be offered by client (Phil 
Yang)"

This reverts commit e47bfb90786df6fa794af844028a4a0f50b3433c.


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

Branch: refs/heads/HBASE-14850
Commit: b2b3b1fa4d061b242970b335bbb87892537e5d99
Parents: 98fa263
Author: zhangduo 
Authored: Wed May 18 13:08:50 2016 +0800
Committer: zhangduo 
Committed: Wed May 18 13:08:50 2016 +0800

--
 .../hbase/protobuf/generated/RPCProtos.java | 106 ++-
 hbase-protocol/src/main/protobuf/RPC.proto  |   1 -
 .../org/apache/hadoop/hbase/ipc/CallRunner.java |   2 +-
 .../org/apache/hadoop/hbase/ipc/RpcServer.java  |  43 ++--
 .../hadoop/hbase/ipc/RpcServerInterface.java|   5 -
 .../hbase/regionserver/RSRpcServices.java   |   9 --
 .../TestScannerHeartbeatMessages.java   |  19 ++--
 7 files changed, 27 insertions(+), 158 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b2b3b1fa/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
--
diff --git 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
index d05eb57..2d4a430 100644
--- 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
+++ 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
@@ -3895,16 +3895,6 @@ public final class RPCProtos {
  * 
  */
 int getPriority();
-
-// optional uint32 timeout = 7;
-/**
- * optional uint32 timeout = 7;
- */
-boolean hasTimeout();
-/**
- * optional uint32 timeout = 7;
- */
-int getTimeout();
   }
   /**
* Protobuf type {@code hbase.pb.RequestHeader}
@@ -4007,11 +3997,6 @@ public final class RPCProtos {
   priority_ = input.readUInt32();
   break;
 }
-case 56: {
-  bitField0_ |= 0x0040;
-  timeout_ = input.readUInt32();
-  break;
-}
   }
 }
   } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -4225,22 +4210,6 @@ public final class RPCProtos {
   return priority_;
 }
 
-// optional uint32 timeout = 7;
-public static final int TIMEOUT_FIELD_NUMBER = 7;
-private int timeout_;
-/**
- * optional uint32 timeout = 7;
- */
-public boolean hasTimeout() {
-  return ((bitField0_ & 0x0040) == 0x0040);
-}
-/**
- * optional uint32 timeout = 7;
- */
-public int getTimeout() {
-  return timeout_;
-}
-
 private void initFields() {
   callId_ = 0;
   traceInfo_ = 
org.apache.hadoop.hbase.protobuf.generated.TracingProtos.RPCTInfo.getDefaultInstance();
@@ -4248,7 +4217,6 @@ public final class RPCProtos {
   requestParam_ = false;
   cellBlockMeta_ = 
org.apache.hadoop.hbase.protobuf.generated.RPCProtos.CellBlockMeta.getDefaultInstance();
   priority_ = 0;
-  timeout_ = 0;
 }
 private byte memoizedIsInitialized = -1;
 public final boolean isInitialized() {
@@ -4280,9 +4248,6 @@ public final class RPCProtos {
   if (((bitField0_ & 0x0020) == 0x0020)) {
 output.writeUInt32(6, priority_);
   }
-  if (((bitField0_ & 0x0040) == 0x0040)) {
-output.writeUInt32(7, timeout_);
-  }
   getUnknownFields().writeTo(output);
 }
 
@@ -4316,10 +4281,6 @@ public final class RPCProtos {
 size += com.google.protobuf.CodedOutputStream
   .computeUInt32Size(6, priority_);
   }
-  if (((bitField0_ & 0x0040) == 0x0040)) {
-size += com.google.protobuf.CodedOutputStream
-  .computeUInt32Size(7, timeout_);
-  }
   size += getUnknownFields().getSerializedSize();
   memoizedSerializedSize = size;
   return size;
@@ -4373,11 +4334,6 @@ public final class RPCProtos {
 result = result && (getPriority()
 == other.getPriority());
   }
-  result = result && (hasTimeout() == other.hasTimeout());
-  if (hasTimeout()) {
-result = result && (getTimeout()
-== other.getTimeout());
-  }
   result = result &&
   getUnknownFields().equals(other.getUnknownFields());
   return result;
@@ -4415,10 +4371,6 @@ public final class RPCProtos {
 hash = (37 * hash) + PRIORITY_FIELD_NU

hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/master 5ac54e6ab -> 8aa8abfcb


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/master
Commit: 8aa8abfcb672e4b905c487a10f1511db431f7006
Parents: 5ac54e6
Author: Stephen Yuan Jiang 
Authored: Wed May 18 09:41:13 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 13:22:41 2016 -0700

--
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8aa8abfc/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
index 165fea6..57bc77e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java
@@ -1472,7 +1472,8 @@ public class TestHBaseFsckOneRS extends BaseTestHBaseFsck 
{
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] 
{HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
+assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 final CountDownLatch latch = new CountDownLatch(1);
 new Thread() {
@@ -1496,24 +1497,27 @@ public class TestHBaseFsckOneRS extends 
BaseTestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
+// still one expired, one not-expired
 assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
-HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // still one 
expired, one not-expired
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] 
{HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
+assertErrors(hbck, new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK,
 HBaseFsck.ErrorReporter.ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are 
expired
 
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
+Configuration localConf = new Configuration(conf);
 // reaping from ZKInterProcessWriteLock uses znode cTime,
 // which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



[2/2] hbase git commit: HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set

2016-05-18 Thread mbertozzi
HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set


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

Branch: refs/heads/branch-1
Commit: e5eea96ca6c55f285f0fd8fb0b19c7d161650546
Parents: a997235
Author: Matteo Bertozzi 
Authored: Wed May 18 12:51:17 2016 -0700
Committer: Matteo Bertozzi 
Committed: Wed May 18 12:51:17 2016 -0700

--
 .../org/apache/hadoop/hbase/ClusterStatus.java  | 23 +++---
 .../hadoop/hbase/protobuf/ProtobufUtil.java | 14 -
 .../master/AssignmentManagerStatusTmpl.jamon| 33 +---
 .../hadoop/hbase/master/AssignmentManager.java  | 18 +--
 .../org/apache/hadoop/hbase/master/HMaster.java |  4 +--
 .../hadoop/hbase/master/MasterDumpServlet.java  |  9 +++---
 .../hadoop/hbase/master/RegionStates.java   |  6 ++--
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 12 +++
 .../hadoop/hbase/util/HBaseFsckRepair.java  | 12 ---
 .../apache/hadoop/hbase/TestDrainingServer.java |  7 ++---
 .../hbase/coprocessor/TestMasterObserver.java   | 13 
 .../org/apache/hadoop/hbase/master/Mocking.java | 21 -
 .../hbase/master/TestMasterStatusServlet.java   | 17 --
 .../TestSplitTransactionOnCluster.java  | 21 +
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 32 +--
 hbase-shell/src/main/ruby/hbase/admin.rb|  2 +-
 16 files changed, 106 insertions(+), 138 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e5eea96c/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
index f1e2d56..97b0ea2 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
@@ -24,7 +24,9 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
@@ -80,7 +82,7 @@ public class ClusterStatus extends VersionedWritable {
   private Collection deadServers;
   private ServerName master;
   private Collection backupMasters;
-  private Map intransition;
+  private Set intransition;
   private String clusterId;
   private String[] masterCoprocessors;
   private Boolean balancerOn;
@@ -102,7 +104,7 @@ public class ClusterStatus extends VersionedWritable {
   final Collection deadServers,
   final ServerName master,
   final Collection backupMasters,
-  final Map rit,
+  final Set rit,
   final String[] masterCoprocessors,
   final Boolean balancerOn) {
 this.hbaseVersion = hbaseVersion;
@@ -275,7 +277,7 @@ public class ClusterStatus extends VersionedWritable {
   }
 
   @InterfaceAudience.Private
-  public Map getRegionsInTransition() {
+  public Set getRegionsInTransition() {
 return this.intransition;
   }
 
@@ -354,7 +356,7 @@ public class ClusterStatus extends VersionedWritable {
 int ritSize = (intransition != null) ? intransition.size() : 0;
 sb.append("\nNumber of regions in transition: " + ritSize);
 if (ritSize > 0) {
-  for (RegionState state: intransition.values()) {
+  for (RegionState state: intransition) {
 sb.append("\n  " + state.toDescriptiveString());
   }
 }
@@ -388,11 +390,11 @@ public class ClusterStatus extends VersionedWritable {
 }
 
 if (intransition != null) {
-  for (Map.Entry rit : 
getRegionsInTransition().entrySet()) {
-ClusterStatusProtos.RegionState rs = rit.getValue().convert();
+  for (RegionState rit : getRegionsInTransition()) {
+ClusterStatusProtos.RegionState rs = rit.convert();
 RegionSpecifier.Builder spec =
 
RegionSpecifier.newBuilder().setType(RegionSpecifierType.REGION_NAME);
-spec.setValue(ByteStringer.wrap(Bytes.toBytes(rit.getKey(;
+spec.setValue(ByteStringer.wrap(rit.getRegion().getRegionName()));
 
 RegionInTransition pbRIT =
 
RegionInTransition.newBuilder().setSpec(spec.build()).setRegionState(rs).build();
@@ -461,13 +463,12 @@ public class ClusterStatus extends VersionedWritable {
   }
 }
 
-Map rit = null;
+Set rit = null;
 if (proto.getRegionsInTransitionList() != null) {
-  rit = new HashMap(proto.getRegionsInTransi

[1/2] hbase git commit: HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set

2016-05-18 Thread mbertozzi
Repository: hbase
Updated Branches:
  refs/heads/branch-1 a9972355c -> e5eea96ca
  refs/heads/master 393bcd69f -> 5ac54e6ab


HBASE-15843 Replace RegionState.getRegionInTransition() Map with a Set


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

Branch: refs/heads/master
Commit: 5ac54e6abb4e14f3d2fb2e013a7688d7043a60d3
Parents: 393bcd6
Author: Matteo Bertozzi 
Authored: Wed May 18 12:48:26 2016 -0700
Committer: Matteo Bertozzi 
Committed: Wed May 18 12:48:26 2016 -0700

--
 .../org/apache/hadoop/hbase/ClusterStatus.java  |  9 ++--
 .../hadoop/hbase/protobuf/ProtobufUtil.java | 15 +++
 .../hbase/rsgroup/RSGroupAdminServer.java   |  2 +-
 .../master/AssignmentManagerStatusTmpl.jamon| 43 +--
 .../hadoop/hbase/master/AssignmentManager.java  |  8 ++--
 .../org/apache/hadoop/hbase/master/HMaster.java |  4 +-
 .../hadoop/hbase/master/MasterDumpServlet.java  |  9 ++--
 .../hadoop/hbase/master/RegionStates.java   | 44 +---
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 14 +++
 .../hadoop/hbase/util/HBaseFsckRepair.java  | 12 --
 .../hbase/coprocessor/TestMasterObserver.java   |  6 +--
 .../hbase/master/TestMasterStatusServlet.java   | 19 -
 .../TestRegionMergeTransactionOnCluster.java|  2 +-
 .../TestSplitTransactionOnCluster.java  |  8 ++--
 .../hadoop/hbase/util/TestHBaseFsckOneRS.java   | 17 
 hbase-shell/src/main/ruby/hbase/admin.rb|  2 +-
 16 files changed, 103 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/5ac54e6a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
index bc97a95..ffeb51a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java
@@ -25,6 +25,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
@@ -80,7 +81,7 @@ public class ClusterStatus extends VersionedWritable {
   private Collection deadServers;
   private ServerName master;
   private Collection backupMasters;
-  private Map intransition;
+  private Set intransition;
   private String clusterId;
   private String[] masterCoprocessors;
   private Boolean balancerOn;
@@ -90,7 +91,7 @@ public class ClusterStatus extends VersionedWritable {
   final Collection deadServers,
   final ServerName master,
   final Collection backupMasters,
-  final Map rit,
+  final Set rit,
   final String[] masterCoprocessors,
   final Boolean balancerOn) {
 this.hbaseVersion = hbaseVersion;
@@ -261,7 +262,7 @@ public class ClusterStatus extends VersionedWritable {
   }
 
   @InterfaceAudience.Private
-  public Map getRegionsInTransition() {
+  public Set getRegionsInTransition() {
 return this.intransition;
   }
 
@@ -340,7 +341,7 @@ public class ClusterStatus extends VersionedWritable {
 int ritSize = (intransition != null) ? intransition.size() : 0;
 sb.append("\nNumber of regions in transition: " + ritSize);
 if (ritSize > 0) {
-  for (RegionState state: intransition.values()) {
+  for (RegionState state: intransition) {
 sb.append("\n  " + state.toDescriptiveString());
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/5ac54e6a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
index bbc13ab..e16a3a3 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
@@ -31,10 +31,12 @@ import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.NavigableSet;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hadoop.conf.Configuration;
@@ -3528

hbase git commit: HBASE-15841 Performance Evaluation tool total rows may not be set correctly

2016-05-18 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 98aa826b7 -> 58131946d


HBASE-15841 Performance Evaluation tool total rows may not be set correctly


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

Branch: refs/heads/branch-1.2
Commit: 58131946d0160fb9c8184afce929a1268939
Parents: 98aa826
Author: Jerry He 
Authored: Wed May 18 12:15:18 2016 -0700
Committer: Jerry He 
Committed: Wed May 18 12:16:18 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/58131946/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 05d788e..8af2a7e 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2084,8 +2084,7 @@ public class PerformanceEvaluation extends Configured 
implements Tool {
   // total size in GB specified
   opts.totalRows = (int) opts.size * rowsPerGB;
   opts.perClientRunRows = opts.totalRows / opts.numClientThreads;
-} else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) {
-  // number of rows specified
+} else {
   opts.totalRows = opts.perClientRunRows * opts.numClientThreads;
   opts.size = opts.totalRows / rowsPerGB;
 }



hbase git commit: HBASE-15841 Performance Evaluation tool total rows may not be set correctly

2016-05-18 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 8566fd0f1 -> 4b1221398


HBASE-15841 Performance Evaluation tool total rows may not be set correctly


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

Branch: refs/heads/branch-1.3
Commit: 4b1221398b18aaf749d522fb4f7b1594a7468aad
Parents: 8566fd0
Author: Jerry He 
Authored: Wed May 18 12:15:18 2016 -0700
Committer: Jerry He 
Committed: Wed May 18 12:18:20 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/4b122139/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 7dced80..12f5073 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2074,8 +2074,7 @@ public class PerformanceEvaluation extends Configured 
implements Tool {
   // total size in GB specified
   opts.totalRows = (int) opts.size * rowsPerGB;
   opts.perClientRunRows = opts.totalRows / opts.numClientThreads;
-} else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) {
-  // number of rows specified
+} else {
   opts.totalRows = opts.perClientRunRows * opts.numClientThreads;
   opts.size = opts.totalRows / rowsPerGB;
 }



hbase git commit: HBASE-15841 Performance Evaluation tool total rows may not be set correctly

2016-05-18 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/branch-1 49359a4ee -> a9972355c


HBASE-15841 Performance Evaluation tool total rows may not be set correctly


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

Branch: refs/heads/branch-1
Commit: a9972355c4c374f9350be37249b2d7acf84fcf5f
Parents: 49359a4
Author: Jerry He 
Authored: Wed May 18 12:15:18 2016 -0700
Committer: Jerry He 
Committed: Wed May 18 12:15:18 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/a9972355/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 7dced80..12f5073 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2074,8 +2074,7 @@ public class PerformanceEvaluation extends Configured 
implements Tool {
   // total size in GB specified
   opts.totalRows = (int) opts.size * rowsPerGB;
   opts.perClientRunRows = opts.totalRows / opts.numClientThreads;
-} else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) {
-  // number of rows specified
+} else {
   opts.totalRows = opts.perClientRunRows * opts.numClientThreads;
   opts.size = opts.totalRows / rowsPerGB;
 }



hbase git commit: HBASE-15841 Performance Evaluation tool total rows may not be set correctly

2016-05-18 Thread jerryjch
Repository: hbase
Updated Branches:
  refs/heads/master c1ada0a37 -> 393bcd69f


HBASE-15841 Performance Evaluation tool total rows may not be set correctly


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

Branch: refs/heads/master
Commit: 393bcd69f9a6088e2af7751619f973a43671b7aa
Parents: c1ada0a
Author: Jerry He 
Authored: Wed May 18 12:09:13 2016 -0700
Committer: Jerry He 
Committed: Wed May 18 12:09:13 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/393bcd69/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 02b994a..c85607d 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2143,8 +2143,7 @@ public class PerformanceEvaluation extends Configured 
implements Tool {
   // total size in GB specified
   opts.totalRows = (int) opts.size * rowsPerGB;
   opts.perClientRunRows = opts.totalRows / opts.numClientThreads;
-} else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) {
-  // number of rows specified
+} else {
   opts.totalRows = opts.perClientRunRows * opts.numClientThreads;
   opts.size = opts.totalRows / rowsPerGB;
 }



[1/5] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread enis
Repository: hbase
Updated Branches:
  refs/heads/branch-1 007852254 -> 49359a4ee
  refs/heads/branch-1.1 e4ef86cbd -> cf0dd5d4f
  refs/heads/branch-1.2 d14803534 -> 98aa826b7
  refs/heads/branch-1.3 d3d50338e -> 8566fd0f1
  refs/heads/master 3bd9220f0 -> c1ada0a37


HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/master
Commit: c1ada0a373561132a3359b48a27975b2e85978da
Parents: 3bd9220
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:36:10 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1ada0a3/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index 8b16a5b..84367b0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -144,9 +144,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -450,4 +447,4 @@ public class LocalHBaseCluster {
 connection.close();
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1ada0a3/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index 002bdb2..f788bed 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -86,6 +86,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



[5/5] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread enis
HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/branch-1.1
Commit: cf0dd5d4fe292a1a21b6103e4dca901d1e9009c3
Parents: e4ef86c
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:40:37 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/cf0dd5d4/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index e60f868..f70f73f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -143,9 +143,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -487,4 +484,4 @@ public class LocalHBaseCluster {
 }
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/cf0dd5d4/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index a3154d4..42f83ca 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -87,6 +87,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



[2/5] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread enis
HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/branch-1
Commit: 49359a4ee3713349190e056c1941c290c03fb1dd
Parents: 0078522
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:36:16 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/49359a4e/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index da38775..b98078a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -143,9 +143,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -447,4 +444,4 @@ public class LocalHBaseCluster {
 }
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/49359a4e/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index 002bdb2..f788bed 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -86,6 +86,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



[4/5] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread enis
HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/branch-1.2
Commit: 98aa826b78ed63f73cb7bde7f62eb75aa813151d
Parents: d148035
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:39:08 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/98aa826b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index afedbe9..e79d518 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -143,9 +143,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -487,4 +484,4 @@ public class LocalHBaseCluster {
 }
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/98aa826b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index 68f4c13..64470f3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -87,6 +87,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



[3/5] hbase git commit: HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM

2016-05-18 Thread enis
HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM


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

Branch: refs/heads/branch-1.3
Commit: 8566fd0f1ec4ae0bcbadb0550d6b857402ee6f49
Parents: d3d5033
Author: Enis Soztutar 
Authored: Wed May 18 11:36:10 2016 -0700
Committer: Enis Soztutar 
Committed: Wed May 18 11:37:40 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java| 5 +
 .../src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8566fd0f/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index da38775..b98078a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -143,9 +143,6 @@ public class LocalHBaseCluster {
 // Always have masters and regionservers come up on port '0' so we don't
 // clash over default ports.
 conf.set(HConstants.MASTER_PORT, "0");
-if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
-  conf.set(HConstants.MASTER_INFO_PORT, "0");
-}
 conf.set(HConstants.REGIONSERVER_PORT, "0");
 if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
   conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -447,4 +444,4 @@ public class LocalHBaseCluster {
 }
 cluster.shutdown();
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/8566fd0f/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
index 002bdb2..f788bed 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
@@ -86,6 +86,9 @@ public class MiniHBaseCluster extends HBaseCluster {
   throws IOException, InterruptedException {
 super(conf);
 conf.set(HConstants.MASTER_PORT, "0");
+if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+  conf.set(HConstants.MASTER_INFO_PORT, "0");
+}
 
 // Hadoop 2
 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();



hbase git commit: HBASE-15125 HBaseFsck's adoptHdfsOrphan function creates region with wrong end key boundary (chenrongwei)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 55212d531 -> e4ef86cbd


HBASE-15125 HBaseFsck's adoptHdfsOrphan function creates region with wrong end 
key boundary (chenrongwei)


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

Branch: refs/heads/branch-1.1
Commit: e4ef86cbdf373df7f436a11c485280df566859a1
Parents: 55212d5
Author: Stephen Yuan Jiang 
Authored: Wed May 18 08:34:46 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 08:34:46 2016 -0700

--
 .../org/apache/hadoop/hbase/util/HBaseFsck.java |  3 +-
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 62 +++-
 2 files changed, 63 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e4ef86cb/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
--
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 e14c858..7962f99 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
@@ -916,7 +916,8 @@ public class HBaseFsck extends Configured implements 
Closeable {
 Bytes.toString(orphanRegionRange.getSecond()) + ")");
 
 // create new region on hdfs.  move data into place.
-HRegionInfo hri = new HRegionInfo(template.getTableName(), 
orphanRegionRange.getFirst(), orphanRegionRange.getSecond());
+HRegionInfo hri = new HRegionInfo(template.getTableName(), 
orphanRegionRange.getFirst(),
+  Bytes.add(orphanRegionRange.getSecond(), new byte[1]));
 LOG.info("Creating new region : " + hri);
 HRegion region = HBaseFsckRepair.createHDFSRegionDir(getConf(), hri, 
template);
 Path target = region.getRegionFileSystem().getRegionDir();

http://git-wip-us.apache.org/repos/asf/hbase/blob/e4ef86cb/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 3731a51..153b0cd 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -447,7 +447,7 @@ public class TestHBaseFsck {
   }
 
   /**
-   * Counts the number of row to verify data loss or non-dataloss.
+   * Counts the number of rows to verify data loss or non-dataloss.
*/
   int countRows() throws IOException {
  Scan s = new Scan();
@@ -460,6 +460,19 @@ public class TestHBaseFsck {
   }
 
   /**
+   * Counts the number of rows to verify data loss or non-dataloss.
+   */
+  int countRows(byte[] start, byte[] end) throws IOException {
+Scan s = new Scan(start, end);
+ResultScanner rs = tbl.getScanner(s);
+int i = 0;
+while (rs.next() != null) {
+  i++;
+}
+return i;
+  }
+
+  /**
* delete table in preparation for next test
*
* @param tablename
@@ -1227,6 +1240,53 @@ public class TestHBaseFsck {
   }
 
   /**
+   * This creates and fixes a bad table with a missing region -- hole in meta 
and data present but
+   * .regioninfo missing (an orphan hdfs region)in the fs. At last we check 
every row was present
+   * at the correct region.
+   */
+  @Test(timeout = 18)
+  public void testHDFSRegioninfoMissingAndCheckRegionBoundary() throws 
Exception {
+TableName table = 
TableName.valueOf("testHDFSRegioninfoMissingAndCheckRegionBoundary");
+try {
+  setupTable(table);
+  assertEquals(ROWKEYS.length, countRows());
+
+  // Mess it up by leaving a hole in the meta data
+  admin.disableTable(table);
+  deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes("B"), 
Bytes.toBytes("C"), true,
+true, false, true, HRegionInfo.DEFAULT_REPLICA_ID);
+  admin.enableTable(table);
+
+  HBaseFsck hbck = doFsck(conf, false);
+  assertErrors(hbck,
+new HBaseFsck.ErrorReporter.ERROR_CODE[] {
+HBaseFsck.ErrorReporter.ERROR_CODE.ORPHAN_HDFS_REGION,
+HBaseFsck.ErrorReporter.ERROR_CODE.NOT_IN_META_OR_DEPLOYED,
+HBaseFsck.ErrorReporter.ERROR_CODE.HOLE_IN_REGION_CHAIN });
+  // holes are separate from overlap groups
+  assertEquals(0, hbck.getOverlapGroups(table).size());
+
+  // fix hole
+  doFsck(conf, true);
+
+  // check that hole fixed
+  assertNoErrors(doFsck(conf, fa

hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 7c0fc0d6c -> d14803534


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/branch-1.2
Commit: d14803534b93fc393535a7314f3596b3ba4c95c4
Parents: 7c0fc0d
Author: Stephen Yuan Jiang 
Authored: Wed May 18 07:12:29 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 09:21:24 2016 -0700

--
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/d1480353/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 8f2f2da..322bc74 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -2523,20 +2523,26 @@ public class TestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK}); // 
still one expired, one not-expired
+// still one expired, one not-expired
+assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
-
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1); // reaping 
from ZKInterProcessWriteLock uses znode cTime,
- // which is 
not injectable through EnvironmentEdge
+// both are expired
+assertErrors(
+  hbck,
+  new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK});
+
+Configuration localConf = new Configuration(conf);
+// reaping from ZKInterProcessWriteLock uses znode cTime,
+// which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 fc733bd31 -> d3d50338e


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/branch-1.3
Commit: d3d50338e742bc7b2e6fbd73cc48d176d8f24409
Parents: fc733bd
Author: Stephen Yuan Jiang 
Authored: Wed May 18 07:12:29 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 09:10:11 2016 -0700

--
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/d3d50338/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 343f2a9..6b7c304 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -2575,20 +2575,26 @@ public class TestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK}); // 
still one expired, one not-expired
+// still one expired, one not-expired
+assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
-
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1); // reaping 
from ZKInterProcessWriteLock uses znode cTime,
- // which is 
not injectable through EnvironmentEdge
+// both are expired
+assertErrors(
+  hbck,
+  new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK});
+
+Configuration localConf = new Configuration(conf);
+// reaping from ZKInterProcessWriteLock uses znode cTime,
+// which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1 ce43e3387 -> 007852254


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/branch-1
Commit: 00785225494ee2b7eca248e5d0d5ef5ff56b6003
Parents: ce43e33
Author: Stephen Yuan Jiang 
Authored: Wed May 18 07:12:29 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 07:13:39 2016 -0700

--
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/00785225/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 343f2a9..6b7c304 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -2575,20 +2575,26 @@ public class TestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK}); // 
still one expired, one not-expired
+// still one expired, one not-expired
+assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
-
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1); // reaping 
from ZKInterProcessWriteLock uses znode cTime,
- // which is 
not injectable through EnvironmentEdge
+// both are expired
+assertErrors(
+  hbck,
+  new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK});
+
+Configuration localConf = new Configuration(conf);
+// reaping from ZKInterProcessWriteLock uses znode cTime,
+// which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



hbase git commit: HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)

2016-05-18 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 ce6f111a3 -> 55212d531


HBASE-15850 Localize the configuration change in testCheckTableLocks to reduce 
flakiness of TestHBaseFsck test suite (Stephen Yuan Jiang)


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

Branch: refs/heads/branch-1.1
Commit: 55212d53139d197e1fd499592c2ff9a390ed60c5
Parents: ce6f111
Author: Stephen Yuan Jiang 
Authored: Wed May 18 07:12:29 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed May 18 07:12:29 2016 -0700

--
 .../apache/hadoop/hbase/util/TestHBaseFsck.java | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/55212d53/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
index 04ee249..3731a51 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
@@ -2465,20 +2465,26 @@ public class TestHBaseFsck {
 Threads.sleep(300); // wait some more to ensure writeLock.acquire() is 
called
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK}); // 
still one expired, one not-expired
+// still one expired, one not-expired
+assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK});
 
 edge.incrementTime(conf.getLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT,
 TableLockManager.DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS)); // let table 
lock expire
 
 hbck = doFsck(conf, false);
-assertErrors(hbck, new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK}); // both are expired
-
-conf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1); // reaping 
from ZKInterProcessWriteLock uses znode cTime,
- // which is 
not injectable through EnvironmentEdge
+// both are expired
+assertErrors(
+  hbck,
+  new ERROR_CODE[] {ERROR_CODE.EXPIRED_TABLE_LOCK, 
ERROR_CODE.EXPIRED_TABLE_LOCK});
+
+Configuration localConf = new Configuration(conf);
+// reaping from ZKInterProcessWriteLock uses znode cTime,
+// which is not injectable through EnvironmentEdge
+localConf.setLong(TableLockManager.TABLE_LOCK_EXPIRE_TIMEOUT, 1);
 Threads.sleep(10);
-hbck = doFsck(conf, true); // now fix both cases
+hbck = doFsck(localConf, true); // now fix both cases
 
-hbck = doFsck(conf, false);
+hbck = doFsck(localConf, false);
 assertNoErrors(hbck);
 
 // ensure that locks are deleted



hbase git commit: HBASE-15593 Time limit of scanning should be offered by client

2016-05-18 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/master 7b5d5394c -> 3bd9220f0


HBASE-15593 Time limit of scanning should be offered by client

Signed-off-by: zhangduo 


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

Branch: refs/heads/master
Commit: 3bd9220f0ca315822ba2f5652add772b8c518f71
Parents: 7b5d539
Author: Phil Yang 
Authored: Wed May 18 13:25:15 2016 +0800
Committer: zhangduo 
Committed: Wed May 18 19:13:15 2016 +0800

--
 .../hadoop/hbase/ipc/AsyncRpcChannelImpl.java   |   2 +
 .../apache/hadoop/hbase/ipc/RpcClientImpl.java  |   1 +
 .../hbase/protobuf/generated/RPCProtos.java | 106 +--
 hbase-protocol/src/main/protobuf/RPC.proto  |   1 +
 .../org/apache/hadoop/hbase/ipc/CallRunner.java |   2 +-
 .../org/apache/hadoop/hbase/ipc/RpcServer.java  |  43 ++--
 .../hadoop/hbase/ipc/RpcServerInterface.java|   5 +
 .../hbase/regionserver/RSRpcServices.java   |   9 ++
 .../TestScannerHeartbeatMessages.java   |  19 ++--
 9 files changed, 161 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
index cd61b61..2b9000a 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannelImpl.java
@@ -397,6 +397,8 @@ public class AsyncRpcChannelImpl implements AsyncRpcChannel 
{
   if (call.getPriority() != PayloadCarryingRpcController.PRIORITY_UNSET) {
 requestHeaderBuilder.setPriority(call.getPriority());
   }
+  requestHeaderBuilder.setTimeout(call.rpcTimeout > Integer.MAX_VALUE ?
+  Integer.MAX_VALUE : (int)call.rpcTimeout);
 
   RPCProtos.RequestHeader rh = requestHeaderBuilder.build();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
index a5d2482..00eea7a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
@@ -907,6 +907,7 @@ public class RpcClientImpl extends AbstractRpcClient {
   if (priority != PayloadCarryingRpcController.PRIORITY_UNSET) {
 builder.setPriority(priority);
   }
+  builder.setTimeout(call.timeout);
   RequestHeader requestHeader = builder.build();
 
   setupIOstreams();

http://git-wip-us.apache.org/repos/asf/hbase/blob/3bd9220f/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
--
diff --git 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
index 2d4a430..d05eb57 100644
--- 
a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
+++ 
b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java
@@ -3895,6 +3895,16 @@ public final class RPCProtos {
  * 
  */
 int getPriority();
+
+// optional uint32 timeout = 7;
+/**
+ * optional uint32 timeout = 7;
+ */
+boolean hasTimeout();
+/**
+ * optional uint32 timeout = 7;
+ */
+int getTimeout();
   }
   /**
* Protobuf type {@code hbase.pb.RequestHeader}
@@ -3997,6 +4007,11 @@ public final class RPCProtos {
   priority_ = input.readUInt32();
   break;
 }
+case 56: {
+  bitField0_ |= 0x0040;
+  timeout_ = input.readUInt32();
+  break;
+}
   }
 }
   } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -4210,6 +4225,22 @@ public final class RPCProtos {
   return priority_;
 }
 
+// optional uint32 timeout = 7;
+public static final int TIMEOUT_FIELD_NUMBER = 7;
+private int timeout_;
+/**
+ * optional uint32 timeout = 7;
+ */
+public boolean hasTimeout() {
+  return ((bitField0_ & 0x0040) ==

hbase git commit: HBASE-15784 Misuse core/maxPoolSize of LinkedBlockingQueue in ThreadPoolExecutor (Jingcheng Du)

2016-05-18 Thread ramkrishna
Repository: hbase
Updated Branches:
  refs/heads/master b2b3b1fa4 -> 7b5d5394c


HBASE-15784 Misuse core/maxPoolSize of LinkedBlockingQueue in
ThreadPoolExecutor (Jingcheng Du)


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

Branch: refs/heads/master
Commit: 7b5d5394c08e4d5a18c8f9fc62b45930bf892f41
Parents: b2b3b1f
Author: Ramkrishna 
Authored: Wed May 18 12:40:43 2016 +0530
Committer: Ramkrishna 
Committed: Wed May 18 12:40:43 2016 +0530

--
 .../hadoop/hbase/client/ConnectionImplementation.java | 10 ++
 hbase-client/src/test/resources/hbase-site.xml|  4 
 .../hbase/replication/regionserver/HFileReplicator.java   |  2 +-
 .../regionserver/RegionReplicaReplicationEndpoint.java|  6 +-
 .../org/apache/hadoop/hbase/util/MultiHConnection.java|  6 +-
 .../org/apache/hadoop/hbase/util/TestHBaseFsckMOB.java|  1 -
 .../org/apache/hadoop/hbase/util/TestHBaseFsckOneRS.java  |  1 -
 .../apache/hadoop/hbase/util/TestHBaseFsckReplicas.java   |  1 -
 .../org/apache/hadoop/hbase/util/TestHBaseFsckTwoRS.java  |  1 -
 hbase-server/src/test/resources/hbase-site.xml|  4 
 .../hadoop/hbase/thrift/TBoundedThreadPoolServer.java | 10 +++---
 .../apache/hadoop/hbase/thrift/ThriftServerRunner.java|  6 --
 12 files changed, 20 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
index 9a7dfc7..429e47d 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
@@ -352,8 +352,8 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
 if (batchPool == null) {
   synchronized (this) {
 if (batchPool == null) {
-  this.batchPool = 
getThreadPool(conf.getInt("hbase.hconnection.threads.max", 256),
-  conf.getInt("hbase.hconnection.threads.core", 256), "-shared", 
null);
+  int threads = conf.getInt("hbase.hconnection.threads.max", 256);
+  this.batchPool = getThreadPool(threads, threads, "-shared", null);
   this.cleanupPool = true;
 }
   }
@@ -377,6 +377,7 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
 new LinkedBlockingQueue(maxThreads *
 conf.getInt(HConstants.HBASE_CLIENT_MAX_TOTAL_TASKS,
 HConstants.DEFAULT_HBASE_CLIENT_MAX_TOTAL_TASKS));
+  coreThreads = maxThreads;
 }
 ThreadPoolExecutor tpe = new ThreadPoolExecutor(
 coreThreads,
@@ -397,9 +398,10 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
   //To start with, threads.max.core threads can hit the meta 
(including replicas).
   //After that, requests will get queued up in the passed queue, and 
only after
   //the queue is full, a new thread will be started
+  int threads = 
conf.getInt("hbase.hconnection.meta.lookup.threads.max", 128);
   this.metaLookupPool = getThreadPool(
- conf.getInt("hbase.hconnection.meta.lookup.threads.max", 128),
- conf.getInt("hbase.hconnection.meta.lookup.threads.core", 10),
+ threads,
+ threads,
  "-metaLookup-shared-", new LinkedBlockingQueue());
 }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-client/src/test/resources/hbase-site.xml
--
diff --git a/hbase-client/src/test/resources/hbase-site.xml 
b/hbase-client/src/test/resources/hbase-site.xml
index 5788238..99d2ab8 100644
--- a/hbase-client/src/test/resources/hbase-site.xml
+++ b/hbase-client/src/test/resources/hbase-site.xml
@@ -26,10 +26,6 @@
 true
   
   
-hbase.hconnection.meta.lookup.threads.core
-4
-  
-  
 hbase.hconnection.threads.keepalivetime
 3
   

http://git-wip-us.apache.org/repos/asf/hbase/blob/7b5d5394/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HFileReplicator.java
 
b/hbase-server/src/main/java/org