From 8641a2c08b0ce0f1f23cf2d508baccc4f627a385 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Tue, 27 Jun 2017 00:39:47 -0700 Subject: [PATCH] HDFS-12045. Add log when Diskbalancer volume is transient storage type. Contributed by steven-wugang. --- .../hadoop/hdfs/server/datanode/DiskBalancer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java index 0c75001e5f..6b2cd52f91 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java @@ -1011,15 +1011,19 @@ public void copyBlocks(VolumePair pair, DiskBalancerWorkItem item) { return; } + if (source.isTransientStorage() || dest.isTransientStorage()) { + final String errMsg = "Disk Balancer - Unable to support " + + "transient storage type."; + LOG.error(errMsg); + item.setErrMsg(errMsg); + return; + } + List poolIters = new LinkedList<>(); startTime = Time.now(); item.setStartTime(startTime); secondsElapsed = 0; - if (source.isTransientStorage() || dest.isTransientStorage()) { - return; - } - try { openPoolIters(source, poolIters); if (poolIters.size() == 0) {