Class IPCLoggerChannel

java.lang.Object
org.apache.hadoop.hdfs.qjournal.client.IPCLoggerChannel

@Private public class IPCLoggerChannel extends Object
Channel to a remote JournalNode using Hadoop IPC. All of the calls are run on a separate thread, and return ListenableFuture instances to wait for their result. This allows calls to be bound together using the QuorumCall class.
  • Field Details

  • Constructor Details

  • Method Details

    • setEpoch

      public void setEpoch(long epoch)
    • setCommittedTxId

      public void setCommittedTxId(long txid)
    • close

      public void close()
    • getProxy

      protected QJournalProtocol getProxy() throws IOException
      Throws:
      IOException
    • createProxy

      protected QJournalProtocol createProxy() throws IOException
      Throws:
      IOException
    • createSingleThreadExecutor

      @VisibleForTesting protected ExecutorService createSingleThreadExecutor()
      Separated out for easy overriding in tests.
    • createParallelExecutor

      @VisibleForTesting protected ExecutorService createParallelExecutor()
      Separated out for easy overriding in tests.
    • buildURLToFetchLogs

      public URL buildURLToFetchLogs(long segmentTxId)
    • getQueuedEditsSize

      public int getQueuedEditsSize()
    • getRemoteAddress

      public InetSocketAddress getRemoteAddress()
    • isOutOfSync

      public boolean isOutOfSync()
      Returns:
      true if the server has gotten out of sync from the client, and thus a log roll is required for this logger to successfully start logging more edits.
    • isFormatted

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Boolean> isFormatted()
    • getJournalState

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournalStateResponseProto> getJournalState()
    • newEpoch

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.NewEpochResponseProto> newEpoch(long epoch)
    • sendEdits

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> sendEdits(long segmentTxId, long firstTxnId, int numTxns, byte[] data)
    • format

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> format(NamespaceInfo nsInfo, boolean force)
    • startLogSegment

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> startLogSegment(long txid, int layoutVersion)
    • finalizeLogSegment

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> finalizeLogSegment(long startTxId, long endTxId)
    • purgeLogsOlderThan

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> purgeLogsOlderThan(long minTxIdToKeep)
    • getJournaledEdits

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournaledEditsResponseProto> getJournaledEdits(long fromTxnId, int maxTransactions)
    • getEditLogManifest

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<RemoteEditLogManifest> getEditLogManifest(long fromTxnId, boolean inProgressOk)
    • prepareRecovery

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.PrepareRecoveryResponseProto> prepareRecovery(long segmentTxId)
    • acceptRecovery

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> acceptRecovery(QJournalProtocolProtos.SegmentStateProto log, URL url)
    • doPreUpgrade

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> doPreUpgrade()
    • doUpgrade

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> doUpgrade(StorageInfo sInfo)
    • doFinalize

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> doFinalize()
    • canRollBack

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Boolean> canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion)
    • doRollback

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> doRollback()
    • discardSegments

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void> discardSegments(long startTxId)
    • getJournalCTime

      public org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Long> getJournalCTime()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • appendReport

      public void appendReport(StringBuilder sb)
    • getLagTxns

      public long getLagTxns()
    • getLagTimeMillis

      public long getLagTimeMillis()