public Endpoint getRpcEndpoint() { final int rpcPort = HiveConf.getIntVar(conf, ConfVars.LLAP_DAEMON_RPC_PORT); return RegistryTypeUtils.ipcEndpoint(IPC_LLAP, new InetSocketAddress(hostname, rpcPort)); }
public Endpoint getMngEndpoint() { return RegistryTypeUtils.ipcEndpoint(IPC_MNG, new InetSocketAddress(hostname, HiveConf.getIntVar(conf, ConfVars.LLAP_MANAGEMENT_RPC_PORT))); }
public Endpoint getOutputFormatEndpoint() { return RegistryTypeUtils.ipcEndpoint(IPC_OUTPUTFORMAT, new InetSocketAddress(hostname, HiveConf.getIntVar(conf, ConfVars.LLAP_DAEMON_OUTPUT_SERVICE_PORT))); }
private void updateEndpoint(final ServiceRecord srv, final String endpointName) { final String instanceUri = srv.get(INSTANCE_URI_CONFIG); final String[] tokens = instanceUri.split(":"); final String hostname = tokens[0]; final int port = Integer.parseInt(tokens[1]); Endpoint urlEndpoint = RegistryTypeUtils.ipcEndpoint(endpointName, new InetSocketAddress(hostname, port)); srv.addInternalEndpoint(urlEndpoint); LOG.info("Added {} endpoint to service record", urlEndpoint); }
public String register(int amPort, int pluginPort, String sessionId, String serializedToken, String jobIdForToken, int guaranteedCount) throws IOException { if (srv != null) { throw new UnsupportedOperationException("Already registered with " + srv); } srv = new ServiceRecord(); Endpoint rpcEndpoint = RegistryTypeUtils.ipcEndpoint( IPC_TEZCLIENT, new InetSocketAddress(hostname, amPort)); srv.addInternalEndpoint(rpcEndpoint); Endpoint pluginEndpoint = null; if (pluginPort >= 0) { pluginEndpoint = RegistryTypeUtils.ipcEndpoint( IPC_PLUGIN, new InetSocketAddress(hostname, pluginPort)); srv.addInternalEndpoint(pluginEndpoint); } srv.set(AM_SESSION_ID, sessionId); boolean hasToken = serializedToken != null; srv.set(AM_PLUGIN_TOKEN, hasToken ? serializedToken : ""); srv.set(AM_PLUGIN_JOBID, jobIdForToken != null ? jobIdForToken : ""); srv.set(AM_GUARANTEED_COUNT, Integer.toString(guaranteedCount)); String uniqueId = registerServiceRecord(srv); LOG.info("Registered this AM: rpc: {}, plugin: {}, sessionId: {}, token: {}, znodePath: {}", rpcEndpoint, pluginEndpoint, sessionId, hasToken, getRegistrationZnodePath()); return uniqueId; }
public Endpoint getOutputFormatEndpoint() { return RegistryTypeUtils.ipcEndpoint(IPC_OUTPUTFORMAT, new InetSocketAddress(hostname, HiveConf.getIntVar(conf, ConfVars.LLAP_DAEMON_OUTPUT_SERVICE_PORT))); }
public Endpoint getRpcEndpoint() { final int rpcPort = HiveConf.getIntVar(conf, ConfVars.LLAP_DAEMON_RPC_PORT); return RegistryTypeUtils.ipcEndpoint(IPC_LLAP, new InetSocketAddress(hostname, rpcPort)); }
public Endpoint getMngEndpoint() { return RegistryTypeUtils.ipcEndpoint(IPC_MNG, new InetSocketAddress(hostname, HiveConf.getIntVar(conf, ConfVars.LLAP_MANAGEMENT_RPC_PORT))); }
private void updateEndpoint(final ServiceRecord srv, final String endpointName) { final String instanceUri = srv.get(INSTANCE_URI_CONFIG); final String[] tokens = instanceUri.split(":"); final String hostname = tokens[0]; final int port = Integer.parseInt(tokens[1]); Endpoint urlEndpoint = RegistryTypeUtils.ipcEndpoint(endpointName, new InetSocketAddress(hostname, port)); srv.addInternalEndpoint(urlEndpoint); LOG.info("Added {} endpoint to service record", urlEndpoint); }
public String register(int amPort, int pluginPort, String sessionId, String serializedToken, String jobIdForToken, int guaranteedCount) throws IOException { if (srv != null) { throw new UnsupportedOperationException("Already registered with " + srv); } srv = new ServiceRecord(); Endpoint rpcEndpoint = RegistryTypeUtils.ipcEndpoint( IPC_TEZCLIENT, new InetSocketAddress(hostname, amPort)); srv.addInternalEndpoint(rpcEndpoint); Endpoint pluginEndpoint = null; if (pluginPort >= 0) { pluginEndpoint = RegistryTypeUtils.ipcEndpoint( IPC_PLUGIN, new InetSocketAddress(hostname, pluginPort)); srv.addInternalEndpoint(pluginEndpoint); } srv.set(AM_SESSION_ID, sessionId); boolean hasToken = serializedToken != null; srv.set(AM_PLUGIN_TOKEN, hasToken ? serializedToken : ""); srv.set(AM_PLUGIN_JOBID, jobIdForToken != null ? jobIdForToken : ""); srv.set(AM_GUARANTEED_COUNT, Integer.toString(guaranteedCount)); String uniqueId = registerServiceRecord(srv); LOG.info("Registered this AM: rpc: {}, plugin: {}, sessionId: {}, token: {}, znodePath: {}", rpcEndpoint, pluginEndpoint, sessionId, hasToken, getRegistrationZnodePath()); return uniqueId; }
/** * Add some endpoints * @param entry entry */ public static void addSampleEndpoints(ServiceRecord entry, String hostname) throws URISyntaxException { assertNotNull(hostname); entry.addExternalEndpoint(webEndpoint(HTTP_API, new URI("http", hostname + ":80", "/"))); entry.addExternalEndpoint( restEndpoint(API_WEBHDFS, new URI("http", hostname + ":8020", "/"))); Endpoint endpoint = ipcEndpoint(API_HDFS, null); endpoint.addresses.add(RegistryTypeUtils.hostnamePortPair(hostname, 8030)); entry.addInternalEndpoint(endpoint); InetSocketAddress localhost = new InetSocketAddress("localhost", 8050); entry.addInternalEndpoint( inetAddrEndpoint(NNIPC, ProtocolTypes.PROTOCOL_THRIFT, "localhost", 8050)); entry.addInternalEndpoint( RegistryTypeUtils.ipcEndpoint( IPC2, localhost)); }
/** * Add some endpoints * @param entry entry */ public static void addSampleEndpoints(ServiceRecord entry, String hostname) throws URISyntaxException { assertNotNull(hostname); entry.addExternalEndpoint(webEndpoint(HTTP_API, new URI("http", hostname + ":80", "/"))); entry.addExternalEndpoint( restEndpoint(API_WEBHDFS, new URI("http", hostname + ":8020", "/"))); Endpoint endpoint = ipcEndpoint(API_HDFS, null); endpoint.addresses.add(RegistryTypeUtils.hostnamePortPair(hostname, 8030)); entry.addInternalEndpoint(endpoint); InetSocketAddress localhost = new InetSocketAddress("localhost", 8050); entry.addInternalEndpoint( inetAddrEndpoint(NNIPC, ProtocolTypes.PROTOCOL_THRIFT, "localhost", 8050)); entry.addInternalEndpoint( RegistryTypeUtils.ipcEndpoint( IPC2, localhost)); }
RegistryTypeUtils.ipcEndpoint( CustomRegistryConstants.AM_IPC_PROTOCOL, rpcServiceAddress));
RegistryTypeUtils.ipcEndpoint( CustomRegistryConstants.AM_IPC_PROTOCOL, rpcServiceAddress));