/** * Finds all queries that are being managed by this instance of Fluo that * are also being exported to the provided instance of Accumulo. * * @param fluo - The Fluo instance that will be searched. (not null) * @return An ascending alphabetically sorted list of the Query IDs being * managed by the Fluo app and exported to an instance of Accumulo. */ public List<String> listQueryIds(final FluoClient fluo) { checkNotNull(fluo); final List<String> queryIds = new ArrayList<>(); try(Snapshot snap = fluo.newSnapshot() ) { // Create an iterator that iterates over the QUERY_ID column. final CellScanner cellScanner = snap.scanner().fetch( FluoQueryColumns.QUERY_NODE_ID).build(); for (RowColumnValue rcv : cellScanner) { queryIds.add(rcv.getsValue()); //TODO this was doing a snap.get that seemed unnecessary } } // Sort them alphabetically. Collections.sort(queryIds); return queryIds; } }
/** * Finds all queries that are being managed by this instance of Fluo that * are also being exported to the provided instance of Accumulo. * * @param fluo - The Fluo instance that will be searched. (not null) * @return An ascending alphabetically sorted list of the Query IDs being * managed by the Fluo app and exported to an instance of Accumulo. */ public List<String> listQueryIds(final FluoClient fluo) { checkNotNull(fluo); final List<String> queryIds = new ArrayList<>(); try(Snapshot snap = fluo.newSnapshot() ) { // Create an iterator that iterates over the QUERY_ID column. final CellScanner cellScanner = snap.scanner().fetch( FluoQueryColumns.QUERY_NODE_ID).build(); for (RowColumnValue rcv : cellScanner) { queryIds.add(rcv.getsValue()); //TODO this was doing a snap.get that seemed unnecessary } } // Sort them alphabetically. Collections.sort(queryIds); return queryIds; } }
sb.append(rcv.getColumn()); sb.append("\t"); sb.append(rcv.getsValue()); System.out.println(sb.toString());
static void setAlias(TransactionBase tx, String node, String alias) { tx.set("r:" + node, new Column("node", "alias"), alias); CellScanner scanner = tx.scanner().over(Span.prefix("r:" + node + ":")).build(); for (RowColumnValue rcv : scanner) { String otherNode = rcv.getsRow().split(":")[2]; String[] aliases = rcv.getsValue().split(":"); if (aliases.length != 2) { throw new RuntimeException("bad alias " + rcv); } if (!alias.equals(aliases[0])) { tx.delete("d:" + aliases[0] + ":" + aliases[1], new Column("edge", node + ":" + otherNode)); tx.delete("d:" + aliases[1] + ":" + aliases[0], new Column("edge", otherNode + ":" + node)); addEdge(tx, node, otherNode, alias, aliases[1]); } } }
rcv.getColumn().getsFamily(), rcv.getColumn().getsQualifier(), rcv.getsValue()); return false;