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

Examples of org.apache.hadoop.hbase.security.visibility.Authorizations


    for (int i = 0; i < numRetries; i++) {
      try {
        Scan scan = new Scan();
        // Scan entire family.
        scan.addFamily(Bytes.toBytes(family));
        scan.setAuthorizations(new Authorizations("secret","private"));
        ResultScanner resScanner = table.getScanner(scan);
        Result[] next = resScanner.next(5);
        assertEquals(1, next.length);
        for (Result res : resScanner) {
          LOG.debug("Getting results " + res.size());
View Full Code Here


   * @param proto
   * @return the converted client Authorizations
   */
  public static Authorizations toAuthorizations(ClientProtos.Authorizations proto) {
    if (proto == null) return null;
    return new Authorizations(proto.getLabelList());
  }
View Full Code Here

    Filter filter = scan.getFilter();
    if (filter != null) {
      model.setFilter(stringifyFilter(filter));
    }
    // Add the visbility labels if found in the attributes
    Authorizations authorizations = scan.getAuthorizations();
    if (authorizations != null) {
      List<String> labels = authorizations.getLabels();
      for (String label : labels) {
        if (!VisibilityLabelsValidator.isValidLabel(label)) {
          throw new IllegalArgumentException("Invalid authorization label : " + label
              + ". Authorizations cannot contain '(', ')' ,'&' ,'|', '!'" + " " +
                  "and cannot be empty");
View Full Code Here

    if (in.isSetAttributes()) {
      addAttributes(out,in.getAttributes());
    }

    if (in.isSetAuthorizations()) {
      out.setAuthorizations(new Authorizations(in.getAuthorizations().getLabels()));
    }
   
    if (!in.isSetColumns()) {
      return out;
    }
View Full Code Here

    if (in.isSetAttributes()) {
      addAttributes(out,in.getAttributes());
    }
   
    if (in.isSetAuthorizations()) {
      out.setAuthorizations(new Authorizations(in.getAuthorizations().getLabels()));
    }

    return out;
  }
View Full Code Here

    ResultScanner scanner = null;
    try {
      labels = new HashMap<String, Integer>();
      visibilityLabelsTable = new HTable(conf, LABELS_TABLE_NAME.getName());
      Scan scan = new Scan();
      scan.setAuthorizations(new Authorizations(VisibilityUtils.SYSTEM_LABEL));
      scan.addColumn(LABELS_TABLE_FAMILY, LABEL_QUALIFIER);
      scanner = visibilityLabelsTable.getScanner(scan);
      while (true) {
        Result next = scanner.next();
        if (next == null) {
View Full Code Here

        table.delete(d);

        Scan scan = new Scan();
        // Scan entire family.
        scan.addFamily(Bytes.toBytes(FAMILY));
        scan.setAuthorizations(new Authorizations("secret", "private"));
        ResultScanner resScanner = table.getScanner(scan);
        Result[] next = resScanner.next(5);
        assertEquals(0, next.length);
        verified = true;
        break;
View Full Code Here

    for (int i = 0; i < numRetries; i++) {
      try {
        Scan scan = new Scan();
        // Scan entire family.
        scan.addFamily(Bytes.toBytes(family));
        scan.setAuthorizations(new Authorizations("secret","private"));
        ResultScanner resScanner = table.getScanner(scan);
        Result[] next = resScanner.next(5);
        assertEquals(1, next.length);
        for (Result res : resScanner) {
          LOG.debug("Getting results " + res.size());
View Full Code Here

      scan = new Scan();
      scan.setCacheBlocks(false);
      scan.setRaw(true);

      String[] split = labels.split(COMMA);
      scan.setAuthorizations(new Authorizations(split[this.labelIndex * 2],
          split[(this.labelIndex * 2) + 1]));
      if (delete) {
        LOG.info("Running deletes");
      } else {
        LOG.info("Running copiers");
View Full Code Here

      scan.addColumn(FAMILY_NAME, COLUMN_PREV);
      scan.setCaching(10000);
      scan.setCacheBlocks(false);
      String[] split = labels.split(COMMA);

      scan.setAuthorizations(new Authorizations(split[this.labelIndex * 2],
          split[(this.labelIndex * 2) + 1]));

      TableMapReduceUtil.initTableMapperJob(tableName.getName(), scan, VerifyMapper.class,
          BytesWritable.class, BytesWritable.class, job);
      TableMapReduceUtil.addDependencyJars(job.getConfiguration(), AbstractHBaseTool.class);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.security.visibility.Authorizations

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.