/* * The timestamp field is no longer really a timestamp, it is a unique id that is time based * and is similar to a pre-IV2 transaction ID except the less significant bits are set * to allow matching partition counts with IV2. It's OK, still can do 512k txns/second per * partition so plenty of headroom. */ public long getUniqueId() { StoredProcedureInvocation invocation = m_txnState.getInvocation(); if (invocation != null && invocation.getType() == ProcedureInvocationType.REPLICATED) { return invocation.getOriginalUniqueId(); } else { return m_txnState.uniqueId; } }
/* * Extract the timestamp from the timestamp field we have been passing around * that is now a unique id with a timestamp encoded in the most significant bits ala * a pre-IV2 transaction id. */ public Date getTransactionTime() { StoredProcedureInvocation invocation = m_txnState.getInvocation(); if (invocation != null && invocation.getType() == ProcedureInvocationType.REPLICATED) { return new Date(UniqueIdGenerator.getTimestampFromUniqueId(invocation.getOriginalUniqueId())); } else { return new Date(UniqueIdGenerator.getTimestampFromUniqueId(m_txnState.uniqueId)); } }