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

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


      HaDescriptor descriptor = new DefaultHaDescriptor();
      HaProvider provider = new DefaultHaProvider(descriptor);
      ArrayList<String> urls = new ArrayList<String>();
      urls.add("http://host1");
      urls.add("http://host2");
      provider.addHaService("foo", urls);
      assertNull(provider.getActiveURL("bar"));
      String url = provider.getActiveURL("foo");
      assertNotNull(url);
      assertThat(url, isIn(urls));
   }
View Full Code Here


      String url1 = "http://host1";
      urls.add(url1);
      String url2 = "http://host2";
      urls.add(url2);
      String serviceName = "foo";
      provider.addHaService(serviceName, urls);
      assertEquals(url1, provider.getActiveURL(serviceName));
      provider.markFailedURL(serviceName, url1);
      assertEquals(url2, provider.getActiveURL(serviceName));
      provider.markFailedURL(serviceName, url2);
      assertEquals(url1, provider.getActiveURL(serviceName));
View Full Code Here

      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

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.