@InterfaceAudience.Private public class IPCLoggerChannel extends Object
ListenableFuture
instances to wait for their result.
This allows calls to be bound together using the QuorumCall
class.Modifier and Type | Class and Description |
---|---|
static interface |
AsyncLogger.Factory |
Modifier and Type | Field and Description |
---|---|
protected InetSocketAddress |
addr |
Constructor and Description |
---|
IPCLoggerChannel(Configuration conf,
NamespaceInfo nsInfo,
String journalId,
InetSocketAddress addr) |
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<Void> |
acceptRecovery(QJournalProtocolProtos.SegmentStateProto log,
URL url)
Accept a recovery proposal.
|
void |
appendHtmlReport(StringBuilder sb)
Append an HTML-formatted report for this logger's status to the provided
StringBuilder.
|
URL |
buildURLToFetchLogs(long segmentTxId)
Build an HTTP URL to fetch the log segment with the given startTxId.
|
void |
close()
Tear down any resources, connections, etc.
|
protected ExecutorService |
createExecutor()
Separated out for easy overriding in tests.
|
protected QJournalProtocol |
createProxy() |
com.google.common.util.concurrent.ListenableFuture<Void> |
finalizeLogSegment(long startTxId,
long endTxId)
Finalize a log segment.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
format(NamespaceInfo nsInfo)
Format the log directory.
|
com.google.common.util.concurrent.ListenableFuture<RemoteEditLogManifest> |
getEditLogManifest(long fromTxnId,
boolean forReading,
boolean inProgressOk)
Fetch the list of edit logs available on the remote node.
|
com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournalStateResponseProto> |
getJournalState() |
long |
getLagTimeMillis() |
long |
getLagTxns() |
protected QJournalProtocol |
getProxy() |
int |
getQueuedEditsSize() |
InetSocketAddress |
getRemoteAddress() |
com.google.common.util.concurrent.ListenableFuture<Boolean> |
isFormatted() |
boolean |
isOutOfSync() |
com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.NewEpochResponseProto> |
newEpoch(long epoch)
Begin a new epoch on the target node.
|
com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.PrepareRecoveryResponseProto> |
prepareRecovery(long segmentTxId)
Prepare recovery.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
purgeLogsOlderThan(long minTxIdToKeep)
Allow the remote node to purge edit logs earlier than this.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
sendEdits(long segmentTxId,
long firstTxnId,
int numTxns,
byte[] data)
Send a batch of edits to the logger.
|
void |
setCommittedTxId(long txid)
Let the logger know the highest committed txid across all loggers in the
set.
|
void |
setEpoch(long epoch)
Set the epoch number used for all future calls.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
startLogSegment(long txid)
Begin writing a new log segment.
|
String |
toString() |
protected final InetSocketAddress addr
public IPCLoggerChannel(Configuration conf, NamespaceInfo nsInfo, String journalId, InetSocketAddress addr)
public void setEpoch(long epoch)
public void setCommittedTxId(long txid)
public void close()
protected QJournalProtocol getProxy() throws IOException
IOException
protected QJournalProtocol createProxy() throws IOException
IOException
protected ExecutorService createExecutor()
public URL buildURLToFetchLogs(long segmentTxId)
public int getQueuedEditsSize()
public InetSocketAddress getRemoteAddress()
public boolean isOutOfSync()
public com.google.common.util.concurrent.ListenableFuture<Boolean> isFormatted()
public com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.GetJournalStateResponseProto> getJournalState()
public com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.NewEpochResponseProto> newEpoch(long epoch)
public com.google.common.util.concurrent.ListenableFuture<Void> sendEdits(long segmentTxId, long firstTxnId, int numTxns, byte[] data)
segmentTxId
- the first txid in the current segmentfirstTxnId
- the first txid of the edits.numTxns
- the number of transactions in the batchdata
- the actual data to be sentpublic com.google.common.util.concurrent.ListenableFuture<Void> format(NamespaceInfo nsInfo)
nsInfo
- the namespace info to format withpublic com.google.common.util.concurrent.ListenableFuture<Void> startLogSegment(long txid)
txid
- the first txid to be written to the new logpublic com.google.common.util.concurrent.ListenableFuture<Void> finalizeLogSegment(long startTxId, long endTxId)
startTxId
- the first txid that was written to the segmentendTxId
- the last txid that was written to the segmentpublic com.google.common.util.concurrent.ListenableFuture<Void> purgeLogsOlderThan(long minTxIdToKeep)
minTxIdToKeep
- the min txid which must be retainedpublic com.google.common.util.concurrent.ListenableFuture<RemoteEditLogManifest> getEditLogManifest(long fromTxnId, boolean forReading, boolean inProgressOk)
public com.google.common.util.concurrent.ListenableFuture<QJournalProtocolProtos.PrepareRecoveryResponseProto> prepareRecovery(long segmentTxId)
public com.google.common.util.concurrent.ListenableFuture<Void> acceptRecovery(QJournalProtocolProtos.SegmentStateProto log, URL url)
public void appendHtmlReport(StringBuilder sb)
public long getLagTxns()
public long getLagTimeMillis()
Copyright © 2013 Apache Software Foundation. All rights reserved.