Package org.apache.hadoop.hbase.security.visibility.expression

Examples of org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode


    return true;
  }

  private List<Tag> createVisibilityTags(String visibilityLabelsExp, boolean addSerializationTag)
      throws IOException, ParseException, InvalidLabelException {
    ExpressionNode node = null;
    node = this.expressionParser.parse(visibilityLabelsExp);
    node = this.expressionExpander.expand(node);
    List<Tag> tags = new ArrayList<Tag>();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    List<Integer> labelOrdinals = new ArrayList<Integer>();
    // We will be adding this tag before the visibility tags and the presence of this
    // tag indicates we are supporting deletes with cell visibility
    if (addSerializationTag) {
      tags.add(VisibilityUtils.VIS_SERIALIZATION_TAG);
    }
    if (node.isSingleNode()) {
      getLabelOrdinals(node, labelOrdinals);
      writeLabelOrdinalsToStream(labelOrdinals, dos);
      tags.add(new Tag(VisibilityUtils.VISIBILITY_TAG_TYPE, baos.toByteArray()));
      baos.reset();
    } else {
View Full Code Here


    ExpressionExpander expander = new ExpressionExpander();

    // (!a) -> (!a)
    NonLeafExpressionNode exp1 = new NonLeafExpressionNode(Operator.NOT,
        new LeafExpressionNode("a"));
    ExpressionNode result = expander.expand(exp1);
    assertTrue(result instanceof NonLeafExpressionNode);
    NonLeafExpressionNode nlResult = (NonLeafExpressionNode) result;
    assertEquals(Operator.NOT, nlResult.getOperator());
    assertEquals("a", ((LeafExpressionNode) nlResult.getChildExps().get(0)).getIdentifier());
View Full Code Here

    }
    return src;
  }

  private ExpressionNode negate(NonLeafExpressionNode nlExp) {
    ExpressionNode notChild = nlExp.getChildExps().get(0);
    if (notChild instanceof LeafExpressionNode) {
      return nlExp;
    }
    NonLeafExpressionNode nlNotChild = (NonLeafExpressionNode) notChild;
    if (nlNotChild.getOperator() == Operator.NOT) {
View Full Code Here

  private NonLeafExpressionNode expandNonLeaf(NonLeafExpressionNode newNode, Operator outerOp) {
    // Now go for the merge or expansion across brackets
    List<ExpressionNode> newChildExps = newNode.getChildExps();
    assert newChildExps.size() == 2;
    ExpressionNode leftChild = newChildExps.get(0);
    ExpressionNode rightChild = newChildExps.get(1);
    if (rightChild.isSingleNode()) {
      // Merge the single right node into the left side
      assert leftChild instanceof NonLeafExpressionNode;
      newNode = mergeChildNodes(newNode, outerOp, rightChild, (NonLeafExpressionNode) leftChild);
    } else if (leftChild.isSingleNode()) {
      // Merge the single left node into the right side
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.security.visibility.expression.ExpressionNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.