@InterfaceAudience.Private @InterfaceStability.Stable public class NamenodeProtocolTranslatorPB extends Object implements NamenodeProtocol, ProtocolMetaInterface, Closeable
NamenodeProtocol
interfaces to the RPC server implementing
NamenodeProtocolPB
.ACT_CHECKPOINT, ACT_SHUTDOWN, ACT_UNKNOWN, FATAL, NOTIFY, versionID
Constructor and Description |
---|
NamenodeProtocolTranslatorPB(NamenodeProtocolPB rpcProxy) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
endCheckpoint(NamenodeRegistration registration,
CheckpointSignature sig)
A request to the active name-node to finalize
previously started checkpoint.
|
void |
errorReport(NamenodeRegistration registration,
int errorCode,
String msg)
Report to the active name-node an error occurred on a subordinate node.
|
ExportedBlockKeys |
getBlockKeys()
Get the current block keys
|
BlocksWithLocations |
getBlocks(DatanodeInfo datanode,
long size)
Get a list of blocks belonging to
datanode
whose total size equals size . |
RemoteEditLogManifest |
getEditLogManifest(long sinceTxId)
Return a structure containing details about all edit logs
available to be fetched from the NameNode.
|
long |
getMostRecentCheckpointTxId()
Get the transaction ID of the most recent checkpoint.
|
long |
getTransactionID() |
boolean |
isMethodSupported(String methodName)
Checks whether the given method name is supported by the server.
|
NamenodeRegistration |
registerSubordinateNamenode(NamenodeRegistration registration)
Register a subordinate name-node like backup node.
|
CheckpointSignature |
rollEditLog()
Closes the current edit log and opens a new one.
|
NamenodeCommand |
startCheckpoint(NamenodeRegistration registration)
A request to the active name-node to start a checkpoint.
|
NamespaceInfo |
versionRequest()
Request name-node version and storage information.
|
public NamenodeProtocolTranslatorPB(NamenodeProtocolPB rpcProxy)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public BlocksWithLocations getBlocks(DatanodeInfo datanode, long size) throws IOException
NamenodeProtocol
datanode
whose total size equals size
.getBlocks
in interface NamenodeProtocol
datanode
- a data nodesize
- requested sizeIOException
- if size is less than or equal to 0 or
datanode does not existBalancer
public ExportedBlockKeys getBlockKeys() throws IOException
NamenodeProtocol
getBlockKeys
in interface NamenodeProtocol
IOException
public long getTransactionID() throws IOException
getTransactionID
in interface NamenodeProtocol
IOException
public long getMostRecentCheckpointTxId() throws IOException
NamenodeProtocol
getMostRecentCheckpointTxId
in interface NamenodeProtocol
IOException
public CheckpointSignature rollEditLog() throws IOException
NamenodeProtocol
rollEditLog
in interface NamenodeProtocol
IOException
public NamespaceInfo versionRequest() throws IOException
NamenodeProtocol
versionRequest
in interface NamenodeProtocol
NamespaceInfo
identifying versions and storage information
of the name-nodeIOException
public void errorReport(NamenodeRegistration registration, int errorCode, String msg) throws IOException
NamenodeProtocol
errorReport
in interface NamenodeProtocol
registration
- requesting node.errorCode
- indicates the errormsg
- free text description of the errorIOException
public NamenodeRegistration registerSubordinateNamenode(NamenodeRegistration registration) throws IOException
NamenodeProtocol
registerSubordinateNamenode
in interface NamenodeProtocol
NamenodeRegistration
of the node,
which this node has just registered with.IOException
public NamenodeCommand startCheckpoint(NamenodeRegistration registration) throws IOException
NamenodeProtocol
startCheckpoint
in interface NamenodeProtocol
registration
- the requesting nodeCheckpointCommand
if checkpoint is allowed.IOException
CheckpointCommand
,
NamenodeCommand
,
NamenodeProtocol.ACT_SHUTDOWN
public void endCheckpoint(NamenodeRegistration registration, CheckpointSignature sig) throws IOException
NamenodeProtocol
endCheckpoint
in interface NamenodeProtocol
registration
- the requesting nodesig
- CheckpointSignature
which identifies the checkpoint.IOException
public RemoteEditLogManifest getEditLogManifest(long sinceTxId) throws IOException
NamenodeProtocol
getEditLogManifest
in interface NamenodeProtocol
sinceTxId
- return only logs that contain transactions >= sinceTxIdIOException
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.