hbase git commit: HBASE-16486 Unify system table creation using the same createSystemTable API (Stephen Yuan Jiang)

2016-08-24 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 70daa23ea -> 258e38100


HBASE-16486 Unify system table creation using the same createSystemTable API 
(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/258e3810
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/258e3810
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/258e3810

Branch: refs/heads/branch-1.3
Commit: 258e381001b71a090e54c25ee4e17fd1b2497bf5
Parents: 70daa23
Author: Stephen Yuan Jiang 
Authored: Wed Aug 24 21:59:33 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed Aug 24 22:01:15 2016 -0700

--
 .../org/apache/hadoop/hbase/master/HMaster.java | 24 
 .../hadoop/hbase/master/MasterServices.java |  7 ++
 .../hbase/master/TableNamespaceManager.java | 12 +-
 .../hadoop/hbase/quotas/MasterQuotaManager.java |  8 +--
 .../security/access/AccessControlLists.java |  9 
 .../visibility/VisibilityController.java|  2 +-
 .../hadoop/hbase/master/TestCatalogJanitor.java |  5 
 7 files changed, 43 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/258e3810/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index bb7459a..5fb8344 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1565,6 +1565,30 @@ public class HMaster extends HRegionServer implements 
MasterServices, Server {
 return procId;
   }
 
+  @Override
+  public long createSystemTable(final HTableDescriptor hTableDescriptor) 
throws IOException {
+if (isStopped()) {
+  throw new MasterNotRunningException();
+}
+
+TableName tableName = hTableDescriptor.getTableName();
+if (!(tableName.isSystemTable())) {
+  throw new IllegalArgumentException(
+"Only system table creation can use this createSystemTable API");
+}
+
+HRegionInfo[] newRegions = 
ModifyRegionUtils.createHRegionInfos(hTableDescriptor, null);
+
+LOG.info(getClientIdAuditPrefix() + " create " + hTableDescriptor);
+
+// This special create table is called locally to master.  Therefore, no 
RPC means no need
+// to use nonce to detect duplicated RPC call.
+long procId = this.procedureExecutor.submitProcedure(
+  new CreateTableProcedure(procedureExecutor.getEnvironment(), 
hTableDescriptor, newRegions));
+
+return procId;
+  }
+
   /**
* Checks whether the table conforms to some sane limits, and configured
* values (compression, etc) work. Throws an exception if something is wrong.

http://git-wip-us.apache.org/repos/asf/hbase/blob/258e3810/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
index a1bcd7d..ac7fa67 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
@@ -122,6 +122,13 @@ public interface MasterServices extends Server {
   final long nonce) throws IOException;
 
   /**
+   * Create a system table using the given table definition.
+   * @param hTableDescriptor The system table definition
+   * a single region is created.
+   */
+  long createSystemTable(final HTableDescriptor hTableDescriptor) throws 
IOException;
+
+  /**
* Delete a table
* @param tableName The table name
* @param nonceGroup

http://git-wip-us.apache.org/repos/asf/hbase/blob/258e3810/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
index e82cb31..afc8a21 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
@@ -30,7 +30,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionI

hbase git commit: HBASE-16486 Unify system table creation using the same createSystemTable API (Stephen Yuan Jiang)

2016-08-24 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/branch-1 440079951 -> 86d570b95


HBASE-16486 Unify system table creation using the same createSystemTable API 
(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/86d570b9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/86d570b9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/86d570b9

Branch: refs/heads/branch-1
Commit: 86d570b9595408180e15ebe05d4e827b325b
Parents: 4400799
Author: Stephen Yuan Jiang 
Authored: Wed Aug 24 21:59:33 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed Aug 24 21:59:33 2016 -0700

--
 .../org/apache/hadoop/hbase/master/HMaster.java | 24 
 .../hadoop/hbase/master/MasterServices.java |  7 ++
 .../hbase/master/TableNamespaceManager.java | 12 +-
 .../hadoop/hbase/quotas/MasterQuotaManager.java |  8 +--
 .../security/access/AccessControlLists.java |  9 
 .../visibility/VisibilityController.java|  2 +-
 .../hadoop/hbase/master/TestCatalogJanitor.java |  5 
 7 files changed, 43 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/86d570b9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 19bd484..8952a66 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1601,6 +1601,30 @@ public class HMaster extends HRegionServer implements 
MasterServices, Server {
 return procId;
   }
 
+  @Override
+  public long createSystemTable(final HTableDescriptor hTableDescriptor) 
throws IOException {
+if (isStopped()) {
+  throw new MasterNotRunningException();
+}
+
+TableName tableName = hTableDescriptor.getTableName();
+if (!(tableName.isSystemTable())) {
+  throw new IllegalArgumentException(
+"Only system table creation can use this createSystemTable API");
+}
+
+HRegionInfo[] newRegions = 
ModifyRegionUtils.createHRegionInfos(hTableDescriptor, null);
+
+LOG.info(getClientIdAuditPrefix() + " create " + hTableDescriptor);
+
+// This special create table is called locally to master.  Therefore, no 
RPC means no need
+// to use nonce to detect duplicated RPC call.
+long procId = this.procedureExecutor.submitProcedure(
+  new CreateTableProcedure(procedureExecutor.getEnvironment(), 
hTableDescriptor, newRegions));
+
+return procId;
+  }
+
   /**
* Checks whether the table conforms to some sane limits, and configured
* values (compression, etc) work. Throws an exception if something is wrong.

http://git-wip-us.apache.org/repos/asf/hbase/blob/86d570b9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
index e42fae5..015e201 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterServices.java
@@ -128,6 +128,13 @@ public interface MasterServices extends Server {
   final long nonce) throws IOException;
 
   /**
+   * Create a system table using the given table definition.
+   * @param hTableDescriptor The system table definition
+   * a single region is created.
+   */
+  long createSystemTable(final HTableDescriptor hTableDescriptor) throws 
IOException;
+
+  /**
* Delete a table
* @param tableName The table name
* @param nonceGroup

http://git-wip-us.apache.org/repos/asf/hbase/blob/86d570b9/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
index e82cb31..afc8a21 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
@@ -30,7 +30,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.HRegionInfo;

hbase git commit: HBASE-16462 TestRSGroupsBas#testGroupBalance may hang due to uneven region distribution (Guangxu Cheng)

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master a1f760ff7 -> 44c9021d6


HBASE-16462 TestRSGroupsBas#testGroupBalance may hang due to uneven region 
distribution (Guangxu Cheng)


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

Branch: refs/heads/master
Commit: 44c9021d67b0e922e1d2f5f53908742aceab6c80
Parents: a1f760f
Author: tedyu 
Authored: Wed Aug 24 21:55:37 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 21:55:37 2016 -0700

--
 .../test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java| 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/44c9021d/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
--
diff --git 
a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java 
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
index 25c54b2..73e021e 100644
--- 
a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
+++ 
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
@@ -68,6 +68,8 @@ public class TestRSGroups extends TestRSGroupsBase {
   @BeforeClass
   public static void setUp() throws Exception {
 TEST_UTIL = new HBaseTestingUtility();
+TEST_UTIL.getConfiguration().setFloat(
+"hbase.master.balancer.stochastic.tableSkewCost", 6000);
 TEST_UTIL.getConfiguration().set(
 HConstants.HBASE_MASTER_LOADBALANCER_CLASS,
 RSGroupBasedLoadBalancer.class.getName());



[1/2] hbase git commit: HBASE-16464 archive folder grows bigger and bigger due to corrupt snapshot under tmp dir

2016-08-24 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 3c4e8c16f -> 99a82bebd


HBASE-16464 archive folder grows bigger and bigger due to corrupt snapshot 
under tmp dir


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

Branch: refs/heads/0.98
Commit: ab011391ab392f1a62b6ea9bdca87fc950af42a9
Parents: 3c4e8c1
Author: chenheng 
Authored: Mon Aug 22 16:45:20 2016 +0800
Committer: Andrew Purtell 
Committed: Wed Aug 24 18:12:48 2016 -0700

--
 .../master/snapshot/SnapshotFileCache.java  | 17 -
 .../master/snapshot/TakeSnapshotHandler.java|  2 +-
 .../snapshot/SnapshotDescriptionUtils.java  | 14 ++
 .../hbase/snapshot/SnapshotManifestV2.java  | 18 --
 .../snapshot/TestSnapshotHFileCleaner.java  | 20 
 .../hbase/snapshot/SnapshotTestingUtils.java| 12 
 6 files changed, 75 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/ab011391/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
index dfd3cb5..5b367c5 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
@@ -39,6 +39,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.Stoppable;
+import org.apache.hadoop.hbase.snapshot.CorruptedSnapshotException;
 import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils;
 import org.apache.hadoop.hbase.util.FSUtils;
 
@@ -300,7 +301,21 @@ public class SnapshotFileCache implements Stoppable {
 FileStatus[] running = FSUtils.listStatus(fs, snapshotTmpDir);
 if (running != null) {
   for (FileStatus run : running) {
-
snapshotInProgress.addAll(fileInspector.filesUnderSnapshot(run.getPath()));
+try {
+  
snapshotInProgress.addAll(fileInspector.filesUnderSnapshot(run.getPath()));
+} catch (CorruptedSnapshotException e) {
+  // See HBASE-16464
+  if (e.getCause() instanceof FileNotFoundException) {
+// If the snapshot is not in progress, we will delete it
+if (!fs.exists(new Path(run.getPath(),
+  SnapshotDescriptionUtils.SNAPSHOT_IN_PROGRESS))) {
+  fs.delete(run.getPath(), true);
+  LOG.warn("delete the " + run.getPath() + " due to exception:", 
e.getCause());
+}
+  } else {
+throw e;
+  }
+}
   }
 }
 return snapshotInProgress;

http://git-wip-us.apache.org/repos/asf/hbase/blob/ab011391/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
index 806975a..acd8161 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
@@ -161,7 +161,7 @@ public abstract class TakeSnapshotHandler extends 
EventHandler implements Snapsh
 try {
   // If regions move after this meta scan, the region specific snapshot 
should fail, triggering
   // an external exception that gets captured here.
-
+  SnapshotDescriptionUtils.createInProgressTag(workingDir, fs);
   // write down the snapshot info in the working directory
   SnapshotDescriptionUtils.writeSnapshotInfo(snapshot, workingDir, fs);
   snapshotManifest.addTableDescriptor(this.htd);

http://git-wip-us.apache.org/repos/asf/hbase/blob/ab011391/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java
index fc5037a..ef28ccc 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java

[2/2] hbase git commit: HBASE-16495 When accessed via Thrift, all column families have timeToLive equal to -1 (Tigran Saluev)

2016-08-24 Thread apurtell
HBASE-16495 When accessed via Thrift, all column families have timeToLive equal 
to -1 (Tigran Saluev)


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

Branch: refs/heads/0.98
Commit: 99a82bebd97f6303d0144cda08f18b84216d0010
Parents: ab01139
Author: tedyu 
Authored: Wed Aug 24 13:40:08 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 18:14:38 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/99a82beb/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
index 6c2b7b5..036dbf8 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
@@ -90,6 +90,7 @@ public class ThriftUtilities {
 col.inMemory = in.isInMemory();
 col.blockCacheEnabled = in.isBlockCacheEnabled();
 col.bloomFilterType = in.getBloomFilterType().toString();
+col.timeToLive = in.getTimeToLive();
 return col;
   }
 



[2/4] hbase git commit: HBASE-16377 ServerName check is ineffective in region_mover.rb

2016-08-24 Thread apurtell
HBASE-16377 ServerName check is ineffective in region_mover.rb


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

Branch: refs/heads/0.98
Commit: 62690dfba8b6f799ca26adde8a6dd4a8ff9cd0bd
Parents: 5987620
Author: tedyu 
Authored: Tue Aug 9 18:21:18 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:53:51 2016 -0700

--
 bin/region_mover.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/62690dfb/bin/region_mover.rb
--
diff --git a/bin/region_mover.rb b/bin/region_mover.rb
index 91bfd93..a734ccb 100644
--- a/bin/region_mover.rb
+++ b/bin/region_mover.rb
@@ -73,7 +73,7 @@ def getServerNameForRegion(admin, r)
 sleep 0.1
   end
   # Make a fake servername by appending ','
-  metaServer = tracker.getMetaRegionLocation().toString() + ","
+  metaServer = (tracker.getMetaRegionLocation().toString() + ",").to_s
   tracker.stop()
   return metaServer
 ensure
@@ -385,7 +385,7 @@ def loadRegions(options, hostname, port)
 end
 next unless exists
 currentServer = getServerNameForRegion(admin, r)
-if currentServer and currentServer == servername
+if currentServer and servername and currentServer == servername.to_s
   $LOG.info("Region " + r.getRegionNameAsString() + " (" + counter.to_s +
 " of " + regions.length.to_s + ") already on target server=" + 
servername)
   counter = counter + 1



[3/4] hbase git commit: HBASE-16379 [replication] Minor improvement to replication/copy_tables_desc.rb

2016-08-24 Thread apurtell
HBASE-16379 [replication] Minor improvement to replication/copy_tables_desc.rb


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

Branch: refs/heads/0.98
Commit: c2830638709897fd53baece55f7a22848a932b93
Parents: 62690df
Author: Esteban Gutierrez 
Authored: Mon Aug 8 16:10:29 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:54:36 2016 -0700

--
 bin/replication/copy_tables_desc.rb | 41 +---
 1 file changed, 33 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c2830638/bin/replication/copy_tables_desc.rb
--
diff --git a/bin/replication/copy_tables_desc.rb 
b/bin/replication/copy_tables_desc.rb
index bc70031..07b17a8 100644
--- a/bin/replication/copy_tables_desc.rb
+++ b/bin/replication/copy_tables_desc.rb
@@ -27,7 +27,6 @@ include Java
 import org.apache.commons.logging.LogFactory
 import org.apache.hadoop.hbase.HBaseConfiguration
 import org.apache.hadoop.hbase.HConstants
-import org.apache.hadoop.hbase.EmptyWatcher
 import org.apache.hadoop.hbase.client.HBaseAdmin
 import org.apache.hadoop.hbase.HTableDescriptor
 import org.apache.hadoop.conf.Configuration
@@ -37,11 +36,32 @@ NAME = "copy_tables_desc"
 
 # Print usage for this script
 def usage
-  puts 'Usage: %s.rb master_zookeeper.quorum.peers:clientport:znode_parent 
slave_zookeeper.quorum.peers:clientport:znode_parent' % NAME
+  puts 'Usage: %s.rb master_zookeeper.quorum.peers:clientport:znode_parent 
slave_zookeeper.quorum.peers:clientport:znode_parent 
[table1,table2,table3,...]' % NAME
   exit!
 end
 
-if ARGV.size != 2
+def copy (src, dst, table)
+  # verify if table exists in source cluster
+  begin
+t = src.getTableDescriptor(table.to_java_bytes)
+  rescue org.apache.hadoop.hbase.TableNotFoundException
+puts "Source table \"%s\" doesn't exist, skipping." % table
+return
+  end
+
+  # verify if table *doesn't* exists in the target cluster
+  begin
+dst.createTable(t)
+  rescue org.apache.hadoop.hbase.TableExistsException
+puts "Destination table \"%s\" exists in remote cluster, skipping." % table
+return
+  end
+
+  puts "Schema for table \"%s\" was succesfully copied to remote cluster." % 
table
+end
+
+
+if ARGV.size < 2 || ARGV.size > 3
   usage
 end
 
@@ -51,6 +71,8 @@ parts1 = ARGV[0].split(":")
 
 parts2 = ARGV[1].split(":")
 
+parts3 = ARGV[2].split(",") unless ARGV[2].nil?
+
 c1 = HBaseConfiguration.create()
 c1.set(HConstants::ZOOKEEPER_QUORUM, parts1[0])
 c1.set("hbase.zookeeper.property.clientPort", parts1[1])
@@ -65,9 +87,12 @@ c2.set(HConstants::ZOOKEEPER_ZNODE_PARENT, parts2[2])
 
 admin2 = HBaseAdmin.new(c2)
 
-for t in admin1.listTables()
-  admin2.createTable(t)
+if parts3.nil?
+  admin1.listTableNames().each do |t|
+copy(admin1, admin2, t.nameAsString())
+  end
+else
+  parts3.each do |t|
+copy(admin1, admin2, t)
+  end
 end
-
-
-puts "All descriptions were copied"



[4/4] hbase git commit: HBASE-16385 Have hbase-rest pull hbase.rest.port from Constants.java (Yi Liang)

2016-08-24 Thread apurtell
HBASE-16385 Have hbase-rest pull hbase.rest.port from Constants.java (Yi Liang)


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

Branch: refs/heads/0.98
Commit: 3c4e8c16ffaea85d41bb19df2dda224e36d83d43
Parents: c283063
Author: stack 
Authored: Wed Aug 10 16:06:05 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:56:58 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3c4e8c16/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
--
diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
index 79b3377..d91b58a 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
@@ -110,7 +110,7 @@ public class RESTServer implements Constants {
 RESTServlet servlet = RESTServlet.getInstance(conf, userProvider);
 
 Options options = new Options();
-options.addOption("p", "port", true, "Port to bind to [default: 8080]");
+options.addOption("p", "port", true, "Port to bind to [default: " + 
DEFAULT_LISTEN_PORT + "]");
 options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +
   "method requests [default: false]");
 options.addOption(null, "infoport", true, "Port for web UI");
@@ -204,7 +204,7 @@ public class RESTServer implements Constants {
   sslConnector.setKeyPassword(keyPassword);
   connector = sslConnector;
 }
-connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 
8080));
+connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 
DEFAULT_LISTEN_PORT));
 connector.setHost(servlet.getConfiguration().get("hbase.rest.host", 
"0.0.0.0"));
 connector.setHeaderBufferSize(65536);
 



[1/4] hbase git commit: HBASE-16299 Update REST API scanner with ability to do reverse scan (Minwoo Kang)

2016-08-24 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 e78008700 -> 3c4e8c16f


HBASE-16299 Update REST API scanner with ability to do reverse scan
(Minwoo Kang)

Conflicts:
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java


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

Branch: refs/heads/0.98
Commit: 598762096540b1fcfb497687d014469f50f38f0c
Parents: e780087
Author: Ramkrishna 
Authored: Mon Aug 8 14:27:13 2016 +0530
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:49:16 2016 -0700

--
 .../org/apache/hadoop/hbase/rest/Constants.java |  1 +
 .../apache/hadoop/hbase/rest/TableResource.java |  4 +-
 .../apache/hadoop/hbase/rest/TestTableScan.java | 51 
 3 files changed, 55 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/59876209/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java
--
diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java
index f3dba9a..29a78a5 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/Constants.java
@@ -68,6 +68,7 @@ public interface Constants {
   String SCAN_BATCH_SIZE = "batchsize";
   String SCAN_LIMIT = "limit";
   String SCAN_FETCH_SIZE = "hbase.rest.scan.fetchsize";
+  String SCAN_REVERSED = "reversed";
 
   String ROW_KEYS_PARAM_NAME = "row";
   /** If this query parameter is present when processing row or scanner 
resources,

http://git-wip-us.apache.org/repos/asf/hbase/blob/59876209/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
--
diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
index b55d0e0..56016b1 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java
@@ -130,7 +130,8 @@ public class TableResource extends ResourceBase {
   @DefaultValue("-1") @QueryParam(Constants.SCAN_BATCH_SIZE) int batchSize,
   @DefaultValue("0") @QueryParam(Constants.SCAN_START_TIME) long startTime,
   @DefaultValue(Long.MAX_VALUE + "") @QueryParam(Constants.SCAN_END_TIME) 
long endTime,
-  @DefaultValue("true") @QueryParam(Constants.SCAN_BATCH_SIZE) boolean 
cacheBlocks) {
+  @DefaultValue("true") @QueryParam(Constants.SCAN_BATCH_SIZE) boolean 
cacheBlocks,
+  @DefaultValue("false") @QueryParam(Constants.SCAN_REVERSED) boolean 
reversed) {
 try {
   Filter filter = null;
   Scan tableScan = new Scan();
@@ -183,6 +184,7 @@ public class TableResource extends ResourceBase {
   }
   int fetchSize = 
this.servlet.getConfiguration().getInt(Constants.SCAN_FETCH_SIZE, 10);
   tableScan.setCaching(fetchSize);
+  tableScan.setReversed(reversed);
  return new TableScanResource(hTable.getScanner(tableScan), 
userRequestedLimit);
 } catch (Exception exp) {
   servlet.getMetrics().incrementFailedScanRequests(1);

http://git-wip-us.apache.org/repos/asf/hbase/blob/59876209/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java
--
diff --git 
a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java 
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java
index e12afc5..e1a3775 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestTableScan.java
@@ -28,6 +28,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import javax.ws.rs.core.MediaType;
@@ -460,6 +461,56 @@ public class TestTableScan {
 assertEquals(0, count);
   }
 
+  @Test
+  public void testReversed() throws IOException, JAXBException {
+StringBuilder builder = new StringBuilder();
+builder.append("/*");
+builder.append("?");
+builder.append(Constants.SCAN_COLUMN + "=" + COLUMN_1);
+builder.append("&");
+builder.append(Constants.SCAN_START_ROW + "=aaa");
+

hbase git commit: HBASE-16433 Remove AsyncRpcChannel related stuffs

2016-08-24 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/master 8a692ff18 -> a1f760ff7


HBASE-16433 Remove AsyncRpcChannel related stuffs


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

Branch: refs/heads/master
Commit: a1f760ff763bacbfcfd6eb80d5076ec35e3b27e3
Parents: 8a692ff
Author: zhangduo 
Authored: Wed Aug 17 17:03:53 2016 +0800
Committer: zhangduo 
Committed: Thu Aug 25 08:15:46 2016 +0800

--
 .../org/apache/hadoop/hbase/client/Future.java  |  34 -
 .../hbase/client/ResponseFutureListener.java|  30 -
 .../org/apache/hadoop/hbase/ipc/AsyncCall.java  |  10 +-
 .../hadoop/hbase/ipc/AsyncRpcChannel.java   | 728 +-
 .../hadoop/hbase/ipc/AsyncRpcChannelImpl.java   | 770 ---
 .../apache/hadoop/hbase/ipc/AsyncRpcClient.java |  28 +-
 .../hbase/ipc/AsyncServerResponseHandler.java   |   4 +-
 .../org/apache/hadoop/hbase/ipc/Promise.java|  38 -
 .../org/apache/hadoop/hbase/ipc/RpcClient.java  |  20 +-
 .../apache/hadoop/hbase/ipc/RpcClientImpl.java  | 156 +---
 .../hadoop/hbase/ipc/AbstractTestIPC.java   | 146 +---
 11 files changed, 730 insertions(+), 1234 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a1f760ff/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Future.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Future.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Future.java
deleted file mode 100644
index 99a8baa..000
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Future.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.client;
-
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.classification.InterfaceStability;
-
-/**
- * Promise for responses
- * @param  Value type
- */
-@InterfaceAudience.Public
-@InterfaceStability.Evolving
-
-@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NM_SAME_SIMPLE_NAME_AS_INTERFACE",
-  justification="Agree that this can be confusing but folks will pull in this 
and think twice "
-  + "about pulling in netty; incidence of confusion should be rare in this 
case.")
-public interface Future extends io.netty.util.concurrent.Future {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/a1f760ff/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResponseFutureListener.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResponseFutureListener.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResponseFutureListener.java
deleted file mode 100644
index f23dc8f..000
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ResponseFutureListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.client;
-
-import io.netty.util.concurrent.GenericFutureListener;
-import 

[2/2] hbase git commit: Amend HBASE-16448 Custom metrics for custom replication endpoints

2016-08-24 Thread apurtell
Amend HBASE-16448 Custom metrics for custom replication endpoints

Add missing support in hbase-hadoop1-compat


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

Branch: refs/heads/0.98
Commit: e78008700bcf30443cdd94b206575d8bb2ce31f8
Parents: 6fbdc38
Author: Andrew Purtell 
Authored: Wed Aug 24 17:44:21 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:44:21 2016 -0700

--
 .../MetricsReplicationGlobalSourceSource.java   | 64 ++-
 .../MetricsReplicationSourceSourceImpl.java | 82 +---
 2 files changed, 135 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e7800870/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java
--
diff --git 
a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java
 
b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java
index 620b764..ee59b1c 100644
--- 
a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java
+++ 
b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java
@@ -22,7 +22,7 @@ import 
org.apache.hadoop.metrics2.lib.MetricMutableCounterLong;
 import org.apache.hadoop.metrics2.lib.MetricMutableGaugeLong;
 
 public class MetricsReplicationGlobalSourceSource implements 
MetricsReplicationSourceSource {
-
+  private final MetricsReplicationSource rms;
   private final MetricMutableGaugeLong ageOfLastShippedOpGauge;
   private long ageOfLastShipped; // Hadoop 1 metrics don't let you read from 
gauges
   private final MetricMutableGaugeLong sizeOfLogQueueGauge;
@@ -36,7 +36,7 @@ public class MetricsReplicationGlobalSourceSource implements 
MetricsReplicationS
   private final MetricMutableCounterLong logReadInBytesCounter;
 
   public MetricsReplicationGlobalSourceSource(MetricsReplicationSourceImpl 
rms) {
-
+this.rms = rms;
 ageOfLastShippedOpGauge = 
rms.getMetricsRegistry().getLongGauge(SOURCE_AGE_OF_LAST_SHIPPED_OP, 0L);
 
 sizeOfLogQueueGauge = 
rms.getMetricsRegistry().getLongGauge(SOURCE_SIZE_OF_LOG_QUEUE, 0L);
@@ -115,4 +115,64 @@ public class MetricsReplicationGlobalSourceSource 
implements MetricsReplicationS
   public long getLastShippedAge() {
 return ageOfLastShipped;
   }
+
+  @Override
+  public void init() {
+rms.init();
+  }
+
+  @Override
+  public void setGauge(String gaugeName, long value) {
+rms.setGauge(gaugeName, value);
+  }
+
+  @Override
+  public void incGauge(String gaugeName, long delta) {
+rms.incGauge(gaugeName, delta);
+  }
+
+  @Override
+  public void decGauge(String gaugeName, long delta) {
+rms.decGauge(gaugeName, delta);
+  }
+
+  @Override
+  public void removeMetric(String key) {
+rms.removeMetric(key);
+  }
+
+  @Override
+  public void incCounters(String counterName, long delta) {
+rms.incCounters(counterName, delta);
+  }
+
+  @Override
+  public void updateHistogram(String name, long value) {
+rms.updateHistogram(name, value);
+  }
+
+  @Override
+  public void updateQuantile(String name, long value) {
+rms.updateQuantile(name, value);
+  }
+
+  @Override
+  public String getMetricsContext() {
+return rms.getMetricsContext();
+  }
+
+  @Override
+  public String getMetricsDescription() {
+return rms.getMetricsDescription();
+  }
+
+  @Override
+  public String getMetricsJmxContext() {
+return rms.getMetricsJmxContext();
+  }
+
+  @Override
+  public String getMetricsName() {
+return rms.getMetricsName();
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e7800870/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java
--
diff --git 
a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java
 
b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java
index 21a6cb3..e15af46 100644
--- 
a/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java
+++ 
b/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java
@@ -31,6 +31,8 @@ public c

[1/2] hbase git commit: HBASE-16315 RegionSizeCalculator prints region names as binary without escapes

2016-08-24 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 bc6b564fc -> e78008700


HBASE-16315 RegionSizeCalculator prints region names as binary without escapes


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

Branch: refs/heads/0.98
Commit: 6fbdc38f3ac47d372abd1a4fd8aa1a04f7db716f
Parents: bc6b564
Author: Enis Soztutar 
Authored: Tue Aug 2 16:35:25 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 17:27:36 2016 -0700

--
 hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6fbdc38f/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
--
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
index 234c5ae..bd31092 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
@@ -50,7 +50,7 @@ public class RegionLoad {
* @return the region name as a string
*/
   public String getNameAsString() {
-return Bytes.toString(getName());
+return Bytes.toStringBinary(getName());
   }
 
   /**



hbase git commit: HBASE-16254 hbase:backup table should have proper description in system table UI (Vladimir Rodionov)

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/HBASE-7912 7c6b10ff4 -> f09911fe8


HBASE-16254 hbase:backup table should have proper description in system table 
UI (Vladimir Rodionov)


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

Branch: refs/heads/HBASE-7912
Commit: f09911fe8140e4e5a4adf23bcd74912822bf0e3c
Parents: 7c6b10f
Author: tedyu 
Authored: Wed Aug 24 16:33:42 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 16:33:42 2016 -0700

--
 .../org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f09911fe/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
--
diff --git 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index 1af3db9..63b9c94 100644
--- 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -380,6 +380,8 @@ AssignmentManager assignmentManager = 
master.getAssignmentManager();
 } else if (tableName.equals(QuotaUtil.QUOTA_TABLE_NAME)){
 description = "The hbase:quota table holds quota information about 
number" +
 " or size of requests in a given time frame.";
+} else if (tableName.equals(TableName.BACKUP_TABLE_NAME)){
+description = "The hbase:backup table stores backup system 
information.";
 }
 
 <% description %>



hbase git commit: HBASE-16486 Unify system table creation using the same createSystemTable API (Stephen Yuan Jiang)

2016-08-24 Thread syuanjiang
Repository: hbase
Updated Branches:
  refs/heads/master 9cbe516b1 -> 8a692ff18


HBASE-16486 Unify system table creation using the same createSystemTable API 
(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/8a692ff1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8a692ff1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8a692ff1

Branch: refs/heads/master
Commit: 8a692ff189b577dcda85141b7ead708a997dd4ec
Parents: 9cbe516
Author: Stephen Yuan Jiang 
Authored: Wed Aug 24 15:20:53 2016 -0700
Committer: Stephen Yuan Jiang 
Committed: Wed Aug 24 15:21:20 2016 -0700

--
 .../hbase/rsgroup/RSGroupInfoManagerImpl.java   | 30 +++-
 .../org/apache/hadoop/hbase/master/HMaster.java | 24 
 .../hadoop/hbase/master/MasterServices.java |  7 +
 .../hbase/master/TableNamespaceManager.java | 12 +---
 .../hadoop/hbase/quotas/MasterQuotaManager.java | 11 +--
 .../security/access/AccessControlLists.java |  9 +++---
 .../visibility/VisibilityController.java|  2 +-
 .../hbase/master/MockNoopMasterServices.java|  5 
 8 files changed, 54 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8a692ff1/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
--
diff --git 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
index 10e7eaf..52cd339 100644
--- 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
+++ 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
@@ -22,7 +22,6 @@ package org.apache.hadoop.hbase.rsgroup;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-
 import com.google.common.collect.Sets;
 import com.google.common.net.HostAndPort;
 import com.google.protobuf.ServiceException;
@@ -53,6 +52,7 @@ import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.ProcedureInfo;
 import org.apache.hadoop.hbase.MetaTableAccessor.DefaultVisitorBase;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.ServerName;
@@ -71,8 +71,6 @@ import org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel;
 import org.apache.hadoop.hbase.master.MasterServices;
 import org.apache.hadoop.hbase.master.ServerListener;
 import org.apache.hadoop.hbase.master.TableStateManager;
-import org.apache.hadoop.hbase.master.procedure.CreateTableProcedure;
-import org.apache.hadoop.hbase.master.procedure.ProcedurePrepareLatch;
 import org.apache.hadoop.hbase.protobuf.ProtobufMagic;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.RequestConverter;
@@ -82,7 +80,6 @@ import 
org.apache.hadoop.hbase.protobuf.generated.RSGroupProtos;
 import org.apache.hadoop.hbase.regionserver.DisabledRegionSplitPolicy;
 import org.apache.hadoop.hbase.security.access.AccessControlLists;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.ModifyRegionUtils;
 import org.apache.hadoop.hbase.zookeeper.ZKUtil;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.zookeeper.KeeperException;
@@ -703,22 +700,12 @@ public class RSGroupInfoManagerImpl implements 
RSGroupInfoManager, ServerListene
   }
 
   private void createGroupTable(MasterServices masterServices) throws 
IOException {
-HRegionInfo[] newRegions =
-ModifyRegionUtils.createHRegionInfos(RSGROUP_TABLE_DESC, null);
-ProcedurePrepareLatch latch = ProcedurePrepareLatch.createLatch();
-masterServices.getMasterProcedureExecutor().submitProcedure(
-new CreateTableProcedure(
-masterServices.getMasterProcedureExecutor().getEnvironment(),
-RSGROUP_TABLE_DESC,
-newRegions,
-latch),
-HConstants.NO_NONCE,
-HConstants.NO_NONCE);
-latch.await();
+Long procId = masterServices.createSystemTable(RSGROUP_TABLE_DESC);
 // wait for region to be online
 int tries = 600;
-while(masterServices.getAssignmentManager().getRegionStates()
-.getRegionServerOfRegion(newRegions[0]) == null && tries > 0) {
+while (!(masterServices.getMasterProcedureExecutor().isFinished(procId))
+&& masterServices.getMasterProcedureExecutor().isRunning()
+&& tries > 0) {
   try {
 Thread.sleep(100);
   } catch (InterruptedException e) {
@@ -727,7 +714,12 @@

hbase git commit: HBASE-16495 When accessed via Thrift, all column families have timeToLive equal to -1 (Tigran Saluev)

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f9490aaf4 -> 440079951


HBASE-16495 When accessed via Thrift, all column families have timeToLive equal 
to -1 (Tigran Saluev)


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

Branch: refs/heads/branch-1
Commit: 440079951ecf8368d377ed9d936d60fed4aa4465
Parents: f9490aa
Author: tedyu 
Authored: Wed Aug 24 13:40:08 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 13:40:08 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/44007995/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
index 8aec6c5..c3375a3 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
@@ -94,6 +94,7 @@ public class ThriftUtilities {
 col.inMemory = in.isInMemory();
 col.blockCacheEnabled = in.isBlockCacheEnabled();
 col.bloomFilterType = in.getBloomFilterType().toString();
+col.timeToLive = in.getTimeToLive();
 return col;
   }
 



hbase git commit: HBASE-16495 When accessed via Thrift, all column families have timeToLive equal to -1 (Tigran Saluev)

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master bf7015d32 -> 9cbe516b1


HBASE-16495 When accessed via Thrift, all column families have timeToLive equal 
to -1 (Tigran Saluev)


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

Branch: refs/heads/master
Commit: 9cbe516b1f63bc8ed1635412da902b6a90ab09db
Parents: bf7015d
Author: tedyu 
Authored: Wed Aug 24 13:35:18 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 13:35:18 2016 -0700

--
 .../main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/9cbe516b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
index dd0c52c..9a3eb58 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftUtilities.java
@@ -94,6 +94,7 @@ public class ThriftUtilities {
 col.inMemory = in.isInMemory();
 col.blockCacheEnabled = in.isBlockCacheEnabled();
 col.bloomFilterType = in.getBloomFilterType().toString();
+col.timeToLive = in.getTimeToLive();
 return col;
   }
 



hbase git commit: HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to deadlock when trying to obtain write lock on updatesLock

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 fefb8e851 -> 029131ddf


HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to 
deadlock when trying to obtain write lock on updatesLock


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

Branch: refs/heads/branch-1.2
Commit: 029131ddfedb7ef878dd6531988cbadd2b2da6a8
Parents: fefb8e8
Author: tedyu 
Authored: Wed Aug 24 11:28:59 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 11:28:59 2016 -0700

--
 .../hadoop/hbase/regionserver/HRegion.java  | 52 ++--
 1 file changed, 49 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/029131dd/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 73fbf78..22c66e3 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -251,6 +251,9 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
*/
   protected volatile long lastReplayedOpenRegionSeqId = -1L;
   protected volatile long lastReplayedCompactionSeqId = -1L;
+  
+  // collects Map(s) of Store to sequence Id when handleFileNotFound() is 
involved
+  protected List storeSeqIds = new ArrayList<>();
 
   
//
   // Members
@@ -4883,6 +4886,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 
 startRegionOperation(); // obtain region close lock
 try {
+  Map map = new HashMap();
   synchronized (writestate) {
 for (Store store : getStores()) {
   // TODO: some stores might see new data from flush, while others do 
not which
@@ -4915,8 +4919,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   }
 }
 
-// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
-totalFreedSize += dropMemstoreContentsForSeqId(storeSeqId, store);
+map.put(store, storeSeqId);
   }
 }
 
@@ -4939,6 +4942,19 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   this.lastReplayedOpenRegionSeqId = smallestSeqIdInStores;
 }
   }
+  if (!map.isEmpty()) {
+if (!force) {
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+} else {
+  synchronized (storeSeqIds) {
+// don't try to acquire write lock of updatesLock now
+storeSeqIds.add(map);
+  }
+}
+  }
   // C. Finally notify anyone waiting on memstore to clear:
   // e.g. checkResources().
   synchronized (this) {
@@ -7160,6 +7176,28 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   // We should refactor append and increment as local get-mutate-put
   // transactions, so all stores only go through one code path for puts.
 
+  // dropMemstoreContentsForSeqId() would acquire write lock of updatesLock
+  // We perform this operation outside of the read lock of updatesLock to 
avoid dead lock
+  // See HBASE-16304
+  @SuppressWarnings("unchecked")
+  private void dropMemstoreContents() throws IOException {
+long totalFreedSize = 0;
+while (!storeSeqIds.isEmpty()) {
+  Map map = null;
+  synchronized (storeSeqIds) {
+if (storeSeqIds.isEmpty()) break;
+map = storeSeqIds.remove(storeSeqIds.size()-1);
+  }
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the latest 
seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+}
+if (totalFreedSize > 0) {
+  LOG.debug("Freed " + totalFreedSize + " bytes from memstore");
+}
+  }
+
   @Override
   public Result append(Append mutate, long nonceGroup, long nonce) throws 
IOException {
 Operation op = Operation.APPEND;
@@ -7312,6 +7350,10 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
  

hbase git commit: HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to deadlock when trying to obtain write lock on updatesLock

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 25995a2bf -> 70daa23ea


HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to 
deadlock when trying to obtain write lock on updatesLock


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

Branch: refs/heads/branch-1.3
Commit: 70daa23ea79b21b9ae337bcf962ada26ac95c1a2
Parents: 25995a2
Author: tedyu 
Authored: Wed Aug 24 11:28:24 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 11:28:24 2016 -0700

--
 .../hadoop/hbase/regionserver/HRegion.java  | 52 ++--
 1 file changed, 49 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/70daa23e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index b56c887..d43e838 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -252,6 +252,9 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
*/
   protected volatile long lastReplayedOpenRegionSeqId = -1L;
   protected volatile long lastReplayedCompactionSeqId = -1L;
+  
+  // collects Map(s) of Store to sequence Id when handleFileNotFound() is 
involved
+  protected List storeSeqIds = new ArrayList<>();
 
   
//
   // Members
@@ -5036,6 +5039,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 
 startRegionOperation(); // obtain region close lock
 try {
+  Map map = new HashMap();
   synchronized (writestate) {
 for (Store store : getStores()) {
   // TODO: some stores might see new data from flush, while others do 
not which
@@ -5068,8 +5072,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   }
 }
 
-// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
-totalFreedSize += dropMemstoreContentsForSeqId(storeSeqId, store);
+map.put(store, storeSeqId);
   }
 }
 
@@ -5092,6 +5095,19 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   this.lastReplayedOpenRegionSeqId = smallestSeqIdInStores;
 }
   }
+  if (!map.isEmpty()) {
+if (!force) {
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+} else {
+  synchronized (storeSeqIds) {
+// don't try to acquire write lock of updatesLock now
+storeSeqIds.add(map);
+  }
+}
+  }
   // C. Finally notify anyone waiting on memstore to clear:
   // e.g. checkResources().
   synchronized (this) {
@@ -7364,6 +7380,28 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   // We should refactor append and increment as local get-mutate-put
   // transactions, so all stores only go through one code path for puts.
 
+  // dropMemstoreContentsForSeqId() would acquire write lock of updatesLock
+  // We perform this operation outside of the read lock of updatesLock to 
avoid dead lock
+  // See HBASE-16304
+  @SuppressWarnings("unchecked")
+  private void dropMemstoreContents() throws IOException {
+long totalFreedSize = 0;
+while (!storeSeqIds.isEmpty()) {
+  Map map = null;
+  synchronized (storeSeqIds) {
+if (storeSeqIds.isEmpty()) break;
+map = storeSeqIds.remove(storeSeqIds.size()-1);
+  }
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the latest 
seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+}
+if (totalFreedSize > 0) {
+  LOG.debug("Freed " + totalFreedSize + " bytes from memstore");
+}
+  }
+
   @Override
   public Result append(Append mutate, long nonceGroup, long nonce) throws 
IOException {
 Operation op = Operation.APPEND;
@@ -7522,6 +7560,10 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
  

hbase git commit: HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to deadlock when trying to obtain write lock on updatesLock

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f0385b4b8 -> f9490aaf4


HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to 
deadlock when trying to obtain write lock on updatesLock


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

Branch: refs/heads/branch-1
Commit: f9490aaf43e1df0caead47cb03127cd61206ba00
Parents: f0385b4
Author: tedyu 
Authored: Wed Aug 24 10:57:14 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 10:57:14 2016 -0700

--
 .../hadoop/hbase/regionserver/HRegion.java  | 52 ++--
 1 file changed, 49 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f9490aaf/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 02428bd..bfb9171 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -253,6 +253,9 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
*/
   protected volatile long lastReplayedOpenRegionSeqId = -1L;
   protected volatile long lastReplayedCompactionSeqId = -1L;
+  
+  // collects Map(s) of Store to sequence Id when handleFileNotFound() is 
involved
+  protected List storeSeqIds = new ArrayList<>();
 
   
//
   // Members
@@ -5037,6 +5040,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 
 startRegionOperation(); // obtain region close lock
 try {
+  Map map = new HashMap();
   synchronized (writestate) {
 for (Store store : getStores()) {
   // TODO: some stores might see new data from flush, while others do 
not which
@@ -5069,8 +5073,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   }
 }
 
-// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
-totalFreedSize += dropMemstoreContentsForSeqId(storeSeqId, store);
+map.put(store, storeSeqId);
   }
 }
 
@@ -5093,6 +5096,19 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   this.lastReplayedOpenRegionSeqId = smallestSeqIdInStores;
 }
   }
+  if (!map.isEmpty()) {
+if (!force) {
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+} else {
+  synchronized (storeSeqIds) {
+// don't try to acquire write lock of updatesLock now
+storeSeqIds.add(map);
+  }
+}
+  }
   // C. Finally notify anyone waiting on memstore to clear:
   // e.g. checkResources().
   synchronized (this) {
@@ -7365,6 +7381,28 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   // We should refactor append and increment as local get-mutate-put
   // transactions, so all stores only go through one code path for puts.
 
+  // dropMemstoreContentsForSeqId() would acquire write lock of updatesLock
+  // We perform this operation outside of the read lock of updatesLock to 
avoid dead lock
+  // See HBASE-16304
+  @SuppressWarnings("unchecked")
+  private void dropMemstoreContents() throws IOException {
+long totalFreedSize = 0;
+while (!storeSeqIds.isEmpty()) {
+  Map map = null;
+  synchronized (storeSeqIds) {
+if (storeSeqIds.isEmpty()) break;
+map = storeSeqIds.remove(storeSeqIds.size()-1);
+  }
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the latest 
seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+}
+if (totalFreedSize > 0) {
+  LOG.debug("Freed " + totalFreedSize + " bytes from memstore");
+}
+  }
+
   @Override
   public Result append(Append mutate, long nonceGroup, long nonce) throws 
IOException {
 Operation op = Operation.APPEND;
@@ -7523,6 +7561,10 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   }
 

hbase git commit: Revert "HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results"

2016-08-24 Thread apurtell
Repository: hbase
Updated Branches:
  refs/heads/0.98 02badbdf9 -> bc6b564fc


Revert "HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results"

This reverts commit 7ca58503b5514b5fc509a631ed84c0e21a097a63.


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

Branch: refs/heads/0.98
Commit: bc6b564fca5242f7a261301c83b7bfcddb85bbc2
Parents: 02badbd
Author: Andrew Purtell 
Authored: Wed Aug 24 09:42:09 2016 -0700
Committer: Andrew Purtell 
Committed: Wed Aug 24 09:42:09 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bc6b564f/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index 710c6dc..2b77359 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -374,13 +374,7 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next().
-   * Callers should be aware that invoking this method with any value
-   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
-   * with a value of {@code true}; partial results may be returned if
-   * this method is called. Use {@link #setMaxResultSize(long)}} to
-   * limit the size of a Scan's Results instead.
-   *
+   * Set the maximum number of values to return for each call to next()
* @param batch the maximum number of values
*/
   public void setBatch(int batch) {



hbase git commit: HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to deadlock when trying to obtain write lock on updatesLock

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master dda8f67b2 -> bf7015d32


HBASE-16304 HRegion#RegionScannerImpl#handleFileNotFoundException may lead to 
deadlock when trying to obtain write lock on updatesLock


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

Branch: refs/heads/master
Commit: bf7015d3204818fdc88ef505e0a06cac4ea2774b
Parents: dda8f67
Author: tedyu 
Authored: Wed Aug 24 09:04:47 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 09:04:47 2016 -0700

--
 .../hadoop/hbase/regionserver/HRegion.java  | 48 ++--
 1 file changed, 45 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bf7015d3/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 86c02ea..f97f6b2 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -238,6 +238,9 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
*/
   protected volatile long lastReplayedOpenRegionSeqId = -1L;
   protected volatile long lastReplayedCompactionSeqId = -1L;
+  
+  // collects Map(s) of Store to sequence Id when handleFileNotFound() is 
involved
+  protected List storeSeqIds = new ArrayList<>();
 
   
//
   // Members
@@ -4970,6 +4973,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 
 startRegionOperation(); // obtain region close lock
 try {
+  Map map = new HashMap();
   synchronized (writestate) {
 for (Store store : getStores()) {
   // TODO: some stores might see new data from flush, while others do 
not which
@@ -5002,8 +5006,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   }
 }
 
-// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
-totalFreedSize += dropMemstoreContentsForSeqId(storeSeqId, store);
+map.put(store, storeSeqId);
   }
 }
 
@@ -5026,6 +5029,19 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   this.lastReplayedOpenRegionSeqId = smallestSeqIdInStores;
 }
   }
+  if (!map.isEmpty()) {
+if (!force) {
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the 
latest seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+} else {
+  synchronized (storeSeqIds) {
+// don't try to acquire write lock of updatesLock now
+storeSeqIds.add(map);
+  }
+}
+  }
   // C. Finally notify anyone waiting on memstore to clear:
   // e.g. checkResources().
   synchronized (this) {
@@ -7141,6 +7157,28 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 return increment(increment, HConstants.NO_NONCE, HConstants.NO_NONCE);
   }
 
+  // dropMemstoreContentsForSeqId() would acquire write lock of updatesLock
+  // We perform this operation outside of the read lock of updatesLock to 
avoid dead lock
+  // See HBASE-16304
+  @SuppressWarnings("unchecked")
+  private void dropMemstoreContents() throws IOException {
+long totalFreedSize = 0;
+while (!storeSeqIds.isEmpty()) {
+  Map map = null;
+  synchronized (storeSeqIds) {
+if (storeSeqIds.isEmpty()) break;
+map = storeSeqIds.remove(storeSeqIds.size()-1);
+  }
+  for (Map.Entry entry : map.entrySet()) {
+// Drop the memstore contents if they are now smaller than the latest 
seen flushed file
+totalFreedSize += dropMemstoreContentsForSeqId(entry.getValue(), 
entry.getKey());
+  }
+}
+if (totalFreedSize > 0) {
+  LOG.debug("Freed " + totalFreedSize + " bytes from memstore");
+}
+  }
+
   @Override
   public Result increment(Increment mutation, long nonceGroup, long nonce)
   throws IOException {
@@ -7206,6 +7244,10 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 writeEntry = null;
   } finally {
 this.updatesLock.readLock().unlock();
+// For

[4/4] hbase git commit: HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert Yokota)

2016-08-24 Thread enis
HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert 
Yokota)


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

