本文整理汇总了Java中org.apache.accumulo.core.data.Range.exact方法的典型用法代码示例。如果您正苦于以下问题:Java Range.exact方法的具体用法?Java Range.exact怎么用?Java Range.exact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.data.Range
的用法示例。
在下文中一共展示了Range.exact方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldTransformRangeWhenUsingRangeNotExact
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
@Test
public void shouldTransformRangeWhenUsingRangeNotExact() {
try {
// Create SimpleEntity
final Entity simpleEntity = new Entity.Builder()
.group(TestGroups.ENTITY)
.vertex("1")
.build();
final Key key = elementConverter.getKeyFromEntity(simpleEntity);
final Range range = Range.exact(key.getRow());
final org.apache.hadoop.util.bloom.Key expectedBloomKey1 = new org.apache.hadoop.util.bloom.Key(elementFunctor.getVertexFromRangeKey(key.getRowData().getBackingArray()));
assertNotNull(elementFunctor.transform(range));
assertEquals(expectedBloomKey1, elementFunctor.transform(range));
} catch (final AccumuloElementConversionException e) {
fail("ConversionException " + e);
}
}
示例2: shouldTransformRangeWhenUsingRangeNotExact
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
@Test
public void shouldTransformRangeWhenUsingRangeNotExact() {
try {
// Create SimpleEntity
final Entity simpleEntity = new Entity.Builder().group(TestGroups.ENTITY)
.vertex("1")
.build();
final Key key = elementConverter.getKeyFromEntity(simpleEntity);
final Range range = Range.exact(key.getRow());
final org.apache.hadoop.util.bloom.Key expectedBloomKey1 = new org.apache.hadoop.util.bloom.Key(elementFunctor.getVertexFromRangeKey(key.getRowData().getBackingArray()));
assertNotNull(elementFunctor.transform(range));
assertEquals(expectedBloomKey1, elementFunctor.transform(range));
} catch (final AccumuloElementConversionException e) {
fail("ConversionException " + e);
}
}
示例3: visit
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
@Override
public void visit(In obj) {
visitNode(obj.getLeftExpression());
Column column = (Column)this.onGoingExpression.pop();
visitNodes(obj.getRightExpressions());
if (isPartOfPrimaryKey(column)) {
Object prevExpr = null;
// NOTE: we are popping in reverse order to IN stmt
for (int i = 0; i < obj.getRightExpressions().size(); i++) {
Object rightExpr = this.onGoingExpression.pop();
Range range = Range.exact(rightExpr.toString());
if (obj.isNegated()) {
if (prevExpr == null) {
this.ranges.add(new Range(rightExpr.toString(), false, null, true));
this.ranges.add(new Range(null, true, rightExpr.toString(), false));
}
else {
this.ranges.remove(this.ranges.size()-1);
this.ranges.add(new Range(rightExpr.toString(), false, prevExpr.toString(), false));
this.ranges.add(new Range(null, true, rightExpr.toString(), false));
}
prevExpr = rightExpr;
}
else {
this.ranges.add(range);
}
}
}
else {
this.doScanEvaluation = true;
}
}