public static String encNonAscii(Notification n) { StringBuilder sb = new StringBuilder(); encNonAscii(sb, n, " "); sb.append(" "); sb.append(n.getTimestamp()); return sb.toString(); }
public Flutation newDelete(Environment env) { return newDelete(env, getTimestamp()); }
public TracingTransaction(TransactionImpl tx, Notification notification, Class<?> clazz) { this.tx = tx; this.txid = tx.getStartTs(); this.notification = notification; this.clazz = clazz; if (log.isTraceEnabled()) { log.trace("txid: {} begin() thread: {}", txid, Thread.currentThread().getId()); if (notification != null) { log.trace("txid: {} trigger: {} {} {}", txid, enc(notification.getRow()), enc(notification.getColumn()), notification.getTimestamp()); } if (clazz != null) { log.trace("txid: {} class: {}", txid, clazz.getName()); } } }
@Override public void commit() throws CommitException { try { tx.commit(); committed = true; log.trace("txid: {} commit() -> SUCCESSFUL commitTs: {}", txid, tx.getStats().getCommitTs()); } catch (CommitException ce) { log.trace("txid: {} commit() -> UNSUCCESSFUL commitTs: {}", txid, tx.getStats().getCommitTs()); if (!log.isTraceEnabled() && notification != null) { collisionLog.trace("txid: {} trigger: {} {} {}", txid, notification.getRow(), notification.getColumn(), notification.getTimestamp()); } if (!log.isTraceEnabled() && clazz != null) { collisionLog.trace("txid: {} class: {}", txid, clazz.getName()); } collisionLog.trace("txid: {} collisions: {}", txid, tx.getStats().getRejected()); throw ce; } }
private ConditionalFlutation prewrite(ConditionalFlutation cm, Bytes row, Column col, Bytes val, Bytes primaryRow, Column primaryColumn, boolean isTriggerRow) { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = isTriggerRow && col.equals(notification.getColumn()); if (isTrigger) { PrewriteIterator.enableAckCheck(iterConf, notification.getTimestamp()); } Condition cond = new FluoCondition(env, col).setIterators(iterConf); if (cm == null) { cm = new ConditionalFlutation(env, row, cond); } else { cm.addCondition(cond); } if (val != null && val != DELETE) { cm.put(col, ColumnConstants.DATA_PREFIX | startTs, val.toArray()); } cm.put(col, ColumnConstants.LOCK_PREFIX | startTs, LockValue.encode(primaryRow, primaryColumn, val != null, val == DELETE, isTriggerRow, getTransactorID())); return cm; }
endKey.setTimestamp(ColumnConstants.ACK_PREFIX | (notification.getTimestamp() + 1));