useLogicalUri = HAUtil.useLogicalUri(conf, nsUri); } catch (IOException e){ LOG.warn("Getting exception while trying to determine if nameservice "
useLogicalUri = HAUtil.useLogicalUri(conf, nsUri); } catch (IOException e){ LOG.warn("Getting exception while trying to determine if nameservice "
useLogicalUri = HAUtil.useLogicalUri(conf, nsUri); } catch (IOException e){ LOG.warn("Getting exception while trying to determine if nameservice "
/** * Test to verify IPFailoverProxyProvider is not requiring logical URI. */ @Test public void testIPFailoverProxyProviderLogicalUri() throws Exception { // setup the config with the IP failover proxy provider class Configuration config = new HdfsConfiguration(conf); URI nnUri = cluster.getURI(0); config.set(DFS_CLIENT_FAILOVER_PROXY_PROVIDER_KEY_PREFIX + "." + nnUri.getHost(), IPFailoverProxyProvider.class.getName()); assertFalse("IPFailoverProxyProvider should not use logical URI.", HAUtil.useLogicalUri(config, nnUri)); }
/** * Test to verify legacy proxy providers are correctly wrapped. */ @Test public void testWrappedFailoverProxyProvider() throws Exception { // setup the config with the dummy provider class Configuration config = new HdfsConfiguration(conf); String logicalName = HATestUtil.getLogicalHostname(cluster); HATestUtil.setFailoverConfigurations(cluster, config, logicalName); config.set(DFS_CLIENT_FAILOVER_PROXY_PROVIDER_KEY_PREFIX + "." + logicalName, DummyLegacyFailoverProxyProvider.class.getName()); Path p = new Path("hdfs://" + logicalName + "/"); // not to use IP address for token service SecurityUtil.setTokenServiceUseIp(false); // Logical URI should be used. assertTrue("Legacy proxy providers should use logical URI.", HAUtil.useLogicalUri(config, p.toUri())); }