use of org.apache.accumulo.core.security.ColumnVisibility in project incubator-rya by apache.
the class RyaTableMutationsFactory method deleteMutation.
protected Mutation deleteMutation(TripleRow tripleRow) {
Mutation m = new Mutation(new Text(tripleRow.getRow()));
byte[] columnFamily = tripleRow.getColumnFamily();
Text cfText = columnFamily == null ? EMPTY_TEXT : new Text(columnFamily);
byte[] columnQualifier = tripleRow.getColumnQualifier();
Text cqText = columnQualifier == null ? EMPTY_TEXT : new Text(columnQualifier);
m.putDelete(cfText, cqText, new ColumnVisibility(tripleRow.getColumnVisibility()), tripleRow.getTimestamp());
return m;
}
use of org.apache.accumulo.core.security.ColumnVisibility in project accumulo by apache.
the class ConditionTest method testHashCode.
@Test
public void testHashCode() {
ColumnVisibility cvis = new ColumnVisibility(VISIBILITY);
c.setVisibility(cvis);
c.setValue(VALUE);
c.setTimestamp(1234L);
c.setIterators(ITERATORS);
int hc1 = c.hashCode();
Condition c2 = new Condition(FAMILY, QUALIFIER);
c2.setVisibility(cvis);
c2.setValue(VALUE);
c2.setTimestamp(1234L);
c2.setIterators(ITERATORS);
assertTrue(c.equals(c2));
assertEquals(hc1, c2.hashCode());
}
use of org.apache.accumulo.core.security.ColumnVisibility in project accumulo by apache.
the class ConditionTest method testGetSetVisibility.
@Test
public void testGetSetVisibility() {
ColumnVisibility vis = new ColumnVisibility(VISIBILITY);
c.setVisibility(vis);
assertEquals(VISIBILITY, toString(c.getVisibility()));
}
use of org.apache.accumulo.core.security.ColumnVisibility in project accumulo by apache.
the class KeyTest method testVisibilityGetters.
public void testVisibilityGetters() {
Key k = new Key("r", "f", "q", "v1|(v2&v3)");
Text expression = k.getColumnVisibility();
ColumnVisibility parsed = k.getColumnVisibilityParsed();
assertEquals(expression, new Text(parsed.getExpression()));
}
use of org.apache.accumulo.core.security.ColumnVisibility in project accumulo by apache.
the class MutationTest method testPutsStringString.
@Test
public void testPutsStringString() {
Mutation m = new Mutation("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());
assertEquals("r1", new String(m.getRow()));
List<ColumnUpdate> updates = m.getUpdates();
assertEquals(8, m.size());
assertEquals(8, updates.size());
verifyColumnUpdate(updates.get(0), "cf1", "cq1", "", 0l, false, false, "v1");
verifyColumnUpdate(updates.get(1), "cf2", "cq2", "cv2", 0l, false, false, "v2");
verifyColumnUpdate(updates.get(2), "cf3", "cq3", "", 3l, true, false, "v3");
verifyColumnUpdate(updates.get(3), "cf4", "cq4", "cv4", 4l, true, false, "v4");
verifyColumnUpdate(updates.get(4), "cf5", "cq5", "", 0l, false, true, "");
verifyColumnUpdate(updates.get(5), "cf6", "cq6", "cv6", 0l, false, true, "");
verifyColumnUpdate(updates.get(6), "cf7", "cq7", "", 7l, true, true, "");
verifyColumnUpdate(updates.get(7), "cf8", "cq8", "cv8", 8l, true, true, "");
}
Aggregations