/** * <pre> * This journal entry is a list of other entries. when a journal entry * contains other journal entries, all other optional fields must be unset. * </pre> * * <code>repeated .alluxio.proto.journal.JournalEntry journal_entries = 39;</code> */ public alluxio.proto.journal.Journal.JournalEntry.Builder addJournalEntriesBuilder() { return getJournalEntriesFieldBuilder().addBuilder( alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance()); } /**
/** * <pre> * This journal entry is a list of other entries. when a journal entry * contains other journal entries, all other optional fields must be unset. * </pre> * * <code>repeated .alluxio.proto.journal.JournalEntry journal_entries = 39;</code> */ public alluxio.proto.journal.Journal.JournalEntry.Builder addJournalEntriesBuilder( int index) { return getJournalEntriesFieldBuilder().addBuilder( index, alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance()); } /**
/** * 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); } }
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 alluxio.proto.journal.Journal.JournalEntry getDefaultInstanceForType() { return alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance(); }
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());
/** * 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 alluxio.proto.journal.Journal.JournalEntry getDefaultInstanceForType() { return alluxio.proto.journal.Journal.JournalEntry.getDefaultInstance(); }