Package org.apache.accumulo.core.security

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


        break;
      case WRITE:
        String key = SecurityHelper.getLastKey(state) + "1";
        Mutation m = new Mutation(new Text(key));
        for (String s : SecurityHelper.getAuthsArray()) {
          m.put(new Text(), new Text(), new ColumnVisibility(s), new Value("value".getBytes()));
        }
        BatchWriter writer;
        try {
          writer = conn.createBatchWriter(tableName, 9000l, 0l, 1);
        } catch (TableNotFoundException tnfe) {
View Full Code Here


 
  private static List<ColumnVisibility> visibilities;
 
  private static void initVisibilities() throws Exception {
    if (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(visFile))));
   
    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(min, max, r);
        prevRows[index] = rowLong;
        firstRows[index] = rowLong;
View Full Code Here

@Deprecated
public class NoLabelFilter implements Filter, OptionDescriber {
 
  @Override
  public boolean accept(Key k, Value v) {
    ColumnVisibility label = new ColumnVisibility(k.getColumnVisibility());
    return label.getExpression().length > 0;
   
  }
View Full Code Here

    Boolean b = (Boolean) cache.get(testVis);
    if (b != null)
      return b;
   
    try {
      Boolean bb = ve.evaluate(new ColumnVisibility(testVis));
      cache.put(new Text(testVis), bb);
      return bb;
    } catch (VisibilityParseException e) {
      log.error("Parse Error", e);
      return false;
View Full Code Here

    BatchWriter bw = uconn.createBatchWriter("table1", 10000, 1000000, 2);
   
    UUID uuid = UUID.randomUUID();
   
    Mutation m = new Mutation(uuid.toString());
    m.put("META", "SIZE", new ColumnVisibility("A|B"), "8");
    m.put("META", "CRC", new ColumnVisibility("A|B"), "456");
    m.put("META", "COUNT", new ColumnVisibility("A|B"), "1");
    m.put("DATA", "IMG", new ColumnVisibility("A&B"), "ABCDEFGH");
   
    bw.addMutation(m);
    bw.flush();
   
    m = new Mutation(uuid.toString());
    m.put("META", "COUNT", new ColumnVisibility("A|B"), "1");
    m.put("META", "CRC", new ColumnVisibility("A|B"), "123");
    bw.addMutation(m);
   
    bw.close();
   
    int count = 0;
View Full Code Here

  @Test
  public void testPuts() {
    Mutation m = new Mutation(new Text("r1"));
   
    m.put(nt("cf1"), nt("cq1"), nv("v1"));
    m.put(nt("cf2"), nt("cq2"), new ColumnVisibility("cv2"), nv("v2"));
    m.put(nt("cf3"), nt("cq3"), 3l, nv("v3"));
    m.put(nt("cf4"), nt("cq4"), new ColumnVisibility("cv4"), 4l, nv("v4"));
   
    m.putDelete(nt("cf5"), nt("cq5"));
    m.putDelete(nt("cf6"), nt("cq6"), new ColumnVisibility("cv6"));
    m.putDelete(nt("cf7"), nt("cq7"), 7l);
    m.putDelete(nt("cf8"), nt("cq8"), new ColumnVisibility("cv8"), 8l);
   
    assertEquals(8, m.size());
   
    List<ColumnUpdate> updates = m.getUpdates();
   
View Full Code Here

  @Test
  public void testPutsString() {
    Mutation m = new Mutation(new Text("r1"));
   
    m.put("cf1", "cq1", nv("v1"));
    m.put("cf2", "cq2", new ColumnVisibility("cv2"), nv("v2"));
    m.put("cf3", "cq3", 3l, nv("v3"));
    m.put("cf4", "cq4", new ColumnVisibility("cv4"), 4l, nv("v4"));
   
    m.putDelete("cf5", "cq5");
    m.putDelete("cf6", "cq6", new ColumnVisibility("cv6"));
    m.putDelete("cf7", "cq7", 7l);
    m.putDelete("cf8", "cq8", new ColumnVisibility("cv8"), 8l);
   
    assertEquals(8, m.size());
   
    List<ColumnUpdate> updates = m.getUpdates();
   
View Full Code Here

  @Test
  public void testPutsStringString() {
    Mutation m = new Mutation(new Text("r1"));
   
    m.put("cf1", "cq1", "v1");
    m.put("cf2", "cq2", new ColumnVisibility("cv2"), "v2");
    m.put("cf3", "cq3", 3l, "v3");
    m.put("cf4", "cq4", new ColumnVisibility("cv4"), 4l, "v4");
   
    m.putDelete("cf5", "cq5");
    m.putDelete("cf6", "cq6", new ColumnVisibility("cv6"));
    m.putDelete("cf7", "cq7", 7l);
    m.putDelete("cf8", "cq8", new ColumnVisibility("cv8"), 8l);
   
    assertEquals(8, m.size());
   
    List<ColumnUpdate> updates = m.getUpdates();
   
View Full Code Here

   */
  @Test
  public void testMultipleReadFieldsCalls() throws IOException {
    // Create test mutations and write them to a byte output stream
    Mutation m1 = new Mutation("row1");
    m1.put("cf1.1", "cq1.1", new ColumnVisibility("A|B"), "val1.1");
    m1.put("cf1.2", "cq1.2", new ColumnVisibility("C|D"), "val1.2");
    byte[] val1_3 = new byte[Mutation.VALUE_SIZE_COPY_CUTOFF + 3];
    Arrays.fill(val1_3, (byte) 3);
    m1.put("cf1.3", "cq1.3", new ColumnVisibility("E|F"), new String(val1_3));
    int size1 = m1.size();
    long nb1 = m1.numBytes();
   
    Mutation m2 = new Mutation("row2");
    byte[] val2 = new byte[Mutation.VALUE_SIZE_COPY_CUTOFF + 2];
    Arrays.fill(val2, (byte) 2);
    m2.put("cf2", "cq2", new ColumnVisibility("G|H"), 1234, new String(val2));
    int size2 = m2.size();
    long nb2 = m2.numBytes();
   
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(bos);
View Full Code Here

TOP

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

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.