public Flutation(Environment env, Bytes row) { super(ByteUtil.toText(row)); this.env = env; }
@Override public ColumnVisibility call() throws Exception { return new ColumnVisibility(ByteUtil.toText(colvis)); } });
public static void configureScanner(Scanner scanner) { scanner.fetchColumnFamily(ByteUtil.toText(ColumnConstants.NOTIFY_CF)); scanner.addScanIterator(new IteratorSetting(11, NotificationIterator.class)); } }
static void setupScanner(ScannerBase scanner, Set<Column> columns, long startTs) { for (Column col : columns) { if (col.isQualifierSet()) { scanner.fetchColumn(ByteUtil.toText(col.getFamily()), ByteUtil.toText(col.getQualifier())); } else { scanner.fetchColumnFamily(ByteUtil.toText(col.getFamily())); } } IteratorSetting iterConf = new IteratorSetting(10, SnapshotIterator.class); SnapshotIterator.setSnaptime(iterConf, startTs); scanner.addScanIterator(iterConf); }
public static void put(Environment env, Mutation m, Column col, long ts, byte[] val) { ColumnVisibility cv; if (env != null) { cv = env.getSharedResources().getVisCache().getCV(col.getVisibility()); } else if (col.getVisibility().length() == 0) { cv = VisibilityCache.EMPTY_VIS; } else { cv = new ColumnVisibility(ByteUtil.toText(col.getVisibility())); } m.put(ByteUtil.toText(col.getFamily()), ByteUtil.toText(col.getQualifier()), cv, ts, new Value( val)); } }
private BatchScanner setupBatchScanner(Collection<Bytes> rows, Set<Column> columns) { BatchScanner scanner; try { // TODO hardcoded number of threads! // one thread is probably good.. going for throughput scanner = env.getConnector().createBatchScanner(env.getTable(), env.getAuthorizations(), 1); } catch (TableNotFoundException e) { throw new RuntimeException(e); } scanner.clearColumns(); scanner.clearScanIterators(); List<Range> ranges = new ArrayList<>(rows.size()); for (Bytes row : rows) { ranges.add(Range.exact(ByteUtil.toText(row))); } scanner.setRanges(ranges); SnapshotScanner.setupScanner(scanner, columns, startTs); return scanner; }
/** * Converts from a Fluo RowColumn to a Accumulo Key * * @param rc RowColumn * @return Key */ public static Key toKey(RowColumn rc) { if ((rc == null) || (rc.getRow().equals(Bytes.EMPTY))) { return null; } Text row = ByteUtil.toText(rc.getRow()); if ((rc.getColumn().equals(Column.EMPTY)) || !rc.getColumn().isFamilySet()) { return new Key(row); } Text cf = ByteUtil.toText(rc.getColumn().getFamily()); if (!rc.getColumn().isQualifierSet()) { return new Key(row, cf); } Text cq = ByteUtil.toText(rc.getColumn().getQualifier()); if (!rc.getColumn().isVisibilitySet()) { return new Key(row, cf, cq); } Text cv = ByteUtil.toText(rc.getColumn().getVisibility()); return new Key(row, cf, cq, cv); }
groups.put("notify", Collections.singleton(ByteUtil.toText(ColumnConstants.NOTIFY_CF))); conn.tableOperations().setLocalityGroups(config.getAccumuloTable(), groups);