[45/50] hbase git commit: HBASE-15952 Bulk load data replication is not working when RS user does not have permission on hfile-refs node

2016-06-10 Thread syuanjiang
HBASE-15952 Bulk load data replication is not working when RS user does not 
have permission on hfile-refs node


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

Branch: refs/heads/hbase-12439
Commit: 9012a0b123b3eea8b08c8687cef812e83e9b491d
Parents: 41cc215
Author: Ashish Singhi 
Authored: Thu Jun 9 18:44:29 2016 +0530
Committer: Ashish Singhi 
Committed: Thu Jun 9 18:44:29 2016 +0530

--
 .../replication/ReplicationPeersZKImpl.java | 21 -
 .../hbase/replication/ReplicationQueues.java|  6 
 .../replication/ReplicationQueuesHBaseImpl.java |  6 
 .../replication/ReplicationQueuesZKImpl.java| 33 
 .../regionserver/ReplicationSourceManager.java  | 11 +--
 .../cleaner/TestReplicationHFileCleaner.java|  1 +
 .../replication/TestReplicationStateBasic.java  |  5 +++
 7 files changed, 53 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
index 15265d9..5af97c2 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
@@ -129,17 +129,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 
   ZKUtil.createWithParents(this.zookeeper, this.peersZNode);
 
-  // Irrespective of bulk load hfile replication is enabled or not we add 
peerId node to
-  // hfile-refs node -- HBASE-15397
-  try {
-String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-LOG.info("Adding peer " + peerId + " to hfile reference queue.");
-ZKUtil.createWithParents(this.zookeeper, peerId);
-  } catch (KeeperException e) {
-throw new ReplicationException("Failed to add peer with id=" + id
-+ ", node under hfile references node.", e);
-  }
-
   List listOfOps = new ArrayList();
   ZKUtilOp op1 = ZKUtilOp.createAndFailSilent(getPeerNode(id),
 ReplicationSerDeHelper.toByteArray(peerConfig));
