Class RemoteMethod
java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.RemoteMethod
Determines the remote client protocol method and the parameter list for a
specific location.
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteMethod(Class<?> proto, String method) Create a method with no parameters.RemoteMethod(Class<?> proto, String method, Class<?>[] pTypes, Object... pParams) Creates a remote method generator.RemoteMethod(String method) Create a remote method generator for the ClientProtocol with no parameters.RemoteMethod(String method, Class<?>[] pTypes, Object... pParams) Create a remote method generator for the ClientProtocol. -
Method Summary
Modifier and TypeMethodDescriptionGet the represented java method.Get the name of the method.Object[]Generate a list of parameters for this specific location using no context.Object[]getParams(RemoteLocationContext context) Generate a list of parameters for this specific location.Class<?>Get the interface/protocol for this method.Class<?>[]getTypes()Get the calling types for this method.toString()
-
Constructor Details
-
RemoteMethod
Create a remote method generator for the ClientProtocol with no parameters.- Parameters:
method- The string name of the protocol method.
-
RemoteMethod
Create a method with no parameters.- Parameters:
proto- Protocol of the method.method- The string name of the ClientProtocol method.
-
RemoteMethod
Create a remote method generator for the ClientProtocol.- Parameters:
method- The string name of the ClientProtocol method.pTypes- A list of types to use to locate the specific method.pParams- A list of parameters for the method. The order of the parameter list must match the order and number of the types. Parameters are grouped into 2 categories:- Static parameters that are immutable across locations.
- Dynamic parameters that are determined for each location by a RemoteParam object. To specify a dynamic parameter, pass an instance of RemoteParam in place of the parameter value.
- Throws:
IOException- If the types and parameter lists are not valid.
-
RemoteMethod
public RemoteMethod(Class<?> proto, String method, Class<?>[] pTypes, Object... pParams) throws IOException Creates a remote method generator.- Parameters:
proto- Protocol of the method.method- The string name of the ClientProtocol method.pTypes- A list of types to use to locate the specific method.pParams- A list of parameters for the method. The order of the parameter list must match the order and number of the types. Parameters are grouped into 2 categories:- Static parameters that are immutable across locations.
- Dynamic parameters that are determined for each location by a RemoteParam object. To specify a dynamic parameter, pass an instance of RemoteParam in place of the parameter value.
- Throws:
IOException- If the types and parameter lists are not valid.
-
-
Method Details
-
getProtocol
Get the interface/protocol for this method. For example, ClientProtocol or NamenodeProtocol.- Returns:
- Protocol for this method.
-
getMethod
Get the represented java method.- Returns:
Method- Throws:
IOException- If the method cannot be found.
-
getTypes
Get the calling types for this method.- Returns:
- An array of calling types.
-
getParams
Generate a list of parameters for this specific location using no context.- Returns:
- A list of parameters for the method customized for the location.
-
getMethodName
Get the name of the method.- Returns:
- Name of the method.
-
getParams
Generate a list of parameters for this specific location. Parameters are grouped into 2 categories:- Static parameters that are immutable across locations.
- Dynamic parameters that are determined for each location by a RemoteParam object.
- Parameters:
context- The context identifying the location.- Returns:
- A list of parameters for the method customized for the location.
-
toString
-