Branch: refs/heads/branch-1.1
Commit: dca60dbc566c6693269718e469021cdbbfce
Parents: 43c93d4
Author: Enis Soztutar 
Authored: Wed Aug 24 06:43:19 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 06:47:17 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/dca60dbc/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
index 7787b23..4fa755b 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
@@ -185,6 +185,7 @@ public class DefaultMemStore implements MemStore {
   @Override
   public void clearSnapshot(long id) throws UnexpectedStateException {
 MemStoreLAB tmpAllocator = null;
+if (this.snapshotId == -1) return;  // already cleared
 if (this.snapshotId != id) {
   throw new UnexpectedStateException("Current snapshot id is " + 
this.snapshotId + ",passed "
   + id);



[3/4] hbase git commit: HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert Yokota)

2016-08-24 Thread enis
HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert 
Yokota)


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

Branch: refs/heads/branch-1.2
Commit: fefb8e8513f6eac93cd89cd2a2cf4a8874a33116
Parents: 4dcd7fb
Author: Enis Soztutar 
Authored: Wed Aug 24 06:43:19 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 06:45:40 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/fefb8e85/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
index f8fc397..80501ee 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
@@ -189,6 +189,7 @@ public class DefaultMemStore implements MemStore {
   @Override
   public void clearSnapshot(long id) throws UnexpectedStateException {
 MemStoreLAB tmpAllocator = null;
+if (this.snapshotId == -1) return;  // already cleared
 if (this.snapshotId != id) {
   throw new UnexpectedStateException("Current snapshot id is " + 
this.snapshotId + ",passed "
   + id);



[1/4] hbase git commit: HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert Yokota)

2016-08-24 Thread enis
Repository: hbase
Updated Branches:
  refs/heads/branch-1 3606b890f -> f0385b4b8
  refs/heads/branch-1.1 43c93d4c6 -> dca60dbc5
  refs/heads/branch-1.2 4dcd7fb6d -> fefb8e851
  refs/heads/branch-1.3 6b9a0b3b0 -> 25995a2bf


HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert 
Yokota)


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

Branch: refs/heads/branch-1
Commit: f0385b4b83bd9725aefcc9c9ec3f08cb57b33afa
Parents: 3606b89
Author: Enis Soztutar 
Authored: Wed Aug 24 06:43:19 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 06:43:19 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/f0385b4b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
index 71bfca0..0a64e2e 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
@@ -189,6 +189,7 @@ public class DefaultMemStore implements MemStore {
   @Override
   public void clearSnapshot(long id) throws UnexpectedStateException {
 MemStoreLAB tmpAllocator = null;
+if (this.snapshotId == -1) return;  // already cleared
 if (this.snapshotId != id) {
   throw new UnexpectedStateException("Current snapshot id is " + 
this.snapshotId + ",passed "
   + id);



[2/4] hbase git commit: HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert Yokota)

2016-08-24 Thread enis
HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert 
Yokota)


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

Branch: refs/heads/branch-1.3
Commit: 25995a2bf71195d0fe697e919f226a21b0d84be1
Parents: 6b9a0b3
Author: Enis Soztutar 
Authored: Wed Aug 24 06:43:19 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 06:43:28 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/25995a2b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
index 458e3b8..70f5a12 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultMemStore.java
@@ -189,6 +189,7 @@ public class DefaultMemStore implements MemStore {
   @Override
   public void clearSnapshot(long id) throws UnexpectedStateException {
 MemStoreLAB tmpAllocator = null;
+if (this.snapshotId == -1) return;  // already cleared
 if (this.snapshotId != id) {
   throw new UnexpectedStateException("Current snapshot id is " + 
this.snapshotId + ",passed "
   + id);



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/0.98 7ca58503b -> 02badbdf9


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/0.98
Commit: 02badbdf9d069f515d3198c799d5575539bd0459
Parents: 7ca5850
Author: Ashish Singhi 
Authored: Wed Aug 24 19:07:47 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 19:07:47 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 26 
 2 files changed, 28 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/02badbdf/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index 4ad9f33..66c477b 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster")) {
+if (serverName.startsWith("HMaster")) {
   return "Master";
-} else if (serverName.contains("HRegion")) {
+} else if (serverName.startsWith("HRegion")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/02badbdf/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index e81f47a..6f3f732 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -136,5 +136,31 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames =
+{ "HMaster/node-xyz/10.19.250.253:16020", 
"HMaster/node-HRegion-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { 
"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-HMaster1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("IPC", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("IPC", rsSource.getMetricsName());
+}
+  }
 }
 



hbase git commit: HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert Yokota)

2016-08-24 Thread enis
Repository: hbase
Updated Branches:
  refs/heads/master 31f16d6ae -> dda8f67b2


HBASE-16270 Handle duplicate clearing of snapshot in region replicas (Robert 
Yokota)


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

Branch: refs/heads/master
Commit: dda8f67b2cc9f6ef4ab434beea2a47d461a20a1f
Parents: 31f16d6
Author: Enis Soztutar 
Authored: Wed Aug 24 06:33:46 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 06:33:46 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/dda8f67b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java
index e306b1e..15bdd92 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java
@@ -190,6 +190,7 @@ public abstract class AbstractMemStore implements MemStore {
*/
   @Override
   public void clearSnapshot(long id) throws UnexpectedStateException {
+if (this.snapshotId == -1) return;  // already cleared
 if (this.snapshotId != id) {
   throw new UnexpectedStateException("Current snapshot id is " + 
this.snapshotId + ",passed "
   + id);



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 ecedea0b0 -> 43c93d4c6


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/branch-1.1
Commit: 43c93d4c69a490723f176c1e1e4aed181cc6ef85
Parents: ecedea0
Author: Ashish Singhi 
Authored: Wed Aug 24 18:59:44 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 19:05:18 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 29 
 2 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/43c93d4c/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index d6b1392..e9a3348 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster") || serverName.contains("master")) {
+if (serverName.startsWith("HMaster") || serverName.startsWith("master")) {
   return "Master";
-} else if (serverName.contains("HRegion") || 
serverName.contains("regionserver")) {
+} else if (serverName.startsWith("HRegion") || 
serverName.startsWith("regionserver")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/43c93d4c/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index e33a0d7..dd8f226 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -132,5 +132,34 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames = { "master/node-xyz/10.19.250.253:16020",
+"master/node-regionserver-xyz/10.19.250.253:16020", 
"HMaster/node-xyz/10.19.250.253:16020",
+"HMaster/node-regionserver-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { "regionserver/node-xyz/10.19.250.253:16020",
+"regionserver/node-master1-xyz/10.19.250.253:16020",
+"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-master1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("Master", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("RegionServer", rsSource.getMetricsName());
+}
+  }
 }
 



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 46f3f5bf7 -> 4dcd7fb6d


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/branch-1.2
Commit: 4dcd7fb6d1ea670073ce80bad0dd6a372b5836f1
Parents: 46f3f5b
Author: Ashish Singhi 
Authored: Wed Aug 24 18:59:44 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 19:04:28 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 29 
 2 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4dcd7fb6/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index d6b1392..e9a3348 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster") || serverName.contains("master")) {
+if (serverName.startsWith("HMaster") || serverName.startsWith("master")) {
   return "Master";
-} else if (serverName.contains("HRegion") || 
serverName.contains("regionserver")) {
+} else if (serverName.startsWith("HRegion") || 
serverName.startsWith("regionserver")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/4dcd7fb6/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index 52518f8..2b8bdd7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -137,5 +137,34 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames = { "master/node-xyz/10.19.250.253:16020",
+"master/node-regionserver-xyz/10.19.250.253:16020", 
"HMaster/node-xyz/10.19.250.253:16020",
+"HMaster/node-regionserver-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { "regionserver/node-xyz/10.19.250.253:16020",
+"regionserver/node-master1-xyz/10.19.250.253:16020",
+"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-master1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("Master", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("RegionServer", rsSource.getMetricsName());
+}
+  }
 }
 



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 dae97549e -> 6b9a0b3b0


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/branch-1.3
Commit: 6b9a0b3b0259c360e33d6171e26898b166ad8863
Parents: dae9754
Author: Ashish Singhi 
Authored: Wed Aug 24 18:59:44 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 19:03:27 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 29 
 2 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6b9a0b3b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index d6b1392..e9a3348 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster") || serverName.contains("master")) {
+if (serverName.startsWith("HMaster") || serverName.startsWith("master")) {
   return "Master";
-} else if (serverName.contains("HRegion") || 
serverName.contains("regionserver")) {
+} else if (serverName.startsWith("HRegion") || 
serverName.startsWith("regionserver")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/6b9a0b3b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index 52518f8..2b8bdd7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -137,5 +137,34 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames = { "master/node-xyz/10.19.250.253:16020",
+"master/node-regionserver-xyz/10.19.250.253:16020", 
"HMaster/node-xyz/10.19.250.253:16020",
+"HMaster/node-regionserver-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { "regionserver/node-xyz/10.19.250.253:16020",
+"regionserver/node-master1-xyz/10.19.250.253:16020",
+"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-master1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("Master", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("RegionServer", rsSource.getMetricsName());
+}
+  }
 }
 



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1 c64c0e85c -> 3606b890f


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/branch-1
Commit: 3606b890f86a826462e42da62e6244515a1710c9
Parents: c64c0e8
Author: Ashish Singhi 
Authored: Wed Aug 24 18:59:44 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 19:01:58 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 29 
 2 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3606b890/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index d6b1392..e9a3348 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster") || serverName.contains("master")) {
+if (serverName.startsWith("HMaster") || serverName.startsWith("master")) {
   return "Master";
-} else if (serverName.contains("HRegion") || 
serverName.contains("regionserver")) {
+} else if (serverName.startsWith("HRegion") || 
serverName.startsWith("regionserver")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/3606b890/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index 52518f8..2b8bdd7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -137,5 +137,34 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames = { "master/node-xyz/10.19.250.253:16020",
+"master/node-regionserver-xyz/10.19.250.253:16020", 
"HMaster/node-xyz/10.19.250.253:16020",
+"HMaster/node-regionserver-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { "regionserver/node-xyz/10.19.250.253:16020",
+"regionserver/node-master1-xyz/10.19.250.253:16020",
+"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-master1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("Master", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("RegionServer", rsSource.getMetricsName());
+}
+  }
 }
 



hbase git commit: HBASE-16471 Region Server metrics context will be wrong when machine hostname contain "master" word (Pankaj Kumar)

2016-08-24 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/master 1ca849269 -> 31f16d6ae


HBASE-16471 Region Server metrics context will be wrong when machine hostname 
contain "master" word (Pankaj Kumar)


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

Branch: refs/heads/master
Commit: 31f16d6aec7d09f0a4102ed7651db9ff0d190cf9
Parents: 1ca8492
Author: Ashish Singhi 
Authored: Wed Aug 24 18:59:44 2016 +0530
Committer: Ashish Singhi 
Committed: Wed Aug 24 18:59:44 2016 +0530

--
 .../ipc/MetricsHBaseServerSourceFactory.java|  4 +--
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java | 29 
 2 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/31f16d6a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
index d6b1392..e9a3348 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceFactory.java
@@ -47,9 +47,9 @@ public abstract class MetricsHBaseServerSourceFactory {
* @return The Camel Cased context name.
*/
   protected static String createContextName(String serverName) {
-if (serverName.contains("HMaster") || serverName.contains("master")) {
+if (serverName.startsWith("HMaster") || serverName.startsWith("master")) {
   return "Master";
-} else if (serverName.contains("HRegion") || 
serverName.contains("regionserver")) {
+} else if (serverName.startsWith("HRegion") || 
serverName.startsWith("regionserver")) {
   return "RegionServer";
 }
 return "IPC";

http://git-wip-us.apache.org/repos/asf/hbase/blob/31f16d6a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
index 9f1b63a..4de618f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestRpcMetrics.java
@@ -138,5 +138,34 @@ public class TestRpcMetrics {
 HELPER.assertCounter("exceptions", 5, serverSource);
   }
 
+  @Test
+  public void testServerContextNameWithHostName() {
+String[] masterServerNames = { "master/node-xyz/10.19.250.253:16020",
+"master/node-regionserver-xyz/10.19.250.253:16020", 
"HMaster/node-xyz/10.19.250.253:16020",
+"HMaster/node-regionserver-xyz/10.19.250.253:16020" };
+
+String[] regionServerNames = { "regionserver/node-xyz/10.19.250.253:16020",
+"regionserver/node-master1-xyz/10.19.250.253:16020",
+"HRegionserver/node-xyz/10.19.250.253:16020",
+"HRegionserver/node-master1-xyz/10.19.250.253:16020" };
+
+MetricsHBaseServerSource masterSource = null;
+for (String serverName : masterServerNames) {
+  masterSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("master", masterSource.getMetricsContext());
+  assertEquals("Master,sub=IPC", masterSource.getMetricsJmxContext());
+  assertEquals("Master", masterSource.getMetricsName());
+}
+
+MetricsHBaseServerSource rsSource = null;
+for (String serverName : regionServerNames) {
+  rsSource = new MetricsHBaseServer(serverName, new 
MetricsHBaseServerWrapperStub())
+  .getMetricsSource();
+  assertEquals("regionserver", rsSource.getMetricsContext());
+  assertEquals("RegionServer,sub=IPC", rsSource.getMetricsJmxContext());
+  assertEquals("RegionServer", rsSource.getMetricsName());
+}
+  }
 }
 



[4/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/branch-1.1
Commit: ecedea0b00d83c66cf5c1b4ffe329a4a33429ea9
Parents: bb7a054
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:14:09 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/ecedea0b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index f56d3f9..6c03a97 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -466,7 +466,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public Scan setBatch(int batch) {



[5/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/branch-1.3
Commit: dae97549eec05ee74830ce59b467b0dc054aa92d
Parents: 58891ba
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:14:50 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/dae97549/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index b13837d..1d9b130 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -466,7 +466,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public Scan setBatch(int batch) {



[3/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/branch-1.2
Commit: 46f3f5bf7f9571ba354e76f5703902dd4f508d5f
Parents: 09ade32
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:13:36 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/46f3f5bf/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index b13837d..1d9b130 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -466,7 +466,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public Scan setBatch(int batch) {



[6/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/0.98
Commit: 7ca58503b5514b5fc509a631ed84c0e21a097a63
Parents: aac4e09
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:15:18 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7ca58503/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index 2b77359..710c6dc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -374,7 +374,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public void setBatch(int batch) {



[2/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/branch-1
Commit: c64c0e85c0fe1b8f0c210ff41dbaf4e6b56afa8d
Parents: de2f653
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:13:00 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c64c0e85/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index b13837d..1d9b130 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -466,7 +466,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public Scan setBatch(int batch) {



[1/6] hbase git commit: HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

2016-08-24 Thread enis
Repository: hbase
Updated Branches:
  refs/heads/0.98 aac4e0951 -> 7ca58503b
  refs/heads/branch-1 de2f653ca -> c64c0e85c
  refs/heads/branch-1.1 bb7a054ec -> ecedea0b0
  refs/heads/branch-1.2 09ade3208 -> 46f3f5bf7
  refs/heads/branch-1.3 58891babc -> dae97549e
  refs/heads/master cbfd6eecb -> 1ca849269


HBASE-16376 Scan#setBatch(int) javadoc update WRT partial results

Signed-off-by: Enis Soztutar 


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

Branch: refs/heads/master
Commit: 1ca849269d35494e4adcb4868b4e78e9c6502de7
Parents: cbfd6ee
Author: Josh Elser 
Authored: Sun Aug 21 22:40:42 2016 -0400
Committer: Enis Soztutar 
Committed: Wed Aug 24 05:06:30 2016 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/client/Scan.java   | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1ca84926/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
index 1892f54..ee3ed43 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
@@ -479,7 +479,13 @@ public class Scan extends Query {
   }
 
   /**
-   * Set the maximum number of values to return for each call to next()
+   * Set the maximum number of values to return for each call to next().
+   * Callers should be aware that invoking this method with any value
+   * is equivalent to calling {@link #setAllowPartialResults(boolean)}
+   * with a value of {@code true}; partial results may be returned if
+   * this method is called. Use {@link #setMaxResultSize(long)}} to
+   * limit the size of a Scan's Results instead.
+   *
* @param batch the maximum number of values
*/
   public Scan setBatch(int batch) {



hbase git commit: HBASE-16474 Remove dfs.support.append related code and documentation

2016-08-24 Thread enis
Repository: hbase
Updated Branches:
  refs/heads/master c11923d8a -> cbfd6eecb


HBASE-16474 Remove dfs.support.append related code and documentation


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

Branch: refs/heads/master
Commit: cbfd6eecbddc8833b11aada3658e589c1bf099d6
Parents: c11923d
Author: Enis Soztutar 
Authored: Wed Aug 24 03:41:54 2016 -0700
Committer: Enis Soztutar 
Committed: Wed Aug 24 03:41:54 2016 -0700

--
 .../org/apache/hadoop/hbase/util/FSUtils.java   | 35 +---
 .../hadoop/hbase/TestFullLogReconstruction.java |  1 -
 .../org/apache/hadoop/hbase/TestIOFencing.java  |  3 +-
 .../org/apache/hadoop/hbase/TestZooKeeper.java  |  1 -
 .../apache/hadoop/hbase/client/TestAdmin2.java  |  2 --
 .../hbase/coprocessor/TestWALObserver.java  |  1 -
 .../hadoop/hbase/fs/TestBlockReorder.java   |  1 -
 .../hbase/master/TestMasterTransitions.java |  1 -
 ...stDeleteColumnFamilyProcedureFromClient.java |  1 -
 .../wal/AbstractTestProtobufLog.java|  2 --
 .../regionserver/wal/AbstractTestWALReplay.java |  1 -
 .../regionserver/wal/TestLogRollAbort.java  |  9 -
 .../hbase/regionserver/wal/TestLogRolling.java  | 10 --
 .../replication/TestMasterReplication.java  |  1 -
 .../replication/TestMultiSlaveReplication.java  |  1 -
 .../replication/TestPerTableCFReplication.java  |  1 -
 .../hbase/replication/TestReplicationBase.java  |  4 +--
 .../replication/TestReplicationWithTags.java|  2 --
 .../regionserver/TestReplicationSink.java   |  1 -
 ...sibilityLabelReplicationWithExpAsString.java |  2 --
 .../TestVisibilityLabelsReplication.java|  2 --
 .../apache/hadoop/hbase/util/TestFSUtils.java   |  5 +--
 .../apache/hadoop/hbase/wal/TestWALFactory.java |  2 --
 .../apache/hadoop/hbase/wal/TestWALSplit.java   |  4 +--
 .../hbase/zookeeper/TestZooKeeperACL.java   |  1 -
 src/main/asciidoc/_chapters/configuration.adoc  | 21 +---
 26 files changed, 6 insertions(+), 109 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/cbfd6eec/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
index 3f77610..15f079d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
@@ -83,7 +83,6 @@ import org.apache.hadoop.hdfs.DFSClient;
 import org.apache.hadoop.hdfs.DFSHedgedReadMetrics;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.io.IOUtils;
-import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Progressable;
@@ -1267,6 +1266,7 @@ public abstract class FSUtils {
   super(fs, HConstants.HBASE_NON_TABLE_DIRS);
 }
 
+@Override
 protected boolean isValidName(final String name) {
   if (!super.isValidName(name))
 return false;
@@ -1282,39 +1282,6 @@ public abstract class FSUtils {
   }
 
   /**
-   * Heuristic to determine whether is safe or not to open a file for append
-   * Looks both for dfs.support.append and use reflection to search
-   * for SequenceFile.Writer.syncFs() or FSDataOutputStream.hflush()
-   * @param conf
-   * @return True if append support
-   */
-  public static boolean isAppendSupported(final Configuration conf) {
-boolean append = conf.getBoolean("dfs.support.append", false);
-if (append) {
-  try {
-// TODO: The implementation that comes back when we do a createWriter
-// may not be using SequenceFile so the below is not a definitive test.
-// Will do for now (hdfs-200).
-SequenceFile.Writer.class.getMethod("syncFs", new Class []{});
-append = true;
-  } catch (SecurityException e) {
-  } catch (NoSuchMethodException e) {
-append = false;
-  }
-}
-if (!append) {
-  // Look for the 0.21, 0.22, new-style append evidence.
-  try {
-FSDataOutputStream.class.getMethod("hflush", new Class []{});
-append = true;
-  } catch (NoSuchMethodException e) {
-append = false;
-  }
-}
-return append;
-  }
-
-  /**
* @param conf
* @return True if this filesystem whose scheme is 'hdfs'.
* @throws IOException

http://git-wip-us.apache.org/repos/asf/hbase/blob/cbfd6eec/hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstru

hbase git commit: HBASE-16456 Fix findbugs warnings in hbase-rsgroup module (Guangxu Cheng)

2016-08-24 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master 3909b7c96 -> c11923d8a


HBASE-16456 Fix findbugs warnings in hbase-rsgroup module (Guangxu Cheng)


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

Branch: refs/heads/master
Commit: c11923d8aafbb12a5a837b6e099e164ac5270f8b
Parents: 3909b7c
Author: tedyu 
Authored: Wed Aug 24 02:30:12 2016 -0700
Committer: tedyu 
Committed: Wed Aug 24 02:30:12 2016 -0700

--
 .../hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java  | 16 +++-
 .../hadoop/hbase/rsgroup/RSGroupAdminServer.java|  2 +-
 .../hbase/rsgroup/RSGroupBasedLoadBalancer.java | 16 +---
 .../hbase/rsgroup/RSGroupInfoManagerImpl.java   | 13 -
 4 files changed, 37 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c11923d8/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
--
diff --git 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
index 7172f06..49b02be 100644
--- 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
+++ 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
@@ -93,7 +93,7 @@ public class RSGroupAdminEndpoint extends RSGroupAdminService
   public void start(CoprocessorEnvironment env) throws IOException {
 MasterCoprocessorEnvironment menv = (MasterCoprocessorEnvironment)env;
 master = menv.getMasterServices();
-groupInfoManager = new RSGroupInfoManagerImpl(master);
+setGroupInfoManager(new RSGroupInfoManagerImpl(master));
 groupAdminServer = new RSGroupAdminServer(master, groupInfoManager);
 Class clazz =
 
master.getConfiguration().getClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, 
null);
@@ -111,6 +111,20 @@ public class RSGroupAdminEndpoint extends 
RSGroupAdminService
 return this;
   }
 
+  private static void setStaticGroupInfoManager(RSGroupInfoManagerImpl 
groupInfoManager) {
+RSGroupAdminEndpoint.groupInfoManager = groupInfoManager;
+  }
+
+  private void setGroupInfoManager(RSGroupInfoManagerImpl groupInfoManager) 
throws IOException {
+if (groupInfoManager == null) {
+  groupInfoManager = new RSGroupInfoManagerImpl(master);
+  groupInfoManager.init();
+} else if (!groupInfoManager.isInit()) {
+  groupInfoManager.init();
+}
+setStaticGroupInfoManager(groupInfoManager);
+  }
+
   public RSGroupInfoManager getGroupInfoManager() {
 return groupInfoManager;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c11923d8/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
--
diff --git 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
index 7aea464..dc28f7d 100644
--- 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
+++ 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
@@ -216,7 +216,7 @@ public class RSGroupAdminServer extends RSGroupAdmin {
 }
   }
   try {
-Thread.sleep(1000);
+manager.wait(1000);
   } catch (InterruptedException e) {
 LOG.warn("Sleep interrupted", e);
 Thread.currentThread().interrupt();

http://git-wip-us.apache.org/repos/asf/hbase/blob/c11923d8/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
--
diff --git 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
index 0e7f267..b5dd743 100644
--- 
a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
+++ 
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
@@ -316,18 +316,19 @@ public class RSGroupBasedLoadBalancer implements 
RSGroupableBalancer, LoadBalanc
   private Set getMisplacedRegions(
   Map regions) throws IOException {
 Set misplacedRegions = new HashSet();
-for (HRegionInfo region : regions.keySet()) {
-  ServerName assignedServer = regions.get(region);
+for(Map.Entry region : regions.entrySet())