this.size += (4 + keyBytes.length); saveDrId(drId); initVersionsBytes(tag, lastModifiedTime);
public void initialize(long oplogKeyId, byte[] keyBytes, byte[] valueBytes, byte userBits, long drId, VersionTag tag, boolean notToUseUserBits) throws IOException { this.opCode = OPLOG_MOD_ENTRY_WITH_KEY_1ID; this.size = 1;// for the opcode saveUserBits(notToUseUserBits, userBits); this.keyBytes = keyBytes; this.value = new DiskEntry.Helper.CompactorValueWrapper(valueBytes, valueBytes.length); if (this.userBits == 1 && this.value.getLength() == 0) { throw new IllegalStateException("userBits==1 and valueLength is 0"); } this.needsValue = EntryBits.isNeedsValue(this.userBits); this.size += (4 + this.keyBytes.length); saveDrId(drId); initVersionsBytes(tag); if (this.needsValue) { this.size += 4 + this.value.getLength(); } this.deltaIdBytesLength = 0; { long delta = calcDelta(oplogKeyId, this.opCode); this.deltaIdBytesLength = bytesNeeded(delta); this.size += this.deltaIdBytesLength; this.opCode += this.deltaIdBytesLength - 1; for (int i = this.deltaIdBytesLength - 1; i >= 0; i--) { this.deltaIdBytes[i] = (byte) (delta & 0xFF); delta >>= 8; } } this.size++; // for END_OF_RECORD_ID }
initVersionsBytes(entry); } else if (this.opCode == OPLOG_NEW_ENTRY_0ID) { needsKey = true; this.needsValue = EntryBits.isNeedsValue(this.userBits); initVersionsBytes(entry); } else if (this.opCode == OPLOG_DEL_ENTRY_1ID) { needsKey = false;
initVersionsBytes(entry); } else if (this.opCode == OPLOG_NEW_ENTRY_0ID) { needsKey = true; this.needsValue = EntryBits.isNeedsValue(this.userBits); initVersionsBytes(entry); } else if (this.opCode == OPLOG_DEL_ENTRY_1ID) { needsKey = false;