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.
  • Constructor Details

    • JournalProtocolTranslatorPB

      public JournalProtocolTranslatorPB(JournalProtocolPB rpcProxy)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • journal

      public void journal(JournalInfo journalInfo, long epoch, long firstTxnId, int numTxns, byte[] records) throws IOException
      Description copied from interface: JournalProtocol
      Journal edit records. This message is sent by the active name-node to the backup node via EditLogBackupOutputStream in order to synchronize meta-data changes with the backup namespace image.
      Specified by:
      journal in interface JournalProtocol
      Parameters:
      journalInfo - journal information
      epoch - marks beginning a new journal writer
      firstTxnId - the first transaction of this batch
      numTxns - number of transactions
      records - byte array containing serialized journal records
      Throws:
      FencedException - if the resource has been fenced
      IOException
    • fence

      public FenceResponse fence(JournalInfo journalInfo, long epoch, String fencerInfo) throws IOException
      Description copied from interface: JournalProtocol
      Request to fence any other journal writers. Older writers with at previous epoch will be fenced and can no longer perform journal operations.
      Specified by:
      fence in interface JournalProtocol
      Parameters:
      journalInfo - journal information
      epoch - marks beginning a new journal writer
      fencerInfo - info about fencer for debugging purposes
      Throws:
      FencedException - if the resource has been fenced
      IOException
    • startLogSegment

      public void startLogSegment(JournalInfo journalInfo, long epoch, long txid) throws IOException
      Description copied from interface: JournalProtocol
      Notify the BackupNode that the NameNode has rolled its edit logs and is now writing a new log segment.
      Specified by:
      startLogSegment in interface JournalProtocol
      Parameters:
      journalInfo - journal information
      epoch - marks beginning a new journal writer
      txid - the first txid in the new log
      Throws:
      FencedException - if the resource has been fenced
      IOException
    • isMethodSupported

      public boolean isMethodSupported(String methodName) throws IOException
      Specified by:
      isMethodSupported in interface org.apache.hadoop.ipc.ProtocolMetaInterface
      Throws:
      IOException