@InterfaceAudience.Private @InterfaceStability.Stable public class QJournalProtocolTranslatorPB extends Object implements ProtocolMetaInterface, QJournalProtocol, Closeable
JournalProtocol
interfaces to the RPC server implementing
JournalProtocolPB
.versionID
Constructor and Description |
---|
QJournalProtocolTranslatorPB(QJournalProtocolPB rpcProxy) |
Modifier and Type | Method and Description |
---|---|
void |
acceptRecovery(RequestInfo reqInfo,
QJournalProtocolProtos.SegmentStateProto stateToAccept,
URL fromUrl)
Accept a proposed recovery for the given transaction ID.
|
void |
close() |
void |
finalizeLogSegment(RequestInfo reqInfo,
long startTxId,
long endTxId)
Finalize the given log segment on the JournalNode.
|
void |
format(String jid,
NamespaceInfo nsInfo)
Format the underlying storage for the given namespace.
|
QJournalProtocolProtos.GetEditLogManifestResponseProto |
getEditLogManifest(String jid,
long sinceTxId,
boolean forReading,
boolean inProgressOk) |
QJournalProtocolProtos.GetJournalStateResponseProto |
getJournalState(String jid)
Get the current state of the journal, including the most recent
epoch number and the HTTP port.
|
void |
heartbeat(RequestInfo reqInfo)
Heartbeat.
|
boolean |
isFormatted(String journalId) |
boolean |
isMethodSupported(String methodName)
Checks whether the given method name is supported by the server.
|
void |
journal(RequestInfo reqInfo,
long segmentTxId,
long firstTxnId,
int numTxns,
byte[] records)
Journal edit records.
|
QJournalProtocolProtos.NewEpochResponseProto |
newEpoch(String jid,
NamespaceInfo nsInfo,
long epoch)
Begin a new epoch.
|
QJournalProtocolProtos.PrepareRecoveryResponseProto |
prepareRecovery(RequestInfo reqInfo,
long segmentTxId)
Begin the recovery process for a given segment.
|
void |
purgeLogsOlderThan(RequestInfo reqInfo,
long minTxIdToKeep) |
void |
startLogSegment(RequestInfo reqInfo,
long txid)
Start writing to a new log segment on the JournalNode.
|
public QJournalProtocolTranslatorPB(QJournalProtocolPB rpcProxy)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean isFormatted(String journalId) throws IOException
isFormatted
in interface QJournalProtocol
IOException
public QJournalProtocolProtos.GetJournalStateResponseProto getJournalState(String jid) throws IOException
QJournalProtocol
getJournalState
in interface QJournalProtocol
IOException
public void format(String jid, NamespaceInfo nsInfo) throws IOException
QJournalProtocol
format
in interface QJournalProtocol
IOException
public QJournalProtocolProtos.NewEpochResponseProto newEpoch(String jid, NamespaceInfo nsInfo, long epoch) throws IOException
QJournalProtocol
newEpoch
in interface QJournalProtocol
IOException
public void journal(RequestInfo reqInfo, long segmentTxId, long firstTxnId, int numTxns, byte[] records) throws IOException
QJournalProtocol
journal
in interface QJournalProtocol
IOException
public void heartbeat(RequestInfo reqInfo) throws IOException
QJournalProtocol
heartbeat
in interface QJournalProtocol
IOException
public void startLogSegment(RequestInfo reqInfo, long txid) throws IOException
QJournalProtocol
QJournalProtocol.finalizeLogSegment(RequestInfo, long, long)
.startLogSegment
in interface QJournalProtocol
txid
- the first txid in the new logIOException
public void finalizeLogSegment(RequestInfo reqInfo, long startTxId, long endTxId) throws IOException
QJournalProtocol
finalizeLogSegment
in interface QJournalProtocol
startTxId
- the starting transaction ID of the logendTxId
- the expected last transaction in the given logIOException
- if no such segment existspublic void purgeLogsOlderThan(RequestInfo reqInfo, long minTxIdToKeep) throws IOException
purgeLogsOlderThan
in interface QJournalProtocol
IOException
LogsPurgeable.purgeLogsOlderThan(long)
public QJournalProtocolProtos.GetEditLogManifestResponseProto getEditLogManifest(String jid, long sinceTxId, boolean forReading, boolean inProgressOk) throws IOException
getEditLogManifest
in interface QJournalProtocol
jid
- the journal from which to enumerate editssinceTxId
- the first transaction which the client cares aboutforReading
- whether or not the caller intends to read from the edit
logsinProgressOk
- whether or not to check the in-progress edit log
segmentIOException
public QJournalProtocolProtos.PrepareRecoveryResponseProto prepareRecovery(RequestInfo reqInfo, long segmentTxId) throws IOException
QJournalProtocol
prepareRecovery
in interface QJournalProtocol
IOException
public void acceptRecovery(RequestInfo reqInfo, QJournalProtocolProtos.SegmentStateProto stateToAccept, URL fromUrl) throws IOException
QJournalProtocol
acceptRecovery
in interface QJournalProtocol
IOException
public boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterface
isMethodSupported
in interface ProtocolMetaInterface
methodName
- The name of the methodIOException
Copyright © 2013 Apache Software Foundation. All rights reserved.