@VisibleForTesting static boolean shouldProcess(Notification notification, int divisor, int remainder) { byte[] cfcq = NotificationUtil.encodeCol(notification.getColumn()); return NotificationHashFilter.accept(ByteUtil.toByteSequence(notification.getRow()), new ArrayByteSequence(cfcq), divisor, remainder); }
@VisibleForTesting static boolean shouldProcess(Notification notification, int divisor, int remainder) { byte[] cfcq = NotificationUtil.encodeCol(notification.getColumn()); return NotificationHashFilter.accept(ByteUtil.toByteSequence(notification.getRow()), new ArrayByteSequence(cfcq), divisor, remainder); }
public static void put(Environment env, Mutation m, Column col, long ts) { ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(col); m.put(NOTIFY_CF_ARRAY, encodeCol(col), cv, encodeTs(ts, false), TransactionImpl.EMPTY); }
public static void put(Environment env, Mutation m, Column col, long ts) { ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(col); m.put(NOTIFY_CF_ARRAY, encodeCol(col), cv, encodeTs(ts, false), TransactionImpl.EMPTY); }
public static long getNotificationTS(Environment env, String row, Column col) { Scanner scanner; try { scanner = env.getAccumuloClient().createScanner(env.getTable(), env.getAuthorizations()); } catch (TableNotFoundException e) { throw new RuntimeException(e); } IteratorSetting iterCfg = new IteratorSetting(11, NotificationIterator.class); scanner.addScanIterator(iterCfg); Text cv = ByteUtil.toText(col.getVisibility()); scanner.setRange(SpanUtil.toRange(Span.prefix(row))); scanner.fetchColumn(ByteUtil.toText(ColumnConstants.NOTIFY_CF), new Text(NotificationUtil.encodeCol(col))); for (Entry<Key, org.apache.accumulo.core.data.Value> entry : scanner) { if (entry.getKey().getColumnVisibility().equals(cv)) { return Notification.from(entry.getKey()).getTimestamp(); } } throw new RuntimeException("No notification found"); }
public Flutation newDelete(Environment env, long ts) { Flutation m = new Flutation(env, rowCol.getRow()); ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(rowCol.getColumn()); m.put(NOTIFY_CF_ARRAY, encodeCol(rowCol.getColumn()), cv, encodeTs(ts, true), TransactionImpl.EMPTY); return m; }
public Flutation newDelete(Environment env, long ts) { Flutation m = new Flutation(env, rowCol.getRow()); ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(rowCol.getColumn()); m.put(NOTIFY_CF_ARRAY, encodeCol(rowCol.getColumn()), cv, encodeTs(ts, true), TransactionImpl.EMPTY); return m; }