You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2018/02/14 20:18:41 UTC

atlas git commit: ATLAS-2445: updated HBase hook to handle table-clone and snapshot-restore operations

Repository: atlas
Updated Branches:
  refs/heads/master a0c85e5aa -> 4119f431e


ATLAS-2445: updated HBase hook to handle table-clone and snapshot-restore operations

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/master
Commit: 4119f431ebb7c948fbe6ea031338d918acb30919
Parents: a0c85e5
Author: rmani <rm...@hortonworks.com>
Authored: Wed Feb 14 11:28:04 2018 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Wed Feb 14 11:36:42 2018 -0800

----------------------------------------------------------------------
 .../atlas/hbase/hook/HBaseAtlasCoprocessor.java | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/4119f431/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java
----------------------------------------------------------------------
diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java
index 8beccd2..af8afd4 100644
--- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java
+++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.NamespaceDescriptor;
 import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.ObserverContext;
+import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -149,6 +150,30 @@ public class HBaseAtlasCoprocessor extends HBaseAtlasCoprocessorBase {
             LOG.debug("<== HBaseAtlasCoprocessor.postModifyNamespace()");
         }
     }
+
+    @Override
+    public void postCloneSnapshot(ObserverContext<MasterCoprocessorEnvironment> observerContext, HBaseProtos.SnapshotDescription snapshotDescription, HTableDescriptor hTableDescriptor) throws IOException {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("==> HBaseAtlasCoprocessoror.postCloneSnapshot()");
+        }
+        hbaseAtlasHook.sendHBaseTableOperation(hTableDescriptor, null, HBaseAtlasHook.OPERATION.CREATE_TABLE);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("<== HBaseAtlasCoprocessoror.postCloneSnapshot()");
+        }
+
+    }
+
+    @Override
+    public void postRestoreSnapshot(ObserverContext<MasterCoprocessorEnvironment> observerContext, HBaseProtos.SnapshotDescription snapshotDescription, HTableDescriptor hTableDescriptor) throws IOException {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("==> HBaseAtlasCoprocessor.postRestoreSnapshot()");
+        }
+        hbaseAtlasHook.sendHBaseTableOperation(hTableDescriptor, hTableDescriptor.getTableName(), HBaseAtlasHook.OPERATION.ALTER_TABLE);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("<== HBaseAtlasCoprocessor.postRestoreSnapshot()");
+        }
+    }
+
 }