/** * Check that the registration returned from a NameNode is consistent * with the information in the storage. If the storage is fresh/unformatted, * sets the storage ID based on this registration. * Also updates the block pool's state in the secret manager. */ synchronized void bpRegistrationSucceeded(DatanodeRegistration bpRegistration, String blockPoolId) throws IOException { id = bpRegistration; if(!storage.getDatanodeUuid().equals(bpRegistration.getDatanodeUuid())) { throw new IOException("Inconsistent Datanode IDs. Name-node returned " + bpRegistration.getDatanodeUuid() + ". Expecting " + storage.getDatanodeUuid()); } registerBlockPoolWithSecretManager(bpRegistration, blockPoolId); }
@Override public String toString() { return getClass().getSimpleName() + "(" + super.toString() + ", datanodeUuid=" + getDatanodeUuid() + ", infoPort=" + getInfoPort() + ", infoSecurePort=" + getInfoSecurePort() + ", ipcPort=" + getIpcPort() + ", storageInfo=" + storageInfo + ")"; }
ClientTraceLog.info(String.format(DN_CLIENTTRACE_FORMAT, inAddr, myAddr, block.getNumBytes(), "HDFS_WRITE", clientname, offset, dnR.getDatanodeUuid(), block, endTime - startTime)); } else { LOG.info("Received " + block + " size " + block.getNumBytes()
"src: 127.0.0.1, dest: 127.0.0.1, op: REQUEST_SHORT_CIRCUIT_FDS," + " blockid: %s, srvID: %s, success: %b", blk.getBlockId(), dnR.getDatanodeUuid(), success));
? String.format(DN_CLIENTTRACE_FORMAT, localAddress, remoteAddress, "%d", "HDFS_READ", clientName, "%d", dnR.getDatanodeUuid(), block, "%d") : dnR + " Served block " + block + " to " + remoteAddress;
+ nodeReg + " storage " + nodeReg.getDatanodeUuid()); DatanodeDescriptor nodeS = getDatanode(nodeReg.getDatanodeUuid()); DatanodeDescriptor nodeN = host2DatanodeMap.getDatanodeByXferAddr( nodeReg.getIpAddr(), nodeReg.getXferPort()); + nodeReg.getDatanodeUuid());
/** * Check that the registration returned from a NameNode is consistent * with the information in the storage. If the storage is fresh/unformatted, * sets the storage ID based on this registration. * Also updates the block pool's state in the secret manager. */ synchronized void bpRegistrationSucceeded(DatanodeRegistration bpRegistration, String blockPoolId) throws IOException { id = bpRegistration; if(!storage.getDatanodeUuid().equals(bpRegistration.getDatanodeUuid())) { throw new IOException("Inconsistent Datanode IDs. Name-node returned " + bpRegistration.getDatanodeUuid() + ". Expecting " + storage.getDatanodeUuid()); } registerBlockPoolWithSecretManager(bpRegistration, blockPoolId); }
/** * Check that the registration returned from a NameNode is consistent * with the information in the storage. If the storage is fresh/unformatted, * sets the storage ID based on this registration. * Also updates the block pool's state in the secret manager. */ synchronized void bpRegistrationSucceeded(DatanodeRegistration bpRegistration, String blockPoolId) throws IOException { id = bpRegistration; if(!storage.getDatanodeUuid().equals(bpRegistration.getDatanodeUuid())) { throw new IOException("Inconsistent Datanode IDs. Name-node returned " + bpRegistration.getDatanodeUuid() + ". Expecting " + storage.getDatanodeUuid()); } registerBlockPoolWithSecretManager(bpRegistration, blockPoolId); }
@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 DatanodeRegistration answer(InvocationOnMock invocation) throws Throwable { i++; if ( i > 1 && i < 5) { LOG.info("mockito exception " + i); throw new EOFException("TestDatanodeProtocolRetryPolicy"); } else { DatanodeRegistration dr = (DatanodeRegistration) invocation.getArguments()[0]; datanodeRegistration = new DatanodeRegistration(dr.getDatanodeUuid(), dr); LOG.info("mockito succeeded " + datanodeRegistration); return datanodeRegistration; } } }).when(namenode).registerDatanode(
ClientTraceLog.info(String.format(DN_CLIENTTRACE_FORMAT, inAddr, myAddr, block.getNumBytes(), "HDFS_WRITE", clientname, offset, dnR.getDatanodeUuid(), block, endTime - startTime)); } else { LOG.info("Received " + block + " size " + block.getNumBytes()
Mockito.when(dr.getDatanodeUuid()).thenReturn(storageID);
doReturn("127.0.0.1").when(mockDnReg).getIpAddr(); doReturn(123).when(mockDnReg).getXferPort(); doReturn("fake-storage-id").when(mockDnReg).getDatanodeUuid(); doReturn(mockStorageInfo).when(mockDnReg).getStorageInfo();
ClientTraceLog.info(String.format(DN_CLIENTTRACE_FORMAT, inAddr, myAddr, block.getNumBytes(), "HDFS_WRITE", clientname, offset, dnR.getDatanodeUuid(), block, endTime - startTime)); } else { LOG.info("Received " + block + " size " + block.getNumBytes()
doReturn("fake-storage-id").when(mockDnReg).getDatanodeUuid(); doReturn(mockStorageInfo).when(mockDnReg).getStorageInfo();
String ip = "IP-" + i; DatanodeRegistration dr = Mockito.mock(DatanodeRegistration.class); Mockito.when(dr.getDatanodeUuid()).thenReturn(uuid); Mockito.when(dr.getIpAddr()).thenReturn(ip); Mockito.when(dr.getXferAddr()).thenReturn(ip + ":9000");
DataNodeTestUtils.getDNRegistrationForBP(cluster.getDataNodes().get(0), poolId); DFSTestUtil.waitForDatanodeState(cluster, reg.getDatanodeUuid(), true, 20000); DFSTestUtil.waitForDatanodeState(cluster, reg.getDatanodeUuid(), false, 20000); null) }; StorageReceivedDeletedBlocks[] storageBlocks = { new StorageReceivedDeletedBlocks(reg.getDatanodeUuid(), blocks) }; new DatanodeStorage(reg.getDatanodeUuid()), BlockListAsLongs.EMPTY) }; try { new DatanodeStorage(reg.getDatanodeUuid()), false, 0, 0, 0, 0, 0) }; DatanodeCommand[] cmd = dnp.sendHeartbeat(reg, rep, 0L, 0L, 0, 0, 0, null)
+ bpos.bpRegistration.getDatanodeUuid() + "; nna=" + getNNSocketAddress(bpos));
DatanodeRegistration dnReg = DataNodeTestUtils.getDNRegistrationForBP( lastDN, namesystem.getBlockPoolId()); String lastDNid = dnReg.getDatanodeUuid();