public static void formJobTerminateLogRecord(LogRecord logRecord, long txnId, boolean isCommit) { logRecord.setLogType(isCommit ? LogType.JOB_COMMIT : LogType.ABORT); logRecord.setDatasetId(-1); logRecord.setPKHashValue(-1); logRecord.setTxnId(txnId); logRecord.computeAndSetLogSize(); }
public static void formMarkerLogRecord(LogRecord logRecord, ITransactionContext txnCtx, int datasetId, int resourcePartition, ByteBuffer marker) { logRecord.setTxnCtx(txnCtx); logRecord.setLogSource(LogSource.LOCAL); logRecord.setLogType(LogType.MARKER); logRecord.setTxnId(txnCtx.getTxnId().getId()); logRecord.setDatasetId(datasetId); logRecord.setResourcePartition(resourcePartition); marker.get(); // read the first byte since it is not part of the marker object logRecord.setMarker(marker); logRecord.computeAndSetLogSize(); } }
public static void formFlushLogRecord(LogRecord logRecord, int datasetId, int resourcePartition, long flushingComponentMinId, long flushingComponentMaxId, PrimaryIndexOperationTracker opTracker) { logRecord.setLogType(LogType.FLUSH); logRecord.setTxnId(-1); logRecord.setDatasetId(datasetId); logRecord.setResourcePartition(resourcePartition); logRecord.setFlushingComponentMinId(flushingComponentMinId); logRecord.setFlushingComponentMaxId(flushingComponentMaxId); logRecord.setOpTracker(opTracker); logRecord.computeAndSetLogSize(); }
public static void formEntityCommitLogRecord(LogRecord logRecord, ITransactionContext txnCtx, int datasetId, int PKHashValue, ITupleReference PKValue, int[] PKFields, int resourcePartition, byte entityCommitType) { logRecord.setTxnCtx(txnCtx); logRecord.setLogType(entityCommitType); logRecord.setTxnId(txnCtx.getTxnId().getId()); logRecord.setDatasetId(datasetId); logRecord.setPKHashValue(PKHashValue); logRecord.setPKFieldCnt(PKFields.length); logRecord.setPKValue(PKValue); logRecord.setPKFields(PKFields); logRecord.setResourcePartition(resourcePartition); logRecord.computeAndSetPKValueSize(); logRecord.computeAndSetLogSize(); }