hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject git commit: HBASE-11465 [VisibilityController] Reserved tags check not happening for Append/Increment. (Anoop)
Date Sun, 06 Jul 2014 13:44:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/master c6db30897 -> a04e0b703


HBASE-11465 [VisibilityController] Reserved tags check not happening for Append/Increment.
(Anoop)


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

Branch: refs/heads/master
Commit: a04e0b703f1ec2075ad99d93d8b7edd603b14872
Parents: c6db308
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Sun Jul 6 19:14:00 2014 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Sun Jul 6 19:14:00 2014 +0530

----------------------------------------------------------------------
 .../visibility/VisibilityController.java        | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a04e0b70/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
index 4501c0b..9cd21d8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
@@ -57,8 +57,10 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.Tag;
 import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.Increment;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
@@ -75,6 +77,7 @@ import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionObserver;
 import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
+import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException;
 import org.apache.hadoop.hbase.filter.Filter;
 import org.apache.hadoop.hbase.filter.FilterBase;
 import org.apache.hadoop.hbase.filter.FilterList;
@@ -1194,6 +1197,28 @@ public class VisibilityController extends BaseRegionObserver implements
MasterOb
   }
 
   @Override
+  public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> e, Append append)
+      throws IOException {
+    for (CellScanner cellScanner = append.cellScanner(); cellScanner.advance();) {
+      if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
+        throw new FailedSanityCheckException("Append contains cell with reserved type tag");
+      }
+    }
+    return null;
+  }
+
+  @Override
+  public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment
increment)
+      throws IOException {
+    for (CellScanner cellScanner = increment.cellScanner(); cellScanner.advance();) {
+      if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
+        throw new FailedSanityCheckException("Increment contains cell with reserved type
tag");
+      }
+    }
+    return null;
+  }
+
+  @Override
   public Cell postMutationBeforeWAL(ObserverContext<RegionCoprocessorEnvironment> ctx,
       MutationType opType, Mutation mutation, Cell oldCell, Cell newCell) throws IOException
{
     List<Tag> tags = Lists.newArrayList();


Mime
View raw message