You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Lisheng Sun (JIRA)" <ji...@apache.org> on 2019/03/04 07:39:00 UTC
[jira] [Created] (HDFS-14330) Consider StorageID to choose volume
Lisheng Sun created HDFS-14330:
----------------------------------
Summary: Consider StorageID to choose volume
Key: HDFS-14330
URL: https://issues.apache.org/jira/browse/HDFS-14330
Project: Hadoop HDFS
Issue Type: Improvement
Components: datanode
Affects Versions: 3.0.0-alpha4
Reporter: Lisheng Sun
RoundRobinVolumeChoosingPolicy#chooseVolume does not consider parameter storageId.
The {{BlockPlacementPolicy}} considers specific storages and return the infomation including storageId to client.
{code:java}
@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);
}
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org