Class IPCLoggerChannel
java.lang.Object
org.apache.hadoop.hdfs.qjournal.client.IPCLoggerChannel
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIPCLoggerChannel(org.apache.hadoop.conf.Configuration conf, NamespaceInfo nsInfo, String journalId, String nameServiceId, InetSocketAddress addr) IPCLoggerChannel(org.apache.hadoop.conf.Configuration conf, NamespaceInfo nsInfo, String journalId, InetSocketAddress addr) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>voidbuildURLToFetchLogs(long segmentTxId) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Boolean>canRollBack(StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion) voidclose()protected ExecutorServiceSeparated out for easy overriding in tests.protected QJournalProtocolprotected ExecutorServiceSeparated out for easy overriding in tests.org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>discardSegments(long startTxId) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>doUpgrade(StorageInfo sInfo) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>finalizeLogSegment(long startTxId, long endTxId) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>format(NamespaceInfo nsInfo, boolean force) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<RemoteEditLogManifest>getEditLogManifest(long fromTxnId, boolean inProgressOk) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Long>org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournaledEditsResponseProto>getJournaledEdits(long fromTxnId, int maxTransactions) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournalStateResponseProto>longlongprotected QJournalProtocolgetProxy()intorg.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Boolean>booleanorg.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.NewEpochResponseProto>newEpoch(long epoch) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.PrepareRecoveryResponseProto>prepareRecovery(long segmentTxId) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>purgeLogsOlderThan(long minTxIdToKeep) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>sendEdits(long segmentTxId, long firstTxnId, int numTxns, byte[] data) voidsetCommittedTxId(long txid) voidsetEpoch(long epoch) org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<Void>startLogSegment(long txid, int layoutVersion) toString()
-
Field Details
-
addr
-
-
Constructor Details
-
IPCLoggerChannel
public IPCLoggerChannel(org.apache.hadoop.conf.Configuration conf, NamespaceInfo nsInfo, String journalId, InetSocketAddress addr) -
IPCLoggerChannel
public IPCLoggerChannel(org.apache.hadoop.conf.Configuration conf, NamespaceInfo nsInfo, String journalId, String nameServiceId, InetSocketAddress addr)
-
-
Method Details
-
setEpoch
public void setEpoch(long epoch) -
setCommittedTxId
public void setCommittedTxId(long txid) -
close
public void close() -
getProxy
- Throws:
IOException
-
createProxy
- Throws:
IOException
-
createSingleThreadExecutor
Separated out for easy overriding in tests. -
createParallelExecutor
Separated out for easy overriding in tests. -
buildURLToFetchLogs
-
getQueuedEditsSize
public int getQueuedEditsSize() -
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
-
appendReport
-
getLagTxns
public long getLagTxns() -
getLagTimeMillis
public long getLagTimeMillis()
-