rangeValues.put(rangeToKey.get(Range.exact(entry.getKey().getRow())), parseLong(entry.getValue().toString()));
/** * 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())); }
/** * 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())); }
/** * 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())); }
/** * 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())); }
/** * 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); }
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()); } }
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; }
workScanner.setRange(Range.exact(file));
/** * 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())); }
/** * 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())); }
/** * 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())); }
/** * 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())); }
/** * 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); }
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)); } }
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()); } }
/** * 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() ); }
/** * 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(); } } }
/** * 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(); } } }
/** * 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(); } } }