|
@@ -70,7 +70,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
|
|
|
|
|
/**
|
|
|
- * A client proxy for Router -> NN communication using the NN ClientProtocol.
|
|
|
+ * A client proxy for Router to NN communication using the NN ClientProtocol.
|
|
|
* <p>
|
|
|
* Provides routers to invoke remote ClientProtocol methods and handle
|
|
|
* retries/failover.
|
|
@@ -584,7 +584,7 @@ public class RouterRpcClient {
|
|
|
* @param block Block used to determine appropriate nameservice.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @return The result of invoking the method.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException If the invoke generated an error.
|
|
|
*/
|
|
|
public Object invokeSingle(final ExtendedBlock block, RemoteMethod method)
|
|
|
throws IOException {
|
|
@@ -602,7 +602,7 @@ public class RouterRpcClient {
|
|
|
* @param bpId Block pool identifier.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @return The result of invoking the method.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException If the invoke generated an error.
|
|
|
*/
|
|
|
public Object invokeSingleBlockPool(final String bpId, RemoteMethod method)
|
|
|
throws IOException {
|
|
@@ -619,7 +619,7 @@ public class RouterRpcClient {
|
|
|
* @param nsId Target namespace for the method.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @return The result of invoking the method.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException If the invoke generated an error.
|
|
|
*/
|
|
|
public Object invokeSingle(final String nsId, RemoteMethod method)
|
|
|
throws IOException {
|
|
@@ -639,6 +639,7 @@ public class RouterRpcClient {
|
|
|
* Re-throws exceptions generated by the remote RPC call as either
|
|
|
* RemoteException or IOException.
|
|
|
*
|
|
|
+ * @param <T> The type of the remote method return.
|
|
|
* @param nsId Target namespace for the method.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @param clazz Class for the return type.
|
|
@@ -661,7 +662,7 @@ public class RouterRpcClient {
|
|
|
* @param location RemoteLocation to invoke.
|
|
|
* @param remoteMethod The remote method and parameters to invoke.
|
|
|
* @return The result of invoking the method if successful.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException If the invoke generated an error.
|
|
|
*/
|
|
|
public Object invokeSingle(final RemoteLocationContext location,
|
|
|
RemoteMethod remoteMethod) throws IOException {
|
|
@@ -700,6 +701,7 @@ public class RouterRpcClient {
|
|
|
* If no expected result class/values are specified, the success condition is
|
|
|
* a call that does not throw a remote exception.
|
|
|
*
|
|
|
+ * @param <T> The type of the remote method return.
|
|
|
* @param locations List of locations/nameservices to call concurrently.
|
|
|
* @param remoteMethod The remote method and parameters to invoke.
|
|
|
* @param expectedResultClass In order to be considered a positive result, the
|
|
@@ -871,6 +873,8 @@ public class RouterRpcClient {
|
|
|
/**
|
|
|
* Invoke method in all locations and return success if any succeeds.
|
|
|
*
|
|
|
+ * @param <T> The type of the remote location.
|
|
|
+ * @param <R> The type of the remote method return.
|
|
|
* @param locations List of remote locations to call concurrently.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @return If the call succeeds in any location.
|
|
@@ -899,6 +903,7 @@ public class RouterRpcClient {
|
|
|
* RemoteException or IOException.
|
|
|
*
|
|
|
* @param <T> The type of the remote location.
|
|
|
+ * @param <R> The type of the remote method return.
|
|
|
* @param locations List of remote locations to call concurrently.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @throws IOException If all the calls throw an exception.
|
|
@@ -917,9 +922,10 @@ public class RouterRpcClient {
|
|
|
* RemoteException or IOException.
|
|
|
*
|
|
|
* @param <T> The type of the remote location.
|
|
|
+ * @param <R> The type of the remote method return.
|
|
|
* @param locations List of remote locations to call concurrently.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
- * @return Result of invoking the method per subcluster: nsId -> result.
|
|
|
+ * @return Result of invoking the method per subcluster: nsId to result.
|
|
|
* @throws IOException If all the calls throw an exception.
|
|
|
*/
|
|
|
public <T extends RemoteLocationContext, R> Map<T, R> invokeConcurrent(
|
|
@@ -936,6 +942,7 @@ public class RouterRpcClient {
|
|
|
* RemoteException or IOException.
|
|
|
*
|
|
|
* @param <T> The type of the remote location.
|
|
|
+ * @param <R> The type of the remote method return.
|
|
|
* @param locations List of remote locations to call concurrently.
|
|
|
* @param method The remote method and parameters to invoke.
|
|
|
* @param requireResponse If true an exception will be thrown if all calls do
|
|
@@ -966,7 +973,7 @@ public class RouterRpcClient {
|
|
|
* successfully received are returned.
|
|
|
* @param standby If the requests should go to the standby namenodes too.
|
|
|
* @param clazz Type of the remote return type.
|
|
|
- * @return Result of invoking the method per subcluster: nsId -> result.
|
|
|
+ * @return Result of invoking the method per subcluster: nsId to result.
|
|
|
* @throws IOException If requiredResponse=true and any of the calls throw an
|
|
|
* exception.
|
|
|
*/
|
|
@@ -995,7 +1002,7 @@ public class RouterRpcClient {
|
|
|
* @param standby If the requests should go to the standby namenodes too.
|
|
|
* @param timeOutMs Timeout for each individual call.
|
|
|
* @param clazz Type of the remote return type.
|
|
|
- * @return Result of invoking the method per subcluster: nsId -> result.
|
|
|
+ * @return Result of invoking the method per subcluster: nsId to result.
|
|
|
* @throws IOException If requiredResponse=true and any of the calls throw an
|
|
|
* exception.
|
|
|
*/
|