@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 Closeableclose in interface AutoCloseablepublic boolean isFormatted(String journalId) throws IOException
isFormatted in interface QJournalProtocolIOExceptionpublic QJournalProtocolProtos.GetJournalStateResponseProto getJournalState(String jid) throws IOException
QJournalProtocolgetJournalState in interface QJournalProtocolIOExceptionpublic void format(String jid, NamespaceInfo nsInfo) throws IOException
QJournalProtocolformat in interface QJournalProtocolIOExceptionpublic QJournalProtocolProtos.NewEpochResponseProto newEpoch(String jid, NamespaceInfo nsInfo, long epoch) throws IOException
QJournalProtocolnewEpoch in interface QJournalProtocolIOExceptionpublic void journal(RequestInfo reqInfo, long segmentTxId, long firstTxnId, int numTxns, byte[] records) throws IOException
QJournalProtocoljournal in interface QJournalProtocolIOExceptionpublic void heartbeat(RequestInfo reqInfo) throws IOException
QJournalProtocolheartbeat in interface QJournalProtocolIOExceptionpublic void startLogSegment(RequestInfo reqInfo, long txid) throws IOException
QJournalProtocolQJournalProtocol.finalizeLogSegment(RequestInfo, long, long).startLogSegment in interface QJournalProtocoltxid - the first txid in the new logIOExceptionpublic void finalizeLogSegment(RequestInfo reqInfo, long startTxId, long endTxId) throws IOException
QJournalProtocolfinalizeLogSegment in interface QJournalProtocolstartTxId - 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 QJournalProtocolIOExceptionLogsPurgeable.purgeLogsOlderThan(long)public QJournalProtocolProtos.GetEditLogManifestResponseProto getEditLogManifest(String jid, long sinceTxId, boolean forReading, boolean inProgressOk) throws IOException
getEditLogManifest in interface QJournalProtocoljid - 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
segmentIOExceptionpublic QJournalProtocolProtos.PrepareRecoveryResponseProto prepareRecovery(RequestInfo reqInfo, long segmentTxId) throws IOException
QJournalProtocolprepareRecovery in interface QJournalProtocolIOExceptionpublic void acceptRecovery(RequestInfo reqInfo, QJournalProtocolProtos.SegmentStateProto stateToAccept, URL fromUrl) throws IOException
QJournalProtocolacceptRecovery in interface QJournalProtocolIOExceptionpublic boolean isMethodSupported(String methodName) throws IOException
ProtocolMetaInterfaceisMethodSupported in interface ProtocolMetaInterfacemethodName - The name of the methodIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.