Package org.apache.hadoop.gateway.ha.provider.impl

Examples of org.apache.hadoop.gateway.ha.provider.impl.DefaultHaProvider.addHaService()


      URI uri1 = new URI( "http://unreachable-host" );
      URI uri2 = new URI( "http://reachable-host" );
      ArrayList<String> urlList = new ArrayList<String>();
      urlList.add(uri1.toString());
      urlList.add(uri2.toString());
      provider.addHaService(serviceName, urlList);
      FilterConfig filterConfig = EasyMock.createNiceMock(FilterConfig.class);
      ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);

      EasyMock.expect(filterConfig.getInitParameter(WebHdfsHaHttpClientDispatch.RESOURCE_ROLE_ATTRIBUTE)).andReturn(serviceName).anyTimes();
      EasyMock.expect(filterConfig.getServletContext()).andReturn(servletContext).anyTimes();
View Full Code Here


      String clusterName = (String) servletContext.getAttribute(GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE);
      ServiceRegistry serviceRegistry = services.getService(GatewayServices.SERVICE_REGISTRY_SERVICE);
      HaProvider provider = new DefaultHaProvider(descriptor);
      List<String> serviceNames = descriptor.getEnabledServiceNames();
      for (String serviceName : serviceNames) {
         provider.addHaService(serviceName, serviceRegistry.lookupServiceURLs(clusterName, serviceName));
      }
      servletContext.setAttribute(PROVIDER_ATTRIBUTE_NAME, provider);
   }

   private static URL locateDescriptor(ServletContext context) throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.