/** * Applies the journal entry, handling empty entries and multi-entries. * * @param entry the entry to apply */ private void applyEntry(JournalEntry entry) { Preconditions.checkState( entry.getAllFields().size() <= 1 || (entry.getAllFields().size() == 2 && entry.hasSequenceNumber()), "Raft journal entries should never set multiple fields in addition to sequence " + "number, but found %s", entry); if (entry.getJournalEntriesCount() > 0) { // This entry aggregates multiple entries. for (JournalEntry e : entry.getJournalEntriesList()) { applyEntry(e); } } else if (entry.toBuilder().clearSequenceNumber().build() .equals(JournalEntry.getDefaultInstance())) { // Ignore empty entries, they are created during snapshotting. } else { printEntry(entry); } }
/** * Applies the journal entry, ignoring empty entries and expanding multi-entries. * * @param entry the entry to apply */ private void applyEntry(JournalEntry entry) { Preconditions.checkState( entry.getAllFields().size() <= 1 || (entry.getAllFields().size() == 2 && entry.hasSequenceNumber()), "Raft journal entries should never set multiple fields in addition to sequence " + "number, but found %s", entry); if (entry.getJournalEntriesCount() > 0) { // This entry aggregates multiple entries. for (JournalEntry e : entry.getJournalEntriesList()) { applyEntry(e); } } else if (entry.getSequenceNumber() < 0) { // Negative sequence numbers indicate special entries used to indicate that a new primary is // starting to serve. mLastPrimaryStartSequenceNumber = entry.getSequenceNumber(); } else if (entry.toBuilder().clearSequenceNumber().build() .equals(JournalEntry.getDefaultInstance())) { // Ignore empty entries, they are created during snapshotting. } else { applySingleEntry(entry); } }
public Builder mergeFrom(alluxio.proto.journal.Journal.JournalEntry other) { if (other == alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance()) return this; if (other.hasSequenceNumber()) { setSequenceNumber(other.getSequenceNumber());
public Builder mergeFrom(alluxio.proto.journal.Journal.JournalEntry other) { if (other == alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance()) return this; if (other.hasSequenceNumber()) { setSequenceNumber(other.getSequenceNumber());
result = result && (hasSequenceNumber() == other.hasSequenceNumber()); if (hasSequenceNumber()) { result = result && (getSequenceNumber() == other.getSequenceNumber());
if (hasSequenceNumber()) { hash = (37 * hash) + SEQUENCE_NUMBER_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(