Beispiel #1
0
 /** @see Loggable#writeToLog */
 public void writeToLog(ByteBuffer buffer) {
   LogUtils.writePackedLong(buffer, matchpointVLSN.getSequence());
   LogUtils.writePackedLong(buffer, matchpointLSN);
   LogUtils.writeTimestamp(buffer, time);
   LogUtils.writePackedInt(buffer, activeTxnIds.size());
   for (Long id : activeTxnIds) {
     LogUtils.writePackedLong(buffer, id);
   }
 }
Beispiel #2
0
  /** @see Loggable#getLogSize */
  public int getLogSize() {
    int size =
        LogUtils.getPackedLongLogSize(matchpointVLSN.getSequence())
            + LogUtils.getPackedLongLogSize(matchpointLSN)
            + LogUtils.getTimestampLogSize(time)
            + LogUtils.getPackedIntLogSize(activeTxnIds.size());

    for (Long id : activeTxnIds) {
      size += LogUtils.getPackedLongLogSize(id);
    }

    return size;
  }
Beispiel #3
0
  /** @see Loggable#dumpLog */
  public void dumpLog(StringBuilder sb, boolean verbose) {
    sb.append(" matchpointVLSN=").append(matchpointVLSN.getSequence());
    sb.append(" matchpointLSN=");
    sb.append(DbLsn.getNoFormatString(matchpointLSN));

    /* Make sure the active txns are listed in order, partially for the sake
     * of the LoggableTest unit test, which expects the toString() for two
     * equivalent objects to always display the same, and partially for
     * ease of debugging.
     */
    List<Long> displayTxnIds = new ArrayList<Long>(activeTxnIds);
    Collections.sort(displayTxnIds);
    sb.append(" activeTxnIds=").append(displayTxnIds);
    sb.append("\" time=\"").append(time);
  }