Package org.apache.accumulo.core.security

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


 
  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)), Constants.UTF8));
   
    String line;
   
    while ((line = in.readLine()) != null) {
      visibilities.add(new ColumnVisibility(line));
    }
   
    in.close();
  }
View Full Code Here


   
    long lastFlushTime = System.currentTimeMillis();
   
    out: while (true) {
      // generate first set of nodes
      ColumnVisibility cv = getVisibility(r);

      for (int index = 0; index < flushInterval; index++) {
        long rowLong = genLong(opts.min, opts.max, r);
        prevRows[index] = rowLong;
        firstRows[index] = rowLong;
View Full Code Here

    int maxColF = 32767;
    int maxColQ = 32767;
    long count = 0;
    long totalBytes = 0;
   
    ColumnVisibility cv = new ColumnVisibility();

    // start timer
    startTimer();
   
    // write specified number of entries
View Full Code Here

   
    // append column qualifier
    appendText(sb, key.getColumnQualifier(buffer)).append(" ");
   
    // append visibility expression
    sb.append(new ColumnVisibility(key.getColumnVisibility(buffer)));
   
    // append timestamp
    if (showTimestamps)
      sb.append(" ").append(key.getTimestamp());
   
View Full Code Here

      Iterator<Entry<Key,Value>> iter = super.iterator();
      while (iter.hasNext()) {
        Entry<Key,Value> next = iter.next();
        Key k = next.getKey();
        Mutation m = new Mutation(k.getRow());
        m.putDelete(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp());
        bw.addMutation(m);
      }
    } finally {
      if (bw != null)
        bw.close();
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(BatchWriter bw, List<Entry<Key,Value>> list) throws Exception {
    for (Entry<Key,Value> e : list) {
      Key k = e.getKey();
      Mutation m = new Mutation(k.getRow());
      m.put(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp(), e.getValue());
      bw.addMutation(m);
    }
  }
View Full Code Here

    private int printMutation(Text table, Mutation m) {
      if (log.isTraceEnabled()) {
        log.trace(String.format("Table %s row key: %s", table, hexDump(m.getRow())));
        for (ColumnUpdate cu : m.getUpdates()) {
          log.trace(String.format("Table %s column: %s:%s", table, hexDump(cu.getColumnFamily()), hexDump(cu.getColumnQualifier())));
          log.trace(String.format("Table %s security: %s", table, new ColumnVisibility(cu.getColumnVisibility()).toString()));
          log.trace(String.format("Table %s value: %s", table, hexDump(cu.getValue())));
        }
      }
      return m.getUpdates().size();
    }
View Full Code Here

    String instance = args[0];
    String zooKeepers = args[1];
    String user = args[2];
    String pass = args[3];
    String dataTable = args[4];
    ColumnVisibility colvis = new ColumnVisibility(args[5]);
    int chunkSize = Integer.parseInt(args[6]);

    Connector conn = new ZooKeeperInstance(instance, zooKeepers).getConnector(user, pass.getBytes());
    if (!conn.tableOperations().exists(dataTable)) {
      conn.tableOperations().create(dataTable);
View Full Code Here

  public void test4() {
    Value dv = new Value();
    TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
    ArrayList<Filter> f = new ArrayList<Filter>();
   
    ColumnVisibility le1 = new ColumnVisibility("L1");
    ColumnVisibility le2 = new ColumnVisibility("L0&OFFICIAL");
    ColumnVisibility le3 = new ColumnVisibility("L1&L2");
    ColumnVisibility le4 = new ColumnVisibility("L1&L2&G1");
    ColumnVisibility[] lea = {le1, le2, le3, le4};
    Authorizations auths = new Authorizations("L1", "L2", "L0", "OFFICIAL");
    VisibilityFilter a = new VisibilityFilter(auths, le2.getExpression());
    f.add(a);
   
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.