[
https://issues.apache.org/jira/browse/HDFS-15683?focusedWorklogId=543906&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-543906
]
ASF GitHub Bot logged work on HDFS-15683:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Jan/21 22:13
Start Date: 28/Jan/21 22:13
Worklog Time Spent: 10m
Work Description: LeonGao91 commented on a change in pull request #2625:
URL: https://github.com/apache/hadoop/pull/2625#discussion_r566443106
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/MountVolumeInfo.java
##########
@@ -102,9 +116,28 @@ boolean addVolume(FsVolumeImpl volume) {
return true;
}
-
void removeVolume(FsVolumeImpl target) {
storageTypeVolumeMap.remove(target.getStorageType());
+ capacityRatioMap.remove(target.getStorageType());
+ }
+
+ /**
+ * Set customize capacity ratio for a storage type.
+ * Return false if the value is too big.
+ */
+ boolean setCapacityRatio(StorageType storageType,
+ double capacityRatio) {
+ double leftover = 1;
+ for (Map.Entry<StorageType, Double> e : capacityRatioMap.entrySet()) {
+ if (e.getKey() != storageType) {
+ leftover -= e.getValue();
+ }
+ }
+ if (leftover < capacityRatio) {
+ return false;
+ }
+ capacityRatioMap.put(storageType, capacityRatio);
Review comment:
I think later it will be convenient when we add a feature to update the
capacity ratio without restarting datanode. It should be pretty harmless for
now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 543906)
Time Spent: 1h 20m (was: 1h 10m)
> Allow configuring DISK/ARCHIVE capacity for individual volumes
> --------------------------------------------------------------
>
> Key: HDFS-15683
> URL: https://issues.apache.org/jira/browse/HDFS-15683
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: datanode
> Reporter: Leon Gao
> Assignee: Leon Gao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> This is a follow-up task for https://issues.apache.org/jira/browse/HDFS-15548
> In case that the datanode disks are not unified, we should allow admins to
> configure capacity for individual volumes on top of the default one.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]