@@ -166,16 +155,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 + " because that id does not exist.");
   }
   ZKUtil.deleteNodeRecursively(this.zookeeper, 
ZKUtil.joinZNode(this.peersZNode, id));
-  // Delete peerId node from hfile-refs node irrespective of whether bulk 
loaded hfile
-  // replication is enabled or not
-
-  String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-  try {
-LOG.info("Removing peer " + peerId + " from hfile reference queue.");
-ZKUtil.deleteNodeRecursively(this.zookeeper, peerId);
-  } catch (NoNodeException e) {
-LOG.info("Did not find node " + peerId + " to delete.", e);
-  }
 } catch (KeeperException e) {
   throw new ReplicationException("Could not remove peer with id=" + id, e);
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
index db6da91..809b122 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
@@ -123,6 +123,12 @@ public interface ReplicationQueues {
   void addPeerToHFileRefs(String peerId) throws ReplicationException;
 
   /**
+   * Remove a peer from hfile reference queue.
+   * @param peerId peer cluster id to be removed
+   */
+  void removePeerFromHFileRefs(String peerId);
+
+  /**
* Add new hfile references to the queue.
* @param peerId peer cluster id to which the hfiles need to be replicated
* @param files list of hfile references to be added

http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesHBaseImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/re

hbase git commit: HBASE-15952 Bulk load data replication is not working when RS user does not have permission on hfile-refs node

2016-06-09 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 ba9c11ef1 -> d320ac28e


HBASE-15952 Bulk load data replication is not working when RS user does not 
have permission on hfile-refs node


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

Branch: refs/heads/branch-1.3
Commit: d320ac28ee04e0e7cbac86281f04876ca3a905e5
Parents: ba9c11e
Author: Ashish Singhi 
Authored: Thu Jun 9 18:50:03 2016 +0530
Committer: Ashish Singhi 
Committed: Thu Jun 9 18:50:11 2016 +0530

--
 .../replication/ReplicationPeersZKImpl.java | 21 -
 .../hbase/replication/ReplicationQueues.java|  6 
 .../replication/ReplicationQueuesZKImpl.java| 33 
 .../regionserver/ReplicationSourceManager.java  | 11 +--
 .../cleaner/TestReplicationHFileCleaner.java|  1 +
 .../replication/TestReplicationStateBasic.java  |  5 +++
 6 files changed, 47 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/d320ac28/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
index b0d6e83..d5445ed 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
@@ -124,17 +124,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 
   ZKUtil.createWithParents(this.zookeeper, this.peersZNode);
 
-  // Irrespective of bulk load hfile replication is enabled or not we add 
peerId node to
-  // hfile-refs node -- HBASE-15397
-  try {
-String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-LOG.info("Adding peer " + peerId + " to hfile reference queue.");
-ZKUtil.createWithParents(this.zookeeper, peerId);
-  } catch (KeeperException e) {
-throw new ReplicationException("Failed to add peer with id=" + id
-+ ", node under hfile references node.", e);
-  }
-
   List listOfOps = new ArrayList();
   ZKUtilOp op1 = 
ZKUtilOp.createAndFailSilent(ZKUtil.joinZNode(this.peersZNode, id),
 toByteArray(peerConfig));
@@ -164,16 +153,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 + " because that id does not exist.");
   }
   ZKUtil.deleteNodeRecursively(this.zookeeper, 
ZKUtil.joinZNode(this.peersZNode, id));
-  // Delete peerId node from hfile-refs node irrespective of whether bulk 
loaded hfile
-  // replication is enabled or not
-
-  String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-  try {
-LOG.info("Removing peer " + peerId + " from hfile reference queue.");
-ZKUtil.deleteNodeRecursively(this.zookeeper, peerId);
-  } catch (NoNodeException e) {
-LOG.info("Did not find node " + peerId + " to delete.", e);
-  }
 } catch (KeeperException e) {
   throw new ReplicationException("Could not remove peer with id=" + id, e);
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d320ac28/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
index 0d47a88..507367b 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
@@ -123,6 +123,12 @@ public interface ReplicationQueues {
   void addPeerToHFileRefs(String peerId) throws ReplicationException;
 
   /**
+   * Remove a peer from hfile reference queue.
+   * @param peerId peer cluster id to be removed
+   */
+  void removePeerFromHFileRefs(String peerId);
+
+  /**
* Add new hfile references to the queue.
* @param peerId peer cluster id to which the hfiles need to be replicated
* @param files list of hfile references to be added

http://git-wip-us.apache.org/repos/asf/hbase/blob/d320ac28/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/

hbase git commit: HBASE-15952 Bulk load data replication is not working when RS user does not have permission on hfile-refs node

2016-06-09 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/branch-1 13d06a2cc -> a40ec70da


HBASE-15952 Bulk load data replication is not working when RS user does not 
have permission on hfile-refs node


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

Branch: refs/heads/branch-1
Commit: a40ec70da9d9891f5af074535717fe20658a00cc
Parents: 13d06a2
Author: Ashish Singhi 
Authored: Thu Jun 9 18:46:07 2016 +0530
Committer: Ashish Singhi 
Committed: Thu Jun 9 18:46:07 2016 +0530

--
 .../replication/ReplicationPeersZKImpl.java | 21 -
 .../hbase/replication/ReplicationQueues.java|  6 
 .../replication/ReplicationQueuesZKImpl.java| 33 
 .../regionserver/ReplicationSourceManager.java  | 11 +--
 .../cleaner/TestReplicationHFileCleaner.java|  1 +
 .../replication/TestReplicationStateBasic.java  |  5 +++
 6 files changed, 47 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/a40ec70d/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
index 076167e..d717b0b 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
@@ -128,17 +128,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 
   ZKUtil.createWithParents(this.zookeeper, this.peersZNode);
 
-  // Irrespective of bulk load hfile replication is enabled or not we add 
peerId node to
-  // hfile-refs node -- HBASE-15397
-  try {
-String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-LOG.info("Adding peer " + peerId + " to hfile reference queue.");
-ZKUtil.createWithParents(this.zookeeper, peerId);
-  } catch (KeeperException e) {
-throw new ReplicationException("Failed to add peer with id=" + id
-+ ", node under hfile references node.", e);
-  }
-
   List listOfOps = new ArrayList();
   ZKUtilOp op1 = 
ZKUtilOp.createAndFailSilent(ZKUtil.joinZNode(this.peersZNode, id),
 ReplicationSerDeHelper.toByteArray(peerConfig));
@@ -168,16 +157,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 + " because that id does not exist.");
   }
   ZKUtil.deleteNodeRecursively(this.zookeeper, 
ZKUtil.joinZNode(this.peersZNode, id));
-  // Delete peerId node from hfile-refs node irrespective of whether bulk 
loaded hfile
-  // replication is enabled or not
-
-  String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-  try {
-LOG.info("Removing peer " + peerId + " from hfile reference queue.");
-ZKUtil.deleteNodeRecursively(this.zookeeper, peerId);
-  } catch (NoNodeException e) {
-LOG.info("Did not find node " + peerId + " to delete.", e);
-  }
 } catch (KeeperException e) {
   throw new ReplicationException("Could not remove peer with id=" + id, e);
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/a40ec70d/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
index 0d47a88..507367b 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
@@ -123,6 +123,12 @@ public interface ReplicationQueues {
   void addPeerToHFileRefs(String peerId) throws ReplicationException;
 
   /**
+   * Remove a peer from hfile reference queue.
+   * @param peerId peer cluster id to be removed
+   */
+  void removePeerFromHFileRefs(String peerId);
+
+  /**
* Add new hfile references to the queue.
* @param peerId peer cluster id to which the hfiles need to be replicated
* @param files list of hfile references to be added

http://git-wip-us.apache.org/repos/asf/hbase/blob/a40ec70d/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
--
diff --git 
a/hbase-client

hbase git commit: HBASE-15952 Bulk load data replication is not working when RS user does not have permission on hfile-refs node

2016-06-09 Thread ashishsinghi
Repository: hbase
Updated Branches:
  refs/heads/master 41cc21554 -> 9012a0b12


HBASE-15952 Bulk load data replication is not working when RS user does not 
have permission on hfile-refs node


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

Branch: refs/heads/master
Commit: 9012a0b123b3eea8b08c8687cef812e83e9b491d
Parents: 41cc215
Author: Ashish Singhi 
Authored: Thu Jun 9 18:44:29 2016 +0530
Committer: Ashish Singhi 
Committed: Thu Jun 9 18:44:29 2016 +0530

--
 .../replication/ReplicationPeersZKImpl.java | 21 -
 .../hbase/replication/ReplicationQueues.java|  6 
 .../replication/ReplicationQueuesHBaseImpl.java |  6 
 .../replication/ReplicationQueuesZKImpl.java| 33 
 .../regionserver/ReplicationSourceManager.java  | 11 +--
 .../cleaner/TestReplicationHFileCleaner.java|  1 +
 .../replication/TestReplicationStateBasic.java  |  5 +++
 7 files changed, 53 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
index 15265d9..5af97c2 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeersZKImpl.java
@@ -129,17 +129,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 
   ZKUtil.createWithParents(this.zookeeper, this.peersZNode);
 
-  // Irrespective of bulk load hfile replication is enabled or not we add 
peerId node to
-  // hfile-refs node -- HBASE-15397
-  try {
-String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-LOG.info("Adding peer " + peerId + " to hfile reference queue.");
-ZKUtil.createWithParents(this.zookeeper, peerId);
-  } catch (KeeperException e) {
-throw new ReplicationException("Failed to add peer with id=" + id
-+ ", node under hfile references node.", e);
-  }
-
   List listOfOps = new ArrayList();
   ZKUtilOp op1 = ZKUtilOp.createAndFailSilent(getPeerNode(id),
 ReplicationSerDeHelper.toByteArray(peerConfig));
@@ -166,16 +155,6 @@ public class ReplicationPeersZKImpl extends 
ReplicationStateZKBase implements Re
 + " because that id does not exist.");
   }
   ZKUtil.deleteNodeRecursively(this.zookeeper, 
ZKUtil.joinZNode(this.peersZNode, id));
-  // Delete peerId node from hfile-refs node irrespective of whether bulk 
loaded hfile
-  // replication is enabled or not
-
-  String peerId = ZKUtil.joinZNode(this.hfileRefsZNode, id);
-  try {
-LOG.info("Removing peer " + peerId + " from hfile reference queue.");
-ZKUtil.deleteNodeRecursively(this.zookeeper, peerId);
-  } catch (NoNodeException e) {
-LOG.info("Did not find node " + peerId + " to delete.", e);
-  }
 } catch (KeeperException e) {
   throw new ReplicationException("Could not remove peer with id=" + id, e);
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
index db6da91..809b122 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
@@ -123,6 +123,12 @@ public interface ReplicationQueues {
   void addPeerToHFileRefs(String peerId) throws ReplicationException;
 
   /**
+   * Remove a peer from hfile reference queue.
+   * @param peerId peer cluster id to be removed
+   */
+  void removePeerFromHFileRefs(String peerId);
+
+  /**
* Add new hfile references to the queue.
* @param peerId peer cluster id to which the hfiles need to be replicated
* @param files list of hfile references to be added

http://git-wip-us.apache.org/repos/asf/hbase/blob/9012a0b1/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesHBaseImpl.java
--