restEndpoint(line.getOptionValue("api"), theUri));
restEndpoint(line.getOptionValue("api"), theUri));
private void registerHBaseServiceEntry() throws IOException { String name = amState.getApplicationName() ; ServiceRecord serviceRecord = new ServiceRecord(); // bond lifespan to the application serviceRecord.set(YarnRegistryAttributes.YARN_ID, yarnRegistry.getApplicationAttemptId() .getApplicationId().toString()); serviceRecord.set(YarnRegistryAttributes.YARN_PERSISTENCE, PersistencePolicies.APPLICATION); try { URL configURL = new URL(amWebAPI, SLIDER_PATH_PUBLISHER + "/" + HBASE_SERVICE_TYPE); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_CONFIGURATIONS_API, configURL.toURI())); } catch (URISyntaxException e) { log.warn("failed to create config URL: {}", e, e); } log.info("registering {}/{}", name, HBASE_SERVICE_TYPE); yarnRegistry.putService(HBASE_SERVICE_TYPE, name, serviceRecord, true); PublishedConfiguration publishedSite = new PublishedConfiguration("HBase site", siteConf); PublishedConfigSet configSet = amState.getOrCreatePublishedConfigSet(HBASE_SERVICE_TYPE); configSet.put(HBASE_SITE_PUBLISHED_CONFIG, publishedSite); }
RegistryTypeUtils.restEndpoint( CustomRegistryConstants.MANAGEMENT_REST_API, managementAPI.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_REST_API, publisherURL.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.REGISTRY_REST_API, registryREST.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_CONFIGURATIONS_API, new URI(configurationsURL))); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_EXPORTS_API, new URI(exportsURL)));
RegistryTypeUtils.restEndpoint( CustomRegistryConstants.MANAGEMENT_REST_API, managementAPI.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_REST_API, publisherURL.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.REGISTRY_REST_API, registryREST.toURI())); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_CONFIGURATIONS_API, new URI(configurationsURL))); serviceRecord.addExternalEndpoint( RegistryTypeUtils.restEndpoint( CustomRegistryConstants.PUBLISHER_EXPORTS_API, new URI(exportsURL)));
/** * 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)); }
PersistencePolicies.APPLICATION, "tomcat-based web application", null); webapp.addExternalEndpoint(restEndpoint("www", new URI("http", "//loadbalancer/", null))); null, null); comp1.addExternalEndpoint(restEndpoint("www", new URI("http", "//rack4server3:43572", null))); comp1.addInternalEndpoint( null, null); comp2.addExternalEndpoint(restEndpoint("www", new URI("http", "//rack1server28:35881", null))); comp2.addInternalEndpoint(