/** * Converts an Accumulo Range to a Fluo Span * * @param range Range * @return Span */ public static Span toSpan(Range range) { return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(), toRowColumn(range.getEndKey()), range.isEndKeyInclusive()); }
waitTime = Math.min(MAX_WAIT_TIME, waitTime * 2); RowColumn start = SpanUtil.toRowColumn(locks.get(0).getKey()); RowColumn end = SpanUtil.toRowColumn(locks.get(locks.size() - 1).getKey()).following(); RowColumn start = SpanUtil.toRowColumn(lockEntry.getKey());
private static void commitColumns(Environment env, PrimaryRowColumn prc, List<Entry<Key, Value>> value, long commitTs, Map<ByteSequence, Mutation> mutations) { for (Entry<Key, Value> entry : value) { if (isPrimary(prc, entry.getKey())) { continue; } long lockTs = entry.getKey().getTimestamp() & ColumnConstants.TIMESTAMP_MASK; // TODO may be that a stronger sanity check that could be done here if (commitTs < lockTs) { throw new IllegalStateException("bad commitTs : " + entry.getKey() + " (" + commitTs + "<" + lockTs + ")"); } Mutation mut = getMutation(entry.getKey().getRowData(), mutations); Column col = SpanUtil.toRowColumn(entry.getKey()).getColumn(); LockValue lv = new LockValue(entry.getValue().get()); ColumnUtil.commitColumn(env, lv.isTrigger(), false, col, lv.isWrite(), lv.isDelete(), lockTs, commitTs, env.getObservers().keySet(), mut); } }
private static boolean isPrimary(PrimaryRowColumn prc, Key k) { return prc.prow.equals(ByteUtil.toBytes(k.getRowData())) && prc.pcol.equals(SpanUtil.toRowColumn(k).getColumn()); } }