Skip to content

Commit

Permalink
HDFS-14116. [SBN read] Fix class cast error in NNThroughputBenchmark …
Browse files Browse the repository at this point in the history
…with ObserverReadProxyProvider. Contributed by Chao Sun.
  • Loading branch information
sunchao authored and shvachko committed Dec 24, 2018
1 parent ef3e192 commit c3efc29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -71,7 +71,6 @@
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;


import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
Expand Down Expand Up @@ -2022,18 +2021,17 @@ public static NamenodeProtocol getNamenodeProtocolProxy(Configuration conf,
* Get the RefreshUserMappingsProtocol RPC proxy for the NN associated with * Get the RefreshUserMappingsProtocol RPC proxy for the NN associated with
* this DFSClient object * this DFSClient object
* *
* @param nameNodeUri the URI of the NN to get a proxy for. * @param nnAddr the address of the NN to get a proxy for.
* *
* @return the RefreshUserMappingsProtocol RPC proxy associated with this * @return the RefreshUserMappingsProtocol RPC proxy associated with this
* DFSClient object * DFSClient object
*/ */
@VisibleForTesting @VisibleForTesting
public static RefreshUserMappingsProtocol getRefreshUserMappingsProtocolProxy( public static RefreshUserMappingsProtocol getRefreshUserMappingsProtocolProxy(
Configuration conf, URI nameNodeUri) throws IOException { Configuration conf, InetSocketAddress nnAddr) throws IOException {
final AtomicBoolean nnFallbackToSimpleAuth = new AtomicBoolean(false); return NameNodeProxies.createNonHAProxy(
return NameNodeProxies.createProxy(conf, conf, nnAddr, RefreshUserMappingsProtocol.class,
nameNodeUri, RefreshUserMappingsProtocol.class, UserGroupInformation.getCurrentUser(), false).getProxy();
nnFallbackToSimpleAuth).getProxy();
} }


/** /**
Expand Down
Expand Up @@ -20,6 +20,7 @@
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
Expand Down Expand Up @@ -1519,10 +1520,11 @@ public int run(String[] aArgs) throws Exception {
nameNodeProto = DFSTestUtil.getNamenodeProtocolProxy(config, nnUri, nameNodeProto = DFSTestUtil.getNamenodeProtocolProxy(config, nnUri,
UserGroupInformation.getCurrentUser()); UserGroupInformation.getCurrentUser());
clientProto = dfs.getClient().getNamenode(); clientProto = dfs.getClient().getNamenode();
InetSocketAddress nnAddr = DFSUtilClient.getNNAddress(nnUri);
dataNodeProto = new DatanodeProtocolClientSideTranslatorPB( dataNodeProto = new DatanodeProtocolClientSideTranslatorPB(
DFSUtilClient.getNNAddress(nnUri), config); nnAddr, config);
refreshUserMappingsProto = refreshUserMappingsProto =
DFSTestUtil.getRefreshUserMappingsProtocolProxy(config, nnUri); DFSTestUtil.getRefreshUserMappingsProtocolProxy(config, nnAddr);
getBlockPoolId(dfs); getBlockPoolId(dfs);
} }
// run each benchmark // run each benchmark
Expand Down

0 comments on commit c3efc29

Please sign in to comment.