hbase git commit: HBASE-19782 Reject the replication request when peer is DA or A state

2018-04-23 Thread openinx
Repository: hbase
Updated Branches:
  refs/heads/HBASE-19064 2fd681384 -> b0e6ff7db


HBASE-19782 Reject the replication request when peer is DA or A state


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

Branch: refs/heads/HBASE-19064
Commit: b0e6ff7dbbb2cf6da5d221d0ee5a3970d5fe230e
Parents: 2fd6813
Author: huzheng 
Authored: Fri Mar 2 18:05:29 2018 +0800
Committer: huzheng 
Committed: Mon Apr 23 11:13:44 2018 +0800

--
 .../hbase/protobuf/ReplicationProtbufUtil.java  |  2 +-
 .../hadoop/hbase/regionserver/HRegion.java  |  2 +-
 .../hbase/regionserver/HRegionServer.java   |  5 +--
 .../hbase/regionserver/RSRpcServices.java   | 25 +--
 .../RejectReplicationRequestStateChecker.java   | 45 
 .../ReplaySyncReplicationWALCallable.java   | 24 ++-
 .../replication/regionserver/Replication.java   |  2 +-
 .../regionserver/ReplicationSink.java   | 16 +++
 .../SyncReplicationPeerInfoProvider.java| 11 ++---
 .../SyncReplicationPeerInfoProviderImpl.java| 13 +++---
 .../SyncReplicationPeerMappingManager.java  |  5 +--
 .../hbase/wal/SyncReplicationWALProvider.java   |  7 +--
 .../replication/SyncReplicationTestBase.java| 32 ++
 .../replication/TestSyncReplicationActive.java  | 13 +-
 .../regionserver/TestReplicationSink.java   |  5 +--
 .../regionserver/TestWALEntrySinkFilter.java|  3 +-
 .../wal/TestSyncReplicationWALProvider.java |  6 +--
 17 files changed, 163 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b0e6ff7d/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
index 81dd59e..e01f881 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellScanner;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.PrivateCellUtil;
+import org.apache.hadoop.hbase.wal.WAL.Entry;
 import org.apache.hadoop.hbase.wal.WALKeyImpl;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.io.SizedCellScanner;
@@ -45,7 +46,6 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminServic
 import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos;
 import org.apache.hadoop.hbase.util.Pair;
