Interface JournalProtocol
- All Known Implementing Classes:
JournalProtocolTranslatorPB
@Private
public interface JournalProtocol
Protocol used to journal edits to a remote node. Currently,
this is used to publish edits from the NameNode to a BackupNode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThis class is used by both the Namenode (client) and BackupNode (server) to insulate from the protocol serialization. -
Method Summary
Modifier and TypeMethodDescriptionfence(JournalInfo journalInfo, long epoch, String fencerInfo) Request to fence any other journal writers.voidjournal(JournalInfo journalInfo, long epoch, long firstTxnId, int numTxns, byte[] records) Journal edit records.voidstartLogSegment(JournalInfo journalInfo, long epoch, long txid) Notify the BackupNode that the NameNode has rolled its edit logs and is now writing a new log segment.
-
Field Details
-
versionID
static final long versionIDThis class is used by both the Namenode (client) and BackupNode (server) to insulate from the protocol serialization. If you are adding/changing DN's interface then you need to change both this class and ALSO related protocol buffer wire protocol definition in JournalProtocol.proto. For more details on protocol buffer wire protocol, please see .../org/apache/hadoop/hdfs/protocolPB/overview.html- See Also:
-
-
Method Details
-
journal
void journal(JournalInfo journalInfo, long epoch, long firstTxnId, int numTxns, byte[] records) throws IOException Journal edit records. This message is sent by the active name-node to the backup node viaEditLogBackupOutputStreamin order to synchronize meta-data changes with the backup namespace image.- Parameters:
journalInfo- journal informationepoch- marks beginning a new journal writerfirstTxnId- the first transaction of this batchnumTxns- number of transactionsrecords- byte array containing serialized journal records- Throws:
FencedException- if the resource has been fencedIOException
-
startLogSegment
Notify the BackupNode that the NameNode has rolled its edit logs and is now writing a new log segment.- Parameters:
journalInfo- journal informationepoch- marks beginning a new journal writertxid- the first txid in the new log- Throws:
FencedException- if the resource has been fencedIOException
-
fence
Request to fence any other journal writers. Older writers with at previous epoch will be fenced and can no longer perform journal operations.- Parameters:
journalInfo- journal informationepoch- marks beginning a new journal writerfencerInfo- info about fencer for debugging purposes- Throws:
FencedException- if the resource has been fencedIOException
-