本文整理汇总了Java中org.apache.accumulo.core.security.ColumnVisibility.equals方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnVisibility.equals方法的具体用法?Java ColumnVisibility.equals怎么用?Java ColumnVisibility.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.security.ColumnVisibility
的用法示例。
在下文中一共展示了ColumnVisibility.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: alterElementVisibility
import org.apache.accumulo.core.security.ColumnVisibility; //导入方法依赖的package包/类
public boolean alterElementVisibility(Mutation m, AccumuloElement element, Visibility newVisibility) {
ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(element.getVisibility());
ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
if (currentColumnVisibility.equals(newColumnVisibility)) {
return false;
}
if (element instanceof AccumuloEdge) {
AccumuloEdge edge = (AccumuloEdge) element;
m.putDelete(AccumuloEdge.CF_SIGNAL, new Text(edge.getLabel()), currentColumnVisibility, currentTimeMillis());
m.put(AccumuloEdge.CF_SIGNAL, new Text(edge.getLabel()), newColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
m.putDelete(AccumuloEdge.CF_OUT_VERTEX, new Text(edge.getVertexId(Direction.OUT)), currentColumnVisibility, currentTimeMillis());
m.put(AccumuloEdge.CF_OUT_VERTEX, new Text(edge.getVertexId(Direction.OUT)), newColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
m.putDelete(AccumuloEdge.CF_IN_VERTEX, new Text(edge.getVertexId(Direction.IN)), currentColumnVisibility, currentTimeMillis());
m.put(AccumuloEdge.CF_IN_VERTEX, new Text(edge.getVertexId(Direction.IN)), newColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
} else if (element instanceof AccumuloVertex) {
m.putDelete(AccumuloVertex.CF_SIGNAL, EMPTY_TEXT, currentColumnVisibility, currentTimeMillis());
m.put(AccumuloVertex.CF_SIGNAL, EMPTY_TEXT, newColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
} else {
throw new IllegalArgumentException("Invalid element type: " + element);
}
return true;
}
示例2: accumuloVisibilityToVisibility
import org.apache.accumulo.core.security.ColumnVisibility; //导入方法依赖的package包/类
public static Visibility accumuloVisibilityToVisibility(ColumnVisibility columnVisibility) {
if (columnVisibility.equals(EMPTY_COLUMN_VISIBILITY)) {
return Visibility.EMPTY;
}
String columnVisibilityString = columnVisibility.toString();
return accumuloVisibilityToVisibility(columnVisibilityString);
}
示例3: alterEdgeVertexOutVertex
import org.apache.accumulo.core.security.ColumnVisibility; //导入方法依赖的package包/类
public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) {
ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
if (currentColumnVisibility.equals(newColumnVisibility)) {
return false;
}
EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN));
vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility);
vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
return true;
}
示例4: alterEdgeVertexInVertex
import org.apache.accumulo.core.security.ColumnVisibility; //导入方法依赖的package包/类
public boolean alterEdgeVertexInVertex(Mutation vertexInMutation, Edge edge, Visibility newVisibility) {
ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
if (currentColumnVisibility.equals(newColumnVisibility)) {
return false;
}
EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.OUT));
vertexInMutation.putDelete(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), currentColumnVisibility);
vertexInMutation.put(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
return true;
}
示例5: run
import org.apache.accumulo.core.security.ColumnVisibility; //导入方法依赖的package包/类
/**
* Expert users can override this method for more complete control over
* the execution of the Mapper.
*
* @param context
* @throws IOException
*/
@Override
public void run(final Context context) throws IOException, InterruptedException {
setup(context);
this.context = context;
try {
RyaStatement parentRyaStatement = nextParentRyaStatement();
RyaStatement childRyaStatement = nextChildRyaStatement();
CompareKeysResult compareKeysResult = null;
// Iteratively compare parent keys to child keys until finished
while (compareKeysResult != CompareKeysResult.FINISHED) {
compareKeysResult = compareKeys(parentRyaStatement, childRyaStatement);
// Based on how the keys compare add or delete keys and advance the child or parent iterators forward
switch (compareKeysResult) {
case ADVANCE_CHILD:
childRyaStatement = nextChildRyaStatement();
break;
case ADVANCE_PARENT:
parentRyaStatement = nextParentRyaStatement();
break;
case ADVANCE_CHILD_AND_ADD:
final RyaStatement tempChildRyaStatement = childRyaStatement;
childRyaStatement = nextChildRyaStatement();
addKey(tempChildRyaStatement, context);
break;
case ADVANCE_PARENT_AND_DELETE:
final RyaStatement tempParentRyaStatement = parentRyaStatement;
parentRyaStatement = nextParentRyaStatement();
deleteKey(tempParentRyaStatement, context);
break;
case ADVANCE_BOTH:
final ColumnVisibility cv1 = new ColumnVisibility(parentRyaStatement.getColumnVisibility());
final ColumnVisibility cv2 = new ColumnVisibility(childRyaStatement.getColumnVisibility());
// Update new column visibility now if necessary
if (!cv1.equals(cv2) && !cv2.equals(AccumuloRdfConstants.EMPTY_CV)) {
final ColumnVisibility newCv = combineColumnVisibilities(cv1, cv2);
final RyaStatement newCvRyaStatement = updateRyaStatementColumnVisibility(parentRyaStatement, newCv);
deleteKey(parentRyaStatement, context);
addKey(newCvRyaStatement, context);
}
parentRyaStatement = nextParentRyaStatement();
childRyaStatement = nextChildRyaStatement();
break;
case FINISHED:
log.info("Finished scanning parent and child tables");
break;
default:
log.error("Unknown result: " + compareKeysResult);
break;
}
}
} catch (MutationsRejectedException | TripleRowResolverException e) {
log.error("Error encountered while merging", e);
} finally {
cleanup(context);
}
}