Package org.apache.accumulo.core.security

Examples of org.apache.accumulo.core.security.ColumnVisibility


 
  public static void insertList(final BatchWriter writer, final List<Entry<Key,Value>> list) throws MutationsRejectedException {
    for (Entry<Key,Value> e : list) {
      final Key key = e.getKey();
      final Mutation mutation = new Mutation(key.getRow());
      ColumnVisibility colVisibility = new ColumnVisibility(key.getColumnVisibility());
      mutation.put(key.getColumnFamily(), key.getColumnQualifier(), colVisibility, key.getTimestamp(), e.getValue());
      writer.addMutation(mutation);
    }
  }
View Full Code Here


    final Text colf = new Text(cl.getArgs()[1].getBytes(Shell.CHARSET));
    final Text colq = new Text(cl.getArgs()[2].getBytes(Shell.CHARSET));
    final Value val = new Value(cl.getArgs()[3].getBytes(Shell.CHARSET));
   
    if (cl.hasOption(insertOptAuths.getOpt())) {
      final ColumnVisibility le = new ColumnVisibility(cl.getOptionValue(insertOptAuths.getOpt()));
      Shell.log.debug("Authorization label will be set to: " + le.toString());
     
      if (cl.hasOption(timestampOpt.getOpt()))
        m.put(colf, colq, le, Long.parseLong(cl.getOptionValue(timestampOpt.getOpt())), val);
      else
        m.put(colf, colq, le, val);
View Full Code Here

   
    ColumnQualifierFilter colFilter = new ColumnQualifierFilter(cfsi, new HashSet<Column>(options.fetchedColumns));
   
    byte[] defaultSecurityLabel;
   
    ColumnVisibility cv = new ColumnVisibility(acuTableConf.get(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY));
    defaultSecurityLabel = cv.getExpression();
   
    VisibilityFilter visFilter = new VisibilityFilter(colFilter, authorizations, defaultSecurityLabel);
   
    return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, extent, acuTableConf, options.serverSideIteratorList,
        options.serverSideIteratorOptions, iterEnv, false));
View Full Code Here

 
  public static void insertList(final BatchWriter writer, final List<Entry<Key,Value>> list) throws MutationsRejectedException {
    for (Entry<Key,Value> e : list) {
      final Key key = e.getKey();
      final Mutation mutation = new Mutation(key.getRow());
      ColumnVisibility colVisibility = new ColumnVisibility(key.getColumnVisibility());
      mutation.put(key.getColumnFamily(), key.getColumnQualifier(), colVisibility, key.getTimestamp(), e.getValue());
      writer.addMutation(mutation);
    }
  }
View Full Code Here

   
    connector.tableOperations().create("shard_table");
   
    BatchWriter bw = connector.createBatchWriter("shard_table", new BatchWriterConfig());
   
    ColumnVisibility vis1 = new ColumnVisibility("vis1");
    ColumnVisibility vis3 = new ColumnVisibility("vis3");
   
    Mutation m1 = new Mutation("shard001");
    m1.put("foo", "doc02", vis1, "");
    m1.put("dog", "doc02", vis3, "");
    m1.put("cat", "doc02", vis3, "");
View Full Code Here

          String cq = "cq" + cqID;
          String cv = "vis" + cvID;
          long ts = 100 * cfID + 10 * cqID + cvID;
          String val = "val" + ts;
         
          m.put(cf, cq, new ColumnVisibility(cv), ts, val);
        }
      }
    }
    return m;
  }
View Full Code Here

    BatchWriter mutations = connector.createBatchWriter(t.toString(), bwOpts.getBatchWriterConfig());
   
    for (int i = 0; i < (entries.size() + 1) / 2; i++) {
      RowColumn rc = entries.get(i);
      Mutation m = new Mutation(rc.row);
      m.putDelete(new Text(rc.column.columnFamily), new Text(rc.column.columnQualifier), new ColumnVisibility(rc.column.getColumnVisibility()), rc.timestamp + 1);
      mutations.addMutation(m);
      rows.remove(rc);
      result++;
    }
   
View Full Code Here

    imm = new InMemoryMap(false, "/tmp");
    key = new Text();
   
    colf = new Text(String.format("%0" + colFamLen + "d", 0));
    colq = new Text(String.format("%0" + colQualLen + "d", 0));
    colv = new ColumnVisibility(String.format("%0" + colVisLen + "d", 0));
  }
View Full Code Here

  private void setupDefaultSecurityLabels(KeyExtent extent) {
    if (extent.isMeta()) {
      defaultSecurityLabel = new byte[0];
    } else {
      try {
        ColumnVisibility cv = new ColumnVisibility(acuTableConf.get(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY));
        this.defaultSecurityLabel = cv.getExpression();
      } catch (Exception e) {
        log.error(e, e);
        this.defaultSecurityLabel = new byte[0];
      }
    }
View Full Code Here

 
  private static List<ColumnVisibility> visibilities;
 
  private static void initVisibilities(Opts opts) throws Exception {
    if (opts.visFile == null) {
      visibilities = Collections.singletonList(new ColumnVisibility());
      return;
    }
   
    visibilities = new ArrayList<ColumnVisibility>();
   
    FileSystem fs = FileSystem.get(new Configuration());
    BufferedReader in = new BufferedReader(new InputStreamReader(fs.open(new Path(opts.visFile))));
   
    String line;
   
    while ((line = in.readLine()) != null) {
      visibilities.add(new ColumnVisibility(line));
    }
   
    in.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.security.ColumnVisibility

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.