本文整理了Java中org.apache.accumulo.core.data.Range.exact
方法的一些代码示例,展示了Range.exact
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Range.exact
方法的具体详情如下:
包路径:org.apache.accumulo.core.data.Range
类名称:Range
方法名:exact
[英]Creates a range that covers an exact row.
[中]创建覆盖精确行的范围。
代码示例来源:origin: prestodb/presto
rangeValues.put(rangeToKey.get(Range.exact(entry.getKey().getRow())), parseLong(entry.getValue().toString()));
代码示例来源:origin: apache/accumulo
/**
* Creates a range that covers an exact row.
*
* @param row
* row to cover; set to null to cover all rows
* @see #exact(Text)
*/
public static Range exact(CharSequence row) {
return Range.exact(new Text(row.toString()));
}
代码示例来源:origin: apache/accumulo
/**
* Creates a range that covers an exact row and column family.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @see #exact(Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()));
}
代码示例来源:origin: apache/accumulo
/**
* Creates a range that covers an exact row, column family, and column qualifier.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @see #exact(Text, Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()));
}
代码示例来源:origin: apache/accumulo
/**
* Creates a range that covers an exact row, column family, column qualifier, and column
* visibility.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @param cv
* column visibility to cover
* @see #exact(Text, Text, Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()),
new Text(cv.toString()));
}
代码示例来源:origin: apache/accumulo
/**
* Creates a range that covers an exact row, column family, column qualifier, column visibility,
* and timestamp.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @param cv
* column visibility to cover
* @param ts
* timestamp to cover
* @see #exact(Text, Text, Text, Text, long)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv,
long ts) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()),
new Text(cv.toString()), ts);
}
代码示例来源:origin: apache/accumulo
protected Status getStatus(String file, ReplicationTarget target)
throws ReplicationTableOfflineException, InvalidProtocolBufferException {
Scanner s = ReplicationTable.getScanner(context);
s.setRange(Range.exact(file));
s.fetchColumn(WorkSection.NAME, target.toText());
return Status.parseFrom(Iterables.getOnlyElement(s).getValue().get());
}
}
代码示例来源:origin: apache/accumulo
boolean checkConditions(SortedKeyValueIterator<Key,Value> systemIter,
ServerConditionalMutation scm) throws IOException {
boolean add = true;
for (TCondition tc : scm.getConditions()) {
Range range;
if (tc.hasTimestamp)
range = Range.exact(new Text(scm.getRow()), new Text(tc.getCf()), new Text(tc.getCq()),
new Text(tc.getCv()), tc.getTs());
else
range = Range.exact(new Text(scm.getRow()), new Text(tc.getCf()), new Text(tc.getCq()),
new Text(tc.getCv()));
SortedKeyValueIterator<Key,Value> iter = buildIterator(systemIter, tc);
ByteSequence cf = new ArrayByteSequence(tc.getCf());
iter.seek(range, Collections.singleton(cf), true);
Value val = null;
if (iter.hasTop()) {
val = iter.getTopValue();
}
if ((val == null ^ tc.getVal() == null)
|| (val != null && !Arrays.equals(tc.getVal(), val.get()))) {
add = false;
break;
}
}
return add;
}
代码示例来源:origin: apache/accumulo
workScanner.setRange(Range.exact(file));
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Creates a range that covers an exact row.
*
* @param row
* row to cover; set to null to cover all rows
* @see #exact(Text)
*/
public static Range exact(CharSequence row) {
return Range.exact(new Text(row.toString()));
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Creates a range that covers an exact row and column family.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @see #exact(Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()));
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Creates a range that covers an exact row, column family, and column qualifier.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @see #exact(Text, Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()));
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Creates a range that covers an exact row, column family, column qualifier, and column
* visibility.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @param cv
* column visibility to cover
* @see #exact(Text, Text, Text, Text)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()),
new Text(cv.toString()));
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
/**
* Creates a range that covers an exact row, column family, column qualifier, column visibility,
* and timestamp.
*
* @param row
* row row to cover
* @param cf
* column family to cover
* @param cq
* column qualifier to cover
* @param cv
* column visibility to cover
* @param ts
* timestamp to cover
* @see #exact(Text, Text, Text, Text, long)
*/
public static Range exact(CharSequence row, CharSequence cf, CharSequence cq, CharSequence cv,
long ts) {
return Range.exact(new Text(row.toString()), new Text(cf.toString()), new Text(cq.toString()),
new Text(cv.toString()), ts);
}
代码示例来源:origin: apache/fluo
private void dumpRow(String row, Consumer<String> out) throws TableNotFoundException {
Scanner scanner = aClient.createScanner(getCurTableName(), Authorizations.EMPTY);
scanner.setRange(Range.exact(row));
for (Entry<Key, Value> entry : scanner) {
out.accept(FluoFormatter.toString(entry));
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-tserver
protected Status getStatus(String file, ReplicationTarget target)
throws ReplicationTableOfflineException, AccumuloException, AccumuloSecurityException,
InvalidProtocolBufferException {
Scanner s = ReplicationTable.getScanner(context.getConnector());
s.setRange(Range.exact(file));
s.fetchColumn(WorkSection.NAME, target.toText());
return Status.parseFrom(Iterables.getOnlyElement(s).getValue().get());
}
}
代码示例来源:origin: apache/incubator-rya
/**
* Get a list of timestamps that represents all of the Prospect runs that have
* ever been performed.
*
* @param auths - The authorizations used to scan the table for prospects.
* @return A list of timestamps representing each Prospect run that was found.
* @throws TableNotFoundException The table name that was provided when this
* class was constructed does not match a table that the connector has access to.
*/
public Iterator<Long> getProspects(String[] auths) throws TableNotFoundException {
final Scanner scanner = connector.createScanner(tableName, new Authorizations(auths));
scanner.setRange(Range.exact(METADATA));
scanner.fetchColumnFamily(new Text(PROSPECT_TIME));
return new ProspectTimestampIterator( scanner.iterator() );
}
代码示例来源:origin: JHUAPL/AccumuloGraph
/**
* Return true if the element with given id exists.
* @param id
* @return
*/
public boolean elementExists(String id) {
Scanner scan = null;
try {
scan = getScanner();
scan.setRange(Range.exact(id));
scan.fetchColumnFamily(new Text(Constants.LABEL));
return new PropertyParser().parse(scan) != null;
} finally {
if (scan != null) {
scan.close();
}
}
}
代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph
/**
* Return true if the element with given id exists.
* @param id
* @return
*/
public boolean elementExists(String id) {
Scanner scan = null;
try {
scan = getScanner();
scan.setRange(Range.exact(id));
scan.fetchColumnFamily(new Text(Constants.LABEL));
return new PropertyParser().parse(scan) != null;
} finally {
if (scan != null) {
scan.close();
}
}
}
代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph
/**
* Remove the given vertex.
* Note: This uses a BatchDeleter rather than {@link Mutator}
* because it is more efficient.
* @param vertex
*/
public void deleteVertex(Vertex vertex) {
BatchDeleter deleter = null;
try {
deleter = getDeleter();
deleter.setRanges(Arrays.asList(Range.exact((String) vertex.getId())));
deleter.delete();
} catch (Exception e) {
throw new AccumuloGraphException(e);
} finally {
if (deleter != null) {
deleter.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!