target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testNormalizeHostName() { List<String> hosts = Arrays.asList(new String[] {"127.0.0.1", "localhost", "3w.org", "UnknownHost"}); List<String> normalizedHosts = NetUtils.normalizeHostNames(hosts); assertEquals(normalizedHosts.get(0), hosts.get(0)); assertFalse(normalizedHosts.get(1).equals(hosts.get(1))... | public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } | NetUtils { public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } } | NetUtils { public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } } | NetUtils { public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } static SocketFactory getSocketFactory(Configuration conf,
Class<?> clazz); static SocketFactory getDefaultSocketFactory(Configuration con... | NetUtils { public static String normalizeHostName(String name) { try { return InetAddress.getByName(name).getHostAddress(); } catch (UnknownHostException e) { return name; } } static SocketFactory getSocketFactory(Configuration conf,
Class<?> clazz); static SocketFactory getDefaultSocketFactory(Configuration con... |
@Test public void testGetHostNameOfIP() { assertNull(NetUtils.getHostNameOfIP(null)); assertNull(NetUtils.getHostNameOfIP("")); assertNull(NetUtils.getHostNameOfIP("crazytown")); assertNull(NetUtils.getHostNameOfIP("127.0.0.1:")); assertNull(NetUtils.getHostNameOfIP("127.0.0.1:-1")); assertNull(NetUtils.getHostNameOfIP... | public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).getHostName(); } catch (Unkn... | NetUtils { public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).getHostName(); } ... | NetUtils { public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).getHostName(); } ... | NetUtils { public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).getHostName(); } ... | NetUtils { public static String getHostNameOfIP(String ipPort) { if (null == ipPort || !ipPortPattern.matcher(ipPort).matches()) { return null; } try { int colonIdx = ipPort.indexOf(':'); String ip = (-1 == colonIdx) ? ipPort : ipPort.substring(0, ipPort.indexOf(':')); return InetAddress.getByName(ip).getHostName(); } ... |
@Test public void testHServerAddress() { new HServerAddress(); } | public HServerAddress() { super(); } | HServerAddress implements WritableComparable<HServerAddress> { public HServerAddress() { super(); } } | HServerAddress implements WritableComparable<HServerAddress> { public HServerAddress() { super(); } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); } | HServerAddress implements WritableComparable<HServerAddress> { public HServerAddress() { super(); } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddress(); int getPort(); String getHostname(); S... | HServerAddress implements WritableComparable<HServerAddress> { public HServerAddress() { super(); } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddress(); int getPort(); String getHostname(); S... |
@Test public void testLocatedBlocks2Locations() { DatanodeInfo d = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo[] ds = new DatanodeInfo[1]; ds[0] = d; ExtendedBlock b1 = new ExtendedBlock("bpid", 1, 1, 1); LocatedBlock l1 = new LocatedBlock(b1, ds, 0, false); ExtendedBlock b2 = new ExtendedBlock("bpid", 2, 1, 1); L... | public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } | DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } } | DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); } | DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(Strin... | DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(Strin... |
@Test public void getNameServiceId() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICE_ID, "nn1"); assertEquals("nn1", DFSUtil.getNamenodeNameServiceId(conf)); } | private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } String nnId = c... | DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin... | DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin... | DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin... | DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin... |
@Test public void getNameNodeNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_RPC_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getNamenodeNameServiceId(conf)); } | public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } | DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } } | DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); } | DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static byte... | DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static byte... |
@Test public void getBackupNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_BACKUP_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getBackupNameServiceId(conf)); } | public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } | DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } } | DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); } | DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static byt... | DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static byt... |
@Test public void getSecondaryNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getSecondaryNameServiceId(conf)); } | public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } | DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } } | DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); } | DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes);... | DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes);... |
@Test public void testGetNameServiceIds() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICES, "nn1,nn2"); Collection<String> nameserviceIds = DFSUtil.getNameServiceIds(conf); Iterator<String> it = nameserviceIds.iterator(); assertEquals(2, nameserviceIds.size()); assertEquals("nn1", it.next()... | public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } | DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } } | DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); } | DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static by... | DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[] bytes); static by... |
@Test public void testGetOnlyNameServiceIdOrNull() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICES, "ns1,ns2"); assertNull(DFSUtil.getOnlyNameServiceIdOrNull(conf)); conf.set(DFS_NAMESERVICES, ""); assertNull(DFSUtil.getOnlyNameServiceIdOrNull(conf)); conf.set(DFS_NAMESERVICES, "ns1"); ass... | public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } | DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } } | DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); } | DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static bool... | DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static bool... |
@Test public void testDefaultNamenode() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); final String hdfs_default = "hdfs: conf.set(FS_DEFAULT_NAME_KEY, hdfs_default); Map<String, Map<String, InetSocketAddress>> addrMap = DFSUtil.getNNServiceRpcAddresses(conf); assertEquals(1, addrMap.size()); Ma... | public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<String, InetSo... | DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri... | DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri... | DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri... | DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri... |
@Test public void testHServerAddressInetSocketAddress() { HServerAddress hsa1 = new HServerAddress(new InetSocketAddress("localhost", 1234)); System.out.println(hsa1.toString()); } | @Override public String toString() { return this.cachedToString; } | HServerAddress implements WritableComparable<HServerAddress> { @Override public String toString() { return this.cachedToString; } } | HServerAddress implements WritableComparable<HServerAddress> { @Override public String toString() { return this.cachedToString; } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); } | HServerAddress implements WritableComparable<HServerAddress> { @Override public String toString() { return this.cachedToString; } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddress(); int getP... | HServerAddress implements WritableComparable<HServerAddress> { @Override public String toString() { return this.cachedToString; } HServerAddress(); HServerAddress(InetSocketAddress address); HServerAddress(final String hostname, final int port); HServerAddress(HServerAddress other); String getBindAddress(); int getP... |
@Test public void testConfModificationFederationOnly() { final HdfsConfiguration conf = new HdfsConfiguration(); String nsId = "ns1"; conf.set(DFS_NAMESERVICES, nsId); conf.set(DFS_NAMESERVICE_ID, nsId); for (String key : NameNode.NAMENODE_SPECIFIC_KEYS) { conf.set(DFSUtil.addKeySuffixes(key, nsId), key); } NameNode.in... | public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[]... | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[]... |
@Test public void testConfModificationFederationAndHa() { final HdfsConfiguration conf = new HdfsConfiguration(); String nsId = "ns1"; String nnId = "nn1"; conf.set(DFS_NAMESERVICES, nsId); conf.set(DFS_NAMESERVICE_ID, nsId); conf.set(DFS_HA_NAMENODES_KEY_PREFIX + "." + nsId, nnId); for (String key : NameNode.NAMENODE_... | public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); } | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[]... | DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static Random getRandom(); static SecureRandom getSecureRandom(); static boolean isValidName(String src); static String bytes2String(byte[]... |
@Test public void testGetInfoServer() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); String httpsport = DFSUtil.getInfoServer(null, conf, true); assertEquals("0.0.0.0:"+DFS_NAMENODE_HTTPS_PORT_DEFA... | public static String getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) throws IOException { boolean securityOn = UserGroupInformation.isSecurityEnabled(); String httpAddressKey = (securityOn && httpsAddress) ? DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY; String h... | DFSUtil { public static String getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) throws IOException { boolean securityOn = UserGroupInformation.isSecurityEnabled(); String httpAddressKey = (securityOn && httpsAddress) ? DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY... | DFSUtil { public static String getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) throws IOException { boolean securityOn = UserGroupInformation.isSecurityEnabled(); String httpAddressKey = (securityOn && httpsAddress) ? DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY... | DFSUtil { public static String getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) throws IOException { boolean securityOn = UserGroupInformation.isSecurityEnabled(); String httpAddressKey = (securityOn && httpsAddress) ? DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY... | DFSUtil { public static String getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, boolean httpsAddress) throws IOException { boolean securityOn = UserGroupInformation.isSecurityEnabled(); String httpAddressKey = (securityOn && httpsAddress) ? DFS_NAMENODE_HTTPS_ADDRESS_KEY : DFS_NAMENODE_HTTP_ADDRESS_KEY... |
@Test public void getNameNodeServiceAddr() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); final String NS1_NN1_HOST = "ns1-nn1.example.com:8020"; final String NS1_NN1_HOST_SVC = "ns1-nn2.example.com:8021"; final String NS1_NN2_HOST = "ns1-nn1.example.com:8020"; final String NS1_NN2_HOST_SVC = "n... | public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKeys.DFS_NAM... | DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe... | DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe... | DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe... | DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe... |
@Test public void testSubstituteForWildcardAddress() throws IOException { assertEquals("foo:12345", DFSUtil.substituteForWildcardAddress("0.0.0.0:12345", "foo")); assertEquals("127.0.0.1:12345", DFSUtil.substituteForWildcardAddress("127.0.0.1:12345", "foo")); } | public static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); if (sockAddr.getAddress().isAnyLocalAddress()... | DFSUtil { public static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); if (sockAddr.getAddress().isAnyLoca... | DFSUtil { public static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); if (sockAddr.getAddress().isAnyLoca... | DFSUtil { public static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); if (sockAddr.getAddress().isAnyLoca... | DFSUtil { public static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); if (sockAddr.getAddress().isAnyLoca... |
@Test public void testIsValidName() { assertFalse(DFSUtil.isValidName("/foo/../bar")); assertFalse(DFSUtil.isValidName("/foo assertTrue(DFSUtil.isValidName("/")); assertTrue(DFSUtil.isValidName("/bar/")); } | public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0) || (eleme... | DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0)... | DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0)... | DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0)... | DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals("..") || element.equals(".") || (element.indexOf(":") >= 0)... |
@Test(timeout=5000) public void testGetSpnegoKeytabKey() { HdfsConfiguration conf = new HdfsConfiguration(); String defaultKey = "default.spengo.key"; conf.unset(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); assertEquals("Test spnego key in config is null", defaultKey, DFSUtil.getSpnegoKeytabKey(conf, defa... | public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } | DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } } | DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); } | DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); static Ra... | DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); static Ra... |
@Test public void testCreateAndDestroy() throws Exception { FileInputStreamCache cache = new FileInputStreamCache(10, 1000); cache.close(); } | public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } | FileInputStreamCache { public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } } | FileInputStreamCache { public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } FileInputStreamCache(i... | FileInputStreamCache { public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } FileInputStreamCache(i... | FileInputStreamCache { public synchronized void close() { if (closed) return; closed = true; IOUtils.cleanup(LOG, cacheCleaner); for (Iterator<Entry<Key, Value>> iter = map.entries().iterator(); iter.hasNext();) { Entry<Key, Value> entry = iter.next(); entry.getValue().close(); iter.remove(); } } FileInputStreamCache(i... |
@Test public void testMutativeOperationsWithAutoHaEnabled() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.setBoolean(DFSConfigKeys.DFS_HA_AUTO_FAILOVER_ENABLED_KEY, true); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shel... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testHServerAddressString() { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerAddress hsa2 = new HServerAddress(new InetSocketAddress("localhost", 1234)); assertTrue(hsa1.equals(hsa2)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } | HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } } | HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } HServerAddress(); HServerAddress(InetSocketAddress address); HSe... | HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } HServerAddress(); HServerAddress(InetSocketAddress address); HSe... | HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } HServerAddress(); HServerAddress(InetSocketAddress address); HSe... |
@Test public void testFailoverWithFencerConfigured() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(0, runTool("-failover", "nn1", "nn... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFailoverWithFencerAndNameservice() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(0, runTool("-ns", "ns1", "-fai... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFailoverWithFencerConfiguredAndForce() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(0, runTool("-failover", "n... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFailoverWithForceActive() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(0, runTool("-failover", "nn1", "nn2", "... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFailoverWithInvalidFenceArg() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(-1, runTool("-failover", "nn1", "nn... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFailoverWithAutoHa() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.setBoolean(DFSConfigKeys.DFS_HA_AUTO_FAILOVER_ENABLED_KEY, true); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.s... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testForceFenceOptionListedBeforeArgs() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); HdfsConfiguration conf = getHAConf(); conf.set(DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY, "shell(true)"); tool.setConf(conf); assertEquals(0, runTool("-failover", "--for... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void testFencingConfigPerNameNode() throws Exception { Mockito.doReturn(STANDBY_READY_RESULT).when(mockProtocol).getServiceStatus(); final String nsSpecificKey = DFSConfigKeys.DFS_HA_FENCE_METHODS_KEY + "." + NSID; final String nnSpecificKey = nsSpecificKey + ".nn1"; HdfsConfiguration conf = getHAConf(); c... | @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } | DFSHAAdmin extends HAAdmin { @Override public void setConf(Configuration conf) { if (conf != null) { conf = addSecurityConfiguration(conf); } super.setConf(conf); } @Override void setConf(Configuration conf); static Configuration addSecurityConfiguration(Configuration conf); static void main(String[] argv); } |
@Test public void outputOfLSVisitor() throws IOException { File testFile = new File(ROOT, "/basicCheck"); File outputFile = new File(ROOT, "/basicCheckOutput"); try { copyFile(originalFsimage, testFile); ImageVisitor v = new LsImageVisitor(outputFile.getPath(), true); OfflineImageViewer oiv = new OfflineImageViewer(tes... | public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(tracker); int imageVer... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... |
@Test public void testReadFields() throws IOException { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerAddress hsa2 = new HServerAddress("localhost", 1235); byte [] bytes = Writables.getBytes(hsa1); HServerAddress deserialized = (HServerAddress)Writables.getWritable(bytes, new HServerAddress()); as... | public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); checkBindAddressCanBeResolved(); createCachedToString(); } } | HServerAddress implements WritableComparable<HServerAddress> { public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); checkBindAddressCan... | HServerAddress implements WritableComparable<HServerAddress> { public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); checkBindAddressCan... | HServerAddress implements WritableComparable<HServerAddress> { public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); checkBindAddressCan... | HServerAddress implements WritableComparable<HServerAddress> { public void readFields(DataInput in) throws IOException { String hostname = in.readUTF(); int port = in.readInt(); if (hostname != null && hostname.length() > 0) { this.address = getResolvedAddress(new InetSocketAddress(hostname, port)); checkBindAddressCan... |
@Test public void unsupportedFSLayoutVersion() throws IOException { File testFile = new File(ROOT, "/invalidLayoutVersion"); File outputFile = new File(ROOT, "invalidLayoutVersionOutput"); try { int badVersionNum = -432; changeLayoutVersion(originalFsimage, testFile, badVersionNum); ImageVisitor v = new LsImageVisitor(... | public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(tracker); int imageVer... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... |
@Test public void truncatedFSImage() throws IOException { File testFile = new File(ROOT, "/truncatedFSImage"); File outputFile = new File(ROOT, "/trucnatedFSImageOutput"); try { copyPartOfFile(originalFsimage, testFile); assertTrue("Created truncated fsimage", testFile.exists()); ImageVisitor v = new LsImageVisitor(out... | public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(tracker); int imageVer... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... |
@Test public void outputOfFileDistributionVisitor() throws IOException { File testFile = new File(ROOT, "/basicCheck"); File outputFile = new File(ROOT, "/fileDistributionCheckOutput"); int totalFiles = 0; try { copyFile(originalFsimage, testFile); ImageVisitor v = new FileDistributionVisitor(outputFile.getPath(), 0, 0... | public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(tracker); int imageVer... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... |
@Test public void outputOfTestVisitor() throws IOException { File testFile = new File(ROOT, "/basicCheck"); try { copyFile(originalFsimage, testFile); TestImageVisitor v = new TestImageVisitor(); OfflineImageViewer oiv = new OfflineImageViewer(testFile.getPath(), v, true); oiv.go(); List<String> dtrs = v.getDelegationT... | public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(tracker); int imageVer... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... | OfflineImageViewer { public void go() throws IOException { DataInputStream in = null; PositionTrackingInputStream tracker = null; ImageLoader fsip = null; boolean done = false; try { tracker = new PositionTrackingInputStream(new BufferedInputStream( new FileInputStream(new File(inputFile)))); in = new DataInputStream(t... |
@Test public void testRelease203() { assertTrue(LayoutVersion.supports(Feature.DELEGATION_TOKEN, Feature.RESERVED_REL20_203.lv)); } | public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } static String getString(); static boolean supports(final Feature f, final int lv); static int getCurrentLayoutVersion(); } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } static String getString(); static boolean supports(final Feature f, final int lv); static int getCurrentLayoutVersion(); static final int BUGFIX_HDFS_2991_V... |
@Test public void testRelease204() { assertTrue(LayoutVersion.supports(Feature.DELEGATION_TOKEN, Feature.RESERVED_REL20_204.lv)); } | public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } static String getString(); static boolean supports(final Feature f, final int lv); static int getCurrentLayoutVersion(); } | LayoutVersion { public static boolean supports(final Feature f, final int lv) { final EnumSet<Feature> set = map.get(lv); return set != null && set.contains(f); } static String getString(); static boolean supports(final Feature f, final int lv); static int getCurrentLayoutVersion(); static final int BUGFIX_HDFS_2991_V... |
@Test public void testComputeMd5ForFile() throws Exception { MD5Hash computedDigest = MD5FileUtils.computeMd5ForFile(TEST_FILE); assertEquals(TEST_MD5, computedDigest); } | public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(), 128*1024); return new MD5H... | MD5FileUtils { public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(), 128*1024); ... | MD5FileUtils { public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(), 128*1024); ... | MD5FileUtils { public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(), 128*1024); ... | MD5FileUtils { public static MD5Hash computeMd5ForFile(File dataFile) throws IOException { InputStream in = new FileInputStream(dataFile); try { MessageDigest digester = MD5Hash.getDigester(); DigestInputStream dis = new DigestInputStream(in, digester); IOUtils.copyBytes(dis, new IOUtils.NullOutputStream(), 128*1024); ... |
@Test(expected=IOException.class) public void testVerifyMD5FileMissing() throws Exception { MD5FileUtils.verifySavedMD5(TEST_FILE, TEST_MD5); } | public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHash + ", computed: " + expected... | MD5FileUtils { public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHash + ", compute... | MD5FileUtils { public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHash + ", compute... | MD5FileUtils { public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHash + ", compute... | MD5FileUtils { public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5) throws IOException { MD5Hash storedHash = readStoredMd5ForFile(dataFile); if (!expectedMD5.equals(storedHash)) { throw new IOException( "File " + dataFile + " did not match stored MD5 checksum " + " (stored: " + storedHash + ", compute... |
@Test public void testRegexPatterns() { assertTrue(Pattern.matches(Addressing.VALID_PORT_REGEX, "123")); assertFalse(Pattern.matches(Addressing.VALID_PORT_REGEX, "")); assertTrue(ServerName.SERVERNAME_PATTERN.matcher("www1.example.org,1234,567").matches()); ServerName.parseServerName("a.b.c,58102,1319771740322"); Serve... | public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } | ServerName implements Comparable<ServerName> { public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } } | ServerName implements Comparable<ServerName> { public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } ServerName(final String hostname, final int port, final long startcode); ServerName(final String serve... | ServerName implements Comparable<ServerName> { public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } ServerName(final String hostname, final int port, final long startcode); ServerName(final String serve... | ServerName implements Comparable<ServerName> { public static ServerName parseServerName(final String str) { return SERVERNAME_PATTERN.matcher(str).matches()? new ServerName(str): new ServerName(str, NON_STARTCODE); } ServerName(final String hostname, final int port, final long startcode); ServerName(final String serve... |
@Test public void testOneElementBasic() { LOG.info("Test one element basic"); set.add(list.get(0)); assertEquals(1, set.size()); assertFalse(set.isEmpty()); Iterator<Integer> iter = set.iterator(); assertTrue(iter.hasNext()); assertEquals(list.get(0), iter.next()); assertFalse(iter.hasNext()); LOG.info("Test one elemen... | @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... |
@Test public void testMultiBasic() { LOG.info("Test multi element basic"); for (Integer i : list) { assertTrue(set.add(i)); } assertEquals(list.size(), set.size()); for (Integer i : list) { assertTrue(set.contains(i)); } for (Integer i : list) { assertFalse(set.add(i)); } for (Integer i : list) { assertTrue(set.contain... | @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... |
@Test public void testServerName() { ServerName sn = new ServerName("www.example.org", 1234, 5678); ServerName sn2 = new ServerName("www.example.org", 1234, 5678); ServerName sn3 = new ServerName("www.example.org", 1234, 56789); assertTrue(sn.equals(sn2)); assertFalse(sn.equals(sn3)); assertEquals(sn.hashCode(), sn2.ha... | public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } | ServerName implements Comparable<ServerName> { public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } } | ServerName implements Comparable<ServerName> { public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } ServerName(final String hostname, final int port, final lo... | ServerName implements Comparable<ServerName> { public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } ServerName(final String hostname, final int port, final lo... | ServerName implements Comparable<ServerName> { public ServerName(final String hostname, final int port, final long startcode) { this.hostname = hostname; this.port = port; this.startcode = startcode; this.servername = getServerName(hostname, port, startcode); } ServerName(final String hostname, final int port, final lo... |
@Test public void testRemoveMulti() { LOG.info("Test remove multi"); for (Integer i : list) { assertTrue(set.add(i)); } for (int i = 0; i < NUM / 2; i++) { assertTrue(set.remove(list.get(i))); } for (int i = 0; i < NUM / 2; i++) { assertFalse(set.contains(list.get(i))); } for (int i = NUM / 2; i < NUM; i++) { assertTru... | @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... |
@Test public void testRemoveAll() { LOG.info("Test remove all"); for (Integer i : list) { assertTrue(set.add(i)); } for (int i = 0; i < NUM; i++) { assertTrue(set.remove(list.get(i))); } for (int i = 0; i < NUM; i++) { assertFalse(set.contains(list.get(i))); } Iterator<Integer> iter = set.iterator(); assertFalse(iter.h... | @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public Iterator<T> iterator() { return new LinkedSetIterator(); } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> pollAll(); @O... |
@Test public void testPollOneElement() { LOG.info("Test poll one element"); set.add(list.get(0)); assertEquals(list.get(0), set.pollFirst()); assertNull(set.pollFirst()); LOG.info("Test poll one element - DONE"); } | public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } | LightWeightLinkedSet extends LightWeightHashSet<T> { public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } } | LightWeightLinkedSet extends LightWeightHashSet<T> { public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pol... | LightWeightLinkedSet extends LightWeightHashSet<T> { public T pollFirst() { if (head == null) { return null; } T first = head.element; this.remove(first); return first; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pol... |
@Test public void testPollAll() { LOG.info("Test poll all"); for (Integer i : list) { assertTrue(set.add(i)); } while (set.pollFirst() != null); assertEquals(0, set.size()); assertTrue(set.isEmpty()); for (int i = 0; i < NUM; i++) { assertFalse(set.contains(list.get(i))); } Iterator<Integer> iter = set.iterator(); asse... | @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollAll() { List<T> retList = new ArrayList<T>(size); while (head != null) { retList.add(head.element); head = head.after; } this.clear(); return retList; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor... |
@Test public void testPollNOne() { LOG.info("Test pollN one"); set.add(list.get(0)); List<Integer> l = set.pollN(10); assertEquals(1, l.size()); assertEquals(list.get(0), l.get(0)); LOG.info("Test pollN one - DONE"); } | @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... |
@Test public void testPollNMulti() { LOG.info("Test pollN multi"); set.addAll(list); List<Integer> l = set.pollN(10); assertEquals(10, l.size()); for (int i = 0; i < 10; i++) { assertEquals(list.get(i), l.get(i)); } l = set.pollN(1000); assertEquals(NUM - 10, l.size()); for (int i = 10; i < NUM; i++) { assertEquals(lis... | @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public List<T> pollN(int n) { if (n >= size) { return pollAll(); } List<T> retList = new ArrayList<T>(n); while (n-- > 0 && head != null) { T curr = head.element; this.removeElem(curr); retList.add(curr); } shrinkIfNecessary(); return retList; } LightWeight... |
@Test public void testClear() { LOG.info("Test clear"); set.addAll(list); assertEquals(NUM, set.size()); assertFalse(set.isEmpty()); set.clear(); assertEquals(0, set.size()); assertTrue(set.isEmpty()); assertEquals(0, set.pollAll().size()); assertEquals(0, set.pollN(10).size()); assertNull(set.pollFirst()); Iterator<In... | @Override public void clear() { super.clear(); this.head = null; this.tail = null; } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public void clear() { super.clear(); this.head = null; this.tail = null; } } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public void clear() { super.clear(); this.head = null; this.tail = null; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); } | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public void clear() { super.clear(); this.head = null; this.tail = null; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> poll... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override public void clear() { super.clear(); this.head = null; this.tail = null; } LightWeightLinkedSet(int initCapacity, float maxLoadFactor,
float minLoadFactor); LightWeightLinkedSet(); T pollFirst(); @Override List<T> pollN(int n); @Override List<T> poll... |
@Test public void testOther() { LOG.info("Test other"); assertTrue(set.addAll(list)); Integer[] array = set.toArray(new Integer[0]); assertEquals(NUM, array.length); for (int i = 0; i < array.length; i++) { assertTrue(list.contains(array[i])); } assertEquals(NUM, set.size()); Object[] array2 = set.toArray(); assertEqua... | @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentType(), size); } int currentIndex = 0; DoubleLinkedElement<T> current ... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentType(), size); } ... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentType(), size); } ... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentType(), size); } ... | LightWeightLinkedSet extends LightWeightHashSet<T> { @Override @SuppressWarnings("unchecked") public <U> U[] toArray(U[] a) { if (a == null) { throw new NullPointerException("Input array can not be null"); } if (a.length < size) { a = (U[]) java.lang.reflect.Array.newInstance(a.getClass() .getComponentType(), size); } ... |
@Test public void getServerStartcodeFromServerName() { ServerName sn = new ServerName("www.example.org", 1234, 5678); assertEquals(5678, ServerName.getServerStartcodeFromServerName(sn.toString())); assertNotSame(5677, ServerName.getServerStartcodeFromServerName(sn.toString())); } | public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } | ServerName implements Comparable<ServerName> { public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } } | ServerName implements Comparable<ServerName> { public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } ServerName(final String hostname, final int port, final long startcode); Serv... | ServerName implements Comparable<ServerName> { public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } ServerName(final String hostname, final int port, final long startcode); Serv... | ServerName implements Comparable<ServerName> { public static long getServerStartcodeFromServerName(final String serverName) { int index = serverName.lastIndexOf(SERVERNAME_SEPARATOR); return Long.parseLong(serverName.substring(index + 1)); } ServerName(final String hostname, final int port, final long startcode); Serv... |
@Test public void testConvertNamenodeRole() { assertEquals(NamenodeRoleProto.BACKUP, PBHelper.convert(NamenodeRole.BACKUP)); assertEquals(NamenodeRoleProto.CHECKPOINT, PBHelper.convert(NamenodeRole.CHECKPOINT)); assertEquals(NamenodeRoleProto.NAMENODE, PBHelper.convert(NamenodeRole.NAMENODE)); assertEquals(NamenodeRole... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertStoragInfo() { StorageInfo info = getStorageInfo(); StorageInfoProto infoProto = PBHelper.convert(info); StorageInfo info2 = PBHelper.convert(infoProto); assertEquals(info.getClusterID(), info2.getClusterID()); assertEquals(info.getCTime(), info2.getCTime()); assertEquals(info.getLayoutVers... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertNamenodeRegistration() { StorageInfo info = getStorageInfo(); NamenodeRegistration reg = new NamenodeRegistration("address:999", "http:1000", info, NamenodeRole.NAMENODE); NamenodeRegistrationProto regProto = PBHelper.convert(reg); NamenodeRegistration reg2 = PBHelper.convert(regProto); ass... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertDatanodeID() { DatanodeID dn = DFSTestUtil.getLocalDatanodeID(); DatanodeIDProto dnProto = PBHelper.convert(dn); DatanodeID dn2 = PBHelper.convert(dnProto); compare(dn, dn2); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlock() { Block b = new Block(1, 100, 3); BlockProto bProto = PBHelper.convert(b); Block b2 = PBHelper.convert(bProto); assertEquals(b, b2); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlockWithLocations() { BlockWithLocations locs = getBlockWithLocations(1); BlockWithLocationsProto locsProto = PBHelper.convert(locs); BlockWithLocations locs2 = PBHelper.convert(locsProto); compare(locs, locs2); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlocksWithLocations() { BlockWithLocations[] list = new BlockWithLocations[] { getBlockWithLocations(1), getBlockWithLocations(2) }; BlocksWithLocations locs = new BlocksWithLocations(list); BlocksWithLocationsProto locsProto = PBHelper.convert(locs); BlocksWithLocations locs2 = PBHelper.co... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlockKey() { BlockKey key = getBlockKey(1); BlockKeyProto keyProto = PBHelper.convert(key); BlockKey key1 = PBHelper.convert(keyProto); compare(key, key1); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testAddHostsAndBlockWeight() throws Exception { HDFSBlocksDistribution distribution = new HDFSBlocksDistribution(); distribution.addHostsAndBlockWeight(null, 100); assertEquals("Expecting no hosts weights", 0, distribution.getHostAndWeights().size()); distribution.addHostsAndBlockWeight(new String[0],... | public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } | HDFSBlocksDistribution { public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } } | HDFSBlocksDistribution { public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } HDFSBlocksDistribution(); } | HDFSBlocksDistribution { public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } HDFSBlocksDistribution(); @Override synchronized String toString(); void ad... | HDFSBlocksDistribution { public void addHostsAndBlockWeight(String[] hosts, long weight) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight); } } HDFSBlocksDistribution(); @Override synchronized String toString(); void ad... |
@Test public void testConvertExportedBlockKeys() { BlockKey[] keys = new BlockKey[] { getBlockKey(2), getBlockKey(3) }; ExportedBlockKeys expKeys = new ExportedBlockKeys(true, 9, 10, getBlockKey(1), keys); ExportedBlockKeysProto expKeysProto = PBHelper.convert(expKeys); ExportedBlockKeys expKeys1 = PBHelper.convert(exp... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertCheckpointSignature() { CheckpointSignature s = new CheckpointSignature(getStorageInfo(), "bpid", 100, 1); CheckpointSignatureProto sProto = PBHelper.convert(s); CheckpointSignature s1 = PBHelper.convert(sProto); assertEquals(s.getBlockpoolID(), s1.getBlockpoolID()); assertEquals(s.getClust... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertRemoteEditLog() { RemoteEditLog l = new RemoteEditLog(1, 100); RemoteEditLogProto lProto = PBHelper.convert(l); RemoteEditLog l1 = PBHelper.convert(lProto); compare(l, l1); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertRemoteEditLogManifest() { List<RemoteEditLog> logs = new ArrayList<RemoteEditLog>(); logs.add(new RemoteEditLog(1, 10)); logs.add(new RemoteEditLog(11, 20)); RemoteEditLogManifest m = new RemoteEditLogManifest(logs); RemoteEditLogManifestProto mProto = PBHelper.convert(m); RemoteEditLogMani... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertExtendedBlock() { ExtendedBlock b = getExtendedBlock(); ExtendedBlockProto bProto = PBHelper.convert(b); ExtendedBlock b1 = PBHelper.convert(bProto); assertEquals(b, b1); b.setBlockId(-1); bProto = PBHelper.convert(b); b1 = PBHelper.convert(bProto); assertEquals(b, b1); } | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertRecoveringBlock() { DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 }; RecoveringBlock b = new RecoveringBlock(getExtendedBlock(), dnInfo, 3); RecoveringBlockProto bProto = PB... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlockRecoveryCommand() { DatanodeInfo di1 = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo di2 = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo[] dnInfo = new DatanodeInfo[] { di1, di2 }; List<RecoveringBlock> blks = ImmutableList.of( new RecoveringBlock(getExtendedBlock(1), dnInfo, 3),... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlockToken() { Token<BlockTokenIdentifier> token = new Token<BlockTokenIdentifier>( "identifier".getBytes(), "password".getBytes(), new Text("kind"), new Text("service")); BlockTokenIdentifierProto tokenProto = PBHelper.convert(token); Token<BlockTokenIdentifier> token2 = PBHelper.convert(t... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertNamespaceInfo() { NamespaceInfo info = new NamespaceInfo(37, "clusterID", "bpID", 2300, 53); NamespaceInfoProto proto = PBHelper.convert(info); NamespaceInfo info2 = PBHelper.convert(proto); compare(info, info2); assertEquals(info.getBlockPoolID(), info2.getBlockPoolID()); assertEquals(info... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertLocatedBlock() { DatanodeInfo [] dnInfos = { DFSTestUtil.getLocalDatanodeInfo("127.0.0.1", "h1", AdminStates.DECOMMISSION_INPROGRESS), DFSTestUtil.getLocalDatanodeInfo("127.0.0.1", "h2", AdminStates.DECOMMISSIONED), DFSTestUtil.getLocalDatanodeInfo("127.0.0.1", "h3", AdminStates.NORMAL) }; ... | public static LocatedBlockProto[] convertLocatedBlock(LocatedBlock[] lb) { if (lb == null) return null; final int len = lb.length; LocatedBlockProto[] result = new LocatedBlockProto[len]; for (int i = 0; i < len; ++i) { result[i] = PBHelper.convert(lb[i]); } return result; } | PBHelper { public static LocatedBlockProto[] convertLocatedBlock(LocatedBlock[] lb) { if (lb == null) return null; final int len = lb.length; LocatedBlockProto[] result = new LocatedBlockProto[len]; for (int i = 0; i < len; ++i) { result[i] = PBHelper.convert(lb[i]); } return result; } } | PBHelper { public static LocatedBlockProto[] convertLocatedBlock(LocatedBlock[] lb) { if (lb == null) return null; final int len = lb.length; LocatedBlockProto[] result = new LocatedBlockProto[len]; for (int i = 0; i < len; ++i) { result[i] = PBHelper.convert(lb[i]); } return result; } private PBHelper(); } | PBHelper { public static LocatedBlockProto[] convertLocatedBlock(LocatedBlock[] lb) { if (lb == null) return null; final int len = lb.length; LocatedBlockProto[] result = new LocatedBlockProto[len]; for (int i = 0; i < len; ++i) { result[i] = PBHelper.convert(lb[i]); } return result; } private PBHelper(); static ByteS... | PBHelper { public static LocatedBlockProto[] convertLocatedBlock(LocatedBlock[] lb) { if (lb == null) return null; final int len = lb.length; LocatedBlockProto[] result = new LocatedBlockProto[len]; for (int i = 0; i < len; ++i) { result[i] = PBHelper.convert(lb[i]); } return result; } private PBHelper(); static ByteS... |
@Test public void testAdd() throws Exception { HDFSBlocksDistribution distribution = new HDFSBlocksDistribution(); distribution.add(new MockHDFSBlocksDistribution()); assertEquals("Expecting no hosts weights", 0, distribution.getHostAndWeights().size()); distribution.addHostsAndBlockWeight(new String[]{"test"}, 10); as... | public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHostAndWeight.getValue().host, otherHostAn... | HDFSBlocksDistribution { public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHostAndWeight.get... | HDFSBlocksDistribution { public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHostAndWeight.get... | HDFSBlocksDistribution { public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHostAndWeight.get... | HDFSBlocksDistribution { public void add(HDFSBlocksDistribution otherBlocksDistribution) { Map<String,HostAndWeight> otherHostAndWeights = otherBlocksDistribution.getHostAndWeights(); for (Map.Entry<String, HostAndWeight> otherHostAndWeight: otherHostAndWeights.entrySet()) { addHostAndBlockWeight(otherHostAndWeight.get... |
@Test public void testConvertDatanodeRegistration() { DatanodeID dnId = DFSTestUtil.getLocalDatanodeID(); BlockKey[] keys = new BlockKey[] { getBlockKey(2), getBlockKey(3) }; ExportedBlockKeys expKeys = new ExportedBlockKeys(true, 9, 10, getBlockKey(1), keys); DatanodeRegistration reg = new DatanodeRegistration(dnId, n... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testConvertBlockCommand() { Block[] blocks = new Block[] { new Block(21), new Block(22) }; DatanodeInfo[][] dnInfos = new DatanodeInfo[][] { new DatanodeInfo[1], new DatanodeInfo[2] }; dnInfos[0][0] = DFSTestUtil.getLocalDatanodeInfo(); dnInfos[1][0] = DFSTestUtil.getLocalDatanodeInfo(); dnInfos[1][1]... | public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); } | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... | PBHelper { public static NamenodeRole convert(NamenodeRoleProto role) { switch (role) { case NAMENODE: return NamenodeRole.NAMENODE; case BACKUP: return NamenodeRole.BACKUP; case CHECKPOINT: return NamenodeRole.CHECKPOINT; } return null; } private PBHelper(); static ByteString getByteString(byte[] bytes); static Namen... |
@Test public void testBlockMissingException() throws Exception { LOG.info("Test testBlockMissingException started."); long blockSize = 1024L; int numBlocks = 4; conf = new HdfsConfiguration(); try { dfs = new MiniDFSCluster.Builder(conf).numDataNodes(NUM_DATANODES).build(); dfs.waitActive(); fileSys = (DistributedFileS... | public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } | BlockMissingException extends IOException { public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } } | BlockMissingException extends IOException { public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } BlockMissingException(String filename, String description, long offset); } | BlockMissingException extends IOException { public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } BlockMissingException(String filename, String description, long offset); String getFile(); long getOffset(); } | BlockMissingException extends IOException { public BlockMissingException(String filename, String description, long offset) { super(description); this.filename = filename; this.offset = offset; } BlockMissingException(String filename, String description, long offset); String getFile(); long getOffset(); } |
@Test public void testFormat() throws Exception { QuorumJournalManager qjm = closeLater(new QuorumJournalManager( conf, cluster.getQuorumJournalURI("testFormat-jid"), FAKE_NSINFO)); assertFalse(qjm.hasSomeData()); qjm.format(FAKE_NSINFO); assertTrue(qjm.hasSomeData()); } | @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw new IOException("Interrupted waiting for format() response"); }... | QuorumJournalManager implements JournalManager { @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw new IOExceptio... | QuorumJournalManager implements JournalManager { @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw new IOExceptio... | QuorumJournalManager implements JournalManager { @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw new IOExceptio... | QuorumJournalManager implements JournalManager { @Override public void format(NamespaceInfo nsInfo) throws IOException { QuorumCall<AsyncLogger,Void> call = loggers.format(nsInfo); try { call.waitFor(loggers.size(), loggers.size(), 0, FORMAT_TIMEOUT_MS, "format"); } catch (InterruptedException e) { throw new IOExceptio... |
@Test public void testSelectInputStreamsMajorityDown() throws Exception { cluster.shutdown(); List<EditLogInputStream> streams = Lists.newArrayList(); try { qjm.selectInputStreams(streams, 0, false); fail("Did not throw IOE"); } catch (QuorumException ioe) { GenericTestUtils.assertExceptionContains( "Got too many excep... | @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEditLogManifest> resps = loggers.waitForWriteQuorum(q, selectInputS... | QuorumJournalManager implements JournalManager { @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEditLogManifest> r... | QuorumJournalManager implements JournalManager { @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEditLogManifest> r... | QuorumJournalManager implements JournalManager { @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEditLogManifest> r... | QuorumJournalManager implements JournalManager { @Override public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException { QuorumCall<AsyncLogger, RemoteEditLogManifest> q = loggers.getEditLogManifest(fromTxnId); Map<AsyncLogger, RemoteEditLogManifest> r... |
@Test public void testChangeWritersLogsInSync() throws Exception { writeSegment(cluster, qjm, 1, 3, false); QJMTestUtil.assertExistsInQuorum(cluster, NNStorage.getInProgressEditsFileName(1)); qjm = closeLater(new QuorumJournalManager( conf, cluster.getQuorumJournalURI(JID), FAKE_NSINFO)); qjm.recoverUnfinalizedSegments... | @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps = createNewUniqueEpoch(); LOG.info("Successfully started new e... | QuorumJournalManager implements JournalManager { @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps = createNewUn... | QuorumJournalManager implements JournalManager { @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps = createNewUn... | QuorumJournalManager implements JournalManager { @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps = createNewUn... | QuorumJournalManager implements JournalManager { @Override public void recoverUnfinalizedSegments() throws IOException { Preconditions.checkState(!isActiveWriter, "already active writer"); LOG.info("Starting recovery process for unclosed journal segments..."); Map<AsyncLogger, NewEpochResponseProto> resps = createNewUn... |
@Test public void testNewerVersionOfSegmentWins() throws Exception { setupEdgeCaseOneJnHasSegmentWithAcceptedRecovery(); cluster.getJournalNode(0).stopAndJoin(0); qjm = createSpyingQJM(); try { assertEquals(100, QJMTestUtil.recoverAndReturnLastTxn(qjm)); writeSegment(cluster, qjm, 101, 50, false); } finally { qjm.close... | @Override public void close() throws IOException { loggers.close(); } | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } } | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... |
@Test public void testNewerVersionOfSegmentWins2() throws Exception { setupEdgeCaseOneJnHasSegmentWithAcceptedRecovery(); cluster.getJournalNode(0).stopAndJoin(0); qjm = createSpyingQJM(); try { assertEquals(100, QJMTestUtil.recoverAndReturnLastTxn(qjm)); cluster.restartJournalNode(0); cluster.getJournalNode(1).stopAnd... | @Override public void close() throws IOException { loggers.close(); } | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } } | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... | QuorumJournalManager implements JournalManager { @Override public void close() throws IOException { loggers.close(); } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); ... |
@Test public void testSatisfies() { Assert.assertEquals(FuzzyRowFilter.SatisfiesCode.NEXT_EXISTS, FuzzyRowFilter.satisfies(new byte[]{1, (byte) -128, 0, 0, 1}, new byte[]{1, 0, 1}, new byte[]{0, 1, 0})); Assert.assertEquals(FuzzyRowFilter.SatisfiesCode.YES, FuzzyRowFilter.satisfies(new byte[]{1, (byte) -128, 1, 0, 1}, ... | static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } | FuzzyRowFilter extends FilterBase { static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } } | FuzzyRowFilter extends FilterBase { static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); } | FuzzyRowFilter extends FilterBase { static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); @Override ReturnCode filterKeyValue(KeyValue kv); ... | FuzzyRowFilter extends FilterBase { static SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return satisfies(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); @Override ReturnCode filterKeyValue(KeyValue kv); ... |
@Test public void testToString() throws Exception { GenericTestUtils.assertMatches( qjm.toString(), "QJM to \\[127.0.0.1:\\d+, 127.0.0.1:\\d+, 127.0.0.1:\\d+\\]"); } | @Override public String toString() { return "QJM to " + loggers; } | QuorumJournalManager implements JournalManager { @Override public String toString() { return "QJM to " + loggers; } } | QuorumJournalManager implements JournalManager { @Override public String toString() { return "QJM to " + loggers; } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); } | QuorumJournalManager implements JournalManager { @Override public String toString() { return "QJM to " + loggers; } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); sta... | QuorumJournalManager implements JournalManager { @Override public String toString() { return "QJM to " + loggers; } QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo); QuorumJournalManager(Configuration conf,
URI uri, NamespaceInfo nsInfo,
AsyncLogger.Factory loggerFactory); sta... |
@Test public void testSimpleCall() throws Exception { ch.sendEdits(1, 1, 3, FAKE_DATA).get(); Mockito.verify(mockProxy).journal(Mockito.<RequestInfo>any(), Mockito.eq(1L), Mockito.eq(1L), Mockito.eq(3), Mockito.same(FAKE_DATA)); } | @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } final long submitNanos = System.nanoTime(); ListenableFutur... | IPCLoggerChannel implements AsyncLogger { @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } final long submit... | IPCLoggerChannel implements AsyncLogger { @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } final long submit... | IPCLoggerChannel implements AsyncLogger { @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } final long submit... | IPCLoggerChannel implements AsyncLogger { @Override public ListenableFuture<Void> sendEdits( final long segmentTxId, final long firstTxnId, final int numTxns, final byte[] data) { try { reserveQueueSpace(data.length); } catch (LoggerTooFarBehindException e) { return Futures.immediateFailedFuture(e); } final long submit... |
@Test public void testNamespaceVerification() throws Exception { journal.newEpoch(FAKE_NSINFO, 1); try { journal.newEpoch(FAKE_NSINFO_2, 2); fail("Did not fail newEpoch() when namespaces mismatched"); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "Incompatible namespaceID", ioe); } } | synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpoch()); } updateLastPromisedEpoc... | Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpo... | Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpo... | Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpo... | Journal implements Closeable { synchronized NewEpochResponseProto newEpoch( NamespaceInfo nsInfo, long epoch) throws IOException { checkFormatted(); storage.checkConsistentNamespace(nsInfo); if (epoch <= getLastPromisedEpoch()) { throw new IOException("Proposed epoch " + epoch + " <= last promise " + getLastPromisedEpo... |
@Test public void testJournal() throws Exception { MetricsRecordBuilder metrics = MetricsAsserts.getMetrics( journal.getMetricsForTests().getName()); MetricsAsserts.assertCounter("BatchesWritten", 0L, metrics); MetricsAsserts.assertCounter("BatchesWrittenWhileLagging", 0L, metrics); MetricsAsserts.assertGauge("CurrentL... | public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } | JournalNode implements Tool, Configurable { public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } } | JournalNode implements Tool, Configurable { public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } } | JournalNode implements Tool, Configurable { public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override int run(String[] args); void start(); boolean isStarted(); InetSocketAddress getBoundIpcAddress(); InetSo... | JournalNode implements Tool, Configurable { public InetSocketAddress getBoundIpcAddress() { return rpcServer.getAddress(); } @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override int run(String[] args); void start(); boolean isStarted(); InetSocketAddress getBoundIpcAddress(); InetSo... |
@Test public void testGetInvalidateBlocks() throws Exception { final int MAX_BLOCKS = 10; final int REMAINING_BLOCKS = 2; final int MAX_LIMIT = MAX_BLOCKS - REMAINING_BLOCKS; DatanodeDescriptor dd = DFSTestUtil.getLocalDatanodeDescriptor(); ArrayList<Block> blockList = new ArrayList<Block>(MAX_BLOCKS); for (int i=0; i<... | public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } | DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } } | DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI... | DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI... | DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI... |
@Test public void testRemove() throws Exception { DatanodeDescriptor nodeNotInMap = DFSTestUtil.getDatanodeDescriptor("3.3.3.3", "/d1/r4"); assertFalse(map.remove(nodeNotInMap)); assertTrue(map.remove(dataNodes[0])); assertTrue(map.getDatanodeByHost("1.1.1.1.")==null); assertTrue(map.getDatanodeByHost("2.2.2.2")==dataN... | boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAddr); return true; } else { retu... | Host2NodesMap { boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAddr); return tru... | Host2NodesMap { boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAddr); return tru... | Host2NodesMap { boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAddr); return tru... | Host2NodesMap { boolean remove(DatanodeDescriptor node) { if (node==null) { return false; } String ipAddr = node.getIpAddr(); hostmapLock.writeLock().lock(); try { DatanodeDescriptor[] nodes = map.get(ipAddr); if (nodes==null) { return false; } if (nodes.length==1) { if (nodes[0]==node) { map.remove(ipAddr); return tru... |
@Test public void testGetUgi() throws IOException { conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs: HttpServletRequest request = mock(HttpServletRequest.class); ServletContext context = mock(ServletContext.class); String user = "TheDoctor"; Text userText = new Text(user); DelegationTokenIdentifier dtId = new Delegat... | public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... |
@Test public void testDelegationTokenUrlParam() { conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); String tokenString = "xyzabc"; String delegationTokenParam = JspHelper .getDelegationTokenUrlParam(tokenString); Assert.assertEquals(JspHelper.SET_DELEGATION... | public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } | JspHelper { public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } } | JspHelper { public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } private JspHelper(); } | JspHelper { public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration con... | JspHelper { public static String getDelegationTokenUrlParam(String tokenString) { if (tokenString == null ) { return ""; } if (UserGroupInformation.isSecurityEnabled()) { return SET_DELEGATION + tokenString; } else { return ""; } } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration con... |
@Test public void testGetNextForFuzzyRule() { assertNext( new byte[]{0, 1, 2}, new byte[]{1, 0, 0}, new byte[]{1, 2, 1, 0, 1}, new byte[]{2, 1, 2, 0, 0}); assertNext( new byte[]{0, 1, 2}, new byte[]{1, 0, 0}, new byte[]{1, 1, 2, 0, 1}, new byte[]{1, 1, 2, 0, 2}); assertNext( new byte[]{0, 1, 0, 2, 0}, new byte[]{1, 0, ... | static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return getNextForFuzzyRule(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } | FuzzyRowFilter extends FilterBase { static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return getNextForFuzzyRule(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } } | FuzzyRowFilter extends FilterBase { static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return getNextForFuzzyRule(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); } | FuzzyRowFilter extends FilterBase { static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return getNextForFuzzyRule(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); @Override ReturnCode filterKeyValue(K... | FuzzyRowFilter extends FilterBase { static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta) { return getNextForFuzzyRule(row, 0, row.length, fuzzyKeyBytes, fuzzyKeyMeta); } FuzzyRowFilter(); FuzzyRowFilter(List<Pair<byte[], byte[]>> fuzzyKeysData); @Override ReturnCode filterKeyValue(K... |
@Test public void testGetUgiFromToken() throws IOException { conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs: ServletContext context = mock(ServletContext.class); String realUser = "TheDoctor"; String user = "TheNurse"; conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfig... | public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... |
@Test public void testGetNonProxyUgi() throws IOException { conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs: ServletContext context = mock(ServletContext.class); String realUser = "TheDoctor"; String user = "TheNurse"; conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfigu... | public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... |
@Test public void testGetProxyUgi() throws IOException { conf.set(DFSConfigKeys.FS_DEFAULT_NAME_KEY, "hdfs: ServletContext context = mock(ServletContext.class); String realUser = "TheDoctor"; String user = "TheNurse"; conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); conf.set(ProxyUsers.CONF_HADOOP_PR... | public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); } | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... | JspHelper { public static UserGroupInformation getUGI(HttpServletRequest request, Configuration conf) throws IOException { return getUGI(null, request, conf); } private JspHelper(); static DatanodeInfo bestNode(LocatedBlocks blks, Configuration conf); static DatanodeInfo bestNode(LocatedBlock blk, Configuration conf);... |
@Test public void testClientSideException() throws IOException { Configuration conf = new HdfsConfiguration(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(0).build(); NNStorage mockStorage = Mockito.mock(NNStorage.class); List<File> localPath = Collections.<File>singletonList( new File("/xxx... | static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str); return doGetUrl(... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... |
@Test public void testClientSideExceptionOnJustOneDir() throws IOException { Configuration conf = new HdfsConfiguration(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(0).build(); NNStorage mockStorage = Mockito.mock(NNStorage.class); List<File> localPaths = ImmutableList.of( new File("/xxxxx... | static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str); return doGetUrl(... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... |
@Test(timeout = 5000) public void testImageTransferTimeout() throws Exception { HttpServer testServer = HttpServerFunctionalTest.createServer("hdfs"); try { testServer.addServlet("GetImage", "/getimage", TestGetImageServlet.class); testServer.start(); URL serverURL = HttpServerFunctionalTest.getServerURL(testServer); T... | static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str); return doGetUrl(... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... | TransferFsImage { static MD5Hash getFileClient(String nnHostPort, String queryString, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException { String str = HttpConfig.getSchemePrefix() + nnHostPort + "/getimage?" + queryString; LOG.info("Opening connection to " + str); URL url = new URL(str)... |
@Test public void testSuccessfulBaseCase() throws Exception { removeStandbyNameDirs(); try { cluster.restartNameNode(1); fail("Did not throw"); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "Cannot start an HA namenode with name dirs that need recovery", ioe); } int rc = BootstrapStandby.run( ne... | @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY, myAddr.getHostName()); return SecurityUtil.doAs... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... |
@Test public void testDownloadingLaterCheckpoint() throws Exception { nn0.getRpcServer().rollEditLog(); nn0.getRpcServer().rollEditLog(); NameNodeAdapter.enterSafeMode(nn0, false); NameNodeAdapter.saveNamespace(nn0); NameNodeAdapter.leaveSafeMode(nn0, false); long expectedCheckpointTxId = NameNodeAdapter.getNamesystem(... | @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY, myAddr.getHostName()); return SecurityUtil.doAs... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... |
@Test public void testSharedEditsMissingLogs() throws Exception { removeStandbyNameDirs(); CheckpointSignature sig = nn0.getRpcServer().rollEditLog(); assertEquals(3, sig.getCurSegmentTxId()); URI editsUri = cluster.getSharedEditsDir(0, 1); File editsDir = new File(editsUri); File editsSegment = new File(new File(edits... | @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY, myAddr.getHostName()); return SecurityUtil.doAs... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... | BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.