Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14330

Consider StorageID to choose volume

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0-alpha4
    • Fix Version/s: None
    • Component/s: datanode
    • Labels:
      None

      Description

      RoundRobinVolumeChoosingPolicy#chooseVolume does not consider  parameter storageId. 

      The BlockPlacementPolicy considers specific storages and return the infomation including storageId to client.

       @Override
        public V chooseVolume(final List<V> volumes, long blockSize, String storageId)
            throws IOException {
      
          if (volumes.size() < 1) {
            throw new DiskOutOfSpaceException("No more available volumes");
          }
      
          // As all the items in volumes are with the same storage type,
          // so only need to get the storage type index of the first item in volumes
          StorageType storageType = volumes.get(0).getStorageType();
          int index = storageType != null ?
                  storageType.ordinal() : StorageType.DEFAULT.ordinal();
      
          synchronized (syncLocks[index]) {
            return chooseVolume(index, volumes, blockSize);
          }
        }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                leosun08 Lisheng Sun
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: