storages[i] = dd.getStorageInfo(storageIDs[i]);
getStorageInfo(datanodesAndStorages.get(i + 1)); if (storage != null) { boolean aborted =
/** * @param dn datanode descriptor * @param s data node storage * @return the {@link DatanodeStorageInfo} for the specified datanode. * If {@code s} corresponds to a provided storage, the storage info * representing provided storage is returned. * @throws IOException */ DatanodeStorageInfo getStorage(DatanodeDescriptor dn, DatanodeStorage s) throws IOException { if (providedEnabled && storageId.equals(s.getStorageID())) { if (StorageType.PROVIDED.equals(s.getStorageType())) { if (providedStorageInfo.getState() == State.FAILED && s.getState() == State.NORMAL) { providedStorageInfo.setState(State.NORMAL); LOG.info("Provided storage transitioning to state " + State.NORMAL); } if (dn.getStorageInfo(s.getStorageID()) == null) { dn.injectStorage(providedStorageInfo); } processProvidedStorageReport(); return providedDescriptor.getProvidedStorage(dn, s); } LOG.warn("Reserved storage {} reported as non-provided from {}", s, dn); } return dn.getStorageInfo(s.getStorageID()); }
/** * Find specified DatanodeStorageInfo. * @return DatanodeStorageInfo or null if not found. */ DatanodeStorageInfo findStorageInfo(DatanodeDescriptor dn) { int len = getCapacity(); DatanodeStorageInfo providedStorageInfo = null; for(int idx = 0; idx < len; idx++) { DatanodeStorageInfo cur = getStorageInfo(idx); if(cur != null) { if (cur.getStorageType() == StorageType.PROVIDED) { // if block resides on provided storage, only match the storage ids if (dn.getStorageInfo(cur.getStorageID()) != null) { // do not return here as we have to check the other // DatanodeStorageInfos for this block which could be local providedStorageInfo = cur; } } else if (cur.getDatanodeDescriptor() == dn) { return cur; } } } return providedStorageInfo; }
if (corruptNodes.contains(node)) { String storageId = storage.getStorageID(); DatanodeStorageInfo storageInfo = node.getStorageInfo(storageId); State state = (storageInfo == null) ? null : storageInfo.getState(); out.println("Block=" + block.toString()
storage = node.getStorageInfo(storageID);
private void processIncrementalBlockReport(final DatanodeDescriptor node, final StorageReceivedDeletedBlocks srdb) throws IOException { DatanodeStorageInfo storageInfo = node.getStorageInfo(srdb.getStorage().getStorageID()); if (storageInfo == null) {
/** * Remove block from the list of blocks belonging to the data-node. Remove * data-node from the block. */ boolean removeBlock(String storageID, BlockInfoContiguous b) { DatanodeStorageInfo s = getStorageInfo(storageID); if (s != null) { return s.removeBlock(b); } return false; }
/** * Remove block from the list of blocks belonging to the data-node. Remove * data-node from the block. */ boolean removeBlock(String storageID, BlockInfoContiguous b) { DatanodeStorageInfo s = getStorageInfo(storageID); if (s != null) { return s.removeBlock(b); } return false; }
public DatanodeStorageInfo[] getDatanodeStorageInfos( DatanodeID[] datanodeID, String[] storageIDs, String format, Object... args) throws UnregisteredNodeException { if (datanodeID.length != storageIDs.length) { final String err = (storageIDs.length == 0? "Missing storageIDs: It is likely that the HDFS client," + " who made this call, is running in an older version of Hadoop" + " which does not support storageIDs." : "Length mismatched: storageIDs.length=" + storageIDs.length + " != " ) + " datanodeID.length=" + datanodeID.length; throw new HadoopIllegalArgumentException( err + ", "+ String.format(format, args)); } if (datanodeID.length == 0) { return null; } final DatanodeStorageInfo[] storages = new DatanodeStorageInfo[datanodeID.length]; for(int i = 0; i < datanodeID.length; i++) { final DatanodeDescriptor dd = getDatanode(datanodeID[i]); storages[i] = dd.getStorageInfo(storageIDs[i]); } return storages; }
public DatanodeStorageInfo[] getDatanodeStorageInfos( DatanodeID[] datanodeID, String[] storageIDs, String format, Object... args) throws UnregisteredNodeException { if (datanodeID.length != storageIDs.length) { final String err = (storageIDs.length == 0? "Missing storageIDs: It is likely that the HDFS client," + " who made this call, is running in an older version of Hadoop" + " which does not support storageIDs." : "Length mismatched: storageIDs.length=" + storageIDs.length + " != " ) + " datanodeID.length=" + datanodeID.length; throw new HadoopIllegalArgumentException( err + ", "+ String.format(format, args)); } if (datanodeID.length == 0) { return null; } final DatanodeStorageInfo[] storages = new DatanodeStorageInfo[datanodeID.length]; for(int i = 0; i < datanodeID.length; i++) { final DatanodeDescriptor dd = getDatanode(datanodeID[i]); storages[i] = dd.getStorageInfo(storageIDs[i]); } return storages; }
storage = node.getStorageInfo(storageID);
trimmedTargets.get(i).getStorageInfo(trimmedStorages.get(i)); if (storageInfo != null) { if(copyTruncate) {
private void processIncrementalBlockReport(final DatanodeDescriptor node, final StorageReceivedDeletedBlocks srdb) throws IOException { DatanodeStorageInfo storageInfo = node.getStorageInfo(srdb.getStorage().getStorageID()); if (storageInfo == null) {
storage = node.getStorageInfo(storageID);
DatanodeStorageInfo storageInfo = node.getStorageInfo(storage.getStorageID());
DatanodeStorageInfo storageInfo = node.getStorageInfo(storage.getStorageID());
.getDatanodeManager() .getDatanode(dn0.getDatanodeId()) .getStorageInfo(newStorageUuid); assertNotNull(storageInfo);
private void processIncrementalBlockReport(final DatanodeDescriptor node, final StorageReceivedDeletedBlocks srdb) throws IOException { DatanodeStorageInfo storageInfo = node.getStorageInfo(srdb.getStorage().getStorageID()); if (storageInfo == null) {
final int MAX_INVALIDATE_BLOCKS = 2*MAX_INVALIDATE_LIMIT+REMAINING_BLOCKS; final int MAX_REPLICATE_BLOCKS = 2*MAX_REPLICATE_LIMIT+REMAINING_BLOCKS; final DatanodeStorageInfo[] ONE_TARGET = {dd.getStorageInfo(storageID)};