@Override public String toString() { return getClass().getSimpleName() + "(" + super.toString() + ", datanodeUuid=" + getDatanodeUuid() + ", infoPort=" + getInfoPort() + ", infoSecurePort=" + getInfoSecurePort() + ", ipcPort=" + getIpcPort() + ", storageInfo=" + storageInfo + ")"; }
@Override public String toString() { return getClass().getSimpleName() + "(" + super.toString() + ", datanodeUuid=" + getDatanodeUuid() + ", infoPort=" + getInfoPort() + ", infoSecurePort=" + getInfoSecurePort() + ", ipcPort=" + getIpcPort() + ", storageInfo=" + storageInfo + ")"; }
@Override public String toString() { return getClass().getSimpleName() + "(" + super.toString() + ", datanodeUuid=" + getDatanodeUuid() + ", infoPort=" + getInfoPort() + ", infoSecurePort=" + getInfoSecurePort() + ", ipcPort=" + getIpcPort() + ", storageInfo=" + storageInfo + ")"; }
public void testDataNodeRedirect() throws Exception { if (hdfs.exists(TEST_FILE)) { hdfs.delete(TEST_FILE, true); } FSDataOutputStream out = hdfs.create(TEST_FILE, (short) 1); out.writeBytes("0123456789"); out.close(); BlockLocation[] locations = hdfs.getFileBlockLocations(TEST_FILE, 0, 10); String locationName = locations[0].getNames()[0]; URL u = hftpFs.getNamenodeFileURL(TEST_FILE); HttpURLConnection conn = (HttpURLConnection)u.openConnection(); conn.setFollowRedirects(true); conn.connect(); conn.getInputStream(); boolean checked = false; // Find the datanode that has the block according to locations // and check that the URL was redirected to this DN's info port for (DataNode node : cluster.getDataNodes()) { if (node.getDatanodeRegistration().getName().equals(locationName)) { checked = true; assertEquals(node.getDatanodeRegistration().getInfoPort(), conn.getURL().getPort()); } } assertTrue("The test never checked that location of " + "the block and hftp desitnation are the same", checked); } /**
if (dnR.getXferAddr().equals(xferAddr)) { checked = true; assertEquals(dnR.getInfoPort(), conn.getURL().getPort());
nodeReg.getInfoPort(), nodeReg.getIpcPort()); nodeReg.updateRegInfo(dnReg);
nodeReg.getInfoPort(), nodeReg.getIpcPort()); nodeReg.updateRegInfo(dnReg);