Class JournalProtocolTranslatorPB
java.lang.Object
org.apache.hadoop.hdfs.protocolPB.JournalProtocolTranslatorPB
- All Implemented Interfaces:
Closeable,AutoCloseable,JournalProtocol,org.apache.hadoop.ipc.ProtocolMetaInterface
@Private
@Stable
public class JournalProtocolTranslatorPB
extends Object
implements org.apache.hadoop.ipc.ProtocolMetaInterface, JournalProtocol, Closeable
This class is the client side translator to translate the requests made on
JournalProtocol interfaces to the RPC server implementing
JournalProtocolPB.-
Field Summary
Fields inherited from interface org.apache.hadoop.hdfs.server.protocol.JournalProtocol
versionID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()fence(JournalInfo journalInfo, long epoch, String fencerInfo) Request to fence any other journal writers.booleanisMethodSupported(String methodName) 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.
-
Constructor Details
-
JournalProtocolTranslatorPB
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
journal
public void journal(JournalInfo journalInfo, long epoch, long firstTxnId, int numTxns, byte[] records) throws IOException Description copied from interface:JournalProtocolJournal 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.- Specified by:
journalin interfaceJournalProtocol- 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
-
fence
public FenceResponse fence(JournalInfo journalInfo, long epoch, String fencerInfo) throws IOException Description copied from interface:JournalProtocolRequest to fence any other journal writers. Older writers with at previous epoch will be fenced and can no longer perform journal operations.- Specified by:
fencein interfaceJournalProtocol- Parameters:
journalInfo- journal informationepoch- marks beginning a new journal writerfencerInfo- info about fencer for debugging purposes- Throws:
FencedException- if the resource has been fencedIOException
-
startLogSegment
Description copied from interface:JournalProtocolNotify the BackupNode that the NameNode has rolled its edit logs and is now writing a new log segment.- Specified by:
startLogSegmentin interfaceJournalProtocol- 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
-
isMethodSupported
- Specified by:
isMethodSupportedin interfaceorg.apache.hadoop.ipc.ProtocolMetaInterface- Throws:
IOException
-