當前位置: 首頁>>代碼示例>>Java>>正文


Java RPC.getProxy方法代碼示例

本文整理匯總了Java中org.apache.hadoop.ipc.RPC.getProxy方法的典型用法代碼示例。如果您正苦於以下問題:Java RPC.getProxy方法的具體用法?Java RPC.getProxy怎麽用?Java RPC.getProxy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.ipc.RPC的用法示例。


在下文中一共展示了RPC.getProxy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: HAServiceProtocolClientSideTranslatorPB

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public HAServiceProtocolClientSideTranslatorPB(
    InetSocketAddress addr, Configuration conf,
    SocketFactory socketFactory, int timeout) throws IOException {
  RPC.setProtocolEngine(conf, HAServiceProtocolPB.class,
      ProtobufRpcEngine.class);
  rpcProxy = RPC.getProxy(HAServiceProtocolPB.class,
      RPC.getProtocolVersion(HAServiceProtocolPB.class), addr,
      UserGroupInformation.getCurrentUser(), conf, socketFactory, timeout);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:10,代碼來源:HAServiceProtocolClientSideTranslatorPB.java

示例2: ZKFCProtocolClientSideTranslatorPB

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public ZKFCProtocolClientSideTranslatorPB(
    InetSocketAddress addr, Configuration conf,
    SocketFactory socketFactory, int timeout) throws IOException {
  RPC.setProtocolEngine(conf, ZKFCProtocolPB.class,
      ProtobufRpcEngine.class);
  rpcProxy = RPC.getProxy(ZKFCProtocolPB.class,
      RPC.getProtocolVersion(ZKFCProtocolPB.class), addr,
      UserGroupInformation.getCurrentUser(), conf, socketFactory, timeout);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:10,代碼來源:ZKFCProtocolClientSideTranslatorPB.java

示例3: createClientDatanodeProtocolProxy

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
static ClientDatanodeProtocolPB createClientDatanodeProtocolProxy(
    InetSocketAddress addr, UserGroupInformation ticket, Configuration conf,
    SocketFactory factory, int socketTimeout) throws IOException {
  RPC.setProtocolEngine(conf, ClientDatanodeProtocolPB.class,
      ProtobufRpcEngine.class);
  return RPC.getProxy(ClientDatanodeProtocolPB.class,
      RPC.getProtocolVersion(ClientDatanodeProtocolPB.class), addr, ticket,
      conf, factory, socketTimeout);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:10,代碼來源:ClientDatanodeProtocolTranslatorPB.java

示例4: testAuditLoggerWithIP

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
/**
 * Test {@link AuditLogger} with IP set.
 */
public void testAuditLoggerWithIP() throws Exception {
  Configuration conf = new Configuration();
  // start the IPC server
  Server server = new RPC.Builder(conf).setProtocol(TestProtocol.class)
          .setInstance(new MyTestRPCServer()).setBindAddress("0.0.0.0")
          .setPort(0).build();
  server.start();

  InetSocketAddress addr = NetUtils.getConnectAddress(server);

  // Make a client connection and test the audit log
  TestProtocol proxy = (TestProtocol)RPC.getProxy(TestProtocol.class,
                         TestProtocol.versionID, addr, conf);
  // Start the testcase
  proxy.ping();

  server.stop();
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:22,代碼來源:TestAuditLogger.java

示例5: HAServiceProtocolClientSideTranslatorPB

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public HAServiceProtocolClientSideTranslatorPB(InetSocketAddress addr,
    Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, HAServiceProtocolPB.class,
      ProtobufRpcEngine.class);
  rpcProxy = RPC.getProxy(HAServiceProtocolPB.class,
      RPC.getProtocolVersion(HAServiceProtocolPB.class), addr, conf);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:8,代碼來源:HAServiceProtocolClientSideTranslatorPB.java

示例6: getUgmProtocol

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
/**
 * Get a client of the {@link GetUserMappingsProtocol}.
 * @return A {@link GetUserMappingsProtocol} client proxy.
 * @throws IOException
 */
protected GetUserMappingsProtocol getUgmProtocol() throws IOException {
  GetUserMappingsProtocol userGroupMappingProtocol =
    RPC.getProxy(GetUserMappingsProtocol.class, 
        GetUserMappingsProtocol.versionID,
        getProtocolAddress(getConf()), UserGroupInformation.getCurrentUser(),
        getConf(), NetUtils.getSocketFactory(getConf(),
            GetUserMappingsProtocol.class));
  return userGroupMappingProtocol;
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:15,代碼來源:GetGroupsBase.java

示例7: getProxy

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public static <PROTOCOL> PROTOCOL getProxy(
    Class<PROTOCOL> clazz, String addressStr, Configuration conf)
    throws IOException {
  RPC.setProtocolEngine(conf, clazz, ProtobufRpcEngineShaded.class);
  return RPC.getProxy(clazz, RPC.getProtocolVersion(clazz),
      org.apache.ratis.util.NetUtils.createSocketAddr(addressStr),
      UserGroupInformation.getCurrentUser(),
      conf, NetUtils.getSocketFactory(conf, clazz));
}
 
開發者ID:apache,項目名稱:incubator-ratis,代碼行數:10,代碼來源:Proxy.java

示例8: ApplicationMasterProtocolPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public ApplicationMasterProtocolPBClientImpl(long clientVersion, InetSocketAddress addr,
    Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, ApplicationMasterProtocolPB.class, ProtobufRpcEngine.class);
  proxy =
      (ApplicationMasterProtocolPB) RPC.getProxy(ApplicationMasterProtocolPB.class, clientVersion,
        addr, conf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:8,代碼來源:ApplicationMasterProtocolPBClientImpl.java

示例9: ResourceManagerAdministrationProtocolPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public ResourceManagerAdministrationProtocolPBClientImpl(long clientVersion, InetSocketAddress addr, 
    Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, ResourceManagerAdministrationProtocolPB.class, 
      ProtobufRpcEngine.class);
  proxy = (ResourceManagerAdministrationProtocolPB)RPC.getProxy(
      ResourceManagerAdministrationProtocolPB.class, clientVersion, addr, conf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:8,代碼來源:ResourceManagerAdministrationProtocolPBClientImpl.java

示例10: SCMUploaderProtocolPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public SCMUploaderProtocolPBClientImpl(long clientVersion,
    InetSocketAddress addr, Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, SCMUploaderProtocolPB.class,
    ProtobufRpcEngine.class);
  proxy =
      RPC.getProxy(SCMUploaderProtocolPB.class, clientVersion, addr, conf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:8,代碼來源:SCMUploaderProtocolPBClientImpl.java

示例11: createHSProxy

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
private static Object createHSProxy(InetSocketAddress address,
    Configuration conf, UserGroupInformation ugi, Class<?> xface,
    int rpcTimeout) throws IOException {
  RPC.setProtocolEngine(conf, xface, ProtobufRpcEngine.class);
  Object proxy = RPC.getProxy(xface, RPC.getProtocolVersion(xface), address,
      ugi, conf, NetUtils.getDefaultSocketFactory(conf), rpcTimeout);
  return proxy;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:9,代碼來源:HSProxies.java

示例12: HSClientProtocolPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public HSClientProtocolPBClientImpl(long clientVersion,
    InetSocketAddress addr, Configuration conf) throws IOException {
  super();
  RPC.setProtocolEngine(conf, HSClientProtocolPB.class,
      ProtobufRpcEngine.class);
  proxy = (HSClientProtocolPB)RPC.getProxy(
      HSClientProtocolPB.class, clientVersion, addr, conf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:9,代碼來源:HSClientProtocolPBClientImpl.java

示例13: run

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
@Override
public int run(String argv[]) throws Exception {
  LinkedList<String> args = new LinkedList<String>();
  for (String arg : argv) {
    args.add(arg);
  }
  if (StringUtils.popOption("-h", args) ||
      StringUtils.popOption("-help", args)) {
    usage();
    return 0;
  } else if (args.size() == 0) {
    usage();
    return 0;
  }
  String hostPort = StringUtils.popOptionWithArgument("-host", args);
  if (hostPort == null) {
    System.err.println("You must specify a host with -host.");
    return 1;
  }
  if (args.size() < 0) {
    System.err.println("You must specify an operation.");
    return 1;
  }
  RPC.setProtocolEngine(getConf(), TraceAdminProtocolPB.class,
      ProtobufRpcEngine.class);
  InetSocketAddress address = NetUtils.createSocketAddr(hostPort);
  UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
  Class<?> xface = TraceAdminProtocolPB.class;
  proxy = (TraceAdminProtocolPB)RPC.getProxy(xface,
      RPC.getProtocolVersion(xface), address,
      ugi, getConf(), NetUtils.getDefaultSocketFactory(getConf()), 0);
  remote = new TraceAdminProtocolTranslatorPB(proxy);
  try {
    if (args.get(0).equals("-list")) {
      return listSpanReceivers(args.subList(1, args.size()));
    } else if (args.get(0).equals("-add")) {
      return addSpanReceiver(args.subList(1, args.size()));
    } else if (args.get(0).equals("-remove")) {
      return removeSpanReceiver(args.subList(1, args.size()));
    } else {
      System.err.println("Unrecognized tracing command: " + args.get(0));
      System.err.println("Use -help for help.");
      return 1;
    }
  } finally {
    remote.close();
  }
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:49,代碼來源:TraceAdmin.java

示例14: TensorFlowClusterPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public TensorFlowClusterPBClientImpl(long clientVersion, InetSocketAddress addr, Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, TensorFlowClusterPB.class, ProtobufRpcEngine.class);
  proxy = (TensorFlowClusterPB) RPC.getProxy(
      TensorFlowClusterPB.class, clientVersion, addr, conf);
}
 
開發者ID:Intel-bigdata,項目名稱:TensorFlowOnYARN,代碼行數:6,代碼來源:TensorFlowClusterPBClientImpl.java

示例15: ClientSCMProtocolPBClientImpl

import org.apache.hadoop.ipc.RPC; //導入方法依賴的package包/類
public ClientSCMProtocolPBClientImpl(long clientVersion,
    InetSocketAddress addr, Configuration conf) throws IOException {
  RPC.setProtocolEngine(conf, ClientSCMProtocolPB.class,
    ProtobufRpcEngine.class);
  proxy = RPC.getProxy(ClientSCMProtocolPB.class, clientVersion, addr, conf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:7,代碼來源:ClientSCMProtocolPBClientImpl.java


注:本文中的org.apache.hadoop.ipc.RPC.getProxy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。