-import org.apache.hadoop.hbase.wal.WAL.Entry;
 
 @InterfaceAudience.Private
 public class ReplicationProtbufUtil {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b0e6ff7d/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 e263fc1..582a702 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
@@ -1981,7 +1981,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   private boolean shouldForbidMajorCompaction() {
 if (rsServices != null && rsServices.getReplicationSourceService() != 
null) {
   return 
rsServices.getReplicationSourceService().getSyncReplicationPeerInfoProvider()
-  .checkState(getRegionInfo(), ForbidMajorCompactionChecker.get());
+  .checkState(getRegionInfo().getTable(), 
ForbidMajorCompactionChecker.get());
 }
 return false;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b0e6ff7d/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 4dd8f09..5963cd9 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionSe

[04/50] [abbrv] hbase git commit: HBASE-20398 Redirect doesn't work on web UI

2018-04-23 Thread zhangduo
HBASE-20398 Redirect doesn't work on web UI


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

Branch: refs/heads/HBASE-19064
Commit: b926d359b2ca2dc638cd7157b670f81b2933b4be
Parents: 32764bf
Author: Balazs Meszaros 
Authored: Tue Apr 17 14:58:08 2018 +0200
Committer: Michael Stack 
Committed: Tue Apr 17 09:18:52 2018 -0700

--
 .../resources/hbase-webapps/master/redirect.jsp | 27 
 .../resources/hbase-webapps/master/rsgroup.jsp  |  4 +--
 .../resources/hbase-webapps/master/snapshot.jsp |  2 +-
 .../resources/hbase-webapps/master/table.jsp|  4 +--
 4 files changed, 32 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b926d359/hbase-server/src/main/resources/hbase-webapps/master/redirect.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/redirect.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/redirect.jsp
new file mode 100644
index 000..f9e3ae6
--- /dev/null
+++ b/hbase-server/src/main/resources/hbase-webapps/master/redirect.jsp
@@ -0,0 +1,27 @@
+<%--
+/**
+* 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.
+*/
+--%>
+
+  Go Back, or wait for the redirect.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/hbase/blob/b926d359/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
index 7a80c35..0b2b581 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/rsgroup.jsp
@@ -63,7 +63,7 @@
   RSGroups are not enabled
 
   
-  Go Back, or wait for the redirect.
+  
 <%
   } else if (rsGroupName == null || rsGroupName.isEmpty() ||
   (rsGroupInfo = RSGroupTableAccessor.getRSGroupInfo(
@@ -74,7 +74,7 @@
   RSGroup: <%= rsGroupName %> does not exist
 
   
-  Go Back, or wait for the redirect.
+  
 <%
   } else {
 List rsGroupServers = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b926d359/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
index b0cfe87..6e1c9eb 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp
@@ -72,7 +72,7 @@
   Snapshot "<%= snapshotName %>" does not exist
 
   
-  Go Back, or wait for the redirect.
+  
 <% } else { %>
   
   

http://git-wip-us.apache.org/repos/asf/hbase/blob/b926d359/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index aa96249..abe8fb9 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -185,7 +185,7 @@ if ( fqtn != null ) {
 }
   }
 %>
-Go Back, or wait for the redirect.
+
 
 <%
   } else {
@@ -811,7 +811,7 @@ Actions:
 
 
 
-Go Back, or wait for the redirect.
+
 
 <% } %>
 



[19/50] [abbrv] hbase git commit: HBASE-20438 Add an HBase antipattern check for reintroducing commons-logging

2018-04-23 Thread zhangduo
HBASE-20438 Add an HBase antipattern check for reintroducing commons-logging

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: 8219ec749331eb163060f5ffbeedd8ae826ebfe1
Parents: 4e18374
Author: Nihal Jain 
Authored: Wed Apr 18 23:03:07 2018 +0530
Committer: Sean Busbey 
Committed: Fri Apr 20 11:54:01 2018 -0500

--
 dev-support/hbase-personality.sh | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/8219ec74/dev-support/hbase-personality.sh
--
diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh
index 2198913..b010503 100755
--- a/dev-support/hbase-personality.sh
+++ b/dev-support/hbase-personality.sh
@@ -642,6 +642,12 @@ function hbaseanti_patchfile
 ((result=result+1))
   fi
 
+  warnings=$(${GREP} -cE 'org.apache.commons.logging.Log(Factory|;)' 
"${patchfile}")
+  if [[ ${warnings} -gt 0 ]]; then
+add_vote_table -1 hbaseanti "" "The patch appears to use commons-logging 
instead of slf4j."
+((result=result+1))
+  fi
+
   if [[ ${result} -gt 0 ]]; then
 return 1
   fi



[15/50] [abbrv] hbase git commit: HBASE-20439 Clean up incorrect use of commons-logging in hbase-server

2018-04-23 Thread zhangduo
HBASE-20439 Clean up incorrect use of commons-logging in hbase-server

Signed-off-by: Umesh Agashe 
Signed-off-by: Yu Li 


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

Branch: refs/heads/HBASE-19064
Commit: b1fc00e16f4bb559d039d9dc162cae8042414661
Parents: 70377ba
Author: Sean Busbey 
Authored: Tue Apr 17 14:40:25 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 07:27:18 2018 -0500

--
 .../apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java | 7 ---
 .../hadoop/hbase/quotas/FileArchiverNotifierImpl.java   | 7 ---
 .../hadoop/hbase/quotas/RegionSizeReportingChore.java   | 7 ---
 .../org/apache/hadoop/hbase/quotas/RegionSizeStoreImpl.java | 7 ---
 .../hbase/regionserver/throttle/StoreHotnessProtector.java  | 9 ++---
 .../org/apache/hadoop/hbase/TestClusterPortAssignment.java  | 7 ---
 .../org/apache/hadoop/hbase/client/TestFlushFromClient.java | 7 ---
 .../hadoop/hbase/client/TestSeparateClientZKCluster.java| 7 ---
 .../hadoop/hbase/procedure/TestFailedProcCleanup.java   | 7 ---
 .../java/org/apache/hadoop/hbase/wal/TestDisabledWAL.java   | 7 ---
 10 files changed, 42 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b1fc00e1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java
index 8f735bd..550aea7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/zksyncer/ClientZKSyncer.java
@@ -25,8 +25,6 @@ import java.util.Map;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.util.Threads;
@@ -37,6 +35,9 @@ import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * Tracks the target znode(s) on server ZK cluster and synchronize them to 
client ZK cluster if
  * changed
@@ -45,7 +46,7 @@ import org.apache.zookeeper.KeeperException;
  */
 @InterfaceAudience.Private
 public abstract class ClientZKSyncer extends ZKListener {
-  private static final Log LOG = LogFactory.getLog(ClientZKSyncer.class);
+  private static final Logger LOG = 
LoggerFactory.getLogger(ClientZKSyncer.class);
   private final Server server;
   private final ZKWatcher clientZkWatcher;
   // We use queues and daemon threads to synchronize the data to client ZK 
cluster

http://git-wip-us.apache.org/repos/asf/hbase/blob/b1fc00e1/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
index 8cde9c1..58434f7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
@@ -35,8 +35,6 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -54,6 +52,9 @@ import org.apache.hadoop.hbase.util.HFileArchiveUtil;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.yetus.audience.InterfaceAudience;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.hbase.thirdparty.com.google.common.collect.HashMultimap;
 import org.apache.hbase.thirdparty.com.google.common.collect.Multimap;
 import 
org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException;
@@ -69,7 +70,7 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.Snapshot
  */
 @InterfaceAudience.Private
 public class FileArchiverNotifierImpl implements FileArchiverNotifier

[21/50] [abbrv] hbase git commit: HBASE-20441 Use checkstyle to ban imports from commons-lang 2

2018-04-23 Thread zhangduo
HBASE-20441 Use checkstyle to ban imports from commons-lang 2

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: afb6d3eccef449bad8a5108919c50bdc37db1664
Parents: 90fe98a
Author: Balazs Meszaros 
Authored: Thu Apr 19 14:06:56 2018 +0200
Committer: Sean Busbey 
Committed: Fri Apr 20 13:38:24 2018 -0500

--
 hbase-checkstyle/src/main/resources/hbase/checkstyle.xml | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/afb6d3ec/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
--
diff --git a/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml 
b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
index b5c7c97..c77d46b9 100644
--- a/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
+++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
@@ -77,7 +77,15 @@
   
 
 
-  
+  
 
 



[08/50] [abbrv] hbase git commit: HBASE-20421 HBasecontext creates a connection but does not close it (Yu Wang)

2018-04-23 Thread zhangduo
HBASE-20421 HBasecontext creates a connection but does not close it (Yu Wang)


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

Branch: refs/heads/HBASE-19064
Commit: f4f2b68238a094d7b1931dc8b7939742ccbb2b57
Parents: fd2cec7
Author: tedyu 
Authored: Tue Apr 17 19:45:53 2018 -0700
Committer: tedyu 
Committed: Tue Apr 17 19:45:53 2018 -0700

--
 .../hadoop/hbase/spark/HBaseContext.scala   | 356 ++-
 1 file changed, 181 insertions(+), 175 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f4f2b682/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala
--
diff --git 
a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala 
b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala
index 656b8c2..e50a3e8 100644
--- 
a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala
+++ 
b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala
@@ -628,87 +628,90 @@ class HBaseContext(@transient val sc: SparkContext,
   throw new FileAlreadyExistsException("Path " + stagingDir + " already 
exists")
 }
 val conn = HBaseConnectionCache.getConnection(config)
-val regionLocator = conn.getRegionLocator(tableName)
-val startKeys = regionLocator.getStartKeys
-if (startKeys.length == 0) {
-  logInfo("Table " + tableName.toString + " was not found")
-}
-val defaultCompressionStr = config.get("hfile.compression",
-  Compression.Algorithm.NONE.getName)
-val hfileCompression = HFileWriterImpl
-  .compressionByName(defaultCompressionStr)
-val nowTimeStamp = System.currentTimeMillis()
-val tableRawName = tableName.getName
+try {
+  val regionLocator = conn.getRegionLocator(tableName)
+  val startKeys = regionLocator.getStartKeys
+  if (startKeys.length == 0) {
+logInfo("Table " + tableName.toString + " was not found")
+  }
+  val defaultCompressionStr = config.get("hfile.compression",
+Compression.Algorithm.NONE.getName)
+  val hfileCompression = HFileWriterImpl
+.compressionByName(defaultCompressionStr)
+  val nowTimeStamp = System.currentTimeMillis()
+  val tableRawName = tableName.getName
 
-val familyHFileWriteOptionsMapInternal =
-  new util.HashMap[ByteArrayWrapper, FamilyHFileWriteOptions]
+  val familyHFileWriteOptionsMapInternal =
+new util.HashMap[ByteArrayWrapper, FamilyHFileWriteOptions]
 
-val entrySetIt = familyHFileWriteOptionsMap.entrySet().iterator()
+  val entrySetIt = familyHFileWriteOptionsMap.entrySet().iterator()
 
-while (entrySetIt.hasNext) {
-  val entry = entrySetIt.next()
-  familyHFileWriteOptionsMapInternal.put(new 
ByteArrayWrapper(entry.getKey), entry.getValue)
-}
+  while (entrySetIt.hasNext) {
+val entry = entrySetIt.next()
+familyHFileWriteOptionsMapInternal.put(new 
ByteArrayWrapper(entry.getKey), entry.getValue)
+  }
 
-val regionSplitPartitioner =
-  new BulkLoadPartitioner(startKeys)
-
-//This is where all the magic happens
-//Here we are going to do the following things
-// 1. FlapMap every row in the RDD into key column value tuples
-// 2. Then we are going to repartition sort and shuffle
-// 3. Finally we are going to write out our HFiles
-rdd.flatMap( r => flatMap(r)).
-  repartitionAndSortWithinPartitions(regionSplitPartitioner).
-  hbaseForeachPartition(this, (it, conn) => {
-
-  val conf = broadcastedConf.value.value
-  val fs = FileSystem.get(conf)
-  val writerMap = new mutable.HashMap[ByteArrayWrapper, WriterLength]
-  var previousRow:Array[Byte] = HConstants.EMPTY_BYTE_ARRAY
-  var rollOverRequested = false
-  val localTableName = TableName.valueOf(tableRawName)
-
-  //Here is where we finally iterate through the data in this partition of 
the
-  //RDD that has been sorted and partitioned
-  it.foreach{ case (keyFamilyQualifier, cellValue:Array[Byte]) =>
-
-val wl = writeValueToHFile(keyFamilyQualifier.rowKey,
-  keyFamilyQualifier.family,
-  keyFamilyQualifier.qualifier,
-  cellValue,
-  nowTimeStamp,
-  fs,
-  conn,
-  localTableName,
-  conf,
-  familyHFileWriteOptionsMapInternal,
-  hfileCompression,
-  writerMap,
-  stagingDir)
+  val regionSplitPartitioner =
+new BulkLoadPartitioner(startKeys)
+
+  //This is where all the magic happens
+  //Here we are going to

[09/50] [abbrv] hbase git commit: HBASE-20449 The minimun number of region should be configurable in Normalizer

2018-04-23 Thread zhangduo
HBASE-20449 The minimun number of region should be configurable in Normalizer

Signed-off-by: tedyu 


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

Branch: refs/heads/HBASE-19064
Commit: 80cbc0d1fefdba1492d7ec6e580ad54a2960cbdb
Parents: f4f2b68
Author: wangyu 
Authored: Wed Apr 18 18:09:03 2018 +0800
Committer: tedyu 
Committed: Wed Apr 18 08:45:52 2018 -0700

--
 hbase-common/src/main/resources/hbase-default.xml |  5 +
 .../hbase/master/normalizer/SimpleRegionNormalizer.java   | 10 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/80cbc0d1/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index 61f0461..7983ea3 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -617,6 +617,11 @@ possible configurations would overwhelm and obscure the 
important.
 Period at which the region normalizer runs in the 
Master.
   
   
+hbase.normalizer.min.region.count
+3
+configure the minimum number of regions
+  
+  
 hbase.regions.slop
 0.001
 Rebalance if any regionserver has average + (average * slop) 
regions.

http://git-wip-us.apache.org/repos/asf/hbase/blob/80cbc0d1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
index ea2187b..f02ccf4 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseIOException;
 import org.apache.hadoop.hbase.RegionMetrics;
 import org.apache.hadoop.hbase.ServerName;
@@ -61,11 +62,14 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.RequestConverter;
 public class SimpleRegionNormalizer implements RegionNormalizer {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(SimpleRegionNormalizer.class);
-  private static final int MIN_REGION_COUNT = 3;
+  private int minRegionCount;
   private MasterServices masterServices;
   private MasterRpcServices masterRpcServices;
   private static long[] skippedCount = new 
long[NormalizationPlan.PlanType.values().length];
 
+  public SimpleRegionNormalizer() {
+minRegionCount = 
HBaseConfiguration.create().getInt("hbase.normalizer.min.region.count", 3);
+  }
   /**
* Set the master service.
* @param masterServices inject instance of MasterServices
@@ -131,10 +135,10 @@ public class SimpleRegionNormalizer implements 
RegionNormalizer {
   getRegionsOfTable(table);
 
 //TODO: should we make min number of regions a config param?
-if (tableRegions == null || tableRegions.size() < MIN_REGION_COUNT) {
+if (tableRegions == null || tableRegions.size() < minRegionCount) {
   int nrRegions = tableRegions == null ? 0 : tableRegions.size();
   LOG.debug("Table " + table + " has " + nrRegions + " regions, required 
min number"
-+ " of regions for normalizer to run is " + MIN_REGION_COUNT + ", not 
running normalizer");
++ " of regions for normalizer to run is " + minRegionCount + ", not 
running normalizer");
   return null;
 }
 



[01/50] [abbrv] hbase git commit: HBASE-19994 Create a new class for RPC throttling exception, make it retryable [Forced Update!]

2018-04-23 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/HBASE-19064 b0e6ff7db -> afd78256c (forced update)


HBASE-19994 Create a new class for RPC throttling exception, make it retryable


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

Branch: refs/heads/HBASE-19064
Commit: 1fe3d6a0e915dd2b51e4ffbfe171db79985099fe
Parents: 44ebd28
Author: Huaxiang Sun 
Authored: Mon Apr 16 17:27:14 2018 -0700
Committer: Huaxiang Sun 
Committed: Mon Apr 16 17:27:14 2018 -0700

--
 .../hbase/exceptions/ClientExceptionsUtil.java  |   6 +-
 .../hbase/quotas/RpcThrottlingException.java| 131 +++
 .../hbase/quotas/ThrottlingException.java   |   3 +
 .../hbase/quotas/DefaultOperationQuota.java |   2 +-
 .../hadoop/hbase/quotas/NoopOperationQuota.java |   2 +-
 .../hadoop/hbase/quotas/NoopQuotaLimiter.java   |   2 +-
 .../hadoop/hbase/quotas/OperationQuota.java |   5 +-
 .../hadoop/hbase/quotas/QuotaLimiter.java   |   4 +-
 .../quotas/RegionServerRpcQuotaManager.java |  14 +-
 .../hadoop/hbase/quotas/TimeBasedLimiter.java   |  14 +-
 .../hadoop/hbase/client/TestMetaCache.java  |  14 +-
 .../hadoop/hbase/quotas/TestQuotaAdmin.java |  66 +-
 .../hadoop/hbase/quotas/TestQuotaState.java |   4 +-
 .../hadoop/hbase/quotas/TestQuotaThrottle.java  |   4 +-
 14 files changed, 229 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1fe3d6a0/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
index 4a7ef3e..126571b 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
@@ -39,7 +39,7 @@ import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
 import org.apache.hadoop.hbase.ipc.CallTimeoutException;
 import org.apache.hadoop.hbase.ipc.FailedServerException;
-import org.apache.hadoop.hbase.quotas.ThrottlingException;
+import org.apache.hadoop.hbase.quotas.RpcThrottlingException;
 import org.apache.hadoop.ipc.RemoteException;
 
 @InterfaceAudience.Private
@@ -60,7 +60,7 @@ public final class ClientExceptionsUtil {
 
   public static boolean isSpecialException(Throwable cur) {
 return (cur instanceof RegionMovedException || cur instanceof 
RegionOpeningException
-|| cur instanceof RegionTooBusyException || cur instanceof 
ThrottlingException
+|| cur instanceof RegionTooBusyException || cur instanceof 
RpcThrottlingException
 || cur instanceof MultiActionResultTooLarge || cur instanceof 
RetryImmediatelyException
 || cur instanceof CallQueueTooBigException || cur instanceof 
CallDroppedException
 || cur instanceof NotServingRegionException || cur instanceof 
RequestTooBigException);
@@ -73,7 +73,7 @@ public final class ClientExceptionsUtil {
* - nested exceptions
*
* Looks for: RegionMovedException / RegionOpeningException / 
RegionTooBusyException /
-   *ThrottlingException
+   *RpcThrottlingException
* @return null if we didn't find the exception, the exception otherwise.
*/
   public static Throwable findException(Object exception) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1fe3d6a0/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
new file mode 100644
index 000..9baf91f
--- /dev/null
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
@@ -0,0 +1,131 @@
+/**
+ * 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 unde

[03/50] [abbrv] hbase git commit: HBASE-20399 Fix merge layout

2018-04-23 Thread zhangduo
HBASE-20399 Fix merge layout


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

Branch: refs/heads/HBASE-19064
Commit: 32764bfb2c9eb1d5e9e271840f902670d64e
Parents: 42d5447
Author: Balazs Meszaros 
Authored: Fri Apr 13 17:31:28 2018 +0200
Committer: Michael Stack 
Committed: Tue Apr 17 09:17:25 2018 -0700

--
 .../resources/hbase-webapps/master/table.jsp| 71 +++-
 1 file changed, 41 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/32764bfb/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index a992cc3..aa96249 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -720,46 +720,57 @@ if (withReplica) {
 Actions:
 
 
-
+
 
   
-  
-  
-  
-  
-   
-  Row Key (optional):
-  This action will force a compaction of all
-  regions of the table, or, if a key is supplied, only the region containing 
the
-  given key.
+  
+  
+  
+
+  
+  
+
+  
+  
+This action will force a compaction of all regions of the table, or,
+if a key is supplied, only the region containing the
+given key.
+  
   
 
- 
 
   
-  
-  
-  
-  
-   
-  Row Key (optional):
-  This action will force a split of all eligible
-  regions of the table, or, if a key is supplied, only the region containing 
the
-  given key. An eligible region is one that does not contain any references to
-  other regions. Split requests for noneligible regions will be ignored.
+  
+  
+  
+
+  
+  
+
+  
+  
+ This action will force a split of all eligible
+ regions of the table, or, if a key is supplied, only the region 
containing the
+ given key. An eligible region is one that does not contain any 
references to
+ other regions. Split requests for noneligible regions will be ignored.
+  
   
 
 
   
-  
-  
-  
-  
-   
-  Region Key (Required):
-  Region Key (Required) :
-  This action will merge two
-  regions of the table, Merge requests for noneligible regions will be 
ignored.
+  
+  
+  
+
+  
+  
+
+
+  
+  
+This action will merge two regions of the table, Merge requests for
+noneligible regions will be ignored.
+  
   
 
 



[12/50] [abbrv] hbase git commit: HBASE-18059 remove scanner order related code

2018-04-23 Thread zhangduo
HBASE-18059 remove scanner order related code


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

Branch: refs/heads/HBASE-19064
Commit: 556b22374423ff087c0583d02ae4298d4d4f2e6b
Parents: 6ca8261
Author: jingyuntian 
Authored: Wed Apr 18 10:43:01 2018 +0800
Committer: Michael Stack 
Committed: Wed Apr 18 19:38:08 2018 -0700

--
 .../hbase/regionserver/AbstractMemStore.java| 10 --
 .../hbase/regionserver/CompactingMemStore.java  | 14 +-
 .../regionserver/CompositeImmutableSegment.java | 12 ++--
 .../hbase/regionserver/DefaultMemStore.java |  5 ++---
 .../hadoop/hbase/regionserver/KeyValueHeap.java |  7 ---
 .../hbase/regionserver/KeyValueScanner.java | 12 ++--
 .../MemStoreCompactorSegmentsIterator.java  |  5 +
 .../MemStoreMergerSegmentsIterator.java |  3 +--
 .../hbase/regionserver/MemStoreSnapshot.java|  2 +-
 .../hadoop/hbase/regionserver/Segment.java  | 12 ++--
 .../hbase/regionserver/SegmentScanner.java  | 20 +---
 .../hadoop/hbase/regionserver/StoreScanner.java |  7 ---
 .../hbase/util/CollectionBackedScanner.java |  7 ---
 13 files changed, 25 insertions(+), 91 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/556b2237/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 e6fd04d..9f4fd2f 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
@@ -60,18 +60,16 @@ public abstract class AbstractMemStore implements MemStore {
 
   public final static long DEEP_OVERHEAD = FIXED_OVERHEAD;
 
-  public static long addToScanners(List segments, long 
readPt, long order,
+  public static void addToScanners(List segments, long 
readPt,
   List scanners) {
 for (Segment item : segments) {
-  order = addToScanners(item, readPt, order, scanners);
+  addToScanners(item, readPt, scanners);
 }
-return order;
   }
 
-  protected static long addToScanners(Segment segment, long readPt, long order,
+  protected static void addToScanners(Segment segment, long readPt,
   List scanners) {
-scanners.add(segment.getScanner(readPt, order));
-return order - 1;
+scanners.add(segment.getScanner(readPt));
   }
 
   protected AbstractMemStore(final Configuration conf, final CellComparator c) 
{

http://git-wip-us.apache.org/repos/asf/hbase/blob/556b2237/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
index ea4cc08..68d7d7e 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java
@@ -354,20 +354,16 @@ public class CompactingMemStore extends AbstractMemStore {
   }
 
   @Override
-  /*
-   * Scanners are ordered from 0 (oldest) to newest in increasing order.
-   */
   public List getScanners(long readPt) throws IOException {
 MutableSegment activeTmp = active;
 List pipelineList = pipeline.getSegments();
 List snapshotList = snapshot.getAllSegments();
-long order = 1L + pipelineList.size() + snapshotList.size();
+long numberOfSegments = 1L + pipelineList.size() + snapshotList.size();
 // The list of elements in pipeline + the active element + the snapshot 
segment
-// The order is the Segment ordinal
-List list = createList((int) order);
-order = addToScanners(activeTmp, readPt, order, list);
-order = addToScanners(pipelineList, readPt, order, list);
-addToScanners(snapshotList, readPt, order, list);
+List list = createList((int) numberOfSegments);
+addToScanners(activeTmp, readPt, list);
+addToScanners(pipelineList, readPt, list);
+addToScanners(snapshotList, readPt, list);
 return list;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/556b2237/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
---

[02/50] [abbrv] hbase git commit: HBASE-20128 Add new UTs which extends the old replication UTs but set replication scope to SERIAL

2018-04-23 Thread zhangduo
HBASE-20128 Add new UTs which extends the old replication UTs but set 
replication scope to SERIAL


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

Branch: refs/heads/HBASE-19064
Commit: 42d5447cfbc593becfc26684e03f482eb3a0fc49
Parents: 1fe3d6a
Author: huzheng 
Authored: Thu Apr 12 15:17:32 2018 +0800
Committer: huzheng 
Committed: Tue Apr 17 10:56:21 2018 +0800

--
 .../TestReplicationAdminWithClusters.java   | 10 -
 .../replication/TestMasterReplication.java  |  2 +-
 .../replication/TestMultiSlaveReplication.java  |  2 +-
 .../replication/TestNamespaceReplication.java   | 26 +--
 .../hbase/replication/TestReplicationBase.java  | 46 ++-
 ...estReplicationChangingPeerRegionservers.java | 30 ++---
 .../TestReplicationDroppedTables.java   |  6 +++
 .../replication/TestReplicationEndpoint.java|  8 +++-
 .../TestReplicationKillMasterRS.java|  6 +--
 .../TestReplicationKillMasterRSCompressed.java  |  2 +-
 ...licationKillMasterRSWithSeparateOldWALs.java | 47 
 .../replication/TestReplicationKillSlaveRS.java |  5 +--
 ...plicationKillSlaveRSWithSeparateOldWALs.java | 47 
 .../replication/TestReplicationSmallTests.java  | 24 +-
 .../replication/TestReplicationSyncUpTool.java  |  9 +++-
 15 files changed, 222 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5447c/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminWithClusters.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminWithClusters.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminWithClusters.java
index bc21f1a..7be8c16 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminWithClusters.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdminWithClusters.java
@@ -96,12 +96,13 @@ public class TestReplicationAdminWithClusters extends 
TestReplicationBase {
 admin1.modifyTable(tableName, table);
 admin1.enableTable(tableName);
 
-
 admin1.disableTableReplication(tableName);
 table = admin1.getTableDescriptor(tableName);
 for (HColumnDescriptor fam : table.getColumnFamilies()) {
   assertEquals(HConstants.REPLICATION_SCOPE_LOCAL, fam.getScope());
 }
+
+admin1.deleteColumnFamily(table.getTableName(), f.getName());
   }
 
   @Test
@@ -158,6 +159,9 @@ public class TestReplicationAdminWithClusters extends 
TestReplicationBase {
 for (HColumnDescriptor fam : table.getColumnFamilies()) {
   assertEquals(HConstants.REPLICATION_SCOPE_GLOBAL, fam.getScope());
 }
+
+admin1.deleteColumnFamily(tableName, f.getName());
+admin2.deleteColumnFamily(tableName, f.getName());
   }
 
   @Test
@@ -252,12 +256,14 @@ public class TestReplicationAdminWithClusters extends 
TestReplicationBase {
 rpc.getConfiguration().put("key1", "value2");
 admin.updatePeerConfig(peerId, rpc);
 if (!TestUpdatableReplicationEndpoint.hasCalledBack()) {
-  synchronized(TestUpdatableReplicationEndpoint.class) {
+  synchronized (TestUpdatableReplicationEndpoint.class) {
 TestUpdatableReplicationEndpoint.class.wait(2000L);
   }
 }
 
 assertEquals(true, TestUpdatableReplicationEndpoint.hasCalledBack());
+
+admin.removePeer(peerId);
   }
 
   public static class TestUpdatableReplicationEndpoint extends 
BaseReplicationEndpoint {

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5447c/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
index de0b94f..37ca7dc 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
@@ -90,7 +90,7 @@ public class TestMasterReplication {
   public static final HBaseClassTestRule CLASS_RULE =
   HBaseClassTestRule.forClass(TestMasterReplication.class);
 
-  private static final Logger LOG = 
LoggerFactory.getLogger(TestReplicationBase.class);
+  private static final Logger LOG = 
LoggerFactory.getLogger(TestMasterReplication.class);
 

[11/50] [abbrv] hbase git commit: HBASE-18792 Disabled destructive (mostly write) operations in hbck for HBase 2.0+

2018-04-23 Thread zhangduo
HBASE-18792 Disabled destructive (mostly write) operations in hbck for HBase 
2.0+

HBase server versioned is checked after connecting to the server and then 
following operations are not allowed:
-fix, -fixAssignments, -fixMeta, -fixHdfsHoles, -fixHdfsOrphans, 
-fixTableOrphans, -fixHdfsOverlaps, -maxMerge
-sidelineBigOverlaps, -maxOverlapsToSideline, -fixSplitParents, -removeParents, 
-fixEmptyMetaCells
-repair, -repairHoles


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

Branch: refs/heads/HBASE-19064
Commit: 6ca8261fc0d665e4966f12bf0d872761bdfb430e
Parents: 6ce1136
Author: Umesh Agashe 
Authored: Wed Apr 4 15:00:06 2018 -0700
Committer: Michael Stack 
Committed: Wed Apr 18 15:22:39 2018 -0700

--
 .../apache/hadoop/hbase/util/VersionInfo.java   | 53 -
 .../org/apache/hadoop/hbase/util/HBaseFsck.java | 83 +++-
 2 files changed, 98 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6ca8261f/hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java
index 9d9b563..86ac065 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/VersionInfo.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -35,7 +35,7 @@ public class VersionInfo {
 
   // If between two dots there is not a number, we regard it as a very large 
number so it is
   // higher than any numbers in the version.
-  private static int VERY_LARGE_NUMBER = 10;
+  private static final int VERY_LARGE_NUMBER = 10;
 
   /**
* Get the hbase version.
@@ -118,39 +118,54 @@ public class VersionInfo {
   return 0;
 }
 
-String s1[] = v1.split("\\.|-");//1.2.3-hotfix -> [1, 2, 3, hotfix]
-String s2[] = v2.split("\\.|-");
+Object[] v1Comps = getVersionComponents(v1); //1.2.3-hotfix -> [1, 2, 3, 
hotfix]
+Object[] v2Comps = getVersionComponents(v2);
 int index = 0;
-while (index < s1.length && index < s2.length) {
-  int va = VERY_LARGE_NUMBER, vb = VERY_LARGE_NUMBER;
-  try {
-va = Integer.parseInt(s1[index]);
-  } catch (Exception ingore) {
-  }
-  try {
-vb = Integer.parseInt(s2[index]);
-  } catch (Exception ingore) {
-  }
+while (index < v1Comps.length && index < v2Comps.length) {
+  int va = v1Comps[index] instanceof Integer ? (Integer)v1Comps[index] : 
VERY_LARGE_NUMBER;
+  int vb = v2Comps[index] instanceof Integer ? (Integer)v2Comps[index] : 
VERY_LARGE_NUMBER;
+
   if (va != vb) {
 return va - vb;
   }
   if (va == VERY_LARGE_NUMBER) {
-// compare as String
-int c = s1[index].compareTo(s2[index]);
+// here, va and vb components must be same and Strings, compare as 
String
+int c = ((String)v1Comps[index]).compareTo((String)v2Comps[index]);
 if (c != 0) {
   return c;
 }
   }
   index++;
 }
-if (index < s1.length) {
-  // s1 is longer
+if (index < v1Comps.length) {
+  // v1 is longer
   return 1;
 }
-//s2 is longer
+//v2 is longer
 return -1;
   }
 
+  /**
+   * Returns the version components as Integer and String objects
+   * Examples: "1.2.3" returns [1, 2, 3], "4.5.6-SNAPSHOT" returns [4, 5, 6, 
"SNAPSHOT"]
+   * @return the components of the version string
+   */
+  static Object[] getVersionComponents(final String version) {
+assert(version != null);
+Object[] strComps = version.split("[\\.-]");
+assert(strComps.length > 0);
+
+Object[] comps = new Object[strComps.length];
+for (int i = 0; i < strComps.length; ++i) {
+  try {
+comps[i] = Integer.parseInt((String) strComps[i]);
+  } catch (NumberFormatException e) {
+comps[i] = strComps[i];
+  }
+}
+return comps;
+  }
+
   public static void main(String[] args) {
 writeTo(System.out);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6ca8261f/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java 
b/hbase-server/src/main/java/org/apache/hadoop

[06/50] [abbrv] hbase git commit: HBASE-20275 [DOC] clarify impact to hfile command from HBASE-17197

2018-04-23 Thread zhangduo
HBASE-20275 [DOC] clarify impact to hfile command from HBASE-17197

Signed-off-by: Mike Drob 


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

Branch: refs/heads/HBASE-19064
Commit: 357a089e061dcf80a8c516a65268437d211f70d2
Parents: 824ee52
Author: Balazs Meszaros 
Authored: Fri Apr 13 14:00:47 2018 +0200
Committer: Mike Drob 
Committed: Tue Apr 17 12:27:33 2018 -0500

--
 src/main/asciidoc/_chapters/architecture.adoc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/357a089e/src/main/asciidoc/_chapters/architecture.adoc
--
diff --git a/src/main/asciidoc/_chapters/architecture.adoc 
b/src/main/asciidoc/_chapters/architecture.adoc
index 1d6fc60..8d0a5b0 100644
--- a/src/main/asciidoc/_chapters/architecture.adoc
+++ b/src/main/asciidoc/_chapters/architecture.adoc
@@ -1626,20 +1626,20 @@ Also see <> for information about the HFile v2 
format that was included
 [[hfile_tool]]
 = HFile Tool
 
-To view a textualized version of HFile content, you can use the 
`org.apache.hadoop.hbase.io.hfile.HFile` tool.
+To view a textualized version of HFile content, you can use the `hbase hfile` 
tool.
 Type the following to see usage:
 
 [source,bash]
 
-$ ${HBASE_HOME}/bin/hbase org.apache.hadoop.hbase.io.hfile.HFile
+$ ${HBASE_HOME}/bin/hbase hfile
 
 For example, to view the content of the file 
_hdfs://10.81.47.41:8020/hbase/default/TEST/1418428042/DSMP/4759508618286845475_,
 type the following:
 [source,bash]
 
- $ ${HBASE_HOME}/bin/hbase org.apache.hadoop.hbase.io.hfile.HFile -v -f 
hdfs://10.81.47.41:8020/hbase/default/TEST/1418428042/DSMP/4759508618286845475
+ $ ${HBASE_HOME}/bin/hbase hfile -v -f 
hdfs://10.81.47.41:8020/hbase/default/TEST/1418428042/DSMP/4759508618286845475
 
 If you leave off the option -v to see just a summary on the HFile.
-See usage for other things to do with the `HFile` tool.
+See usage for other things to do with the `hfile` tool.
 
 [[store.file.dir]]
 = StoreFile Directory Structure on HDFS



[25/50] [abbrv] hbase git commit: HBASE-19547 HBase fails building on AArch64 due to asciidoctor-maven-plugin

2018-04-23 Thread zhangduo
HBASE-19547 HBase fails building on AArch64 due to asciidoctor-maven-plugin

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: e5fb33259287d7b9c1b24f6adee28159b49ddeed
Parents: e22f9e2
Author: Yuqi Gu 
Authored: Mon Dec 18 09:13:38 2017 +
Committer: Sean Busbey 
Committed: Fri Apr 20 22:41:26 2018 -0500

--
 pom.xml | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e5fb3325/pom.xml
--
diff --git a/pom.xml b/pom.xml
index f8f1150..7aede4a 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1261,6 +1261,11 @@
 asciidoctorj-pdf
 ${asciidoctorj.pdf.version}
   
+  
+org.jruby
+jruby-complete
+${jruby.version}
+  
 
 
   
${project.reporting.outputDirectory}/



[20/50] [abbrv] hbase git commit: HBASE-20443 Use checkstyle to ban imports from commons-collections 3

2018-04-23 Thread zhangduo
HBASE-20443 Use checkstyle to ban imports from commons-collections 3

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: 90fe98ae99dd13f2194bc6eea37606070d13f268
Parents: 8219ec7
Author: Balazs Meszaros 
Authored: Thu Apr 19 11:08:56 2018 +0200
Committer: Sean Busbey 
Committed: Fri Apr 20 12:06:58 2018 -0500

--
 hbase-checkstyle/src/main/resources/hbase/checkstyle.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/90fe98ae/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
--
diff --git a/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml 
b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
index d0a15ad..b5c7c97 100644
--- a/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
+++ b/hbase-checkstyle/src/main/resources/hbase/checkstyle.xml
@@ -77,7 +77,7 @@
   
 
 
-  
+  
 
 



[22/50] [abbrv] hbase git commit: HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods

2018-04-23 Thread zhangduo
HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods

Signed-off-by: Josh Elser 
Signed-off-by: Ted Yu 
Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: 273d252838e96c4b4af2401743d84e482c4ec565
Parents: afb6d3e
Author: Kevin Risden 
Authored: Thu Apr 12 21:08:15 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 14:38:59 2018 -0500

--
 .../hadoop/hbase/http/TestHttpServer.java   | 13 ++--
 .../hadoop/hbase/thrift/ThriftServerRunner.java |  2 ++
 .../hbase/thrift/TestThriftHttpServer.java  | 21 
 3 files changed, 30 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/273d2528/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
--
diff --git 
a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java 
b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
index 16350d5..10553da 100644
--- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
+++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
@@ -605,8 +605,6 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 myServer.stop();
   }
 
-
-
   @Test
   public void testNoCacheHeader() throws Exception {
 URL url = new URL(baseUrl, "/echo?a=b&c=d");
@@ -619,4 +617,15 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 assertEquals(conn.getHeaderField("Expires"), conn.getHeaderField("Date"));
 assertEquals("DENY", conn.getHeaderField("X-Frame-Options"));
   }
+
+  @Test
+  public void testHttpMethods() throws Exception {
+// HTTP TRACE method should be disabled for security
+// See https://www.owasp.org/index.php/Cross_Site_Tracing
+URL url = new URL(baseUrl, "/echo?a=b");
+HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+conn.setRequestMethod("TRACE");
+conn.connect();
+assertEquals(HttpURLConnection.HTTP_FORBIDDEN, conn.getResponseCode());
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/273d2528/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 39ea259..28ba28a 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -79,6 +79,7 @@ import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.ParseFilter;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
 import org.apache.hadoop.hbase.filter.WhileMatchFilter;
+import org.apache.hadoop.hbase.http.HttpServerUtil;
 import org.apache.hadoop.hbase.log.HBaseMarkers;
 import org.apache.hadoop.hbase.security.SaslUtil;
 import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;
@@ -448,6 +449,7 @@ public class ThriftServerRunner implements Runnable {
 ServletContextHandler ctxHandler = new ServletContextHandler(httpServer, 
"/",
 ServletContextHandler.SESSIONS);
 ctxHandler.addServlet(new ServletHolder(thriftHttpServlet), "/*");
+HttpServerUtil.constrainHttpMethods(ctxHandler);
 
 // set up Jetty and run the embedded server
 HttpConfiguration httpConfig = new HttpConfiguration();

http://git-wip-us.apache.org/repos/asf/hbase/blob/273d2528/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
--
diff --git 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
index d583234..6117953 100644
--- 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
+++ 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
@@ -21,6 +21,8 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
+import java.net.HttpURLConnection;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.hadoop.conf.Configuration;
@@ -38,6 +40,7 @@ import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transpo

[18/50] [abbrv] hbase git commit: HBASE-20006 TestRestoreSnapshotFromClientWithRegionReplicas is flakey

2018-04-23 Thread zhangduo
HBASE-20006 TestRestoreSnapshotFromClientWithRegionReplicas is flakey

Signed-off-by: Ted Yu 
Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: 4e183748c7900da905fb3549634df614b471b3cb
Parents: 914de11
Author: Toshihiro Suzuki 
Authored: Sun Mar 4 14:30:07 2018 +0900
Committer: Sean Busbey 
Committed: Fri Apr 20 10:51:11 2018 -0500

--
 .../hbase/regionserver/StoreFileInfo.java   | 37 ++--
 .../hbase/util/ServerRegionReplicaUtil.java | 27 ++
 ...oreSnapshotFromClientWithRegionReplicas.java |  2 --
 .../regionserver/TestHRegionReplayEvents.java   | 10 +++---
 4 files changed, 51 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4e183748/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
index e7419d5..c9f5f8d 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
@@ -157,13 +157,12 @@ public class StoreFileInfo {
 
   /**
* Create a Store File Info from an HFileLink
-   * @param conf the {@link Configuration} to use
-   * @param fs The current file system to use.
+   * @param conf The {@link Configuration} to use
+   * @param fs The current file system to use
* @param fileStatus The {@link FileStatus} of the file
*/
   public StoreFileInfo(final Configuration conf, final FileSystem fs, final 
FileStatus fileStatus,
-  final HFileLink link)
-  throws IOException {
+  final HFileLink link) {
 this.fs = fs;
 this.conf = conf;
 // initialPath can be null only if we get a link.
@@ -175,15 +174,13 @@ public class StoreFileInfo {
 
   /**
* Create a Store File Info from an HFileLink
-   * @param conf
-   * @param fs
-   * @param fileStatus
-   * @param reference
-   * @throws IOException
+   * @param conf The {@link Configuration} to use
+   * @param fs The current file system to use
+   * @param fileStatus The {@link FileStatus} of the file
+   * @param reference The reference instance
*/
   public StoreFileInfo(final Configuration conf, final FileSystem fs, final 
FileStatus fileStatus,
-  final Reference reference)
-  throws IOException {
+  final Reference reference) {
 this.fs = fs;
 this.conf = conf;
 this.initialPath = fileStatus.getPath();
@@ -193,6 +190,24 @@ public class StoreFileInfo {
   }
 
   /**
+   * Create a Store File Info from an HFileLink and a Reference
+   * @param conf The {@link Configuration} to use
+   * @param fs The current file system to use
+   * @param fileStatus The {@link FileStatus} of the file
+   * @param reference The reference instance
+   * @param link The link instance
+   */
+  public StoreFileInfo(final Configuration conf, final FileSystem fs, final 
FileStatus fileStatus,
+  final Reference reference, final HFileLink link) {
+this.fs = fs;
+this.conf = conf;
+this.initialPath = fileStatus.getPath();
+this.createdTimestamp = fileStatus.getModificationTime();
+this.reference = reference;
+this.link = link;
+  }
+
+  /**
* Sets the region coprocessor env.
* @param coprocessorHost
*/

http://git-wip-us.apache.org/repos/asf/hbase/blob/4e183748/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
index 769d480..0609733 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java
@@ -128,15 +128,28 @@ public class ServerRegionReplicaUtil extends 
RegionReplicaUtil {
 }
 
 // else create a store file link. The link file does not exists on 
filesystem though.
-HFileLink link = HFileLink.build(conf, regionInfoForFs.getTable(),
-regionInfoForFs.getEncodedName(), familyName, path.getName());
-
-if (StoreFileInfo.isReference(path)) {
+if (HFileLink.isHFileLink(path) || StoreFileInfo.isHFile(path)) {
+  HFileLink link = HFileLink
+  .bu

[07/50] [abbrv] hbase git commit: HBASE-20293 get_splits returns duplicate split points when region replication is on

2018-04-23 Thread zhangduo
HBASE-20293 get_splits returns duplicate split points when region replication 
is on


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

Branch: refs/heads/HBASE-19064
Commit: fd2cec75f38689bcc450978cdee394a252dd3fd9
Parents: 357a089
Author: Toshihiro Suzuki 
Authored: Tue Apr 17 15:40:50 2018 -0700
Committer: Huaxiang Sun 
Committed: Tue Apr 17 15:42:25 2018 -0700

--
 hbase-shell/src/main/ruby/hbase/table.rb  |  2 ++
 hbase-shell/src/test/ruby/hbase/table_test.rb | 20 ++--
 hbase-shell/src/test/ruby/test_helper.rb  | 11 +++
 3 files changed, 31 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/fd2cec75/hbase-shell/src/main/ruby/hbase/table.rb
--
diff --git a/hbase-shell/src/main/ruby/hbase/table.rb 
b/hbase-shell/src/main/ruby/hbase/table.rb
index 6af6cfa..d12b30f 100644
--- a/hbase-shell/src/main/ruby/hbase/table.rb
+++ b/hbase-shell/src/main/ruby/hbase/table.rb
@@ -20,6 +20,7 @@
 include Java
 
 java_import org.apache.hadoop.hbase.util.Bytes
+java_import org.apache.hadoop.hbase.client.RegionReplicaUtil
 
 # Wrapper for org.apache.hadoop.hbase.client.Table
 
@@ -808,6 +809,7 @@ EOF
 def _get_splits_internal
   locator = @table.getRegionLocator
   locator.getAllRegionLocations
+ .select { |s| RegionReplicaUtil.isDefaultReplica(s.getRegion) }
  .map { |i| Bytes.toStringBinary(i.getRegionInfo.getStartKey) }
  .delete_if { |k| k == '' }
 ensure

http://git-wip-us.apache.org/repos/asf/hbase/blob/fd2cec75/hbase-shell/src/test/ruby/hbase/table_test.rb
--
diff --git a/hbase-shell/src/test/ruby/hbase/table_test.rb 
b/hbase-shell/src/test/ruby/hbase/table_test.rb
index c1b288c..0885761 100644
--- a/hbase-shell/src/test/ruby/hbase/table_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/table_test.rb
@@ -199,6 +199,7 @@ module Hbase
   end
 
   # Complex data management methods tests
+  # rubocop:disable Metrics/ClassLength
   class TableComplexMethodsTest < Test::Unit::TestCase
 include TestHelpers
 
@@ -337,8 +338,9 @@ module Hbase
   assert_nil(res['x:a'])
   assert_not_nil(res['x:b'])
 end
-
- define_test "get should work with hash columns spec and TIMESTAMP and 
AUTHORIZATIONS" do
+
+define_test 'get should work with hash columns spec and TIMESTAMP and' \
+' AUTHORIZATIONS' do
   res = @test_table._get_internal('1', TIMESTAMP => 1234, 
AUTHORIZATIONS=>['PRIVATE'])
   assert_nil(res)
 end
@@ -696,6 +698,19 @@ module Hbase
   assert_equal([], splits)
 end
 
+define_test 'Split count for a table with region replicas' do
+  @test_table_name = 'tableWithRegionReplicas'
+  create_test_table_with_region_replicas(@test_table_name, 3,
+ SPLITS => ['10'])
+  @table = table(@test_table_name)
+  splits = @table._get_splits_internal
+  # In this case, total splits should be 1 even if the number of region
+  # replicas is 3.
+  assert_equal(1, splits.size)
+  assert_equal(['10'], splits)
+  drop_test_table(@test_table_name)
+end
+
 define_test "scan should throw an exception on a disabled table" do
   @test_table.disable
   begin
@@ -707,4 +722,5 @@ module Hbase
   end
 end
   end
+  # rubocop:enable Metrics/ClassLength
 end

http://git-wip-us.apache.org/repos/asf/hbase/blob/fd2cec75/hbase-shell/src/test/ruby/test_helper.rb
--
diff --git a/hbase-shell/src/test/ruby/test_helper.rb 
b/hbase-shell/src/test/ruby/test_helper.rb
index ec6bb6a..f72a1c6 100644
--- a/hbase-shell/src/test/ruby/test_helper.rb
+++ b/hbase-shell/src/test/ruby/test_helper.rb
@@ -112,6 +112,17 @@ module Hbase
   end
 end
 
+def create_test_table_with_region_replicas(name, num_of_replicas, splits)
+  # Create the table if needed
+  unless admin.exists?(name)
+command(:create, name, 'f1', { REGION_REPLICATION => num_of_replicas },
+splits)
+  end
+
+  # Enable the table if needed
+  admin.enable(name) unless admin.enabled?(name)
+end
+
 def drop_test_table(name)
   return unless admin.exists?(name)
   begin



[13/50] [abbrv] hbase git commit: HBASE-20454 [DOC] Add note on perf to upgrade section Signed-off-by: Mike Drob

2018-04-23 Thread zhangduo
HBASE-20454 [DOC] Add note on perf to upgrade section
Signed-off-by: Mike Drob 


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

Branch: refs/heads/HBASE-19064
Commit: 7fc6e33be32b48912e94153327884b1112022e5f
Parents: 556b223
Author: Michael Stack 
Authored: Thu Apr 19 13:14:12 2018 -0700
Committer: Michael Stack 
Committed: Thu Apr 19 13:21:22 2018 -0700

--
 src/main/asciidoc/_chapters/upgrading.adoc | 11 +++
 1 file changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/7fc6e33b/src/main/asciidoc/_chapters/upgrading.adoc
--
diff --git a/src/main/asciidoc/_chapters/upgrading.adoc 
b/src/main/asciidoc/_chapters/upgrading.adoc
index 046fc90..f7b101a 100644
--- a/src/main/asciidoc/_chapters/upgrading.adoc
+++ b/src/main/asciidoc/_chapters/upgrading.adoc
@@ -576,6 +576,17 @@ The internal changes to HBase during this upgrade were 
sufficient for compilatio
 
 If you previously relied on client side tracing integrated with HBase 
operations, it is recommended that you upgrade your usage to HTrace 4 as well.
 
+[[upgrade2.0.perf]]
+.Performance
+
+You will likely see a change in the performance profile on upgrade to 
hbase-2.0.0 given
+read and write paths have undergone significant change. On release, writes may 
be
+slower with reads about the same or much better, dependent on context. Be 
prepared
+to spend time re-tuning (See <>).
+Performance is also an area that is now under active review so look forward to
+improvement in coming releases (See
+link:https://issues.apache.org/jira/browse/HBASE-20188[HBASE-20188 TESTING 
Performance]).
+
 
 This would be a good place to link to an appendix on migrating applications
 



[24/50] [abbrv] hbase git commit: HBASE-19924 hbase rpc throttling does not work for multi() with request count rater.

2018-04-23 Thread zhangduo
HBASE-19924 hbase rpc throttling does not work for multi() with request count 
rater.


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

Branch: refs/heads/HBASE-19064
Commit: e22f9e2d9729cc17cef932c2e14defad288c7a2d
Parents: 758f429
Author: Huaxiang Sun 
Authored: Fri Apr 20 16:54:03 2018 -0700
Committer: Huaxiang Sun 
Committed: Fri Apr 20 16:54:03 2018 -0700

--
 .../hbase/quotas/DefaultOperationQuota.java |  4 +--
 .../hadoop/hbase/quotas/NoopQuotaLimiter.java   |  6 ++--
 .../hadoop/hbase/quotas/QuotaLimiter.java   | 12 ---
 .../hadoop/hbase/quotas/TimeBasedLimiter.java   | 37 ++-
 .../hadoop/hbase/quotas/TestQuotaState.java | 38 +---
 5 files changed, 66 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e22f9e2d/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java
index 80b39a8..1265a42 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java
@@ -69,13 +69,13 @@ public class DefaultOperationQuota implements 
OperationQuota {
 for (final QuotaLimiter limiter: limiters) {
   if (limiter.isBypass()) continue;
 
-  limiter.checkQuota(writeConsumed, readConsumed);
+  limiter.checkQuota(numWrites, writeConsumed, numReads + numScans, 
readConsumed);
   readAvailable = Math.min(readAvailable, limiter.getReadAvailable());
   writeAvailable = Math.min(writeAvailable, limiter.getWriteAvailable());
 }
 
 for (final QuotaLimiter limiter: limiters) {
-  limiter.grabQuota(writeConsumed, readConsumed);
+  limiter.grabQuota(numWrites, writeConsumed, numReads + numScans, 
readConsumed);
 }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e22f9e2d/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/NoopQuotaLimiter.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/NoopQuotaLimiter.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/NoopQuotaLimiter.java
index acfdc52..3cca955 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/NoopQuotaLimiter.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/NoopQuotaLimiter.java
@@ -35,13 +35,13 @@ class NoopQuotaLimiter implements QuotaLimiter {
   }
 
   @Override
-  public void checkQuota(long estimateWriteSize, long estimateReadSize)
-  throws RpcThrottlingException {
+  public void checkQuota(long writeReqs, long estimateWriteSize, long readReqs,
+  long estimateReadSize) throws RpcThrottlingException {
 // no-op
   }
 
   @Override
-  public void grabQuota(long writeSize, long readSize) {
+  public void grabQuota(long writeReqs, long writeSize, long readReqs, long 
readSize) {
 // no-op
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/e22f9e2d/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaLimiter.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaLimiter.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaLimiter.java
index 1144aec..7cb29b3 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaLimiter.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaLimiter.java
@@ -31,22 +31,26 @@ public interface QuotaLimiter {
   /**
* Checks if it is possible to execute the specified operation.
*
+   * @param writeReqs the write requests that will be checked against the 
available quota
* @param estimateWriteSize the write size that will be checked against the 
available quota
+   * @param readReqs the read requests that will be checked against the 
available quota
* @param estimateReadSize the read size that will be checked against the 
available quota
-   * @throws RpcThrottlingException thrown if not enough avialable resources 
to perform operation.
+   * @throws RpcThrottlingException thrown if not enough available resources 
to perform operation.
*/
-  void checkQuota(long estimateWriteSize, long estimateReadSize)
-throws RpcThrottlingException;
+  void checkQuota(long writeReqs, long estimateWriteSize, long

[17/50] [abbrv] hbase git commit: HBASE-20442 clean up incorrect use of commons-collections 3

2018-04-23 Thread zhangduo
HBASE-20442 clean up incorrect use of commons-collections 3

Signed-off-by: Umesh Agashe 
Signed-off-by: Yu Li 


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

Branch: refs/heads/HBASE-19064
Commit: 914de1141699142bce1486468a742233d9440b23
Parents: 09749f1
Author: Sean Busbey 
Authored: Tue Apr 17 16:15:11 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 07:30:34 2018 -0500

--
 .../org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java  | 3 ++-
 .../main/java/org/apache/hadoop/hbase/client/RowMutations.java   | 3 ++-
 .../src/main/java/org/apache/hadoop/hbase/util/Bytes.java| 2 +-
 .../hadoop/hbase/replication/ZKReplicationQueueStorage.java  | 2 +-
 .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java  | 2 +-
 .../java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java | 2 +-
 .../java/org/apache/hadoop/hbase/regionserver/StoreScanner.java  | 2 +-
 .../org/apache/hadoop/hbase/regionserver/wal/FSWALEntry.java | 2 +-
 .../src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java   | 4 ++--
 9 files changed, 12 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/914de114/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
--
diff --git 
a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
 
b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
index 093ef76..5ce11d1 100644
--- 
a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
+++ 
b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java
@@ -24,7 +24,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections.MapUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
@@ -42,6 +41,8 @@ import org.apache.yetus.audience.InterfaceAudience;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.hbase.thirdparty.org.apache.commons.collections4.MapUtils;
+
 /**
  * Implementation of a log cleaner that checks if a log is still scheduled for 
incremental backup
  * before deleting it when its TTL is over.

http://git-wip-us.apache.org/repos/asf/hbase/blob/914de114/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java
index 4b426cf..345e26a 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RowMutations.java
@@ -23,10 +23,11 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.yetus.audience.InterfaceAudience;
 
+import 
org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils;
+
 /**
  * Performs multiple mutations atomically on a single row.
  * Currently {@link Put} and {@link Delete} are supported.

http://git-wip-us.apache.org/repos/asf/hbase/blob/914de114/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
index a315fd2..6eb09c1 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
@@ -38,7 +38,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.KeyValue;
@@ -50,6 +49,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import 
org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
+import 
org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils;
 
 import com.google.protobuf.ByteString;
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/914de114/hbase-replication/src/main/java/org/apache/hadoop/hbase/repli

[14/50] [abbrv] hbase git commit: HBASE-20059 Make sure documentation is updated for the offheap Bucket cache usage

2018-04-23 Thread zhangduo
HBASE-20059 Make sure documentation is updated for the offheap Bucket cache 
usage


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

Branch: refs/heads/HBASE-19064
Commit: 70377babd0baaf88da153d1c24dba9cff0682825
Parents: 7fc6e33
Author: Michael Stack 
Authored: Thu Apr 19 16:19:53 2018 -0700
Committer: Michael Stack 
Committed: Thu Apr 19 16:19:53 2018 -0700

--
 conf/hbase-env.sh |   3 +-
 src/main/asciidoc/_chapters/architecture.adoc | 140 +++--
 2 files changed, 105 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/70377bab/conf/hbase-env.sh
--
diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh
index 1ac93cc..c2bf09c 100644
--- a/conf/hbase-env.sh
+++ b/conf/hbase-env.sh
@@ -34,7 +34,8 @@
 # export HBASE_HEAPSIZE=1G
 
 # Uncomment below if you intend to use off heap cache. For example, to 
allocate 8G of 
-# offheap, set the value to "8G".
+# offheap, set the value to "8G". See 
http://hbase.apache.org/book.html#direct.memory
+# in the refguide for guidance setting this config.
 # export HBASE_OFFHEAPSIZE=1G
 
 # Extra Java runtime options.

http://git-wip-us.apache.org/repos/asf/hbase/blob/70377bab/src/main/asciidoc/_chapters/architecture.adoc
--
diff --git a/src/main/asciidoc/_chapters/architecture.adoc 
b/src/main/asciidoc/_chapters/architecture.adoc
index 8d0a5b0..d5117db 100644
--- a/src/main/asciidoc/_chapters/architecture.adoc
+++ b/src/main/asciidoc/_chapters/architecture.adoc
@@ -643,44 +643,34 @@ Documentation will eventually move to this reference 
guide, but the blog is the
 [[block.cache]]
 === Block Cache
 
-HBase provides two different BlockCache implementations: the default on-heap 
`LruBlockCache` and the `BucketCache`, which is (usually) off-heap.
-This section discusses benefits and drawbacks of each implementation, how to 
choose the appropriate option, and configuration options for each.
+HBase provides two different BlockCache implementations to cache data read 
from HDFS:
+the default on-heap `LruBlockCache` and the `BucketCache`, which is (usually) 
off-heap.
+This section discusses benefits and drawbacks of each implementation, how to 
choose the
+appropriate option, and configuration options for each.
 
 .Block Cache Reporting: UI
 [NOTE]
 
 See the RegionServer UI for detail on caching deploy.
-Since HBase 0.98.4, the Block Cache detail has been significantly extended 
showing configurations, sizings, current usage, time-in-the-cache, and even 
detail on block counts and types.
+See configurations, sizings, current usage, time-in-the-cache, and even detail 
on block counts and types.
 
 
  Cache Choices
 
-`LruBlockCache` is the original implementation, and is entirely within the 
Java heap. `BucketCache` is mainly intended for keeping block cache data 
off-heap, although `BucketCache` can also keep data on-heap and serve from a 
file-backed cache.
+`LruBlockCache` is the original implementation, and is entirely within the 
Java heap.
+`BucketCache` is optional and mainly intended for keeping block cache data 
off-heap, although `BucketCache` can also be a file-backed cache.
 
-.BucketCache is production ready as of HBase 0.98.6
-[NOTE]
-
-To run with BucketCache, you need HBASE-11678.
-This was included in 0.98.6.
-
-
-Fetching will always be slower when fetching from BucketCache, as compared to 
the native on-heap LruBlockCache.
-However, latencies tend to be less erratic across time, because there is less 
garbage collection when you use BucketCache since it is managing BlockCache 
allocations, not the GC.
-If the BucketCache is deployed in off-heap mode, this memory is not managed by 
the GC at all.
-This is why you'd use BucketCache, so your latencies are less erratic and to 
mitigate GCs and heap fragmentation.
-See Nick Dimiduk's link:http://www.n10k.com/blog/blockcache-101/[BlockCache 
101] for comparisons running on-heap vs off-heap tests.
-Also see link:https://people.apache.org/~stack/bc/[Comparing BlockCache 
Deploys] which finds that if your dataset fits inside your LruBlockCache 
deploy, use it otherwise if you are experiencing cache churn (or you want your 
cache to exist beyond the vagaries of java GC), use BucketCache.
-
-When you enable BucketCache, you are enabling a two tier caching system, an L1 
cache which is implemented by an instance of LruBlockCache and an off-heap L2 
cache which is implemented by BucketCache.
+When you enable BucketCache, you are enabling a two tier caching sy

[16/50] [abbrv] hbase git commit: HBASE-20440 Clean up incorrect use of commons-lang 2.y

2018-04-23 Thread zhangduo
HBASE-20440 Clean up incorrect use of commons-lang 2.y

Signed-off-by: Umesh Agashe 
Signed-off-by: Yu Li 


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

Branch: refs/heads/HBASE-19064
Commit: 09749f157486b3633d5fb0876b0b3afa01919968
Parents: b1fc00e
Author: Sean Busbey 
Authored: Tue Apr 17 15:21:49 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 07:29:23 2018 -0500

--
 .../src/main/java/org/apache/hadoop/hbase/net/Address.java   | 2 +-
 .../hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java | 4 ++--
 .../org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java | 2 +-
 .../hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java   | 2 +-
 .../hadoop/hbase/util/compaction/TestMajorCompactionRequest.java | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/09749f15/hbase-common/src/main/java/org/apache/hadoop/hbase/net/Address.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/net/Address.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/net/Address.java
index 9d7f65c..ab7fa3b 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/net/Address.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/net/Address.java
@@ -17,7 +17,7 @@
  */
 package org.apache.hadoop.hbase.net;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.yetus.audience.InterfaceAudience;
 
 import org.apache.hbase.thirdparty.com.google.common.net.HostAndPort;

http://git-wip-us.apache.org/repos/asf/hbase/blob/09749f15/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java
index 3d21518..5b6d8c1 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierFactoryImpl.java
@@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.quotas;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hbase.TableName;
@@ -111,4 +111,4 @@ public final class FileArchiverNotifierFactoryImpl 
implements FileArchiverNotifi
   return "CacheKey[TableName=" + tn + "]";
 }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/09749f15/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
index 58434f7..aa91696 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/FileArchiverNotifierImpl.java
@@ -34,7 +34,7 @@ import 
java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;

http://git-wip-us.apache.org/repos/asf/hbase/blob/09749f15/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java
index feea086..6c20b5b 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHdfsSnapshotHRegion.java
@@ -18,7 +18,7 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import java.io.IOExcept

[10/50] [abbrv] hbase git commit: HBASE-20452 Master UI: Table merge button should validate required fields before submit

2018-04-23 Thread zhangduo
HBASE-20452 Master UI: Table merge button should validate required fields 
before submit

Signed-off-by: tedyu 


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

Branch: refs/heads/HBASE-19064
Commit: 6ce1136ebae75abc2a1d8d35e1963546b8e2d014
Parents: 80cbc0d
Author: Nihal Jain 
Authored: Wed Apr 18 23:25:42 2018 +0530
Committer: tedyu 
Committed: Wed Apr 18 14:55:12 2018 -0700

--
 hbase-server/src/main/resources/hbase-webapps/master/table.jsp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6ce1136e/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
--
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index abe8fb9..5900a9a 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -764,8 +764,8 @@ Actions:
 
   
   
-
-
+
+
   
   
 This action will merge two regions of the table, Merge requests for



[05/50] [abbrv] hbase git commit: HBASE-20404 Fixes to CleanChore correctness and operability.

2018-04-23 Thread zhangduo
HBASE-20404 Fixes to CleanChore correctness and operability.

* Make CleanerChore less chatty: move WARN message to DEBUG when we expect 
non-empty dirs
* Make CleanerChore less chatty: move IOE we'll retry to INFO
* CleanerChore should treat IOE for FileStatus as a failure
* Add tests asserting assumptions in above

Signed-off-by: Reid Chan 
Signed-off-by: Mike Drob 


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

Branch: refs/heads/HBASE-19064
Commit: 824ee525df009ce21b96450bdb4a56600403aac1
Parents: b926d35
Author: Sean Busbey 
Authored: Fri Apr 13 00:57:35 2018 -0500
Committer: Sean Busbey 
Committed: Tue Apr 17 11:32:44 2018 -0500

--
 .../hbase/master/cleaner/CleanerChore.java  | 27 --
 .../hbase/master/cleaner/TestCleanerChore.java  | 54 ++--
 .../apache/hadoop/hbase/util/TestFSUtils.java   | 10 
 3 files changed, 83 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/824ee525/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
index 396fbaf..dc13645 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
 import org.apache.hadoop.hbase.ScheduledChore;
 import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.conf.ConfigurationObserver;
@@ -446,6 +447,10 @@ public abstract class CleanerChore extends Schedu
 T act() throws IOException;
   }
 
+  /**
+   * Attemps to clean up a directory, its subdirectories, and files.
+   * Return value is true if everything was deleted. false on partial / total 
failures.
+   */
   private class CleanerTask extends RecursiveTask {
 private final Path dir;
 private final boolean root;
@@ -465,11 +470,13 @@ public abstract class CleanerChore extends Schedu
   List subDirs;
   List files;
   try {
+// if dir doesn't exist, we'll get null back for both of these
+// which will fall through to succeeding.
 subDirs = getFilteredStatus(status -> status.isDirectory());
 files = getFilteredStatus(status -> status.isFile());
   } catch (IOException ioe) {
-LOG.warn(dir + " doesn't exist, just skip it. ", ioe);
-return true;
+LOG.warn("failed to get FileStatus for contents of '{}'", dir, ioe);
+return false;
   }
 
   boolean nullSubDirs = subDirs == null;
@@ -507,8 +514,8 @@ public abstract class CleanerChore extends Schedu
  * Pay attention that FSUtils #listStatusWithStatusFilter would return 
null,
  * even though status is empty but not null.
  * @param function a filter function
- * @return filtered FileStatus
- * @throws IOException if there's no such a directory
+ * @return filtered FileStatus or null if dir doesn't exist
+ * @throws IOException if there's an error other than dir not existing
  */
 private List getFilteredStatus(Predicate function) 
throws IOException {
   return FSUtils.listStatusWithStatusFilter(fs, dir, status -> 
function.test(status));
@@ -525,8 +532,18 @@ public abstract class CleanerChore extends Schedu
   try {
 LOG.trace("Start deleting {} under {}", type, dir);
 deleted = deletion.act();
+  } catch (PathIsNotEmptyDirectoryException exception) {
+// N.B. HDFS throws this exception when we try to delete a non-empty 
directory, but
+// LocalFileSystem throws a bare IOException. So some test code will 
get the verbose
+// message below.
+LOG.debug("Couldn't delete '{}' yet because it isn't empty. Probably 
transient. " +
+"exception details at TRACE.", dir);
+LOG.trace("Couldn't delete '{}' yet because it isn't empty 
w/exception.", dir, exception);
+deleted = false;
   } catch (IOException ioe) {
-LOG.warn("Could not delete {} under {}; {}", type, dir, ioe);
+LOG.info("Could not delete {} under {}. might be transient; we'll 
retry. if it keeps " +
+  "happening, use following exception when asking on mailing 
list.",

[50/50] [abbrv] hbase git commit: HBASE-20370 Also remove the wal file in remote cluster when we finish replicating a file

2018-04-23 Thread zhangduo
HBASE-20370 Also remove the wal file in remote cluster when we finish 
replicating a file


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

Branch: refs/heads/HBASE-19064
Commit: da27c1f375a45501c5169a8345983ad0c43563a8
Parents: dd437c1
Author: zhangduo 
Authored: Tue Apr 17 09:04:56 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:08:12 2018 +0800

--
 .../hbase/replication/ReplicationUtils.java |  36 ++-
 .../regionserver/ReplicationSource.java |  38 +++
 .../ReplicationSourceInterface.java |  21 +++-
 .../regionserver/ReplicationSourceManager.java  | 108 ++-
 .../regionserver/ReplicationSourceShipper.java  |  27 ++---
 .../hbase/wal/SyncReplicationWALProvider.java   |  11 +-
 .../replication/ReplicationSourceDummy.java |  20 ++--
 .../TestReplicationSourceManager.java   | 101 -
 8 files changed, 246 insertions(+), 116 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/da27c1f3/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
index cb22f57..66e9b01 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
@@ -22,14 +22,17 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.CompoundConfiguration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Helper class for replication.
@@ -37,6 +40,8 @@ import org.apache.yetus.audience.InterfaceAudience;
 @InterfaceAudience.Private
 public final class ReplicationUtils {
 
+  private static final Logger LOG = 
LoggerFactory.getLogger(ReplicationUtils.class);
+
   public static final String REPLICATION_ATTR_NAME = "__rep__";
 
   public static final String REMOTE_WAL_DIR_NAME = "remoteWALs";
@@ -176,4 +181,33 @@ public final class ReplicationUtils {
   return tableCFs != null && tableCFs.containsKey(tableName);
 }
   }
+
+  public static FileSystem getRemoteWALFileSystem(Configuration conf, String 
remoteWALDir)
+  throws IOException {
+return new Path(remoteWALDir).getFileSystem(conf);
+  }
+
+  public static Path getRemoteWALDirForPeer(String remoteWALDir, String 
peerId) {
+return new Path(remoteWALDir, peerId);
+  }
+
+  /**
+   * Do the sleeping logic
+   * @param msg Why we sleep
+   * @param sleepForRetries the base sleep time.
+   * @param sleepMultiplier by how many times the default sleeping time is 
augmented
+   * @param maxRetriesMultiplier the max retry multiplier
+   * @return True if sleepMultiplier is < 
maxRetriesMultiplier
+   */
+  public static boolean sleepForRetries(String msg, long sleepForRetries, int 
sleepMultiplier,
+  int maxRetriesMultiplier) {
+try {
+  LOG.trace("{}, sleeping {} times {}", msg, sleepForRetries, 
sleepMultiplier);
+  Thread.sleep(sleepForRetries * sleepMultiplier);
+} catch (InterruptedException e) {
+  LOG.debug("Interrupted while sleeping between retries");
+  Thread.currentThread().interrupt();
+}
+return sleepMultiplier < maxRetriesMultiplier;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/da27c1f3/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 236c575..93d8cd0 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -89,8 +89,6 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
 
   protec

[32/50] [abbrv] hbase git commit: HBASE-19747 Introduce a special WALProvider for synchronous replication

2018-04-23 Thread zhangduo
HBASE-19747 Introduce a special WALProvider for synchronous replication


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

Branch: refs/heads/HBASE-19064
Commit: ca24760a0d9719bbccf77b862d9600aff4050cc7
Parents: 5c660dd
Author: zhangduo 
Authored: Fri Jan 19 18:38:39 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../hbase/regionserver/wal/AbstractFSWAL.java   |   7 +
 .../hbase/regionserver/wal/AsyncFSWAL.java  |   1 -
 .../hbase/regionserver/wal/DualAsyncFSWAL.java  |   4 +-
 .../hadoop/hbase/regionserver/wal/FSHLog.java   |   4 -
 .../regionserver/PeerActionListener.java|  33 +++
 .../SynchronousReplicationPeerProvider.java |  35 +++
 .../hadoop/hbase/wal/AbstractFSWALProvider.java |   1 +
 .../hadoop/hbase/wal/AsyncFSWALProvider.java|  18 +-
 .../hbase/wal/NettyAsyncFSWALConfigHelper.java  |   8 +-
 .../hbase/wal/RegionGroupingProvider.java   |  13 +-
 .../wal/SynchronousReplicationWALProvider.java  | 225 +++
 .../org/apache/hadoop/hbase/wal/WALFactory.java |  37 ++-
 .../org/apache/hadoop/hbase/wal/WALKeyImpl.java |  16 +-
 .../regionserver/TestCompactionPolicy.java  |   1 +
 .../regionserver/TestFailedAppendAndSync.java   | 122 +-
 .../hadoop/hbase/regionserver/TestHRegion.java  |  24 +-
 .../TestHRegionWithInMemoryFlush.java   |   7 -
 .../hbase/regionserver/TestRegionIncrement.java |  20 +-
 .../hbase/regionserver/TestWALLockup.java   |   1 +
 .../regionserver/wal/AbstractTestWALReplay.java |   1 +
 .../regionserver/wal/ProtobufLogTestHelper.java |  44 +++-
 .../hbase/regionserver/wal/TestAsyncFSWAL.java  |  13 +-
 .../regionserver/wal/TestAsyncWALReplay.java|   4 +-
 .../wal/TestCombinedAsyncWriter.java|   3 +-
 .../hbase/regionserver/wal/TestFSHLog.java  |  15 +-
 .../hbase/regionserver/wal/TestWALReplay.java   |   1 +
 .../apache/hadoop/hbase/wal/IOTestProvider.java |   2 -
 .../TestSynchronousReplicationWALProvider.java  | 153 +
 28 files changed, 659 insertions(+), 154 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/ca24760a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
index ce8dafa..4816d77 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
@@ -430,6 +430,13 @@ public abstract class AbstractFSWAL 
implements WAL {
 this.implClassName = getClass().getSimpleName();
   }
 
+  /**
+   * Used to initialize the WAL. Usually just call rollWriter to create the 
first log writer.
+   */
+  public void init() throws IOException {
+rollWriter();
+  }
+
   @Override
   public void registerWALActionsListener(WALActionsListener listener) {
 this.listeners.add(listener);

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca24760a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
index 0bee9d6..17133ed 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
@@ -248,7 +248,6 @@ public class AsyncFSWAL extends AbstractFSWAL {
 batchSize = conf.getLong(WAL_BATCH_SIZE, DEFAULT_WAL_BATCH_SIZE);
 waitOnShutdownInSeconds = 
conf.getInt(ASYNC_WAL_WAIT_ON_SHUTDOWN_IN_SECONDS,
   DEFAULT_ASYNC_WAL_WAIT_ON_SHUTDOWN_IN_SECONDS);
-rollWriter();
   }
 
   private static boolean waitingRoll(int epochAndState) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/ca24760a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
index 42b0dae..0495337 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
+++ 
b/hbase-ser

[48/50] [abbrv] hbase git commit: HBASE-19990 Create remote wal directory when transitting to state S

2018-04-23 Thread zhangduo
HBASE-19990 Create remote wal directory when transitting to state S


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

Branch: refs/heads/HBASE-19064
Commit: aa7100ce0e1cca05ef1cbebc9dc3b0ec62e0e939
Parents: 22a9f02
Author: zhangduo 
Authored: Wed Feb 14 16:01:16 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../procedure2/ProcedureYieldException.java |  9 --
 .../hbase/replication/ReplicationUtils.java |  2 ++
 .../hadoop/hbase/master/MasterFileSystem.java   | 19 ++---
 .../master/procedure/MasterProcedureEnv.java|  5 
 ...ransitPeerSyncReplicationStateProcedure.java | 29 
 .../hbase/replication/TestSyncReplication.java  |  8 ++
 6 files changed, 55 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/aa7100ce/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureYieldException.java
--
diff --git 
a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureYieldException.java
 
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureYieldException.java
index 0487ac5b..dbb9981 100644
--- 
a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureYieldException.java
+++ 
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureYieldException.java
@@ -15,16 +15,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.hadoop.hbase.procedure2;
 
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
 
-// TODO: Not used yet
+/**
+ * Indicate that a procedure wants to be rescheduled. Usually because there 
are something wrong but
+ * we do not want to fail the procedure.
+ * 
+ * TODO: need to support scheduling after a delay.
+ */
 @InterfaceAudience.Private
 @InterfaceStability.Stable
 public class ProcedureYieldException extends ProcedureException {
+
   /** default constructor */
   public ProcedureYieldException() {
 super();

http://git-wip-us.apache.org/repos/asf/hbase/blob/aa7100ce/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
index d94cb00..e402d0f 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
@@ -41,6 +41,8 @@ public final class ReplicationUtils {
 
   public static final String REPLICATION_ATTR_NAME = "__rep__";
 
+  public static final String REMOTE_WAL_DIR_NAME = "remoteWALs";
+
   private ReplicationUtils() {
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/aa7100ce/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
index 864be02..7ccbd71 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.log.HBaseMarkers;
 import org.apache.hadoop.hbase.mob.MobConstants;
 import org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore;
 import org.apache.hadoop.hbase.regionserver.HRegion;
+import org.apache.hadoop.hbase.replication.ReplicationUtils;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSTableDescriptors;
 import org.apache.hadoop.hbase.util.FSUtils;
@@ -133,7 +134,6 @@ public class MasterFileSystem {
* Idempotent.
*/
   private void createInitialFileSystemLayout() throws IOException {
-
 final String[] protectedSubDirs = new String[] {
 HConstants.BASE_NAMESPACE_DIR,
 HConstants.HFILE_ARCHIVE_DIRECTORY,
@@ -145,7 +145,8 @@ public class MasterFileSystem {
   HConstants.HREGION_LOGDIR_NAME,
   HConstants.HREGION_OLDLOGDIR_NAME,
   HConstants.CORRUPT_DIR_NAME,
-  WALProcedureStore.MASTER_PROCEDURE_LOGDIR
+  WALProcedureStore.MASTER_PROCEDURE_LOGDIR,
+   

[28/50] [abbrv] hbase git commit: HBASE-20459 Majority of scan CPU time in HBase-1 spent in size estimation.

2018-04-23 Thread zhangduo
HBASE-20459 Majority of scan CPU time in HBase-1 spent in size estimation.


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

Branch: refs/heads/HBASE-19064
Commit: 00fca5a4c9bdc73b4e0c962af0cbfcc7db2029fc
Parents: 46cb5df
Author: Lars Hofhansl 
Authored: Sat Apr 21 10:12:24 2018 -0700
Committer: Lars Hofhansl 
Committed: Sat Apr 21 10:12:24 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/00fca5a4/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java
index 82f6e60..6f88c00 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java
@@ -172,7 +172,7 @@ public class ClassSize {
 }
 
 long sizeOfByteArray(int len) {
-  return align(arrayHeaderSize() + len);
+  return align(ARRAY + len);
 }
   }
 
@@ -217,7 +217,7 @@ public class ClassSize {
 @Override
 @SuppressWarnings("static-access")
 long sizeOfByteArray(int len) {
-  return align(arrayHeaderSize() + len * 
UnsafeAccess.theUnsafe.ARRAY_BYTE_INDEX_SCALE);
+  return align(ARRAY + len * 
UnsafeAccess.theUnsafe.ARRAY_BYTE_INDEX_SCALE);
 }
   }
 



[41/50] [abbrv] hbase git commit: HBASE-19864 Use protobuf instead of enum.ordinal to store SyncReplicationState

2018-04-23 Thread zhangduo
HBASE-19864 Use protobuf instead of enum.ordinal to store SyncReplicationState

Signed-off-by: zhangduo 


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

Branch: refs/heads/HBASE-19064
Commit: 62698141583842b70d5bd12bc25589e6ab33ee30
Parents: b9ddb29
Author: Guanghao Zhang 
Authored: Fri Jan 26 16:50:48 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerConfigUtil.java  | 22 +++---
 .../hbase/replication/SyncReplicationState.java | 17 ++
 .../hbase/shaded/protobuf/RequestConverter.java |  7 +++---
 .../src/main/protobuf/Replication.proto | 13 +++
 .../replication/ZKReplicationPeerStorage.java   | 24 +---
 .../hadoop/hbase/master/MasterRpcServices.java  |  9 
 ...ransitPeerSyncReplicationStateProcedure.java |  9 
 .../TestReplicationSourceManager.java   |  2 +-
 8 files changed, 67 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/62698141/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
index 6cbe05b..331795c 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
@@ -403,7 +403,7 @@ public final class ReplicationPeerConfigUtil {
 ReplicationProtos.ReplicationState.State.ENABLED == 
desc.getState().getState();
 ReplicationPeerConfig config = convert(desc.getConfig());
 return new ReplicationPeerDescription(desc.getId(), enabled, config,
-
SyncReplicationState.valueOf(desc.getSyncReplicationState().getNumber()));
+  toSyncReplicationState(desc.getSyncReplicationState()));
   }
 
   public static ReplicationProtos.ReplicationPeerDescription
@@ -411,17 +411,33 @@ public final class ReplicationPeerConfigUtil {
 ReplicationProtos.ReplicationPeerDescription.Builder builder =
 ReplicationProtos.ReplicationPeerDescription.newBuilder();
 builder.setId(desc.getPeerId());
+
 ReplicationProtos.ReplicationState.Builder stateBuilder =
 ReplicationProtos.ReplicationState.newBuilder();
 stateBuilder.setState(desc.isEnabled() ? 
ReplicationProtos.ReplicationState.State.ENABLED :
 ReplicationProtos.ReplicationState.State.DISABLED);
 builder.setState(stateBuilder.build());
+
 builder.setConfig(convert(desc.getPeerConfig()));
-builder.setSyncReplicationState(
-  
ReplicationProtos.SyncReplicationState.forNumber(desc.getSyncReplicationState().ordinal()));
+
builder.setSyncReplicationState(toSyncReplicationState(desc.getSyncReplicationState()));
+
 return builder.build();
   }
 
+  public static ReplicationProtos.SyncReplicationState
+  toSyncReplicationState(SyncReplicationState state) {
+ReplicationProtos.SyncReplicationState.Builder syncReplicationStateBuilder 
=
+ReplicationProtos.SyncReplicationState.newBuilder();
+syncReplicationStateBuilder
+
.setState(ReplicationProtos.SyncReplicationState.State.forNumber(state.ordinal()));
+return syncReplicationStateBuilder.build();
+  }
+
+  public static SyncReplicationState
+  toSyncReplicationState(ReplicationProtos.SyncReplicationState state) {
+return SyncReplicationState.valueOf(state.getState().getNumber());
+  }
+
   public static ReplicationPeerConfig appendTableCFsToReplicationPeerConfig(
   Map> tableCfs, ReplicationPeerConfig peerConfig) 
{
 ReplicationPeerConfigBuilder builder = 
ReplicationPeerConfig.newBuilder(peerConfig);

http://git-wip-us.apache.org/repos/asf/hbase/blob/62698141/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java
index bd144e9..a65b144 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/SyncReplicationState.java
@@ -17,8 +17,15 @@
  */
 package org.apache.hadoop.hbase.replication;
 

[39/50] [abbrv] hbase git commit: HBASE-20163 Forbid major compaction when standby cluster replay the remote wals

2018-04-23 Thread zhangduo
HBASE-20163 Forbid major compaction when standby cluster replay the remote wals


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

Branch: refs/heads/HBASE-19064
Commit: dd437c1cb4095b5e389f4b7ced2d833d3854b533
Parents: 4f3dd07
Author: Guanghao Zhang 
Authored: Thu Apr 12 14:44:25 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../hadoop/hbase/regionserver/HRegion.java  | 18 
 .../hbase/regionserver/HRegionServer.java   |  2 +-
 .../regionserver/RegionServerServices.java  |  5 +++
 .../ForbidMajorCompactionChecker.java   | 44 
 .../hadoop/hbase/MockRegionServerServices.java  |  6 +++
 .../hadoop/hbase/master/MockRegionServer.java   |  6 +++
 6 files changed, 80 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/dd437c1c/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 ea72cfe..1865144 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
@@ -144,6 +144,7 @@ import 
org.apache.hadoop.hbase.regionserver.ScannerContext.LimitScope;
 import org.apache.hadoop.hbase.regionserver.ScannerContext.NextState;
 import org.apache.hadoop.hbase.regionserver.compactions.CompactionContext;
 import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
+import 
org.apache.hadoop.hbase.regionserver.compactions.ForbidMajorCompactionChecker;
 import 
org.apache.hadoop.hbase.regionserver.throttle.CompactionThroughputControllerFactory;
 import 
org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController;
 import org.apache.hadoop.hbase.regionserver.throttle.StoreHotnessProtector;
@@ -1977,6 +1978,14 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
 return compact(compaction, store, throughputController, null);
   }
 
+  private boolean shouldForbidMajorCompaction() {
+if (rsServices != null && rsServices.getReplicationSourceService() != 
null) {
+  return 
rsServices.getReplicationSourceService().getSyncReplicationPeerInfoProvider()
+  .checkState(getRegionInfo(), ForbidMajorCompactionChecker.get());
+}
+return false;
+  }
+
   public boolean compact(CompactionContext compaction, HStore store,
   ThroughputController throughputController, User user) throws IOException 
{
 assert compaction != null && compaction.hasSelection();
@@ -1986,6 +1995,15 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   store.cancelRequestedCompaction(compaction);
   return false;
 }
+
+if (compaction.getRequest().isAllFiles() && shouldForbidMajorCompaction()) 
{
+  LOG.warn("Skipping major compaction on " + this
+  + " because this cluster is transiting sync replication state"
+  + " from STANDBY to DOWNGRADE_ACTIVE");
+  store.cancelRequestedCompaction(compaction);
+  return false;
+}
+
 MonitoredTask status = null;
 boolean requestNeedsCancellation = true;
 /*

http://git-wip-us.apache.org/repos/asf/hbase/blob/dd437c1c/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 25bc6be..4dd8f09 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -2472,7 +2472,7 @@ public class HRegionServer extends HasThread implements
* @return Return the object that implements the replication
* source executorService.
*/
-  @VisibleForTesting
+  @Override
   public ReplicationSourceService getReplicationSourceService() {
 return replicationSourceHandler;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/dd437c1c/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerServices.java
 
b/hbase-server

[31/50] [abbrv] hbase git commit: HBASE-20465 Fix TestEnableRSGroup flaky

2018-04-23 Thread zhangduo
HBASE-20465 Fix TestEnableRSGroup flaky


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

Branch: refs/heads/HBASE-19064
Commit: 193359ffd22057ef803b923b8f6e858ba36b7f5f
Parents: 1633d9d
Author: Balazs Meszaros 
Authored: Fri Apr 20 16:32:32 2018 +0200
Committer: Michael Stack 
Committed: Sun Apr 22 15:38:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/193359ff/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroup.java
--
diff --git 
a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroup.java
 
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroup.java
index bf9ef14..1407a5b 100644
--- 
a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroup.java
+++ 
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestEnableRSGroup.java
@@ -66,6 +66,7 @@ public class TestEnableRSGroup {
   @Test
   public void testEnableRSGroup() throws IOException, InterruptedException {
 TEST_UTIL.getMiniHBaseCluster().stopMaster(0);
+TEST_UTIL.getMiniHBaseCluster().waitOnMaster(0);
 
 LOG.info("stopped master...");
 conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, 
RSGroupAdminEndpoint.class.getName());



[45/50] [abbrv] hbase git commit: HBASE-19083 Introduce a new log writer which can write to two HDFSes

2018-04-23 Thread zhangduo
HBASE-19083 Introduce a new log writer which can write to two HDFSes


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

Branch: refs/heads/HBASE-19064
Commit: 6ee675b08f8a85754f8f2fbb9a597e6847125a03
Parents: 193359f
Author: zhangduo 
Authored: Thu Jan 11 21:08:02 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../hbase/regionserver/wal/AsyncFSWAL.java  |  21 +--
 .../regionserver/wal/CombinedAsyncWriter.java   | 134 ++
 .../hbase/regionserver/wal/DualAsyncFSWAL.java  |  67 +
 .../wal/AbstractTestProtobufLog.java| 110 +++
 .../regionserver/wal/ProtobufLogTestHelper.java |  99 ++
 .../regionserver/wal/TestAsyncProtobufLog.java  |  32 +
 .../wal/TestCombinedAsyncWriter.java| 136 +++
 .../hbase/regionserver/wal/TestProtobufLog.java |  14 +-
 .../regionserver/wal/WriterOverAsyncWriter.java |  63 +
 9 files changed, 533 insertions(+), 143 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6ee675b0/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
index e34818f..0bee9d6 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java
@@ -607,12 +607,16 @@ public class AsyncFSWAL extends 
AbstractFSWAL {
 }
   }
 
-  @Override
-  protected AsyncWriter createWriterInstance(Path path) throws IOException {
+  protected final AsyncWriter createAsyncWriter(FileSystem fs, Path path) 
throws IOException {
 return AsyncFSWALProvider.createAsyncWriter(conf, fs, path, false, 
eventLoopGroup,
   channelClass);
   }
 
+  @Override
+  protected AsyncWriter createWriterInstance(Path path) throws IOException {
+return createAsyncWriter(fs, path);
+  }
+
   private void waitForSafePoint() {
 consumeLock.lock();
 try {
@@ -632,13 +636,12 @@ public class AsyncFSWAL extends 
AbstractFSWAL {
 }
   }
 
-  private long closeWriter() {
-AsyncWriter oldWriter = this.writer;
-if (oldWriter != null) {
-  long fileLength = oldWriter.getLength();
+  protected final long closeWriter(AsyncWriter writer) {
+if (writer != null) {
+  long fileLength = writer.getLength();
   closeExecutor.execute(() -> {
 try {
-  oldWriter.close();
+  writer.close();
 } catch (IOException e) {
   LOG.warn("close old writer failed", e);
 }
@@ -654,7 +657,7 @@ public class AsyncFSWAL extends AbstractFSWAL {
   throws IOException {
 Preconditions.checkNotNull(nextWriter);
 waitForSafePoint();
-long oldFileLen = closeWriter();
+long oldFileLen = closeWriter(this.writer);
 logRollAndSetupWalProps(oldPath, newPath, oldFileLen);
 this.writer = nextWriter;
 if (nextWriter instanceof AsyncProtobufLogWriter) {
@@ -679,7 +682,7 @@ public class AsyncFSWAL extends AbstractFSWAL {
   @Override
   protected void doShutdown() throws IOException {
 waitForSafePoint();
-closeWriter();
+closeWriter(this.writer);
 closeExecutor.shutdown();
 try {
   if (!closeExecutor.awaitTermination(waitOnShutdownInSeconds, 
TimeUnit.SECONDS)) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/6ee675b0/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CombinedAsyncWriter.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CombinedAsyncWriter.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CombinedAsyncWriter.java
new file mode 100644
index 000..8ecfede
--- /dev/null
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CombinedAsyncWriter.java
@@ -0,0 +1,134 @@
+/**
+ * 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 app

[36/50] [abbrv] hbase git commit: HBASE-19078 Add a remote peer cluster wal directory config for synchronous replication

2018-04-23 Thread zhangduo
HBASE-19078 Add a remote peer cluster wal directory config for synchronous 
replication

Signed-off-by: zhangduo 


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

Branch: refs/heads/HBASE-19064
Commit: 5c660dd9aeb28aca723c0ebd7c20ded5cbfdc4ec
Parents: 6ee675b
Author: Guanghao Zhang 
Authored: Sat Jan 13 18:55:28 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerConfigUtil.java  |  6 ++
 .../replication/ReplicationPeerConfig.java  | 20 -
 .../ReplicationPeerConfigBuilder.java   |  7 ++
 .../src/main/protobuf/Replication.proto |  1 +
 .../replication/ReplicationPeerManager.java | 15 
 .../replication/TestReplicationAdmin.java   | 77 
 .../src/main/ruby/hbase/replication_admin.rb| 14 ++--
 hbase-shell/src/main/ruby/hbase_constants.rb|  1 +
 .../src/main/ruby/shell/commands/add_peer.rb| 21 +-
 .../src/main/ruby/shell/commands/list_peers.rb  | 19 -
 .../test/ruby/hbase/replication_admin_test.rb   | 16 
 11 files changed, 186 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/5c660dd9/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
index b1c1713..474ded3 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
@@ -319,6 +319,9 @@ public final class ReplicationPeerConfigUtil {
 
excludeNamespacesList.stream().map(ByteString::toStringUtf8).collect(Collectors.toSet()));
 }
 
+if (peer.hasRemoteWALDir()) {
+  builder.setRemoteWALDir(peer.getRemoteWALDir());
+}
 return builder.build();
   }
 
@@ -376,6 +379,9 @@ public final class ReplicationPeerConfigUtil {
   }
 }
 
+if (peerConfig.getRemoteWALDir() != null) {
+  builder.setRemoteWALDir(peerConfig.getRemoteWALDir());
+}
 return builder.build();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/5c660dd9/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
index e0d9a4c..97abc74 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
@@ -47,6 +47,8 @@ public class ReplicationPeerConfig {
   private Set excludeNamespaces = null;
   private long bandwidth = 0;
   private final boolean serial;
+  // Used by synchronous replication
+  private String remoteWALDir;
 
   private ReplicationPeerConfig(ReplicationPeerConfigBuilderImpl builder) {
 this.clusterKey = builder.clusterKey;
@@ -66,6 +68,7 @@ public class ReplicationPeerConfig {
 : null;
 this.bandwidth = builder.bandwidth;
 this.serial = builder.serial;
+this.remoteWALDir = builder.remoteWALDir;
   }
 
   private Map>
@@ -213,6 +216,10 @@ public class ReplicationPeerConfig {
 return this;
   }
 
+  public String getRemoteWALDir() {
+return this.remoteWALDir;
+  }
+
   public static ReplicationPeerConfigBuilder newBuilder() {
 return new ReplicationPeerConfigBuilderImpl();
   }
@@ -230,7 +237,8 @@ public class ReplicationPeerConfig {
   .setReplicateAllUserTables(peerConfig.replicateAllUserTables())
   .setExcludeTableCFsMap(peerConfig.getExcludeTableCFsMap())
   .setExcludeNamespaces(peerConfig.getExcludeNamespaces())
-  
.setBandwidth(peerConfig.getBandwidth()).setSerial(peerConfig.isSerial());
+  .setBandwidth(peerConfig.getBandwidth()).setSerial(peerConfig.isSerial())
+  .setRemoteWALDir(peerConfig.getRemoteWALDir());
 return builder;
   }
 
@@ -259,6 +267,8 @@ public class ReplicationPeerConfig {
 
 private boolean serial = false;
 
+private String remoteWALDir = null;
+
 @Override
 public ReplicationPeerConfigBuilder setClusterKey(String clusterKey) {
   this.clusterKey = clusterKey;
@@ -327,6 +337,11 @@ public

[30/50] [abbrv] hbase git commit: HBASE-20470 [2.0.0RC1] has broken unit tests... Fix test that depended upon flush being slow and one family only. Fix MemStoreSize compare to allow passing alternate

2018-04-23 Thread zhangduo
HBASE-20470 [2.0.0RC1] has broken unit tests...
Fix test that depended upon flush being slow and one family only.
Fix MemStoreSize compare to allow passing alternate implementation
(needed when IMC was no longer default everywhere).


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

Branch: refs/heads/HBASE-19064
Commit: 1633d9d61dddfcf8c70ab2f3b8e4dca94b9f2f1a
Parents: f4a3904
Author: Michael Stack 
Authored: Sat Apr 21 08:37:25 2018 -0700
Committer: Michael Stack 
Committed: Sun Apr 22 15:33:25 2018 -0700

--
 .../org/apache/hadoop/hbase/coprocessor/RegionObserver.java   | 3 ---
 .../org/apache/hadoop/hbase/regionserver/MemStoreSize.java| 5 -
 .../hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java   | 7 +--
 3 files changed, 9 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1633d9d6/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
index 7391f6f..c14cbd1 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
@@ -19,8 +19,6 @@
 
 package org.apache.hadoop.hbase.coprocessor;
 
-import edu.umd.cs.findbugs.annotations.NonNull;
-
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
@@ -199,7 +197,6 @@ public interface RegionObserver {
* @param scanner the scanner over existing data used in the memstore 
segments being compact
* @return the scanner to use during in memory compaction. Must be non-null.
*/
-  @NonNull
   default InternalScanner preMemStoreCompactionCompact(
   ObserverContext c, Store store, 
InternalScanner scanner)
   throws IOException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/1633d9d6/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
index 382e6e9..ec79e8d 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
@@ -95,7 +95,10 @@ public class MemStoreSize {
 
   @Override
   public boolean equals(Object obj) {
-if (obj == null || getClass() != obj.getClass()) {
+if (obj == null) {
+  return false;
+}
+if (!(obj instanceof MemStoreSize)) {
   return false;
 }
 MemStoreSize other = (MemStoreSize) obj;

http://git-wip-us.apache.org/repos/asf/hbase/blob/1633d9d6/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
index fded9ba..9bbce09 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.java
@@ -391,8 +391,11 @@ public class TestPerColumnFamilyFlush {
   // CF1 Should have been flushed
   assertEquals(0, cf1MemstoreSize);
   // CF2 and CF3 shouldn't have been flushed.
-  assertTrue(cf2MemstoreSize > 0);
-  assertTrue(cf3MemstoreSize > 0);
+  // TODO: This test doesn't allow for this case:
+  // " Since none of the CFs were above the size, flushing all."
+  // i.e. a flush happens before we get to here and its a flush-all.
+  assertTrue(cf2MemstoreSize >= 0);
+  assertTrue(cf3MemstoreSize >= 0);
   assertEquals(totalMemstoreSize, cf2MemstoreSize + cf3MemstoreSize);
 
   // Wait for the RS report to go across to the master, so that the master



[23/50] [abbrv] hbase git commit: HBASE-20450 Provide metrics for number of total active, priority and replication rpc handlers

2018-04-23 Thread zhangduo
HBASE-20450 Provide metrics for number of total active, priority and 
replication rpc handlers

Signed-off-by: tedyu 


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

Branch: refs/heads/HBASE-19064
Commit: 758f4296a4a8c99e1b8409b0b0e9319559074bb9
Parents: 273d252
Author: Nihal Jain 
Authored: Thu Apr 19 14:05:13 2018 +0530
Committer: tedyu 
Committed: Fri Apr 20 16:24:32 2018 -0700

--
 .../hbase/ipc/MetricsHBaseServerSource.java |  8 ++-
 .../hbase/ipc/MetricsHBaseServerWrapper.java|  6 +
 .../hbase/ipc/MetricsHBaseServerSourceImpl.java |  8 +++
 .../hadoop/hbase/ipc/FifoRpcScheduler.java  | 16 -
 .../ipc/MetricsHBaseServerWrapperImpl.java  | 24 
 .../apache/hadoop/hbase/ipc/RpcScheduler.java   | 11 -
 .../hadoop/hbase/ipc/SimpleRpcScheduler.java| 20 +---
 .../hbase/ipc/DelegatingRpcScheduler.java   | 15 
 .../ipc/MetricsHBaseServerWrapperStub.java  | 15 
 .../apache/hadoop/hbase/ipc/TestRpcMetrics.java |  3 +++
 10 files changed, 120 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/758f4296/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java
index 0833751..d98837f 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java
@@ -76,7 +76,13 @@ public interface MetricsHBaseServerSource extends 
ExceptionTrackingSource {
   String NUM_OPEN_CONNECTIONS_NAME = "numOpenConnections";
   String NUM_OPEN_CONNECTIONS_DESC = "Number of open connections.";
   String NUM_ACTIVE_HANDLER_NAME = "numActiveHandler";
-  String NUM_ACTIVE_HANDLER_DESC = "Number of active rpc handlers.";
+  String NUM_ACTIVE_HANDLER_DESC = "Total number of active rpc handlers.";
+  String NUM_ACTIVE_GENERAL_HANDLER_NAME = "numActiveGeneralHandler";
+  String NUM_ACTIVE_GENERAL_HANDLER_DESC = "Number of active general rpc 
handlers.";
+  String NUM_ACTIVE_PRIORITY_HANDLER_NAME = "numActivePriorityHandler";
+  String NUM_ACTIVE_PRIORITY_HANDLER_DESC = "Number of active priority rpc 
handlers.";
+  String NUM_ACTIVE_REPLICATION_HANDLER_NAME = "numActiveReplicationHandler";
+  String NUM_ACTIVE_REPLICATION_HANDLER_DESC = "Number of active replication 
rpc handlers.";
   String NUM_ACTIVE_WRITE_HANDLER_NAME = "numActiveWriteHandler";
   String NUM_ACTIVE_WRITE_HANDLER_DESC = "Number of active write rpc 
handlers.";
   String NUM_ACTIVE_READ_HANDLER_NAME = "numActiveReadHandler";

http://git-wip-us.apache.org/repos/asf/hbase/blob/758f4296/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerWrapper.java
--
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerWrapper.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerWrapper.java
index c80d1a9..c66ec59 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerWrapper.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerWrapper.java
@@ -35,6 +35,12 @@ public interface MetricsHBaseServerWrapper {
 
   int getActiveRpcHandlerCount();
 
+  int getActiveGeneralRpcHandlerCount();
+
+  int getActivePriorityRpcHandlerCount();
+
+  int getActiveReplicationRpcHandlerCount();
+
   long getNumGeneralCallsDropped();
 
   long getNumLifoModeSwitches();

http://git-wip-us.apache.org/repos/asf/hbase/blob/758f4296/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java
--
diff --git 
a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java
 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java
index ce8b1b4..6e8b81d 100644
--- 
a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java
+++ 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java
@@ -155,6 +155,14 @@ public class MetricsHBaseServerSourceImpl extends 
ExceptionTrackingSourceImpl
 

[37/50] [abbrv] hbase git commit: HBASE-19781 Add a new cluster state flag for synchronous replication

2018-04-23 Thread zhangduo
http://git-wip-us.apache.org/repos/asf/hbase/blob/1d184a67/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java
index 8911982..f5eca39 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsckReplication.java
@@ -28,6 +28,7 @@ import 
org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
 import org.apache.hadoop.hbase.replication.ReplicationPeerStorage;
 import org.apache.hadoop.hbase.replication.ReplicationQueueStorage;
 import org.apache.hadoop.hbase.replication.ReplicationStorageFactory;
+import org.apache.hadoop.hbase.replication.SyncReplicationState;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.ReplicationTests;
 import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE;
@@ -67,9 +68,9 @@ public class TestHBaseFsckReplication {
 String peerId1 = "1";
 String peerId2 = "2";
 peerStorage.addPeer(peerId1, 
ReplicationPeerConfig.newBuilder().setClusterKey("key").build(),
-  true);
+  true, SyncReplicationState.NONE);
 peerStorage.addPeer(peerId2, 
ReplicationPeerConfig.newBuilder().setClusterKey("key").build(),
-  true);
+  true, SyncReplicationState.NONE);
 for (int i = 0; i < 10; i++) {
   queueStorage.addWAL(ServerName.valueOf("localhost", 1 + i, 10 + 
i), peerId1,
 "file-" + i);

http://git-wip-us.apache.org/repos/asf/hbase/blob/1d184a67/hbase-shell/src/main/ruby/hbase/replication_admin.rb
--
diff --git a/hbase-shell/src/main/ruby/hbase/replication_admin.rb 
b/hbase-shell/src/main/ruby/hbase/replication_admin.rb
index d1f1344..5f86365 100644
--- a/hbase-shell/src/main/ruby/hbase/replication_admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/replication_admin.rb
@@ -20,6 +20,7 @@
 include Java
 
 java_import 
org.apache.hadoop.hbase.client.replication.ReplicationPeerConfigUtil
+java_import org.apache.hadoop.hbase.replication.SyncReplicationState
 java_import org.apache.hadoop.hbase.replication.ReplicationPeerConfig
 java_import org.apache.hadoop.hbase.util.Bytes
 java_import org.apache.hadoop.hbase.zookeeper.ZKConfig
@@ -338,6 +339,20 @@ module Hbase
   '!' + ReplicationPeerConfigUtil.convertToString(tableCFs)
 end
 
+# Transit current cluster to a new state in the specified synchronous
+# replication peer
+def transit_peer_sync_replication_state(id, state)
+  if 'ACTIVE'.eql?(state)
+@admin.transitReplicationPeerSyncReplicationState(id, 
SyncReplicationState::ACTIVE)
+  elsif 'DOWNGRADE_ACTIVE'.eql?(state)
+@admin.transitReplicationPeerSyncReplicationState(id, 
SyncReplicationState::DOWNGRADE_ACTIVE)
+  elsif 'STANDBY'.eql?(state)
+@admin.transitReplicationPeerSyncReplicationState(id, 
SyncReplicationState::STANDBY)
+  else
+raise(ArgumentError, 'synchronous replication state must be ACTIVE, 
DOWNGRADE_ACTIVE or STANDBY')
+  end
+end
+
 
#--
 # Enables a table's replication switch
 def enable_tablerep(table_name)

http://git-wip-us.apache.org/repos/asf/hbase/blob/1d184a67/hbase-shell/src/main/ruby/shell.rb
--
diff --git a/hbase-shell/src/main/ruby/shell.rb 
b/hbase-shell/src/main/ruby/shell.rb
index ab07a79..ba4d154 100644
--- a/hbase-shell/src/main/ruby/shell.rb
+++ b/hbase-shell/src/main/ruby/shell.rb
@@ -391,6 +391,7 @@ Shell.load_command_group(
 get_peer_config
 list_peer_configs
 update_peer_config
+transit_peer_sync_replication_state
   ]
 )
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/1d184a67/hbase-shell/src/main/ruby/shell/commands/list_peers.rb
--
diff --git a/hbase-shell/src/main/ruby/shell/commands/list_peers.rb 
b/hbase-shell/src/main/ruby/shell/commands/list_peers.rb
index f3ab749..f2ec014 100644
--- a/hbase-shell/src/main/ruby/shell/commands/list_peers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/list_peers.rb
@@ -39,8 +39,8 @@ EOF
 peers = replication_admin.list_peers
 
 formatter.header(%w[PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME
-REMOTE_ROOT_DIR STATE REPLICATE_ALL 
-NAMESPACES TABLE_CFS BANDWIDTH
+REMOTE_ROOT_DIR SYNC_REPLICATION_STATE STATE
+REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH

[38/50] [abbrv] hbase git commit: HBASE-19781 Add a new cluster state flag for synchronous replication

2018-04-23 Thread zhangduo
HBASE-19781 Add a new cluster state flag for synchronous replication


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

Branch: refs/heads/HBASE-19064
Commit: 1d184a678f0a56e0170530cc99cf01532f1478d0
Parents: ca24760
Author: Guanghao Zhang 
Authored: Mon Jan 22 11:44:49 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../org/apache/hadoop/hbase/client/Admin.java   |  39 +
 .../apache/hadoop/hbase/client/AsyncAdmin.java  |  31 
 .../hadoop/hbase/client/AsyncHBaseAdmin.java|   7 +
 .../hbase/client/ConnectionImplementation.java  |   9 ++
 .../apache/hadoop/hbase/client/HBaseAdmin.java  |  26 +++
 .../hadoop/hbase/client/RawAsyncHBaseAdmin.java |  15 ++
 .../client/ShortCircuitMasterConnection.java|   9 ++
 .../replication/ReplicationPeerConfigUtil.java  |  26 +--
 .../replication/ReplicationPeerDescription.java |  10 +-
 .../hbase/replication/SyncReplicationState.java |  48 ++
 .../hbase/shaded/protobuf/RequestConverter.java |  10 ++
 .../src/main/protobuf/Master.proto  |   4 +
 .../src/main/protobuf/MasterProcedure.proto |   4 +
 .../src/main/protobuf/Replication.proto |  20 +++
 .../replication/ReplicationPeerStorage.java |  18 ++-
 .../hbase/replication/ReplicationUtils.java |   1 +
 .../replication/ZKReplicationPeerStorage.java   |  61 +--
 .../replication/TestReplicationStateBasic.java  |  23 ++-
 .../TestZKReplicationPeerStorage.java   |  12 +-
 .../hbase/coprocessor/MasterObserver.java   |  23 +++
 .../org/apache/hadoop/hbase/master/HMaster.java |  12 ++
 .../hbase/master/MasterCoprocessorHost.java |  21 +++
 .../hadoop/hbase/master/MasterRpcServices.java  |  17 ++
 .../hadoop/hbase/master/MasterServices.java |   9 ++
 .../procedure/PeerProcedureInterface.java   |   2 +-
 .../replication/ReplicationPeerManager.java |  51 +-
 ...ransitPeerSyncReplicationStateProcedure.java | 159 +++
 .../hbase/security/access/AccessController.java |   8 +
 .../replication/TestReplicationAdmin.java   |  62 
 .../hbase/master/MockNoopMasterServices.java|   8 +-
 .../cleaner/TestReplicationHFileCleaner.java|   4 +-
 .../TestReplicationTrackerZKImpl.java   |   6 +-
 .../TestReplicationSourceManager.java   |   3 +-
 .../security/access/TestAccessController.java   |  16 ++
 .../hbase/util/TestHBaseFsckReplication.java|   5 +-
 .../src/main/ruby/hbase/replication_admin.rb|  15 ++
 hbase-shell/src/main/ruby/shell.rb  |   1 +
 .../src/main/ruby/shell/commands/list_peers.rb  |   6 +-
 .../transit_peer_sync_replication_state.rb  |  44 +
 .../test/ruby/hbase/replication_admin_test.rb   |  24 +++
 40 files changed, 816 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1d184a67/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
index 331f2d1..39542e4 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
@@ -51,6 +51,7 @@ import 
org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException;
 import org.apache.hadoop.hbase.replication.ReplicationException;
 import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
 import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
+import org.apache.hadoop.hbase.replication.SyncReplicationState;
 import org.apache.hadoop.hbase.snapshot.HBaseSnapshotException;
 import org.apache.hadoop.hbase.snapshot.RestoreSnapshotException;
 import org.apache.hadoop.hbase.snapshot.SnapshotCreationException;
@@ -2657,6 +2658,44 @@ public interface Admin extends Abortable, Closeable {
   List listReplicationPeers(Pattern pattern) 
throws IOException;
 
   /**
+   * Transit current cluster to a new state in a synchronous replication peer.
+   * @param peerId a short name that identifies the peer
+   * @param state a new state of current cluster
+   * @throws IOException if a remote or network exception occurs
+   */
+  void transitReplicationPeerSyncReplicationState(String peerId, 
SyncReplicationState state)
+  throws IOException;
+
+  /**
+   * Transit current cluster to a new state in a synchronous replication peer. 
But does not block
+   * and wait for it.
+   * 
+   * You can use Future.get(long, TimeUnit) to wait on the operation to 
complete. It may throw
+   * Exec

[40/50] [abbrv] hbase git commit: HBASE-19857 Complete the procedure for adding a sync replication peer

2018-04-23 Thread zhangduo
HBASE-19857 Complete the procedure for adding a sync replication peer


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

Branch: refs/heads/HBASE-19064
Commit: b9ddb296515128929797f94620a39475cf63c01e
Parents: 1d184a6
Author: zhangduo 
Authored: Thu Jan 25 20:09:00 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../hbase/replication/ReplicationPeer.java  |   9 +
 .../hbase/replication/ReplicationPeerImpl.java  |  28 +--
 .../hbase/replication/ReplicationPeers.java |   3 +-
 .../regionserver/PeerActionListener.java|  10 +-
 .../SyncReplicationPeerProvider.java|  35 +++
 .../SynchronousReplicationPeerProvider.java |  35 ---
 .../hbase/wal/SyncReplicationWALProvider.java   | 234 +++
 .../wal/SynchronousReplicationWALProvider.java  | 225 --
 .../org/apache/hadoop/hbase/wal/WALFactory.java |   8 +-
 .../TestReplicationSourceManager.java   |   3 +
 .../wal/TestSyncReplicationWALProvider.java | 153 
 .../TestSynchronousReplicationWALProvider.java  | 153 
 12 files changed, 456 insertions(+), 440 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b9ddb296/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java
index 2da3cce..0196a9a 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java
@@ -54,6 +54,15 @@ public interface ReplicationPeer {
   PeerState getPeerState();
 
   /**
+   * Returns the sync replication state of the peer by reading local cache.
+   * 
+   * If the peer is not a synchronous replication peer, a {@link 
SyncReplicationState#NONE} will be
+   * returned.
+   * @return the sync replication state
+   */
+  SyncReplicationState getSyncReplicationState();
+
+  /**
* Test whether the peer is enabled.
* @return {@code true} if enabled, otherwise {@code false}.
*/

http://git-wip-us.apache.org/repos/asf/hbase/blob/b9ddb296/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerImpl.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerImpl.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerImpl.java
index d656466..ff3f662 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerImpl.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerImpl.java
@@ -36,6 +36,8 @@ public class ReplicationPeerImpl implements ReplicationPeer {
 
   private volatile PeerState peerState;
 
+  private volatile SyncReplicationState syncReplicationState;
+
   private final List peerConfigListeners;
 
   /**
@@ -45,12 +47,13 @@ public class ReplicationPeerImpl implements ReplicationPeer 
{
* @param id string representation of this peer's identifier
* @param peerConfig configuration for the replication peer
*/
-  public ReplicationPeerImpl(Configuration conf, String id, boolean peerState,
-  ReplicationPeerConfig peerConfig) {
+  public ReplicationPeerImpl(Configuration conf, String id, 
ReplicationPeerConfig peerConfig,
+  boolean peerState, SyncReplicationState syncReplicationState) {
 this.conf = conf;
 this.id = id;
 this.peerState = peerState ? PeerState.ENABLED : PeerState.DISABLED;
 this.peerConfig = peerConfig;
+this.syncReplicationState = syncReplicationState;
 this.peerConfigListeners = new ArrayList<>();
   }
 
@@ -77,37 +80,26 @@ public class ReplicationPeerImpl implements ReplicationPeer 
{
 return peerState;
   }
 
-  /**
-   * Get the peer config object
-   * @return the ReplicationPeerConfig for this peer
-   */
+  @Override
+  public SyncReplicationState getSyncReplicationState() {
+return syncReplicationState;
+  }
+
   @Override
   public ReplicationPeerConfig getPeerConfig() {
 return peerConfig;
   }
 
-  /**
-   * Get the configuration object required to communicate with this peer
-   * @return configuration object
-   */
   @Override
   public Configuration getConfiguration() {
 return conf;
   }
 
-  /**
-   * Get replicable (table, cf-list) map of

[33/50] [abbrv] hbase git commit: HBASE-19943 Only allow removing sync replication peer which is in DA state

2018-04-23 Thread zhangduo
HBASE-19943 Only allow removing sync replication peer which is in DA state


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

Branch: refs/heads/HBASE-19064
Commit: 0ef449ab59d991e2ca6ddf7befa3653c855a0041
Parents: aa7100c
Author: huzheng 
Authored: Thu Mar 1 18:34:02 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerManager.java | 14 -
 .../hbase/wal/SyncReplicationWALProvider.java   |  2 +-
 .../replication/TestReplicationAdmin.java   | 63 
 .../hbase/replication/TestSyncReplication.java  |  2 +-
 4 files changed, 78 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/0ef449ab/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
index 0dc922d..41dd6e3 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
@@ -120,8 +120,20 @@ public class ReplicationPeerManager {
 return desc;
   }
 
+  private void checkPeerInDAStateIfSyncReplication(String peerId) throws 
DoNotRetryIOException {
+ReplicationPeerDescription desc = peers.get(peerId);
+if (desc != null && desc.getPeerConfig().isSyncReplication()
+&& 
!SyncReplicationState.DOWNGRADE_ACTIVE.equals(desc.getSyncReplicationState())) {
+  throw new DoNotRetryIOException("Couldn't remove synchronous replication 
peer with state="
+  + desc.getSyncReplicationState()
+  + ", Transit the synchronous replication state to be 
DOWNGRADE_ACTIVE firstly.");
+}
+  }
+
   ReplicationPeerConfig preRemovePeer(String peerId) throws 
DoNotRetryIOException {
-return checkPeerExists(peerId).getPeerConfig();
+ReplicationPeerDescription pd = checkPeerExists(peerId);
+checkPeerInDAStateIfSyncReplication(peerId);
+return pd.getPeerConfig();
   }
 
   void preEnablePeer(String peerId) throws DoNotRetryIOException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ef449ab/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
index ac4b4cd..282aa21 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
@@ -142,7 +142,7 @@ public class SyncReplicationWALProvider implements 
WALProvider, PeerActionListen
   @Override
   public WAL getWAL(RegionInfo region) throws IOException {
 if (region == null) {
-  return provider.getWAL(region);
+  return provider.getWAL(null);
 }
 Optional> peerIdAndRemoteWALDir =
   peerInfoProvider.getPeerIdAndRemoteWALDir(region);

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ef449ab/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
index 0ad476f..486ab51 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
@@ -254,6 +254,62 @@ public class TestReplicationAdmin {
   }
 
   @Test
+  public void testRemovePeerWithNonDAState() throws Exception {
+TableName tableName = TableName.valueOf(name.getMethodName());
+TEST_UTIL.createTable(tableName, Bytes.toBytes("family"));
+ReplicationPeerConfigBuilder builder = ReplicationPeerConfig.newBuilder();
+
+String rootDir = "hdfs://srv1:/hbase";
+builder.setClusterKey(KEY_ONE);
+builder.setRemoteWALDir(rootDir);
+builder.setReplicateAllUserTables(false);
+Map> tableCfs = new HashMap<>();
+tableCfs.put(tableName, new ArrayList<>());
+builder.se

[49/50] [abbrv] hbase git commit: HBASE-19782 Reject the replication request when peer is DA or A state

2018-04-23 Thread zhangduo
HBASE-19782 Reject the replication request when peer is DA or A state


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

Branch: refs/heads/HBASE-19064
Commit: afd78256c56c54081b53e81dc666584e2d4b517d
Parents: da27c1f
Author: huzheng 
Authored: Fri Mar 2 18:05:29 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:08:12 2018 +0800

--
 .../hbase/protobuf/ReplicationProtbufUtil.java  |  2 +-
 .../hadoop/hbase/regionserver/HRegion.java  |  2 +-
 .../hbase/regionserver/HRegionServer.java   |  5 +--
 .../hbase/regionserver/RSRpcServices.java   | 25 +--
 .../RejectReplicationRequestStateChecker.java   | 45 
 .../ReplaySyncReplicationWALCallable.java   | 24 ++-
 .../replication/regionserver/Replication.java   |  2 +-
 .../regionserver/ReplicationSink.java   | 16 +++
 .../SyncReplicationPeerInfoProvider.java| 11 ++---
 .../SyncReplicationPeerInfoProviderImpl.java| 13 +++---
 .../SyncReplicationPeerMappingManager.java  |  5 +--
 .../hbase/wal/SyncReplicationWALProvider.java   |  7 +--
 .../replication/SyncReplicationTestBase.java| 32 ++
 .../replication/TestSyncReplicationActive.java  | 13 +-
 .../regionserver/TestReplicationSink.java   |  5 +--
 .../regionserver/TestWALEntrySinkFilter.java|  3 +-
 .../wal/TestSyncReplicationWALProvider.java |  6 +--
 17 files changed, 163 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/afd78256/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
index 81dd59e..e01f881 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellScanner;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.PrivateCellUtil;
+import org.apache.hadoop.hbase.wal.WAL.Entry;
 import org.apache.hadoop.hbase.wal.WALKeyImpl;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.hadoop.hbase.io.SizedCellScanner;
@@ -45,7 +46,6 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminServic
 import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos;
 import org.apache.hadoop.hbase.util.Pair;
-import org.apache.hadoop.hbase.wal.WAL.Entry;
 
 @InterfaceAudience.Private
 public class ReplicationProtbufUtil {

http://git-wip-us.apache.org/repos/asf/hbase/blob/afd78256/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 1865144..cb7ba6e 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
@@ -1981,7 +1981,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
   private boolean shouldForbidMajorCompaction() {
 if (rsServices != null && rsServices.getReplicationSourceService() != 
null) {
   return 
rsServices.getReplicationSourceService().getSyncReplicationPeerInfoProvider()
-  .checkState(getRegionInfo(), ForbidMajorCompactionChecker.get());
+  .checkState(getRegionInfo().getTable(), 
ForbidMajorCompactionChecker.get());
 }
 return false;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/afd78256/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 4dd8f09..5963cd9 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -2478,10 +2478,9 @@ public class HRegionServer extends HasThread impleme

[35/50] [abbrv] hbase git commit: HBASE-19082 Reject read/write from client but accept write from replication in state S

2018-04-23 Thread zhangduo
HBASE-19082 Reject read/write from client but accept write from replication in 
state S


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

Branch: refs/heads/HBASE-19064
Commit: 22a9f020c97889042698d5c4d4f374efe92ed414
Parents: 6cb516c
Author: zhangduo 
Authored: Mon Feb 12 18:20:18 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../org/apache/hadoop/hbase/HConstants.java |   3 -
 .../src/main/protobuf/MasterProcedure.proto |   3 +-
 .../hbase/replication/ReplicationUtils.java |   4 +
 ...ransitPeerSyncReplicationStateProcedure.java |  10 +
 .../hadoop/hbase/regionserver/HRegion.java  |   5 +-
 .../hbase/regionserver/HRegionServer.java   |   2 +-
 .../hbase/regionserver/RSRpcServices.java   |  88 ++--
 .../RejectRequestsFromClientStateChecker.java   |  44 
 .../regionserver/ReplicationSink.java   |  72 ---
 .../SyncReplicationPeerInfoProvider.java|  10 +-
 .../SyncReplicationPeerInfoProviderImpl.java|  19 +-
 .../hbase/wal/SyncReplicationWALProvider.java   |   3 +
 .../org/apache/hadoop/hbase/wal/WALFactory.java |   4 +-
 .../hbase/replication/TestSyncReplication.java  | 200 +++
 .../wal/TestSyncReplicationWALProvider.java |   8 +-
 15 files changed, 401 insertions(+), 74 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/22a9f020/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 522c2cf..9241682 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -1355,9 +1355,6 @@ public final class HConstants {
 
   public static final String NOT_IMPLEMENTED = "Not implemented";
 
-  // TODO: need to find a better place to hold it.
-  public static final String SYNC_REPLICATION_ENABLED = 
"hbase.replication.sync.enabled";
-
   private HConstants() {
 // Can't be instantiated with this ctor.
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/22a9f020/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
--
diff --git a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto 
b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
index e085846..e08aa2b 100644
--- a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
+++ b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
@@ -393,7 +393,8 @@ enum PeerSyncReplicationStateTransitionState {
   REOPEN_ALL_REGIONS_IN_PEER = 5;
   TRANSIT_PEER_NEW_SYNC_REPLICATION_STATE = 6;
   REFRESH_PEER_SYNC_REPLICATION_STATE_ON_RS_END = 7;
-  POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 8;
+  CREATE_DIR_FOR_REMOTE_WAL = 8;
+  POST_PEER_SYNC_REPLICATION_STATE_TRANSITION = 9;
 }
 
 message PeerModificationStateData {

http://git-wip-us.apache.org/repos/asf/hbase/blob/22a9f020/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
index e4dea83..d94cb00 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
@@ -37,6 +37,10 @@ import org.apache.yetus.audience.InterfaceAudience;
 @InterfaceAudience.Private
 public final class ReplicationUtils {
 
+  public static final String SYNC_REPLICATION_ENABLED = 
"hbase.replication.sync.enabled";
+
+  public static final String REPLICATION_ATTR_NAME = "__rep__";
+
   private ReplicationUtils() {
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/22a9f020/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
index 8fc932f..69404a0 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replica

[26/50] [abbrv] hbase git commit: Revert "HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods"

2018-04-23 Thread zhangduo
Revert "HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods"

This reverts commit 273d252838e96c4b4af2401743d84e482c4ec565.

missing jira id


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

Branch: refs/heads/HBASE-19064
Commit: eb3f5b2812cfe030690d5d22755f7809566d31a6
Parents: e5fb332
Author: Sean Busbey 
Authored: Fri Apr 20 22:41:50 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 22:41:50 2018 -0500

--
 .../hadoop/hbase/http/TestHttpServer.java   | 13 ++--
 .../hadoop/hbase/thrift/ThriftServerRunner.java |  2 --
 .../hbase/thrift/TestThriftHttpServer.java  | 21 
 3 files changed, 6 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/eb3f5b28/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
--
diff --git 
a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java 
b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
index 10553da..16350d5 100644
--- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
+++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
@@ -605,6 +605,8 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 myServer.stop();
   }
 
+
+
   @Test
   public void testNoCacheHeader() throws Exception {
 URL url = new URL(baseUrl, "/echo?a=b&c=d");
@@ -617,15 +619,4 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 assertEquals(conn.getHeaderField("Expires"), conn.getHeaderField("Date"));
 assertEquals("DENY", conn.getHeaderField("X-Frame-Options"));
   }
-
-  @Test
-  public void testHttpMethods() throws Exception {
-// HTTP TRACE method should be disabled for security
-// See https://www.owasp.org/index.php/Cross_Site_Tracing
-URL url = new URL(baseUrl, "/echo?a=b");
-HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-conn.setRequestMethod("TRACE");
-conn.connect();
-assertEquals(HttpURLConnection.HTTP_FORBIDDEN, conn.getResponseCode());
-  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/eb3f5b28/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 28ba28a..39ea259 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -79,7 +79,6 @@ import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.ParseFilter;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
 import org.apache.hadoop.hbase.filter.WhileMatchFilter;
-import org.apache.hadoop.hbase.http.HttpServerUtil;
 import org.apache.hadoop.hbase.log.HBaseMarkers;
 import org.apache.hadoop.hbase.security.SaslUtil;
 import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;
@@ -449,7 +448,6 @@ public class ThriftServerRunner implements Runnable {
 ServletContextHandler ctxHandler = new ServletContextHandler(httpServer, 
"/",
 ServletContextHandler.SESSIONS);
 ctxHandler.addServlet(new ServletHolder(thriftHttpServlet), "/*");
-HttpServerUtil.constrainHttpMethods(ctxHandler);
 
 // set up Jetty and run the embedded server
 HttpConfiguration httpConfig = new HttpConfiguration();

http://git-wip-us.apache.org/repos/asf/hbase/blob/eb3f5b28/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
--
diff --git 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
index 6117953..d583234 100644
--- 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
+++ 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
@@ -21,8 +21,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
-import java.net.HttpURLConnection;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.hadoop.conf.Configuration;
@@ -40,7 +38,6 @@ import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrif

[47/50] [abbrv] hbase git commit: HBASE-19999 Remove the SYNC_REPLICATION_ENABLED flag

2018-04-23 Thread zhangduo
HBASE-1 Remove the SYNC_REPLICATION_ENABLED flag


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

Branch: refs/heads/HBASE-19064
Commit: 88bab1ca1aae3b0b9f8e40f27c61fab6e8fd6b00
Parents: 24d8dc2
Author: Guanghao Zhang 
Authored: Fri Mar 9 11:30:25 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../hbase/replication/ReplicationUtils.java  |  2 --
 .../hadoop/hbase/regionserver/HRegionServer.java | 13 -
 .../hbase/wal/SyncReplicationWALProvider.java| 19 ++-
 .../org/apache/hadoop/hbase/wal/WALFactory.java  | 18 --
 .../hbase/replication/TestSyncReplication.java   |  1 -
 .../master/TestRecoverStandbyProcedure.java  |  2 --
 .../wal/TestSyncReplicationWALProvider.java  |  2 --
 7 files changed, 38 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/88bab1ca/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
--
diff --git 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
index e402d0f..cb22f57 100644
--- 
a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
+++ 
b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationUtils.java
@@ -37,8 +37,6 @@ import org.apache.yetus.audience.InterfaceAudience;
 @InterfaceAudience.Private
 public final class ReplicationUtils {
 
-  public static final String SYNC_REPLICATION_ENABLED = 
"hbase.replication.sync.enabled";
-
   public static final String REPLICATION_ATTR_NAME = "__rep__";
 
   public static final String REMOTE_WAL_DIR_NAME = "remoteWALs";

http://git-wip-us.apache.org/repos/asf/hbase/blob/88bab1ca/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index f8e2105..25bc6be 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -1804,10 +1804,8 @@ public class HRegionServer extends HasThread implements
   private void setupWALAndReplication() throws IOException {
 boolean isMasterNoTableOrSystemTableOnly = this instanceof HMaster &&
   (!LoadBalancer.isTablesOnMaster(conf) || 
LoadBalancer.isSystemTablesOnlyOnMaster(conf));
-if (isMasterNoTableOrSystemTableOnly) {
-  conf.setBoolean(ReplicationUtils.SYNC_REPLICATION_ENABLED, false);
-}
-WALFactory factory = new WALFactory(conf, serverName.toString());
+WALFactory factory =
+new WALFactory(conf, serverName.toString(), 
!isMasterNoTableOrSystemTableOnly);
 if (!isMasterNoTableOrSystemTableOnly) {
   // TODO Replication make assumptions here based on the default 
filesystem impl
   Path oldLogDir = new Path(walRootDir, HConstants.HREGION_OLDLOGDIR_NAME);
@@ -1926,11 +1924,8 @@ public class HRegionServer extends HasThread implements
 }
 this.executorService.startExecutorService(ExecutorType.RS_REFRESH_PEER,
   conf.getInt("hbase.regionserver.executor.refresh.peer.threads", 2));
-
-if (conf.getBoolean(ReplicationUtils.SYNC_REPLICATION_ENABLED, false)) {
-  
this.executorService.startExecutorService(ExecutorType.RS_REPLAY_SYNC_REPLICATION_WAL,
-
conf.getInt("hbase.regionserver.executor.replay.sync.replication.wal.threads", 
2));
-}
+
this.executorService.startExecutorService(ExecutorType.RS_REPLAY_SYNC_REPLICATION_WAL,
+  
conf.getInt("hbase.regionserver.executor.replay.sync.replication.wal.threads", 
1));
 
 Threads.setDaemonThreadRunning(this.walRoller.getThread(), getName() + 
".logRoller",
 uncaughtExceptionHandler);

http://git-wip-us.apache.org/repos/asf/hbase/blob/88bab1ca/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.java
index 282aa21..54287fe 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/SyncReplicationWALProvider.jav

[44/50] [abbrv] hbase git commit: HBASE-19079 Support setting up two clusters with A and S stat

2018-04-23 Thread zhangduo
HBASE-19079 Support setting up two clusters with A and S stat


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

Branch: refs/heads/HBASE-19064
Commit: 4f3dd074ecc50e8c14fe10ef5d606f4cdbf2eff7
Parents: 88bab1c
Author: zhangduo 
Authored: Tue Apr 10 22:35:19 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerManager.java |   5 +-
 ...ransitPeerSyncReplicationStateProcedure.java |   2 +-
 .../hbase/regionserver/wal/DualAsyncFSWAL.java  |  14 ++
 .../hadoop/hbase/regionserver/wal/WALUtil.java  |  25 ++-
 .../hbase/replication/ChainWALEntryFilter.java  |  28 +--
 .../ReplaySyncReplicationWALCallable.java   |  27 ++-
 .../SyncReplicationPeerInfoProviderImpl.java|   6 +-
 .../hadoop/hbase/wal/AbstractFSWALProvider.java |  10 +-
 .../hbase/wal/SyncReplicationWALProvider.java   |  94 ++---
 .../org/apache/hadoop/hbase/wal/WALEdit.java|   8 +-
 .../org/apache/hadoop/hbase/wal/WALFactory.java |   2 +-
 .../replication/TestReplicationAdmin.java   |  33 +--
 .../regionserver/wal/TestWALDurability.java |   2 +
 .../replication/SyncReplicationTestBase.java| 185 +
 .../hbase/replication/TestSyncReplication.java  | 207 ---
 .../replication/TestSyncReplicationActive.java  |  64 ++
 .../replication/TestSyncReplicationStandBy.java |  96 +
 17 files changed, 521 insertions(+), 287 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/4f3dd074/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
index 41dd6e3..229549e 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
@@ -68,8 +68,9 @@ public class ReplicationPeerManager {
 
   private final ImmutableMap>
 allowedTransition = 
Maps.immutableEnumMap(ImmutableMap.of(SyncReplicationState.ACTIVE,
-  EnumSet.of(SyncReplicationState.DOWNGRADE_ACTIVE), 
SyncReplicationState.STANDBY,
-  EnumSet.of(SyncReplicationState.DOWNGRADE_ACTIVE), 
SyncReplicationState.DOWNGRADE_ACTIVE,
+  EnumSet.of(SyncReplicationState.DOWNGRADE_ACTIVE, 
SyncReplicationState.STANDBY),
+  SyncReplicationState.STANDBY, 
EnumSet.of(SyncReplicationState.DOWNGRADE_ACTIVE),
+  SyncReplicationState.DOWNGRADE_ACTIVE,
   EnumSet.of(SyncReplicationState.STANDBY, SyncReplicationState.ACTIVE)));
 
   ReplicationPeerManager(ReplicationPeerStorage peerStorage, 
ReplicationQueueStorage queueStorage,

http://git-wip-us.apache.org/repos/asf/hbase/blob/4f3dd074/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
index cc51890..5da2b0c 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/TransitPeerSyncReplicationStateProcedure.java
@@ -171,7 +171,7 @@ public class TransitPeerSyncReplicationStateProcedure
 }
 return Flow.HAS_MORE_STATE;
   case REPLAY_REMOTE_WAL_IN_PEER:
-// TODO: replay remote wal when transiting from S to DA.
+addChildProcedure(new RecoverStandbyProcedure(peerId));
 
setNextState(PeerSyncReplicationStateTransitionState.REOPEN_ALL_REGIONS_IN_PEER);
 return Flow.HAS_MORE_STATE;
   case REOPEN_ALL_REGIONS_IN_PEER:

http://git-wip-us.apache.org/repos/asf/hbase/blob/4f3dd074/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyncFSWAL.java
index 0495337..a98567a 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/DualAsyn

[42/50] [abbrv] hbase git commit: HBASE-19957 General framework to transit sync replication state

2018-04-23 Thread zhangduo
http://git-wip-us.apache.org/repos/asf/hbase/blob/6cb516cc/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProvider.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProvider.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProvider.java
new file mode 100644
index 000..92f2c52
--- /dev/null
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProvider.java
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import java.util.Optional;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.replication.SyncReplicationState;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Get the information for a sync replication peer.
+ */
+@InterfaceAudience.Private
+public interface SyncReplicationPeerInfoProvider {
+
+  /**
+   * Return the peer id and remote WAL directory if the region is 
synchronously replicated and the
+   * state is {@link SyncReplicationState#ACTIVE}.
+   */
+  Optional> getPeerIdAndRemoteWALDir(RegionInfo info);
+
+  /**
+   * Check whether the give region is contained in a sync replication peer 
which is in the given
+   * state.
+   */
+  boolean isInState(RegionInfo info, SyncReplicationState state);
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6cb516cc/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProviderImpl.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProviderImpl.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProviderImpl.java
new file mode 100644
index 000..32159e6
--- /dev/null
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/SyncReplicationPeerInfoProviderImpl.java
@@ -0,0 +1,71 @@
+/**
+ * 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.replication.regionserver;
+
+import java.util.Optional;
+import org.apache.hadoop.hbase.client.RegionInfo;
+import org.apache.hadoop.hbase.replication.ReplicationPeer;
+import org.apache.hadoop.hbase.replication.ReplicationPeers;
+import org.apache.hadoop.hbase.replication.SyncReplicationState;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.yetus.audience.InterfaceAudience;
+
+@InterfaceAudience.Private
+class SyncReplicationPeerInfoProviderImpl implements 
SyncReplicationPeerInfoProvider {
+
+  private final ReplicationPeers replicationPeers;
+
+  private final SyncReplicationPeerMappingManager mapping;
+
+  SyncReplicationPeerInfoProviderImpl(ReplicationPeers replicationPeers,
+  SyncReplicationPeerMappingManager mapping) {
+this.replicationPeers = replicationPeers;
+this.mapping = mapping;
+  }
+
+  @Override
+  public Optional> getPeerIdAndRemoteWALDir(RegionInfo 
info) {
+String peerId = mapping.getPeerId(info);
+if (peerId == null) {
+  return Optional.empty();
+}
+ReplicationPeer peer = replication

[29/50] [abbrv] hbase git commit: HBASE-20388 nightly tests running on a feature branch should only comment on that feature branch's jira

2018-04-23 Thread zhangduo
HBASE-20388 nightly tests running on a feature branch should only comment on 
that feature branch's jira

Signed-off-by: Mike Drob 


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

Branch: refs/heads/HBASE-19064
Commit: f4a39043e2fb3da69e378b4e1cbcb4bd7e2a6662
Parents: 00fca5a
Author: Sean Busbey 
Authored: Thu Apr 12 21:10:53 2018 -0500
Committer: Sean Busbey 
Committed: Sat Apr 21 13:50:40 2018 -0500

--
 dev-support/Jenkinsfile | 35 +++
 1 file changed, 23 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f4a39043/dev-support/Jenkinsfile
--
diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 6e320ca..821d20e 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -528,8 +528,14 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
echo "[INFO] Comment:"
echo comment
echo ""
-   echo "[INFO] There are ${currentBuild.changeSets.size()} change 
sets."
-   getJirasToComment(currentBuild).each { currentIssue ->
+   echo "[DEBUG] checking to see if feature branch"
+   def jiras = getJirasToComment(env.BRANCH_NAME, [])
+   if (jiras.isEmpty()) {
+ echo "[DEBUG] non-feature branch, checking change messages for 
jira keys."
+ echo "[INFO] There are ${currentBuild.changeSets.size()} change 
sets."
+ jiras = getJirasToCommentFromChangesets(currentBuild)
+   }
+   jiras.each { currentIssue ->
  jiraComment issueKey: currentIssue, body: comment
}
 } catch (Exception exception) {
@@ -542,7 +548,7 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
 }
 import org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper
 @NonCPS
-List getJirasToComment(RunWrapper thisBuild) {
+List getJirasToCommentFromChangesets(RunWrapper thisBuild) {
   def seenJiras = []
   thisBuild.changeSets.each { cs ->
 cs.getItems().each { change ->
@@ -552,16 +558,21 @@ List getJirasToComment(RunWrapper thisBuild) {
   echo " ${change.commitId}"
   echo " ${change.author}"
   echo ""
-  msg.eachMatch("HBASE-[0-9]+") { currentIssue ->
-echo "[DEBUG] found jira key: ${currentIssue}"
-if (currentIssue in seenJiras) {
-  echo "[DEBUG] already commented on ${currentIssue}."
-} else {
-  echo "[INFO] commenting on ${currentIssue}."
-  seenJiras << currentIssue
-}
-  }
+  seenJiras = getJirasToComment(msg, seenJiras)
 }
   }
   return seenJiras
 }
+@NonCPS
+List getJirasToComment(CharSequence source, List seen) {
+  source.eachMatch("HBASE-[0-9]+") { currentIssue ->
+echo "[DEBUG] found jira key: ${currentIssue}"
+if (currentIssue in seen) {
+  echo "[DEBUG] already commented on ${currentIssue}."
+} else {
+  echo "[INFO] commenting on ${currentIssue}."
+  seen << currentIssue
+}
+  }
+  return seen
+}



[27/50] [abbrv] hbase git commit: HBASE-20406 HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods

2018-04-23 Thread zhangduo
HBASE-20406 HBase Thrift HTTP - Shouldn't handle TRACE/OPTIONS methods

Signed-off-by: Josh Elser 
Signed-off-by: Ted Yu 
Signed-off-by: Sean Busbey 


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

Branch: refs/heads/HBASE-19064
Commit: 46cb5dfa226892fd2580f26ce9ce77225bd7e67c
Parents: eb3f5b2
Author: Kevin Risden 
Authored: Thu Apr 12 21:08:15 2018 -0500
Committer: Sean Busbey 
Committed: Fri Apr 20 22:42:03 2018 -0500

--
 .../hadoop/hbase/http/TestHttpServer.java   | 13 ++--
 .../hadoop/hbase/thrift/ThriftServerRunner.java |  2 ++
 .../hbase/thrift/TestThriftHttpServer.java  | 21 
 3 files changed, 30 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/46cb5dfa/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
--
diff --git 
a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java 
b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
index 16350d5..10553da 100644
--- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
+++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java
@@ -605,8 +605,6 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 myServer.stop();
   }
 
-
-
   @Test
   public void testNoCacheHeader() throws Exception {
 URL url = new URL(baseUrl, "/echo?a=b&c=d");
@@ -619,4 +617,15 @@ public class TestHttpServer extends 
HttpServerFunctionalTest {
 assertEquals(conn.getHeaderField("Expires"), conn.getHeaderField("Date"));
 assertEquals("DENY", conn.getHeaderField("X-Frame-Options"));
   }
+
+  @Test
+  public void testHttpMethods() throws Exception {
+// HTTP TRACE method should be disabled for security
+// See https://www.owasp.org/index.php/Cross_Site_Tracing
+URL url = new URL(baseUrl, "/echo?a=b");
+HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+conn.setRequestMethod("TRACE");
+conn.connect();
+assertEquals(HttpURLConnection.HTTP_FORBIDDEN, conn.getResponseCode());
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/46cb5dfa/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 39ea259..28ba28a 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -79,6 +79,7 @@ import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.ParseFilter;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
 import org.apache.hadoop.hbase.filter.WhileMatchFilter;
+import org.apache.hadoop.hbase.http.HttpServerUtil;
 import org.apache.hadoop.hbase.log.HBaseMarkers;
 import org.apache.hadoop.hbase.security.SaslUtil;
 import org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection;
@@ -448,6 +449,7 @@ public class ThriftServerRunner implements Runnable {
 ServletContextHandler ctxHandler = new ServletContextHandler(httpServer, 
"/",
 ServletContextHandler.SESSIONS);
 ctxHandler.addServlet(new ServletHolder(thriftHttpServlet), "/*");
+HttpServerUtil.constrainHttpMethods(ctxHandler);
 
 // set up Jetty and run the embedded server
 HttpConfiguration httpConfig = new HttpConfiguration();

http://git-wip-us.apache.org/repos/asf/hbase/blob/46cb5dfa/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
--
diff --git 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
index d583234..6117953 100644
--- 
a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
+++ 
b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java
@@ -21,6 +21,8 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
+import java.net.HttpURLConnection;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.hadoop.conf.Configuration;
@@ -38,6 +40,7 @@ import org.apache.thrift.protocol.TProtocol;
 import org.apache.th

[46/50] [abbrv] hbase git commit: HBASE-19935 Only allow table replication for sync replication for now

2018-04-23 Thread zhangduo
HBASE-19935 Only allow table replication for sync replication for now


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

Branch: refs/heads/HBASE-19064
Commit: ff0a3329140d6a954ce40f4959678257b8e51056
Parents: 6269814
Author: Guanghao Zhang 
Authored: Tue Feb 6 16:00:59 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerConfig.java  |  9 +++
 .../replication/ReplicationPeerManager.java | 34 -
 .../replication/TestReplicationAdmin.java   | 73 ++--
 .../wal/TestCombinedAsyncWriter.java|  6 ++
 .../wal/TestSyncReplicationWALProvider.java |  6 ++
 5 files changed, 102 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/ff0a3329/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
index 97abc74..997a155 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
@@ -25,6 +25,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+
+import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.yetus.audience.InterfaceAudience;
@@ -220,6 +222,13 @@ public class ReplicationPeerConfig {
 return this.remoteWALDir;
   }
 
+  /**
+   * Use remote wal dir to decide whether a peer is sync replication peer
+   */
+  public boolean isSyncReplication() {
+return !StringUtils.isBlank(this.remoteWALDir);
+  }
+
   public static ReplicationPeerConfigBuilder newBuilder() {
 return new ReplicationPeerConfigBuilderImpl();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/ff0a3329/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
index f07a0d8..ff778a8 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
@@ -170,7 +170,7 @@ public class ReplicationPeerManager {
   " does not match new remote wal dir '" + 
peerConfig.getRemoteWALDir() + "'");
 }
 
-if (oldPeerConfig.getRemoteWALDir() != null) {
+if (oldPeerConfig.isSyncReplication()) {
   if (!ReplicationUtils.isNamespacesAndTableCFsEqual(oldPeerConfig, 
peerConfig)) {
 throw new DoNotRetryIOException(
   "Changing the replicated namespace/table config on a synchronous 
replication " +
@@ -199,8 +199,8 @@ public class ReplicationPeerManager {
 }
 ReplicationPeerConfig copiedPeerConfig = 
ReplicationPeerConfig.newBuilder(peerConfig).build();
 SyncReplicationState syncReplicationState =
-StringUtils.isBlank(peerConfig.getRemoteWALDir()) ? 
SyncReplicationState.NONE
-: SyncReplicationState.DOWNGRADE_ACTIVE;
+copiedPeerConfig.isSyncReplication() ? 
SyncReplicationState.DOWNGRADE_ACTIVE
+: SyncReplicationState.NONE;
 peerStorage.addPeer(peerId, copiedPeerConfig, enabled, 
syncReplicationState);
 peers.put(peerId,
   new ReplicationPeerDescription(peerId, enabled, copiedPeerConfig, 
syncReplicationState));
@@ -324,9 +324,37 @@ public class ReplicationPeerManager {
 peerConfig.getTableCFsMap());
 }
 
+if (peerConfig.isSyncReplication()) {
+  checkPeerConfigForSyncReplication(peerConfig);
+}
+
 checkConfiguredWALEntryFilters(peerConfig);
   }
 
+  private void checkPeerConfigForSyncReplication(ReplicationPeerConfig 
peerConfig)
+  throws DoNotRetryIOException {
+// This is used to reduce the difficulty for implementing the sync 
replication state transition
+// as we need to reopen all the related regions.
+// TODO: Add namespace, replicat_all flag back
+if (peerConfig.replicateAllUserTables()) {
+  throw new DoNotRetryIOException(
+  "Only support replicated table c

[34/50] [abbrv] hbase git commit: HBASE-19973 Implement a procedure to replay sync replication wal for standby cluster

2018-04-23 Thread zhangduo
HBASE-19973 Implement a procedure to replay sync replication wal for standby 
cluster


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

Branch: refs/heads/HBASE-19064
Commit: 24d8dc25cacac7470926e6c0ab3abd79daa974f5
Parents: 0ef449a
Author: Guanghao Zhang 
Authored: Fri Mar 2 18:43:25 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../src/main/protobuf/MasterProcedure.proto |  22 +++
 .../apache/hadoop/hbase/executor/EventType.java |   9 +-
 .../hadoop/hbase/executor/ExecutorType.java |   3 +-
 .../org/apache/hadoop/hbase/master/HMaster.java |   9 +
 .../hadoop/hbase/master/MasterServices.java |   6 +
 .../procedure/PeerProcedureInterface.java   |   3 +-
 .../hbase/master/procedure/PeerQueue.java   |   3 +-
 .../replication/RecoverStandbyProcedure.java| 114 +++
 .../ReplaySyncReplicationWALManager.java| 139 +
 .../ReplaySyncReplicationWALProcedure.java  | 193 +++
 .../hbase/regionserver/HRegionServer.java   |   9 +-
 .../ReplaySyncReplicationWALCallable.java   | 149 ++
 .../SyncReplicationPeerInfoProviderImpl.java|   3 +
 .../org/apache/hadoop/hbase/util/FSUtils.java   |   5 +
 .../hbase/master/MockNoopMasterServices.java|   8 +-
 .../master/TestRecoverStandbyProcedure.java | 186 ++
 16 files changed, 854 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/24d8dc25/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
--
diff --git a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto 
b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
index e08aa2b..53c54b2 100644
--- a/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
+++ b/hbase-protocol-shaded/src/main/protobuf/MasterProcedure.proto
@@ -455,3 +455,25 @@ message TransitPeerSyncReplicationStateStateData {
   optional SyncReplicationState fromState = 1;
   required SyncReplicationState toState = 2;
 }
+
+enum RecoverStandbyState {
+  RENAME_SYNC_REPLICATION_WALS_DIR = 1;
+  INIT_WORKERS = 2;
+  DISPATCH_TASKS = 3;
+  REMOVE_SYNC_REPLICATION_WALS_DIR = 4;
+}
+
+message RecoverStandbyStateData {
+  required string peer_id = 1;
+}
+
+message ReplaySyncReplicationWALStateData {
+  required string peer_id = 1;
+  required string wal = 2;
+  optional ServerName target_server = 3;
+}
+
+message ReplaySyncReplicationWALParameter {
+  required string peer_id = 1;
+  required string wal = 2;
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/24d8dc25/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventType.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventType.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventType.java
index 922deb8..ad38d1c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventType.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/EventType.java
@@ -281,7 +281,14 @@ public enum EventType {
*
* RS_REFRESH_PEER
*/
-  RS_REFRESH_PEER (84, ExecutorType.RS_REFRESH_PEER);
+  RS_REFRESH_PEER(84, ExecutorType.RS_REFRESH_PEER),
+
+  /**
+   * RS replay sync replication wal.
+   *
+   * RS_REPLAY_SYNC_REPLICATION_WAL
+   */
+  RS_REPLAY_SYNC_REPLICATION_WAL(85, 
ExecutorType.RS_REPLAY_SYNC_REPLICATION_WAL);
 
   private final int code;
   private final ExecutorType executor;

http://git-wip-us.apache.org/repos/asf/hbase/blob/24d8dc25/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java
index 7f130d1..ea97354 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/executor/ExecutorType.java
@@ -47,7 +47,8 @@ public enum ExecutorType {
   RS_REGION_REPLICA_FLUSH_OPS  (28),
   RS_COMPACTED_FILES_DISCHARGER (29),
   RS_OPEN_PRIORITY_REGION(30),
-  RS_REFRESH_PEER   (31);
+  RS_REFRESH_PEER(31),
+  RS_REPLAY_SYNC_REPLICATION_WAL(32);
 
   ExecutorType(int value) {
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/24d8dc25/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--

[43/50] [abbrv] hbase git commit: HBASE-19957 General framework to transit sync replication state

2018-04-23 Thread zhangduo
HBASE-19957 General framework to transit sync replication state


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

Branch: refs/heads/HBASE-19064
Commit: 6cb516cc9dc5aab103fd749f911615d890f60e54
Parents: ff0a332
Author: zhangduo 
Authored: Fri Feb 9 18:33:28 2018 +0800
Committer: zhangduo 
Committed: Mon Apr 23 16:05:00 2018 +0800

--
 .../replication/ReplicationPeerConfig.java  |   2 -
 .../replication/ReplicationPeerDescription.java |   5 +-
 .../hbase/replication/SyncReplicationState.java |  19 +-
 .../org/apache/hadoop/hbase/HConstants.java |   3 +
 .../src/main/protobuf/MasterProcedure.proto |  20 +-
 .../hbase/replication/ReplicationPeerImpl.java  |  45 -
 .../replication/ReplicationPeerStorage.java |  25 ++-
 .../hbase/replication/ReplicationPeers.java |  27 ++-
 .../replication/ZKReplicationPeerStorage.java   |  63 +--
 .../hbase/coprocessor/MasterObserver.java   |   7 +-
 .../org/apache/hadoop/hbase/master/HMaster.java |   4 +-
 .../hbase/master/MasterCoprocessorHost.java |  12 +-
 .../replication/AbstractPeerProcedure.java  |  14 +-
 .../master/replication/ModifyPeerProcedure.java |  11 --
 .../replication/RefreshPeerProcedure.java   |  18 +-
 .../replication/ReplicationPeerManager.java |  89 +
 ...ransitPeerSyncReplicationStateProcedure.java | 181 ---
 .../hbase/regionserver/HRegionServer.java   |  35 ++--
 .../regionserver/ReplicationSourceService.java  |  11 +-
 .../regionserver/PeerActionListener.java|   4 +-
 .../regionserver/PeerProcedureHandler.java  |  16 +-
 .../regionserver/PeerProcedureHandlerImpl.java  |  52 +-
 .../regionserver/RefreshPeerCallable.java   |   7 +
 .../replication/regionserver/Replication.java   |  22 ++-
 .../regionserver/ReplicationSourceManager.java  |  41 +++--
 .../SyncReplicationPeerInfoProvider.java|  43 +
 .../SyncReplicationPeerInfoProviderImpl.java|  71 
 .../SyncReplicationPeerMappingManager.java  |  48 +
 .../SyncReplicationPeerProvider.java|  35 
 .../hbase/wal/SyncReplicationWALProvider.java   |  35 ++--
 .../org/apache/hadoop/hbase/wal/WALFactory.java |  47 ++---
 .../replication/TestReplicationAdmin.java   |   3 +-
 .../TestReplicationSourceManager.java   |   5 +-
 .../wal/TestSyncReplicationWALProvider.java |  36 ++--
 34 files changed, 743 insertions(+), 313 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6cb516cc/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
index 997a155..cc7b4bc 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java
@@ -15,7 +15,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.hadoop.hbase.replication;
 
 import java.util.Collection;
@@ -25,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.util.Bytes;

http://git-wip-us.apache.org/repos/asf/hbase/blob/6cb516cc/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerDescription.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerDescription.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerDescription.java
index 2d077c5..b0c27bb 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerDescription.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerDescription.java
@@ -20,7 +20,10 @@ package org.apache.hadoop.hbase.replication;
 import org.apache.yetus.audience.InterfaceAudience;
 
 /**
- * The POJO equivalent of ReplicationProtos.ReplicationPeerDescription
+ * The POJO equivalent of ReplicationProtos.ReplicationPeerDescription.
+ * 
+ * To developer, here we do not store the new sync replication state since it 
is just an
+ * intermediate state and this class is public.
  */
 @InterfaceAudience.Public
 public

hbase git commit: HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

2018-04-23 Thread psomogyi
Repository: hbase
Updated Branches:
  refs/heads/master 193359ffd -> e73ba582f


HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/master
Commit: e73ba582f23e7ac512665bac2539af53bd3cb47c
Parents: 193359f
Author: Balazs Meszaros 
Authored: Mon Apr 16 16:33:48 2018 +0200
Committer: Peter Somogyi 
Committed: Mon Apr 23 11:05:53 2018 +0200

--
 .../hadoop/hbase/thrift/ThriftServerRunner.java | 24 ++--
 .../resources/hbase-webapps/thrift/thrift.jsp   | 11 +
 2 files changed, 23 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e73ba582/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 28ba28a..1db9256 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -139,6 +139,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hbase.thirdparty.com.google.common.base.Joiner;
+import org.apache.hbase.thirdparty.com.google.common.base.Splitter;
 import org.apache.hbase.thirdparty.com.google.common.base.Throwables;
 import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
@@ -224,7 +225,7 @@ public class ThriftServerRunner implements Runnable {
   private final JvmPauseMonitor pauseMonitor;
 
   /** An enum of server implementation selections */
-  enum ImplType {
+  public enum ImplType {
 HS_HA("hsha", true, THsHaServer.class, true),
 NONBLOCKING("nonblocking", true, TNonblockingServer.class, true),
 THREAD_POOL("threadpool", false, TBoundedThreadPoolServer.class, true),
@@ -238,7 +239,7 @@ public class ThriftServerRunner implements Runnable {
 final Class serverClass;
 final boolean canSpecifyBindIP;
 
-ImplType(String option, boolean isAlwaysFramed,
+private ImplType(String option, boolean isAlwaysFramed,
 Class serverClass, boolean canSpecifyBindIP) {
   this.option = option;
   this.isAlwaysFramed = isAlwaysFramed;
@@ -255,7 +256,15 @@ public class ThriftServerRunner implements Runnable {
   return "-" + option;
 }
 
-String getDescription() {
+public String getOption() {
+  return option;
+}
+
+public boolean isAlwaysFramed() {
+  return isAlwaysFramed;
+}
+
+public String getDescription() {
   StringBuilder sb = new StringBuilder("Use the " +
   serverClass.getSimpleName());
   if (isAlwaysFramed) {
@@ -275,7 +284,7 @@ public class ThriftServerRunner implements Runnable {
   return group;
 }
 
-static ImplType getServerImpl(Configuration conf) {
+public static ImplType getServerImpl(Configuration conf) {
   String confType = conf.get(SERVER_TYPE_CONF_KEY, THREAD_POOL.option);
   for (ImplType t : values()) {
 if (confType.equals(t.option)) {
@@ -1979,13 +1988,14 @@ public class ThriftServerRunner implements Runnable {
 
   public static void registerFilters(Configuration conf) {
 String[] filters = conf.getStrings("hbase.thrift.filters");
+Splitter splitter = Splitter.on(':');
 if(filters != null) {
   for(String filterClass: filters) {
-String[] filterPart = filterClass.split(":");
-if(filterPart.length != 2) {
+List filterPart = splitter.splitToList(filterClass);
+if(filterPart.size() != 2) {
   LOG.warn("Invalid filter specification " + filterClass + " - 
skipping");
 } else {
-  ParseFilter.registerFilter(filterPart[0], filterPart[1]);
+  ParseFilter.registerFilter(filterPart.get(0), filterPart.get(1));
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/e73ba582/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
--
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp 
b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
index 579d0f7..eb329fe 100644
--- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
+++ b/hbase-thrift/src/main/res

hbase git commit: HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

2018-04-23 Thread psomogyi
Repository: hbase
Updated Branches:
  refs/heads/branch-2 e93cfb52d -> 035515d4c


HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/branch-2
Commit: 035515d4c287030732ae2b0d5aafb1c89d39e106
Parents: e93cfb5
Author: Balazs Meszaros 
Authored: Mon Apr 16 16:33:48 2018 +0200
Committer: Peter Somogyi 
Committed: Mon Apr 23 11:06:31 2018 +0200

--
 .../hadoop/hbase/thrift/ThriftServerRunner.java | 24 ++--
 .../resources/hbase-webapps/thrift/thrift.jsp   | 11 +
 2 files changed, 23 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/035515d4/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 5d887f9..58f069c 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -139,6 +139,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hbase.thirdparty.com.google.common.base.Joiner;
+import org.apache.hbase.thirdparty.com.google.common.base.Splitter;
 import org.apache.hbase.thirdparty.com.google.common.base.Throwables;
 import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
@@ -223,7 +224,7 @@ public class ThriftServerRunner implements Runnable {
   private final JvmPauseMonitor pauseMonitor;
 
   /** An enum of server implementation selections */
-  enum ImplType {
+  public enum ImplType {
 HS_HA("hsha", true, THsHaServer.class, true),
 NONBLOCKING("nonblocking", true, TNonblockingServer.class, true),
 THREAD_POOL("threadpool", false, TBoundedThreadPoolServer.class, true),
@@ -237,7 +238,7 @@ public class ThriftServerRunner implements Runnable {
 final Class serverClass;
 final boolean canSpecifyBindIP;
 
-ImplType(String option, boolean isAlwaysFramed,
+private ImplType(String option, boolean isAlwaysFramed,
 Class serverClass, boolean canSpecifyBindIP) {
   this.option = option;
   this.isAlwaysFramed = isAlwaysFramed;
@@ -254,7 +255,15 @@ public class ThriftServerRunner implements Runnable {
   return "-" + option;
 }
 
-String getDescription() {
+public String getOption() {
+  return option;
+}
+
+public boolean isAlwaysFramed() {
+  return isAlwaysFramed;
+}
+
+public String getDescription() {
   StringBuilder sb = new StringBuilder("Use the " +
   serverClass.getSimpleName());
   if (isAlwaysFramed) {
@@ -274,7 +283,7 @@ public class ThriftServerRunner implements Runnable {
   return group;
 }
 
-static ImplType getServerImpl(Configuration conf) {
+public static ImplType getServerImpl(Configuration conf) {
   String confType = conf.get(SERVER_TYPE_CONF_KEY, THREAD_POOL.option);
   for (ImplType t : values()) {
 if (confType.equals(t.option)) {
@@ -1973,13 +1982,14 @@ public class ThriftServerRunner implements Runnable {
 
   public static void registerFilters(Configuration conf) {
 String[] filters = conf.getStrings("hbase.thrift.filters");
+Splitter splitter = Splitter.on(':');
 if(filters != null) {
   for(String filterClass: filters) {
-String[] filterPart = filterClass.split(":");
-if(filterPart.length != 2) {
+List filterPart = splitter.splitToList(filterClass);
+if(filterPart.size() != 2) {
   LOG.warn("Invalid filter specification " + filterClass + " - 
skipping");
 } else {
-  ParseFilter.registerFilter(filterPart[0], filterPart[1]);
+  ParseFilter.registerFilter(filterPart.get(0), filterPart.get(1));
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/035515d4/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
--
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp 
b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
index 579d0f7..eb329fe 100644
--- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
+++ b/hbase-thrift/src/main

hbase git commit: HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

2018-04-23 Thread psomogyi
Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 7483b111e -> 3c6cfd9ed


HBASE-20427 thrift.jsp displays "Framed transport" incorrectly

Signed-off-by: Sean Busbey 


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

Branch: refs/heads/branch-2.0
Commit: 3c6cfd9edfbb9fb8a7bc020abf40fcf61a6821b4
Parents: 7483b11
Author: Balazs Meszaros 
Authored: Mon Apr 16 16:33:48 2018 +0200
Committer: Peter Somogyi 
Committed: Mon Apr 23 11:09:58 2018 +0200

--
 .../hadoop/hbase/thrift/ThriftServerRunner.java | 24 ++--
 .../resources/hbase-webapps/thrift/thrift.jsp   | 11 +
 2 files changed, 23 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3c6cfd9e/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
--
diff --git 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
index 16894ad..48cf0e5 100644
--- 
a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
+++ 
b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
@@ -138,6 +138,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hbase.thirdparty.com.google.common.base.Joiner;
+import org.apache.hbase.thirdparty.com.google.common.base.Splitter;
 import org.apache.hbase.thirdparty.com.google.common.base.Throwables;
 import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
@@ -222,7 +223,7 @@ public class ThriftServerRunner implements Runnable {
   private final JvmPauseMonitor pauseMonitor;
 
   /** An enum of server implementation selections */
-  enum ImplType {
+  public enum ImplType {
 HS_HA("hsha", true, THsHaServer.class, true),
 NONBLOCKING("nonblocking", true, TNonblockingServer.class, true),
 THREAD_POOL("threadpool", false, TBoundedThreadPoolServer.class, true),
@@ -236,7 +237,7 @@ public class ThriftServerRunner implements Runnable {
 final Class serverClass;
 final boolean canSpecifyBindIP;
 
-ImplType(String option, boolean isAlwaysFramed,
+private ImplType(String option, boolean isAlwaysFramed,
 Class serverClass, boolean canSpecifyBindIP) {
   this.option = option;
   this.isAlwaysFramed = isAlwaysFramed;
@@ -253,7 +254,15 @@ public class ThriftServerRunner implements Runnable {
   return "-" + option;
 }
 
-String getDescription() {
+public String getOption() {
+  return option;
+}
+
+public boolean isAlwaysFramed() {
+  return isAlwaysFramed;
+}
+
+public String getDescription() {
   StringBuilder sb = new StringBuilder("Use the " +
   serverClass.getSimpleName());
   if (isAlwaysFramed) {
@@ -273,7 +282,7 @@ public class ThriftServerRunner implements Runnable {
   return group;
 }
 
-static ImplType getServerImpl(Configuration conf) {
+public static ImplType getServerImpl(Configuration conf) {
   String confType = conf.get(SERVER_TYPE_CONF_KEY, THREAD_POOL.option);
   for (ImplType t : values()) {
 if (confType.equals(t.option)) {
@@ -1971,13 +1980,14 @@ public class ThriftServerRunner implements Runnable {
 
   public static void registerFilters(Configuration conf) {
 String[] filters = conf.getStrings("hbase.thrift.filters");
+Splitter splitter = Splitter.on(':');
 if(filters != null) {
   for(String filterClass: filters) {
-String[] filterPart = filterClass.split(":");
-if(filterPart.length != 2) {
+List filterPart = splitter.splitToList(filterClass);
+if(filterPart.size() != 2) {
   LOG.warn("Invalid filter specification " + filterClass + " - 
skipping");
 } else {
-  ParseFilter.registerFilter(filterPart[0], filterPart[1]);
+  ParseFilter.registerFilter(filterPart.get(0), filterPart.get(1));
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3c6cfd9e/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
--
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp 
b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
index 579d0f7..eb329fe 100644
--- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp
+++ b/hbase-thrift/src/

hbase git commit: HBASE-20466 Consistently use override mechanism for exempt classes in CoprocessorClassloader

2018-04-23 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master e73ba582f -> a8be3bb81


HBASE-20466 Consistently use override mechanism for exempt classes in 
CoprocessorClassloader

Signed-off-by: tedyu 


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

Branch: refs/heads/master
Commit: a8be3bb814378805a1b5eae85826c9eff3768534
Parents: e73ba58
Author: Rich Fecher 
Authored: Fri Apr 20 12:47:50 2018 -0400
Committer: tedyu 
Committed: Mon Apr 23 07:47:30 2018 -0700

--
 .../hbase/regionserver/RegionCoprocessorHost.java   | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a8be3bb8/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
index d73c012..dea13ca 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.RawCellBuilder;
 import org.apache.hadoop.hbase.RawCellBuilderFactory;
 import org.apache.hadoop.hbase.ServerName;
@@ -350,7 +351,16 @@ public class RegionCoprocessorHost
   cl = CoprocessorHost.class.getClassLoader();
 }
 Thread.currentThread().setContextClassLoader(cl);
-cl.loadClass(attr.getClassName());
+if (cl instanceof CoprocessorClassLoader) {
+  String[] includedClassPrefixes = null;
+  if (conf.get(HConstants.CP_HTD_ATTR_INCLUSION_KEY) != null) {
+String prefixes = 
attr.conf.get(HConstants.CP_HTD_ATTR_INCLUSION_KEY);
+includedClassPrefixes = prefixes.split(";");
+  }
+  ((CoprocessorClassLoader)cl).loadClass(attr.getClassName(), 
includedClassPrefixes);
+} else {
+  cl.loadClass(attr.getClassName());
+}
   } catch (ClassNotFoundException e) {
 throw new IOException("Class " + attr.getClassName() + " cannot be 
loaded", e);
   } finally {



[01/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
Repository: hbase-site
Updated Branches:
  refs/heads/asf-site 9021c033b -> 952146b40


http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.html
--
diff --git 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.html
 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.html
index e001cfb..7459c87 100644
--- 
a/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.html
+++ 
b/testdevapidocs/src-html/org/apache/hadoop/hbase/regionserver/TestPerColumnFamilyFlush.html
@@ -399,303 +399,306 @@
 391  // CF1 Should have been flushed
 392  assertEquals(0, cf1MemstoreSize);
 393  // CF2 and CF3 shouldn't have been 
flushed.
-394  assertTrue(cf2MemstoreSize > 
0);
-395  assertTrue(cf3MemstoreSize > 
0);
-396  assertEquals(totalMemstoreSize, 
cf2MemstoreSize + cf3MemstoreSize);
-397
-398  // Wait for the RS report to go 
across to the master, so that the master
-399  // is aware of which sequence ids 
have been flushed, before we kill the RS.
-400  // If in production, the RS dies 
before the report goes across, we will
-401  // safely replay all the edits.
-402  Thread.sleep(2000);
-403
-404  // Abort the region server where we 
have the region hosted.
-405  HRegionServer rs = 
desiredRegionAndServer.getSecond();
-406  rs.abort("testing");
-407
-408  // The aborted region server's 
regions will be eventually assigned to some
-409  // other region server, and the get 
RPC call (inside verifyEdit()) will
-410  // retry for some time till the 
regions come back up.
-411
-412  // Verify that all the edits are 
safe.
-413  for (int i = 1; i <= 80; i++) 
{
-414verifyEdit(1, i, table);
-415if (i <= 10) {
-416  verifyEdit(2, i, table);
-417  verifyEdit(3, i, table);
-418}
-419  }
-420} finally {
-421  TEST_UTIL.shutdownMiniCluster();
-422}
-423  }
-424
-425  // Test Log Replay with Distributed log 
split on.
-426  @Test
-427  public void 
testLogReplayWithDistributedLogSplit() throws Exception {
-428doTestLogReplay();
-429  }
-430
-431  private WAL getWAL(Region region) {
-432return ((HRegion)region).getWAL();
-433  }
-434
-435  private int getNumRolledLogFiles(Region 
region) {
-436return 
AbstractFSWALProvider.getNumRolledLogFiles(getWAL(region));
-437  }
-438
-439  /**
-440   * When a log roll is about to happen, 
we do a flush of the regions who will be affected by the
-441   * log roll. These flushes cannot be a 
selective flushes, otherwise we cannot roll the logs. This
-442   * test ensures that we do a full-flush 
in that scenario.
-443   * @throws IOException
-444   */
-445  @Test
-446  public void 
testFlushingWhenLogRolling() throws Exception {
-447TableName tableName = 
TableName.valueOf("testFlushingWhenLogRolling");
-448Configuration conf = 
TEST_UTIL.getConfiguration();
-449
conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, 128 * 1024 * 1024);
-450
conf.set(FlushPolicyFactory.HBASE_FLUSH_POLICY_KEY, 
FlushAllLargeStoresPolicy.class.getName());
-451long cfFlushSizeLowerBound = 2048;
-452
conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN,
-453  cfFlushSizeLowerBound);
-454
-455// One hour, prevent periodic 
rolling
-456
conf.setLong("hbase.regionserver.logroll.period", 60L * 60 * 1000);
-457// prevent rolling by size
-458
conf.setLong("hbase.regionserver.hlog.blocksize", 128L * 1024 * 1024);
-459// Make it 10 as max logs before a 
flush comes on.
-460final int maxLogs = 10;
-461
conf.setInt("hbase.regionserver.maxlogs", maxLogs);
-462
-463final int numRegionServers = 1;
-464
TEST_UTIL.startMiniCluster(numRegionServers);
-465try {
-466  Table table = 
TEST_UTIL.createTable(tableName, FAMILIES);
-467  // Force flush the namespace table 
so edits to it are not hanging around as oldest
-468  // edits. Otherwise, below, when we 
make maximum number of WAL files, then it will be
-469  // the namespace region that is 
flushed and not the below 'desiredRegion'.
-470  try (Admin admin = 
TEST_UTIL.getConnection().getAdmin()) {
-471
admin.flush(TableName.NAMESPACE_TABLE_NAME);
-472  }
-473  Pair 
desiredRegionAndServer = getRegionWithName(tableName);
-474  final HRegion desiredRegion = 
desiredRegionAndServer.getFirst();
-475  assertTrue("Could not find a region 
which hosts the new region.", desiredRegion != null);
-476  LOG.info("Writing to region=" + 
desiredRegion);
-477
-478  // Add one row for both CFs.
-479  for (int i = 1; i <= 3; i++) {
-480table.put(createPut(i, 0));
-481  }
-482  // Now only add row to CF1,

[05/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
index fd7ab7a..021207f 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
@@ -147,1891 +147,1901 @@
 139import org.slf4j.Logger;
 140import org.slf4j.LoggerFactory;
 141import 
org.apache.hbase.thirdparty.com.google.common.base.Joiner;
-142import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
-143import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
-144import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
-145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
-146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
-147
-148/**
-149 * ThriftServerRunner - this class starts 
up a Thrift server which implements
-150 * the Hbase API specified in the 
Hbase.thrift IDL file.
-151 */
-152@InterfaceAudience.Private
-153public class ThriftServerRunner 
implements Runnable {
-154
-155  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
-156
-157  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
-158
-159  static final String 
SERVER_TYPE_CONF_KEY =
-160  
"hbase.regionserver.thrift.server.type";
-161
-162  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
-163  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
-164  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
-165  static final String 
MAX_FRAME_SIZE_CONF_KEY =
-166  
"hbase.regionserver.thrift.framed.max_frame_size_in_mb";
-167  static final String PORT_CONF_KEY = 
"hbase.regionserver.thrift.port";
-168  static final String COALESCE_INC_KEY = 
"hbase.regionserver.thrift.coalesceIncrement";
-169  static final String USE_HTTP_CONF_KEY = 
"hbase.regionserver.thrift.http";
-170  static final String HTTP_MIN_THREADS = 
"hbase.thrift.http_threads.min";
-171  static final String HTTP_MAX_THREADS = 
"hbase.thrift.http_threads.max";
-172
-173  static final String THRIFT_SSL_ENABLED 
= "hbase.thrift.ssl.enabled";
-174  static final String 
THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store";
-175  static final String 
THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password";
-176  static final String 
THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword";
-177  static final String 
THRIFT_SSL_EXCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.exclude.cipher.suites";
-178  static final String 
THRIFT_SSL_INCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.include.cipher.suites";
-179  static final String 
THRIFT_SSL_EXCLUDE_PROTOCOLS = "hbase.thrift.ssl.exclude.protocols";
-180  static final String 
THRIFT_SSL_INCLUDE_PROTOCOLS = "hbase.thrift.ssl.include.protocols";
-181
-182  /**
-183   * Amount of time in milliseconds 
before a server thread will timeout
-184   * waiting for client to send data on a 
connected socket. Currently,
-185   * applies only to 
TBoundedThreadPoolServer
-186   */
-187  public static final String 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
-188
"hbase.thrift.server.socket.read.timeout";
-189  public static final int 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 6;
-190
+142import 
org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+143import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
+144import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
+145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
+146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
+147import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
+148
+149/**
+150 * ThriftServerRunner - this class starts 
up a Thrift server which implements
+151 * the Hbase API specified in the 
Hbase.thrift IDL file.
+152 */
+153@InterfaceAudience.Private
+154public class ThriftServerRunner 
implements Runnable {
+155
+156  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
+157
+158  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+159
+160  static final String 
SERVER_TYPE_CONF_KEY =
+161  
"hbase.regionserver.thrift.server.type";
+162
+163  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
+164  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
+165  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
+166  static final S

[11/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
--
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html 
b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
index 8cc10a3..7a29186 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/Version.html
@@ -16,11 +16,11 @@
 008@InterfaceAudience.Private
 009public class Version {
 010  public static final String version = 
"3.0.0-SNAPSHOT";
-011  public static final String revision = 
"f4a39043e2fb3da69e378b4e1cbcb4bd7e2a6662";
+011  public static final String revision = 
"e73ba582f23e7ac512665bac2539af53bd3cb47c";
 012  public static final String user = 
"jenkins";
-013  public static final String date = "Sun 
Apr 22 14:39:02 UTC 2018";
+013  public static final String date = "Mon 
Apr 23 14:39:23 UTC 2018";
 014  public static final String url = 
"git://jenkins-websites1.apache.org/home/jenkins/jenkins-slave/workspace/hbase_generate_website/hbase";
-015  public static final String srcChecksum 
= "4c5dd33779be320f0e358eb0c4768d9a";
+015  public static final String srcChecksum 
= "fa71043078ececcd8bf3d37b0362de75";
 016}
 
 



[06/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
index fd7ab7a..021207f 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
@@ -147,1891 +147,1901 @@
 139import org.slf4j.Logger;
 140import org.slf4j.LoggerFactory;
 141import 
org.apache.hbase.thirdparty.com.google.common.base.Joiner;
-142import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
-143import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
-144import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
-145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
-146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
-147
-148/**
-149 * ThriftServerRunner - this class starts 
up a Thrift server which implements
-150 * the Hbase API specified in the 
Hbase.thrift IDL file.
-151 */
-152@InterfaceAudience.Private
-153public class ThriftServerRunner 
implements Runnable {
-154
-155  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
-156
-157  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
-158
-159  static final String 
SERVER_TYPE_CONF_KEY =
-160  
"hbase.regionserver.thrift.server.type";
-161
-162  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
-163  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
-164  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
-165  static final String 
MAX_FRAME_SIZE_CONF_KEY =
-166  
"hbase.regionserver.thrift.framed.max_frame_size_in_mb";
-167  static final String PORT_CONF_KEY = 
"hbase.regionserver.thrift.port";
-168  static final String COALESCE_INC_KEY = 
"hbase.regionserver.thrift.coalesceIncrement";
-169  static final String USE_HTTP_CONF_KEY = 
"hbase.regionserver.thrift.http";
-170  static final String HTTP_MIN_THREADS = 
"hbase.thrift.http_threads.min";
-171  static final String HTTP_MAX_THREADS = 
"hbase.thrift.http_threads.max";
-172
-173  static final String THRIFT_SSL_ENABLED 
= "hbase.thrift.ssl.enabled";
-174  static final String 
THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store";
-175  static final String 
THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password";
-176  static final String 
THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword";
-177  static final String 
THRIFT_SSL_EXCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.exclude.cipher.suites";
-178  static final String 
THRIFT_SSL_INCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.include.cipher.suites";
-179  static final String 
THRIFT_SSL_EXCLUDE_PROTOCOLS = "hbase.thrift.ssl.exclude.protocols";
-180  static final String 
THRIFT_SSL_INCLUDE_PROTOCOLS = "hbase.thrift.ssl.include.protocols";
-181
-182  /**
-183   * Amount of time in milliseconds 
before a server thread will timeout
-184   * waiting for client to send data on a 
connected socket. Currently,
-185   * applies only to 
TBoundedThreadPoolServer
-186   */
-187  public static final String 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
-188
"hbase.thrift.server.socket.read.timeout";
-189  public static final int 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 6;
-190
+142import 
org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+143import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
+144import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
+145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
+146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
+147import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
+148
+149/**
+150 * ThriftServerRunner - this class starts 
up a Thrift server which implements
+151 * the Hbase API specified in the 
Hbase.thrift IDL file.
+152 */
+153@InterfaceAudience.Private
+154public class ThriftServerRunner 
implements Runnable {
+155
+156  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
+157
+158  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+159
+160  static final String 
SERVER_TYPE_CONF_KEY =
+161  
"hbase.regionserver.thrift.server.type";
+162
+163  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
+164  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
+165  static final String FRAMED_CONF_KEY = 
"hbase.regionser

[03/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.html 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.html
index fd7ab7a..021207f 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.html
@@ -147,1891 +147,1901 @@
 139import org.slf4j.Logger;
 140import org.slf4j.LoggerFactory;
 141import 
org.apache.hbase.thirdparty.com.google.common.base.Joiner;
-142import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
-143import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
-144import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
-145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
-146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
-147
-148/**
-149 * ThriftServerRunner - this class starts 
up a Thrift server which implements
-150 * the Hbase API specified in the 
Hbase.thrift IDL file.
-151 */
-152@InterfaceAudience.Private
-153public class ThriftServerRunner 
implements Runnable {
-154
-155  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
-156
-157  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
-158
-159  static final String 
SERVER_TYPE_CONF_KEY =
-160  
"hbase.regionserver.thrift.server.type";
-161
-162  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
-163  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
-164  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
-165  static final String 
MAX_FRAME_SIZE_CONF_KEY =
-166  
"hbase.regionserver.thrift.framed.max_frame_size_in_mb";
-167  static final String PORT_CONF_KEY = 
"hbase.regionserver.thrift.port";
-168  static final String COALESCE_INC_KEY = 
"hbase.regionserver.thrift.coalesceIncrement";
-169  static final String USE_HTTP_CONF_KEY = 
"hbase.regionserver.thrift.http";
-170  static final String HTTP_MIN_THREADS = 
"hbase.thrift.http_threads.min";
-171  static final String HTTP_MAX_THREADS = 
"hbase.thrift.http_threads.max";
-172
-173  static final String THRIFT_SSL_ENABLED 
= "hbase.thrift.ssl.enabled";
-174  static final String 
THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store";
-175  static final String 
THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password";
-176  static final String 
THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword";
-177  static final String 
THRIFT_SSL_EXCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.exclude.cipher.suites";
-178  static final String 
THRIFT_SSL_INCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.include.cipher.suites";
-179  static final String 
THRIFT_SSL_EXCLUDE_PROTOCOLS = "hbase.thrift.ssl.exclude.protocols";
-180  static final String 
THRIFT_SSL_INCLUDE_PROTOCOLS = "hbase.thrift.ssl.include.protocols";
-181
-182  /**
-183   * Amount of time in milliseconds 
before a server thread will timeout
-184   * waiting for client to send data on a 
connected socket. Currently,
-185   * applies only to 
TBoundedThreadPoolServer
-186   */
-187  public static final String 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
-188
"hbase.thrift.server.socket.read.timeout";
-189  public static final int 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 6;
-190
+142import 
org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+143import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
+144import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
+145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
+146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
+147import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
+148
+149/**
+150 * ThriftServerRunner - this class starts 
up a Thrift server which implements
+151 * the Hbase API specified in the 
Hbase.thrift IDL file.
+152 */
+153@InterfaceAudience.Private
+154public class ThriftServerRunner 
implements Runnable {
+155
+156  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
+157
+158  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+159
+160  static final String 
SERVER_TYPE_CONF_KEY =
+161  
"hbase.regionserver.thrift.server.type";
+162
+163  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
+164  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
+165  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
+166  static final String 
MAX_FRAME_SIZE_CONF_KEY =
+167  

[12/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
--
diff --git 
a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
 
b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
index c2d61b1..aaef58f 100644
--- 
a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
+++ 
b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.IOErrorWithCause.html
@@ -137,7 +137,7 @@ var activeTableTab = "activeTableTab";
 
 
 
-public static class ThriftServerRunner.IOErrorWithCause
+public static class ThriftServerRunner.IOErrorWithCause
 extends org.apache.hadoop.hbase.thrift.generated.IOError
 
 See Also:
@@ -273,7 +273,7 @@ extends 
org.apache.hadoop.hbase.thrift.generated.IOError
 
 
 cause
-private https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable cause
+private https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable cause
 
 
 
@@ -290,7 +290,7 @@ extends 
org.apache.hadoop.hbase.thrift.generated.IOError
 
 
 IOErrorWithCause
-public IOErrorWithCause(https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable cause)
+public IOErrorWithCause(https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable cause)
 
 
 
@@ -307,7 +307,7 @@ extends 
org.apache.hadoop.hbase.thrift.generated.IOError
 
 
 getCause
-public https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable getCause()
+public https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable getCause()
 
 Overrides:
 https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true#getCause--";
 title="class or interface in java.lang">getCause in 
class https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true";
 title="class or interface in java.lang">Throwable
@@ -320,7 +320,7 @@ extends 
org.apache.hadoop.hbase.thrift.generated.IOError
 
 
 equals
-public boolean equals(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true";
 title="class or interface in java.lang">Object other)
+public boolean equals(https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true";
 title="class or interface in java.lang">Object other)
 
 Overrides:
 equals in 
class org.apache.hadoop.hbase.thrift.generated.IOError
@@ -333,7 +333,7 @@ extends 
org.apache.hadoop.hbase.thrift.generated.IOError
 
 
 hashCode
-public int hashCode()
+public int hashCode()
 
 Overrides:
 hashCode in 
class org.apache.hadoop.hbase.thrift.generated.IOError

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
--
diff --git 
a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html 
b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
index 0392c62..3aa763c 100644
--- a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
+++ b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ImplType.html
@@ -18,7 +18,7 @@
 catch(err) {
 }
 //-->
-var methods = 
{"i0":9,"i1":10,"i2":9,"i3":9,"i4":9,"i5":10,"i6":10,"i7":9,"i8":9};
+var methods = 
{"i0":9,"i1":10,"i2":10,"i3":9,"i4":10,"i5":9,"i6":9,"i7":10,"i8":10,"i9":9,"i10":9};
 var tabs = {65535:["t0","All Methods"],1:["t1","Static 
Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
 var altColor = "altColor";
 var rowColor = "rowColor";
@@ -122,7 +122,7 @@ var activeTableTab = "activeTableTab";
 
 
 
-static enum ThriftServerRunner.ImplType
+public static enum ThriftServerRunner.ImplType
 extends https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true";
 title="class or interface in java.lang">Enum
 An enum of server implementation selections
 
@@ -209,37 +209,45 @@ extends https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?i
 createOptionGroup() 
 
 
-(package private) https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String
+https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String
 getDescription() 
 
 
-(package private) static ThriftServerRunner.ImplType
-getServerImpl(org.apache.hadoop.c

hbase git commit: HBASE-20466 Consistently use override mechanism for exempt classes in CoprocessorClassloader

2018-04-23 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/branch-2 035515d4c -> 75004408b


HBASE-20466 Consistently use override mechanism for exempt classes in 
CoprocessorClassloader

Signed-off-by: tedyu 


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

Branch: refs/heads/branch-2
Commit: 75004408b0762cce2ecb0491c50bab113d9f20b4
Parents: 035515d
Author: Rich Fecher 
Authored: Fri Apr 20 12:47:50 2018 -0400
Committer: tedyu 
Committed: Mon Apr 23 07:48:13 2018 -0700

--
 .../hbase/regionserver/RegionCoprocessorHost.java   | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/75004408/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
index d73c012..dea13ca 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CompareOperator;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.RawCellBuilder;
 import org.apache.hadoop.hbase.RawCellBuilderFactory;
 import org.apache.hadoop.hbase.ServerName;
@@ -350,7 +351,16 @@ public class RegionCoprocessorHost
   cl = CoprocessorHost.class.getClassLoader();
 }
 Thread.currentThread().setContextClassLoader(cl);
-cl.loadClass(attr.getClassName());
+if (cl instanceof CoprocessorClassLoader) {
+  String[] includedClassPrefixes = null;
+  if (conf.get(HConstants.CP_HTD_ATTR_INCLUSION_KEY) != null) {
+String prefixes = 
attr.conf.get(HConstants.CP_HTD_ATTR_INCLUSION_KEY);
+includedClassPrefixes = prefixes.split(";");
+  }
+  ((CoprocessorClassLoader)cl).loadClass(attr.getClassName(), 
includedClassPrefixes);
+} else {
+  cl.loadClass(attr.getClassName());
+}
   } catch (ClassNotFoundException e) {
 throw new IOException("Class " + attr.getClassName() + " cannot be 
loaded", e);
   } finally {



[09/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.html 
b/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
index 993c1ea..2c6f38a 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
@@ -27,1043 +27,1040 @@
 019
 020package 
org.apache.hadoop.hbase.coprocessor;
 021
-022import 
edu.umd.cs.findbugs.annotations.NonNull;
-023
-024import java.io.IOException;
-025import java.util.List;
-026import java.util.Map;
-027
-028import org.apache.hadoop.fs.FileSystem;
-029import org.apache.hadoop.fs.Path;
-030import org.apache.hadoop.hbase.Cell;
-031import 
org.apache.hadoop.hbase.CompareOperator;
-032import 
org.apache.hadoop.hbase.HBaseInterfaceAudience;
-033import 
org.apache.hadoop.hbase.client.Append;
-034import 
org.apache.hadoop.hbase.client.Delete;
-035import 
org.apache.hadoop.hbase.client.Durability;
-036import 
org.apache.hadoop.hbase.client.Get;
-037import 
org.apache.hadoop.hbase.client.Increment;
-038import 
org.apache.hadoop.hbase.client.Mutation;
-039import 
org.apache.hadoop.hbase.client.Put;
-040import 
org.apache.hadoop.hbase.client.RegionInfo;
-041import 
org.apache.hadoop.hbase.client.Result;
-042import 
org.apache.hadoop.hbase.client.Scan;
-043import 
org.apache.hadoop.hbase.filter.ByteArrayComparable;
-044import 
org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
-045import 
org.apache.hadoop.hbase.io.Reference;
-046import 
org.apache.hadoop.hbase.io.hfile.CacheConfig;
-047import 
org.apache.hadoop.hbase.regionserver.FlushLifeCycleTracker;
-048import 
org.apache.hadoop.hbase.regionserver.InternalScanner;
-049import 
org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress;
-050import 
org.apache.hadoop.hbase.regionserver.OperationStatus;
-051import 
org.apache.hadoop.hbase.regionserver.Region;
-052import 
org.apache.hadoop.hbase.regionserver.Region.Operation;
-053import 
org.apache.hadoop.hbase.regionserver.RegionScanner;
-054import 
org.apache.hadoop.hbase.regionserver.ScanOptions;
-055import 
org.apache.hadoop.hbase.regionserver.ScanType;
-056import 
org.apache.hadoop.hbase.regionserver.Store;
-057import 
org.apache.hadoop.hbase.regionserver.StoreFile;
-058import 
org.apache.hadoop.hbase.regionserver.StoreFileReader;
-059import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
-060import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
-061import 
org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker;
-062import 
org.apache.hadoop.hbase.util.Pair;
-063import 
org.apache.hadoop.hbase.wal.WALEdit;
-064import 
org.apache.hadoop.hbase.wal.WALKey;
-065import 
org.apache.yetus.audience.InterfaceAudience;
-066import 
org.apache.yetus.audience.InterfaceStability;
-067
-068/**
-069 * Coprocessors implement this interface 
to observe and mediate client actions on the region.
-070 * 

-071 * Since most implementations will be interested in only a subset of hooks, this class uses -072 * 'default' functions to avoid having to add unnecessary overrides. When the functions are -073 * non-empty, it's simply to satisfy the compiler by returning value of expected (non-void) type. It -074 * is done in a way that these default definitions act as no-op. So our suggestion to implementation -075 * would be to not call these 'default' methods from overrides. -076 *

-077 *

Exception Handling


-078 * For all functions, exception handling is done as follows: -079 *
    -080 *
  • Exceptions of type {@link IOException} are reported back to client.
  • -081 *
  • For any other kind of exception: -082 *
      -083 *
    • If the configuration {@link CoprocessorHost#ABORT_ON_ERROR_KEY} is set to true, then the -084 * server aborts.
    • -085 *
    • Otherwise, coprocessor is removed from the server and -086 * {@link org.apache.hadoop.hbase.DoNotRetryIOException} is returned to the client.
    • +022import java.io.IOException; +023import java.util.List; +024import java.util.Map; +025 +026import org.apache.hadoop.fs.FileSystem; +027import org.apache.hadoop.fs.Path; +028import org.apache.hadoop.hbase.Cell; +029import org.apache.hadoop.hbase.CompareOperator; +030import org.apache.hadoop.hbase.HBaseInterfaceAudience; +031import org.apache.hadoop.hbase.client.Append; +032import org.apache.hadoop.hbase.client.Delete; +033import org.apache.hadoop.hbase.client.Durability; +034import org.apache.hadoop.hbase.client.Get; +035import org.apache.hadoop.hbase.client.Increment; +036import org.apache.hadoop.hbase.client.Mutation; +037import org.apache.hadoop.hbase.client.Put; +038import org.apache.hadoop.hbase.client.RegionInfo; +039import org.apache.ha

[15/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
--
diff --git a/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionObserver.html 
b/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
index 4d5f94f..90452b8 100644
--- a/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
+++ b/devapidocs/org/apache/hadoop/hbase/coprocessor/RegionObserver.html
@@ -107,7 +107,7 @@ var activeTableTab = "activeTableTab";
 
 @InterfaceAudience.LimitedPrivate(value="Coprocesssor")
  @InterfaceStability.Evolving
-public interface RegionObserver
+public interface RegionObserver
 Coprocessors implement this interface to observe and 
mediate client actions on the region.
  
  Since most implementations will be interested in only a subset of hooks, this 
class uses
@@ -773,7 +773,7 @@ public interface 
 
 preOpen
-default void preOpen(ObserverContext c)
+default void preOpen(ObserverContext c)
   throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 Called before the region is reported as open to the 
master.
 
@@ -790,7 +790,7 @@ public interface 
 
 postOpen
-default void postOpen(ObserverContext c)
+default void postOpen(ObserverContext c)
 Called after the region is reported as open to the 
master.
 
 Parameters:
@@ -804,7 +804,7 @@ public interface 
 
 preFlush
-default void preFlush(ObserverContext c,
+default void preFlush(ObserverContext c,
   FlushLifeCycleTracker tracker)
throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 Called before the memstore is flushed to disk.
@@ -823,7 +823,7 @@ public interface 
 
 preFlushScannerOpen
-default void preFlushScannerOpen(ObserverContext c,
+default void preFlushScannerOpen(ObserverContext c,
  Store store,
  ScanOptions options,
  FlushLifeCycleTracker tracker)
@@ -846,7 +846,7 @@ public interface 
 
 preFlush
-default InternalScanner preFlush(ObserverContext c,
+default InternalScanner preFlush(ObserverContext c,
  Store store,
  InternalScanner scanner,
  FlushLifeCycleTracker tracker)
@@ -872,7 +872,7 @@ public interface 
 
 postFlush
-default void postFlush(ObserverContext c,
+default void postFlush(ObserverContext c,
FlushLifeCycleTracker tracker)
 throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 Called after the memstore is flushed to disk.
@@ -891,7 +891,7 @@ public interface 
 
 postFlush
-default void postFlush(ObserverContext c,
+default void postFlush(ObserverContext c,
Store store,
StoreFile resultFile,
FlushLifeCycleTracker tracker)
@@ -914,7 +914,7 @@ public interface 
 
 preMemStoreCompaction
-default void preMemStoreCompaction(ObserverContext c,
+default void preMemStoreCompaction(ObserverContext c,
Store store)
 throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 Called before in memory compaction started.
@@ -933,7 +933,7 @@ public interface 
 
 preMemStoreCompactionCompactScannerOpen
-default void preMemStoreCompactionCompactScannerOpen(ObserverContext c,
+default void preMemStoreCompactionCompactScannerOpen(ObserverContext c,
  Store store,
  ScanOptions options)
   throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
@@ -957,11 +957,10 @@ public interface 
 
 preMemStoreCompactionCompact
-@NonNull
-default InternalScanner preMemStoreCompactionCompact(ObserverContext c,
-  

[04/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ResultScannerWrapper.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ResultScannerWrapper.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ResultScannerWrapper.html
index fd7ab7a..021207f 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ResultScannerWrapper.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.ResultScannerWrapper.html
@@ -147,1891 +147,1901 @@
 139import org.slf4j.Logger;
 140import org.slf4j.LoggerFactory;
 141import 
org.apache.hbase.thirdparty.com.google.common.base.Joiner;
-142import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
-143import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
-144import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
-145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
-146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
-147
-148/**
-149 * ThriftServerRunner - this class starts 
up a Thrift server which implements
-150 * the Hbase API specified in the 
Hbase.thrift IDL file.
-151 */
-152@InterfaceAudience.Private
-153public class ThriftServerRunner 
implements Runnable {
-154
-155  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
-156
-157  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
-158
-159  static final String 
SERVER_TYPE_CONF_KEY =
-160  
"hbase.regionserver.thrift.server.type";
-161
-162  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
-163  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
-164  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
-165  static final String 
MAX_FRAME_SIZE_CONF_KEY =
-166  
"hbase.regionserver.thrift.framed.max_frame_size_in_mb";
-167  static final String PORT_CONF_KEY = 
"hbase.regionserver.thrift.port";
-168  static final String COALESCE_INC_KEY = 
"hbase.regionserver.thrift.coalesceIncrement";
-169  static final String USE_HTTP_CONF_KEY = 
"hbase.regionserver.thrift.http";
-170  static final String HTTP_MIN_THREADS = 
"hbase.thrift.http_threads.min";
-171  static final String HTTP_MAX_THREADS = 
"hbase.thrift.http_threads.max";
-172
-173  static final String THRIFT_SSL_ENABLED 
= "hbase.thrift.ssl.enabled";
-174  static final String 
THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store";
-175  static final String 
THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password";
-176  static final String 
THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword";
-177  static final String 
THRIFT_SSL_EXCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.exclude.cipher.suites";
-178  static final String 
THRIFT_SSL_INCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.include.cipher.suites";
-179  static final String 
THRIFT_SSL_EXCLUDE_PROTOCOLS = "hbase.thrift.ssl.exclude.protocols";
-180  static final String 
THRIFT_SSL_INCLUDE_PROTOCOLS = "hbase.thrift.ssl.include.protocols";
-181
-182  /**
-183   * Amount of time in milliseconds 
before a server thread will timeout
-184   * waiting for client to send data on a 
connected socket. Currently,
-185   * applies only to 
TBoundedThreadPoolServer
-186   */
-187  public static final String 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
-188
"hbase.thrift.server.socket.read.timeout";
-189  public static final int 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 6;
-190
+142import 
org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+143import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
+144import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
+145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
+146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
+147import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
+148
+149/**
+150 * ThriftServerRunner - this class starts 
up a Thrift server which implements
+151 * the Hbase API specified in the 
Hbase.thrift IDL file.
+152 */
+153@InterfaceAudience.Private
+154public class ThriftServerRunner 
implements Runnable {
+155
+156  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
+157
+158  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+159
+160  static final String 
SERVER_TYPE_CONF_KEY =
+161  
"hbase.regionserver.thrift.server.type";
+162
+163  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
+164  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
+165  static final String FRAMED_CONF_KEY

[10/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.MutationType.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.MutationType.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.MutationType.html
index 993c1ea..2c6f38a 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.MutationType.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/coprocessor/RegionObserver.MutationType.html
@@ -27,1043 +27,1040 @@
 019
 020package 
org.apache.hadoop.hbase.coprocessor;
 021
-022import 
edu.umd.cs.findbugs.annotations.NonNull;
-023
-024import java.io.IOException;
-025import java.util.List;
-026import java.util.Map;
-027
-028import org.apache.hadoop.fs.FileSystem;
-029import org.apache.hadoop.fs.Path;
-030import org.apache.hadoop.hbase.Cell;
-031import 
org.apache.hadoop.hbase.CompareOperator;
-032import 
org.apache.hadoop.hbase.HBaseInterfaceAudience;
-033import 
org.apache.hadoop.hbase.client.Append;
-034import 
org.apache.hadoop.hbase.client.Delete;
-035import 
org.apache.hadoop.hbase.client.Durability;
-036import 
org.apache.hadoop.hbase.client.Get;
-037import 
org.apache.hadoop.hbase.client.Increment;
-038import 
org.apache.hadoop.hbase.client.Mutation;
-039import 
org.apache.hadoop.hbase.client.Put;
-040import 
org.apache.hadoop.hbase.client.RegionInfo;
-041import 
org.apache.hadoop.hbase.client.Result;
-042import 
org.apache.hadoop.hbase.client.Scan;
-043import 
org.apache.hadoop.hbase.filter.ByteArrayComparable;
-044import 
org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
-045import 
org.apache.hadoop.hbase.io.Reference;
-046import 
org.apache.hadoop.hbase.io.hfile.CacheConfig;
-047import 
org.apache.hadoop.hbase.regionserver.FlushLifeCycleTracker;
-048import 
org.apache.hadoop.hbase.regionserver.InternalScanner;
-049import 
org.apache.hadoop.hbase.regionserver.MiniBatchOperationInProgress;
-050import 
org.apache.hadoop.hbase.regionserver.OperationStatus;
-051import 
org.apache.hadoop.hbase.regionserver.Region;
-052import 
org.apache.hadoop.hbase.regionserver.Region.Operation;
-053import 
org.apache.hadoop.hbase.regionserver.RegionScanner;
-054import 
org.apache.hadoop.hbase.regionserver.ScanOptions;
-055import 
org.apache.hadoop.hbase.regionserver.ScanType;
-056import 
org.apache.hadoop.hbase.regionserver.Store;
-057import 
org.apache.hadoop.hbase.regionserver.StoreFile;
-058import 
org.apache.hadoop.hbase.regionserver.StoreFileReader;
-059import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker;
-060import 
org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest;
-061import 
org.apache.hadoop.hbase.regionserver.querymatcher.DeleteTracker;
-062import 
org.apache.hadoop.hbase.util.Pair;
-063import 
org.apache.hadoop.hbase.wal.WALEdit;
-064import 
org.apache.hadoop.hbase.wal.WALKey;
-065import 
org.apache.yetus.audience.InterfaceAudience;
-066import 
org.apache.yetus.audience.InterfaceStability;
-067
-068/**
-069 * Coprocessors implement this interface 
to observe and mediate client actions on the region.
-070 * 

-071 * Since most implementations will be interested in only a subset of hooks, this class uses -072 * 'default' functions to avoid having to add unnecessary overrides. When the functions are -073 * non-empty, it's simply to satisfy the compiler by returning value of expected (non-void) type. It -074 * is done in a way that these default definitions act as no-op. So our suggestion to implementation -075 * would be to not call these 'default' methods from overrides. -076 *

-077 *

Exception Handling


-078 * For all functions, exception handling is done as follows: -079 *
    -080 *
  • Exceptions of type {@link IOException} are reported back to client.
  • -081 *
  • For any other kind of exception: -082 *
      -083 *
    • If the configuration {@link CoprocessorHost#ABORT_ON_ERROR_KEY} is set to true, then the -084 * server aborts.
    • -085 *
    • Otherwise, coprocessor is removed from the server and -086 * {@link org.apache.hadoop.hbase.DoNotRetryIOException} is returned to the client.
    • +022import java.io.IOException; +023import java.util.List; +024import java.util.Map; +025 +026import org.apache.hadoop.fs.FileSystem; +027import org.apache.hadoop.fs.Path; +028import org.apache.hadoop.hbase.Cell; +029import org.apache.hadoop.hbase.CompareOperator; +030import org.apache.hadoop.hbase.HBaseInterfaceAudience; +031import org.apache.hadoop.hbase.client.Append; +032import org.apache.hadoop.hbase.client.Delete; +033import org.apache.hadoop.hbase.client.Durability; +034import org.apache.hadoop.hbase.client.Get; +035import org.apache.hadoop.hbase.client.Increment; +036import org.apache.hadoop.hbase.client.Mutation; +037import org.apache.hadoop.hbase.client.Put; +038import or

hbase-site git commit: INFRA-10751 Empty commit

2018-04-23 Thread git-site-role
Repository: hbase-site
Updated Branches:
  refs/heads/asf-site 952146b40 -> 6cf85e4b0


INFRA-10751 Empty commit


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

Branch: refs/heads/asf-site
Commit: 6cf85e4b0538470251df9b20a3f7066972b4bb21
Parents: 952146b
Author: jenkins 
Authored: Mon Apr 23 14:48:28 2018 +
Committer: jenkins 
Committed: Mon Apr 23 14:48:28 2018 +

--

--




[16/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.


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

Branch: refs/heads/asf-site
Commit: 952146b40f01d00db3276f5e84eb200bf1f78a44
Parents: 9021c03
Author: jenkins 
Authored: Mon Apr 23 14:48:14 2018 +
Committer: jenkins 
Committed: Mon Apr 23 14:48:14 2018 +

--
 acid-semantics.html |4 +-
 apache_hbase_reference_guide.pdf|4 +-
 book.html   |2 +-
 bulk-loads.html |4 +-
 checkstyle-aggregate.html   |   56 +-
 coc.html|4 +-
 dependencies.html   |4 +-
 dependency-convergence.html |4 +-
 dependency-info.html|4 +-
 dependency-management.html  |4 +-
 devapidocs/constant-values.html |6 +-
 devapidocs/index-all.html   |4 +
 .../hadoop/hbase/backup/package-tree.html   |2 +-
 .../hadoop/hbase/client/package-tree.html   |   20 +-
 .../RegionObserver.MutationType.html|   10 +-
 .../hbase/coprocessor/RegionObserver.html   |  137 +-
 .../hadoop/hbase/filter/package-tree.html   |6 +-
 .../hadoop/hbase/io/hfile/package-tree.html |6 +-
 .../apache/hadoop/hbase/ipc/package-tree.html   |4 +-
 .../hadoop/hbase/mapreduce/package-tree.html|4 +-
 .../hadoop/hbase/master/package-tree.html   |4 +-
 .../hbase/master/procedure/package-tree.html|2 +-
 .../hadoop/hbase/monitoring/package-tree.html   |2 +-
 .../org/apache/hadoop/hbase/package-tree.html   |   16 +-
 .../hadoop/hbase/procedure2/package-tree.html   |4 +-
 .../hadoop/hbase/quotas/package-tree.html   |6 +-
 .../hadoop/hbase/regionserver/MemStoreSize.html |4 +-
 .../hbase/regionserver/Region.Operation.html|4 +-
 .../hadoop/hbase/regionserver/package-tree.html |   18 +-
 .../regionserver/querymatcher/package-tree.html |2 +-
 .../hadoop/hbase/rest/model/package-tree.html   |2 +-
 .../hadoop/hbase/security/package-tree.html |2 +-
 .../thrift/ThriftServerRunner.HBaseHandler.html |  142 +-
 .../ThriftServerRunner.IOErrorWithCause.html|   12 +-
 .../thrift/ThriftServerRunner.ImplType.html |   82 +-
 ...ThriftServerRunner.ResultScannerWrapper.html |   12 +-
 .../hadoop/hbase/thrift/ThriftServerRunner.html |  110 +-
 .../class-use/ThriftServerRunner.ImplType.html  |2 +-
 .../apache/hadoop/hbase/util/package-tree.html  |8 +-
 .../apache/hadoop/hbase/wal/package-tree.html   |2 +-
 .../org/apache/hadoop/hbase/Version.html|6 +-
 .../RegionObserver.MutationType.html| 2045 +-
 .../hbase/coprocessor/RegionObserver.html   | 2045 +-
 .../hadoop/hbase/regionserver/MemStoreSize.html |   47 +-
 .../thrift/ThriftServerRunner.HBaseHandler.html | 3718 +-
 .../ThriftServerRunner.IOErrorWithCause.html| 3718 +-
 .../thrift/ThriftServerRunner.ImplType.html | 3718 +-
 ...ThriftServerRunner.ResultScannerWrapper.html | 3718 +-
 .../hadoop/hbase/thrift/ThriftServerRunner.html | 3718 +-
 export_control.html |4 +-
 index.html  |4 +-
 integration.html|4 +-
 issue-tracking.html |4 +-
 license.html|4 +-
 mail-lists.html |4 +-
 metrics.html|4 +-
 old_news.html   |4 +-
 plugin-management.html  |4 +-
 plugins.html|4 +-
 poweredbyhbase.html |4 +-
 project-info.html   |4 +-
 project-reports.html|4 +-
 project-summary.html|4 +-
 pseudo-distributed.html |4 +-
 replication.html|4 +-
 resources.html  |4 +-
 source-repository.html  |4 +-
 sponsors.html   |4 +-
 supportingprojects.html |4 +-
 team-list.html  |4 +-
 .../regionserver/TestPerColumnFamilyFlush.html  |   14 +-
 .../regionserver/TestPerColumnFamilyFlush.html  |  597 +--
 .../hadoop/hbase/rsgroup/Te

[02/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/export_control.html
--
diff --git a/export_control.html b/export_control.html
index 9cd43ef..437879d 100644
--- a/export_control.html
+++ b/export_control.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – 
   Export Control
@@ -331,7 +331,7 @@ for more details.
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/index.html
--
diff --git a/index.html b/index.html
index a18e713..c039284 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – Apache HBase™ Home
 
@@ -409,7 +409,7 @@ Apache HBase is an open-source, distributed, versioned, 
non-relational database
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/integration.html
--
diff --git a/integration.html b/integration.html
index 2a063f8..230a717 100644
--- a/integration.html
+++ b/integration.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – CI Management
 
@@ -291,7 +291,7 @@
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/issue-tracking.html
--
diff --git a/issue-tracking.html b/issue-tracking.html
index a2537a6..2b8edc6 100644
--- a/issue-tracking.html
+++ b/issue-tracking.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – Issue Management
 
@@ -288,7 +288,7 @@
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/license.html
--
diff --git a/license.html b/license.html
index 4b85e78..2347553 100644
--- a/license.html
+++ b/license.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – Project Licenses
 
@@ -491,7 +491,7 @@
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/mail-lists.html
--
diff --git a/mail-lists.html b/mail-lists.html
index 4f42628..df436c7 100644
--- a/mail-lists.html
+++ b/mail-lists.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase – Project Mailing Lists
 
@@ -341,7 +341,7 @@
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/metrics.html
--
diff --git a/metrics.html b/metrics.html
index f3fd5ff..41770b3 100644
--- a/metrics.html
+++ b/metrics.html
@@ -7,7 +7,7 @@
   
 
 
-
+
 
 Apache HBase –  
   Apache HBase (TM) Metrics
@@ -459,7 +459,7 @@ export HBASE_REGIONSERVER_OPTS="$HBASE_JMX_OPTS 
-Dcom.sun.management.jmxrem
 https://www.apache.org/";>The Apache Software 
Foundation.
 All rights reserved.  
 
-  Last Published: 
2018-04-22
+  Last Published: 
2018-04-23
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/old_news.html
--
diff --git a/old_news.html b/old_news.html
ind

[07/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
index fd7ab7a..021207f 100644
--- 
a/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
+++ 
b/devapidocs/src-html/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
@@ -147,1891 +147,1901 @@
 139import org.slf4j.Logger;
 140import org.slf4j.LoggerFactory;
 141import 
org.apache.hbase.thirdparty.com.google.common.base.Joiner;
-142import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
-143import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
-144import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
-145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
-146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
-147
-148/**
-149 * ThriftServerRunner - this class starts 
up a Thrift server which implements
-150 * the Hbase API specified in the 
Hbase.thrift IDL file.
-151 */
-152@InterfaceAudience.Private
-153public class ThriftServerRunner 
implements Runnable {
-154
-155  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
-156
-157  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
-158
-159  static final String 
SERVER_TYPE_CONF_KEY =
-160  
"hbase.regionserver.thrift.server.type";
-161
-162  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
-163  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
-164  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";
-165  static final String 
MAX_FRAME_SIZE_CONF_KEY =
-166  
"hbase.regionserver.thrift.framed.max_frame_size_in_mb";
-167  static final String PORT_CONF_KEY = 
"hbase.regionserver.thrift.port";
-168  static final String COALESCE_INC_KEY = 
"hbase.regionserver.thrift.coalesceIncrement";
-169  static final String USE_HTTP_CONF_KEY = 
"hbase.regionserver.thrift.http";
-170  static final String HTTP_MIN_THREADS = 
"hbase.thrift.http_threads.min";
-171  static final String HTTP_MAX_THREADS = 
"hbase.thrift.http_threads.max";
-172
-173  static final String THRIFT_SSL_ENABLED 
= "hbase.thrift.ssl.enabled";
-174  static final String 
THRIFT_SSL_KEYSTORE_STORE = "hbase.thrift.ssl.keystore.store";
-175  static final String 
THRIFT_SSL_KEYSTORE_PASSWORD = "hbase.thrift.ssl.keystore.password";
-176  static final String 
THRIFT_SSL_KEYSTORE_KEYPASSWORD = "hbase.thrift.ssl.keystore.keypassword";
-177  static final String 
THRIFT_SSL_EXCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.exclude.cipher.suites";
-178  static final String 
THRIFT_SSL_INCLUDE_CIPHER_SUITES = "hbase.thrift.ssl.include.cipher.suites";
-179  static final String 
THRIFT_SSL_EXCLUDE_PROTOCOLS = "hbase.thrift.ssl.exclude.protocols";
-180  static final String 
THRIFT_SSL_INCLUDE_PROTOCOLS = "hbase.thrift.ssl.include.protocols";
-181
-182  /**
-183   * Amount of time in milliseconds 
before a server thread will timeout
-184   * waiting for client to send data on a 
connected socket. Currently,
-185   * applies only to 
TBoundedThreadPoolServer
-186   */
-187  public static final String 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY =
-188
"hbase.thrift.server.socket.read.timeout";
-189  public static final int 
THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 6;
-190
+142import 
org.apache.hbase.thirdparty.com.google.common.base.Splitter;
+143import 
org.apache.hbase.thirdparty.com.google.common.base.Throwables;
+144import 
org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;
+145import 
org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine;
+146import 
org.apache.hbase.thirdparty.org.apache.commons.cli.Option;
+147import 
org.apache.hbase.thirdparty.org.apache.commons.cli.OptionGroup;
+148
+149/**
+150 * ThriftServerRunner - this class starts 
up a Thrift server which implements
+151 * the Hbase API specified in the 
Hbase.thrift IDL file.
+152 */
+153@InterfaceAudience.Private
+154public class ThriftServerRunner 
implements Runnable {
+155
+156  private static final Logger LOG = 
LoggerFactory.getLogger(ThriftServerRunner.class);
+157
+158  private static final int 
DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+159
+160  static final String 
SERVER_TYPE_CONF_KEY =
+161  
"hbase.regionserver.thrift.server.type";
+162
+163  static final String BIND_CONF_KEY = 
"hbase.regionserver.thrift.ipaddress";
+164  static final String COMPACT_CONF_KEY = 
"hbase.regionserver.thrift.compact";
+165  static final String FRAMED_CONF_KEY = 
"hbase.regionserver.thrift.framed";

[13/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
--
diff --git 
a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
 
b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
index f338c1a..d82c3a7 100644
--- 
a/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
+++ 
b/devapidocs/org/apache/hadoop/hbase/thrift/ThriftServerRunner.HBaseHandler.html
@@ -117,7 +117,7 @@ var activeTableTab = "activeTableTab";
 
 
 
-public static class ThriftServerRunner.HBaseHandler
+public static class ThriftServerRunner.HBaseHandler
 extends https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true";
 title="class or interface in java.lang">Object
 implements org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 The HBaseHandler is a glue object that connects Thrift RPC 
calls to the
@@ -721,7 +721,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 conf
-protected org.apache.hadoop.conf.Configuration conf
+protected org.apache.hadoop.conf.Configuration conf
 
 
 
@@ -730,7 +730,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 LOG
-protected static final org.slf4j.Logger LOG
+protected static final org.slf4j.Logger LOG
 
 
 
@@ -739,7 +739,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 nextScannerId
-protected int nextScannerId
+protected int nextScannerId
 
 
 
@@ -748,7 +748,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 scannerMap
-protected https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html?is-external=true";
 title="class or interface in java.util">HashMapInteger,ThriftServerRunner.ResultScannerWrapper> 
scannerMap
+protected https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html?is-external=true";
 title="class or interface in java.util">HashMapInteger,ThriftServerRunner.ResultScannerWrapper> 
scannerMap
 
 
 
@@ -757,7 +757,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 metrics
-private ThriftMetrics metrics
+private ThriftMetrics metrics
 
 
 
@@ -766,7 +766,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 connectionCache
-private final ConnectionCache connectionCache
+private final ConnectionCache connectionCache
 
 
 
@@ -775,7 +775,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 coalescer
-IncrementCoalescer coalescer
+IncrementCoalescer coalescer
 
 
 
@@ -784,7 +784,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 CLEANUP_INTERVAL
-static final https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String CLEANUP_INTERVAL
+static final https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String CLEANUP_INTERVAL
 
 See Also:
 Constant
 Field Values
@@ -797,7 +797,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 MAX_IDLETIME
-static final https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String MAX_IDLETIME
+static final https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true";
 title="class or interface in java.lang">String MAX_IDLETIME
 
 See Also:
 Constant
 Field Values
@@ -818,7 +818,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 HBaseHandler
-protected HBaseHandler(org.apache.hadoop.conf.Configuration c,
+protected HBaseHandler(org.apache.hadoop.conf.Configuration c,
UserProvider userProvider)
 throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 
@@ -841,7 +841,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 getAllColumns
-byte[][] getAllColumns(Table table)
+byte[][] getAllColumns(Table table)
 throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interface in java.io">IOException
 Returns a list of all the column families for a given 
Table.
 
@@ -858,7 +858,7 @@ implements 
org.apache.hadoop.hbase.thrift.generated.Hbase.Iface
 
 
 getTable
-public Table getTable(byte[] tableName)
+public Table getTable(byte[] tableName)
throws https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true";
 title="class or interfa

[08/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreSize.html
--
diff --git 
a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreSize.html 
b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreSize.html
index 01edd36..cdc0ca3 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreSize.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/MemStoreSize.html
@@ -103,30 +103,33 @@
 095
 096  @Override
 097  public boolean equals(Object obj) {
-098if (obj == null || getClass() != 
obj.getClass()) {
+098if (obj == null) {
 099  return false;
 100}
-101MemStoreSize other = (MemStoreSize) 
obj;
-102return this.dataSize == 
other.dataSize
-103&& this.heapSize == 
other.heapSize
-104&& this.offHeapSize == 
other.offHeapSize;
-105  }
-106
-107  @Override
-108  public int hashCode() {
-109long h = 13 * this.dataSize;
-110h = h + 14 * this.heapSize;
-111h = h + 15 * this.offHeapSize;
-112return (int) h;
-113  }
-114
-115  @Override
-116  public String toString() {
-117return "dataSize=" + this.dataSize
-118+ " , heapSize=" + 
this.heapSize
-119+ " , offHeapSize=" + 
this.offHeapSize;
-120  }
-121}
+101if (!(obj instanceof MemStoreSize)) 
{
+102  return false;
+103}
+104MemStoreSize other = (MemStoreSize) 
obj;
+105return this.dataSize == 
other.dataSize
+106&& this.heapSize == 
other.heapSize
+107&& this.offHeapSize == 
other.offHeapSize;
+108  }
+109
+110  @Override
+111  public int hashCode() {
+112long h = 13 * this.dataSize;
+113h = h + 14 * this.heapSize;
+114h = h + 15 * this.offHeapSize;
+115return (int) h;
+116  }
+117
+118  @Override
+119  public String toString() {
+120return "dataSize=" + this.dataSize
+121+ " , heapSize=" + 
this.heapSize
+122+ " , offHeapSize=" + 
this.offHeapSize;
+123  }
+124}
 
 
 



[14/16] hbase-site git commit: Published site at e73ba582f23e7ac512665bac2539af53bd3cb47c.

2018-04-23 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/filter/package-tree.html
--
diff --git a/devapidocs/org/apache/hadoop/hbase/filter/package-tree.html 
b/devapidocs/org/apache/hadoop/hbase/filter/package-tree.html
index e96b77e..6c817bc 100644
--- a/devapidocs/org/apache/hadoop/hbase/filter/package-tree.html
+++ b/devapidocs/org/apache/hadoop/hbase/filter/package-tree.html
@@ -183,14 +183,14 @@
 
 java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true";
 title="class or interface in java.lang">Enum (implements java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true";
 title="class or interface in java.lang">Comparable, java.io.https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true";
 title="class or interface in java.io">Serializable)
 
-org.apache.hadoop.hbase.filter.FuzzyRowFilter.Order
+org.apache.hadoop.hbase.filter.FilterList.Operator
 org.apache.hadoop.hbase.filter.RegexStringComparator.EngineType
+org.apache.hadoop.hbase.filter.FuzzyRowFilter.SatisfiesCode
 org.apache.hadoop.hbase.filter.CompareFilter.CompareOp
-org.apache.hadoop.hbase.filter.FilterList.Operator
 org.apache.hadoop.hbase.filter.Filter.ReturnCode
 org.apache.hadoop.hbase.filter.FilterWrapper.FilterRowRetCode
+org.apache.hadoop.hbase.filter.FuzzyRowFilter.Order
 org.apache.hadoop.hbase.filter.BitComparator.BitwiseOp
-org.apache.hadoop.hbase.filter.FuzzyRowFilter.SatisfiesCode
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html
--
diff --git a/devapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html 
b/devapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html
index 1a0ab0b..40422cf 100644
--- a/devapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html
+++ b/devapidocs/org/apache/hadoop/hbase/io/hfile/package-tree.html
@@ -273,12 +273,12 @@
 
 java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true";
 title="class or interface in java.lang">Enum (implements java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true";
 title="class or interface in java.lang">Comparable, java.io.https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true";
 title="class or interface in java.io">Serializable)
 
-org.apache.hadoop.hbase.io.hfile.CacheConfig.ExternalBlockCaches
-org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory
 org.apache.hadoop.hbase.io.hfile.Cacheable.MemoryType
+org.apache.hadoop.hbase.io.hfile.CacheConfig.ExternalBlockCaches
 org.apache.hadoop.hbase.io.hfile.BlockType
-org.apache.hadoop.hbase.io.hfile.BlockPriority
 org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer.State
+org.apache.hadoop.hbase.io.hfile.BlockType.BlockCategory
+org.apache.hadoop.hbase.io.hfile.BlockPriority
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/ipc/package-tree.html
--
diff --git a/devapidocs/org/apache/hadoop/hbase/ipc/package-tree.html 
b/devapidocs/org/apache/hadoop/hbase/ipc/package-tree.html
index 928ae20..1f90dde 100644
--- a/devapidocs/org/apache/hadoop/hbase/ipc/package-tree.html
+++ b/devapidocs/org/apache/hadoop/hbase/ipc/package-tree.html
@@ -349,9 +349,9 @@
 
 java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true";
 title="class or interface in java.lang">Enum (implements java.lang.https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true";
 title="class or interface in java.lang">Comparable, java.io.https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true";
 title="class or interface in java.io">Serializable)
 
-org.apache.hadoop.hbase.ipc.BufferCallBeforeInitHandler.BufferCallAction
-org.apache.hadoop.hbase.ipc.MetricsHBaseServerSourceFactoryImpl.SourceStorage
 org.apache.hadoop.hbase.ipc.CallEvent.Type
+org.apache.hadoop.hbase.ipc.MetricsHBaseServerSourceFactoryImpl.SourceStorage
+org.apache.hadoop.hbase.ipc.BufferCallBeforeInitHandler.BufferCallAction
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/952146b4/devapidocs/org/apache/hadoop/hbase/mapreduce/package-tree.html
--
diff --git a/devapidocs/org/apache/hadoop/hbase/mapreduce/package-tree.html 
b/devapidocs/org/apache/hadoop/hbase/mapreduce/package-tree.html
index a77bff8..730b7cf 100644
--- a/devapidocs/org/apache/hadoop/hbase/mapreduce/package-tree.html
+++ b/devapidocs/org/apache/hadoop/hbase/mapreduce/package-tree.html
@@ -293,10 +293,10 @@
 
 java.lang.https://docs.oracle.com/javase/8/docs/api/java/lan

[hbase] Git Push Summary

2018-04-23 Thread stack
Repository: hbase
Updated Tags:  refs/tags/2.0.0RC2 [created] 87c8525da


hbase git commit: HBASE-20425 Do not write the cluster id of the current active cluster when writing remote WAL

2018-04-23 Thread openinx
Repository: hbase
Updated Branches:
  refs/heads/HBASE-19064 afd78256c -> 14687da73


HBASE-20425 Do not write the cluster id of the current active cluster when 
writing remote WAL


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

Branch: refs/heads/HBASE-19064
Commit: 14687da73398e66761b76f544b8eaf4566440e70
Parents: afd7825
Author: huzheng 
Authored: Mon Apr 23 17:20:55 2018 +0800
Committer: huzheng 
Committed: Tue Apr 24 09:44:22 2018 +0800

--
 .../replication/TestSyncReplicationActive.java  | 32 
 1 file changed, 32 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/14687da7/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java
index bff4572..f9020a0 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestSyncReplicationActive.java
@@ -17,9 +17,17 @@
  */
 package org.apache.hadoop.hbase.replication;
 
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.wal.WAL.Entry;
+import org.apache.hadoop.hbase.wal.WAL.Reader;
+import org.apache.hadoop.hbase.wal.WALFactory;
+import org.junit.Assert;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -49,6 +57,9 @@ public class TestSyncReplicationActive extends 
SyncReplicationTestBase {
 // peer is disabled so no data have been replicated
 verifyNotReplicatedThroughRegion(UTIL2, 0, 100);
 
+// Ensure that there's no cluster id in remote log entries.
+verifyNoClusterIdInRemoteLog(UTIL2, PEER_ID);
+
 UTIL2.getAdmin().transitReplicationPeerSyncReplicationState(PEER_ID,
   SyncReplicationState.DOWNGRADE_ACTIVE);
 // confirm that peer with state DA will reject replication request.
@@ -72,4 +83,25 @@ public class TestSyncReplicationActive extends 
SyncReplicationTestBase {
 verifyReplicationRequestRejection(UTIL2, true);
 write(UTIL2, 200, 300);
   }
+
+  private void verifyNoClusterIdInRemoteLog(HBaseTestingUtility utility, 
String peerId)
+  throws Exception {
+FileSystem fs2 = utility.getTestFileSystem();
+Path remoteDir =
+new 
Path(utility.getMiniHBaseCluster().getMaster().getMasterFileSystem().getRootDir(),
+"remoteWALs").makeQualified(fs2.getUri(), 
fs2.getWorkingDirectory());
+FileStatus[] files = fs2.listStatus(new Path(remoteDir, peerId));
+Assert.assertTrue(files.length > 0);
+for (FileStatus file : files) {
+  try (Reader reader =
+  WALFactory.createReader(fs2, file.getPath(), 
utility.getConfiguration())) {
+Entry entry = reader.next();
+Assert.assertTrue(entry != null);
+while (entry != null) {
+  Assert.assertEquals(entry.getKey().getClusterIds().size(), 0);
+  entry = reader.next();
+}
+  }
+}
+  }
 }