[hadoop] branch trunk updated: HDFS-16230. Remove irrelevant trim() call in TestStorageRestore. (#3455). Contributed by Thomas Leplus.
This is an automated email from the ASF dual-hosted git repository. ayushsaxena pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git The following commit(s) were added to refs/heads/trunk by this push: new f92c675 HDFS-16230. Remove irrelevant trim() call in TestStorageRestore. (#3455). Contributed by Thomas Leplus. f92c675 is described below commit f92c6750ec33392b8efa99931fc3c1fa82baa627 Author: Thomas Leplus AuthorDate: Sun Sep 19 11:39:05 2021 -0700 HDFS-16230. Remove irrelevant trim() call in TestStorageRestore. (#3455). Contributed by Thomas Leplus. --- .../java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java | 1 - 1 file changed, 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java index 19f1ca9..3664704 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestStorageRestore.java @@ -294,7 +294,6 @@ public class TestStorageRestore { restore = fsi.getStorage().getRestoreFailedStorage(); assertTrue("After check call restore is " + restore, restore); String commandOutput = cmdResult.getCommandOutput(); - commandOutput.trim(); assertTrue(commandOutput.contains("restoreFailedStorage is set to true")); - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[hadoop] branch trunk updated: YARN-10950. Code cleanup in QueueCapacities (#3454)
This is an automated email from the ASF dual-hosted git repository. snemeth pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git The following commit(s) were added to refs/heads/trunk by this push: new a9b2469 YARN-10950. Code cleanup in QueueCapacities (#3454) a9b2469 is described below commit a9b2469a534c5bc554c09aaf2d460a5a00922aca Author: Adam Antal AuthorDate: Sun Sep 19 14:42:02 2021 +0200 YARN-10950. Code cleanup in QueueCapacities (#3454) --- .../scheduler/capacity/QueueCapacities.java| 51 -- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java index 86d35d6..2d82966 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java @@ -33,17 +33,16 @@ import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsMana public class QueueCapacities { private static final String NL = CommonNodeLabelsManager.NO_LABEL; private static final float LABEL_DOESNT_EXIST_CAP = 0f; - private Map capacitiesMap; - private ReadLock readLock; - private WriteLock writeLock; + private final Map capacitiesMap; + private final ReadLock readLock; + private final WriteLock writeLock; private final boolean isRoot; public QueueCapacities(boolean isRoot) { ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); readLock = lock.readLock(); writeLock = lock.writeLock(); - -capacitiesMap = new HashMap(); +capacitiesMap = new HashMap<>(); this.isRoot = isRoot; } @@ -52,15 +51,15 @@ public class QueueCapacities { USED_CAP(0), ABS_USED_CAP(1), MAX_CAP(2), ABS_MAX_CAP(3), CAP(4), ABS_CAP(5), MAX_AM_PERC(6), RESERVED_CAP(7), ABS_RESERVED_CAP(8), WEIGHT(9), NORMALIZED_WEIGHT(10); -private int idx; +private final int idx; -private CapacityType(int idx) { +CapacityType(int idx) { this.idx = idx; } } private static class Capacities { -private float[] capacitiesArr; +private final float[] capacitiesArr; public Capacities() { capacitiesArr = new float[CapacityType.values().length]; @@ -71,19 +70,17 @@ public class QueueCapacities { @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{used=" + capacitiesArr[0] + "%, ") - .append("abs_used=" + capacitiesArr[1] + "%, ") - .append("max_cap=" + capacitiesArr[2] + "%, ") - .append("abs_max_cap=" + capacitiesArr[3] + "%, ") - .append("cap=" + capacitiesArr[4] + "%, ") - .append("abs_cap=" + capacitiesArr[5] + "%, ") - .append("max_am_perc=" + capacitiesArr[6] + "%, ") - .append("reserved_cap=" + capacitiesArr[7] + "%, ") - .append("abs_reserved_cap=" + capacitiesArr[8] + "%, ") - .append("weight=" + capacitiesArr[9] + "w, ") - .append("normalized_weight=" + capacitiesArr[10] + "w}"); - return sb.toString(); + return "{used=" + capacitiesArr[0] + "%, " + + "abs_used=" + capacitiesArr[1] + "%, " + + "max_cap=" + capacitiesArr[2] + "%, " + + "abs_max_cap=" + capacitiesArr[3] + "%, " + + "cap=" + capacitiesArr[4] + "%, " + + "abs_cap=" + capacitiesArr[5] + "%, " + + "max_am_perc=" + capacitiesArr[6] + "%, " + + "reserved_cap=" + capacitiesArr[7] + "%, " + + "abs_reserved_cap=" + capacitiesArr[8] + "%, " + + "weight=" + capacitiesArr[9] + "w, " + + "normalized_weight=" + capacitiesArr[10] + "w}"; } } @@ -118,7 +115,6 @@ public class QueueCapacities { } } - /* Used Capacity Getter and Setter */ public float getUsedCapacity() { return _get(NL, CapacityType.USED_CAP); } @@ -135,7 +131,6 @@ public class QueueCapacities { _set(label, CapacityType.USED_CAP, value); } - /* Absolute Used Capacity Getter and Setter */ public float getAbsoluteUsedCapacity() { return _get(NL, CapacityType.ABS_USED_CAP); } @@ -152,7 +147,6 @@ public class QueueCapacities { _set(label, CapacityType.ABS_USED_CAP, value); } - /* Capacity Getter and Setter */ public float getCapacity() { return _get(NL, CapacityType.CAP); } @@ -173,7 +167,6 @@ public class QueueCapaci
[hadoop] branch trunk updated: YARN-10937. Fix log message arguments in LogAggregationFileController (#3450)
This is an automated email from the ASF dual-hosted git repository. snemeth pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git The following commit(s) were added to refs/heads/trunk by this push: new 5dcb23c YARN-10937. Fix log message arguments in LogAggregationFileController (#3450) 5dcb23c is described below commit 5dcb23c1f005dfa8203c156abfc3d538a67028dc Author: TiborKovacsCloudera <90398134+tiborkovacscloud...@users.noreply.github.com> AuthorDate: Sun Sep 19 14:35:34 2021 +0200 YARN-10937. Fix log message arguments in LogAggregationFileController (#3450) --- .../logaggregation/filecontroller/LogAggregationFileController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java index bd159ee..3c3380c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java @@ -390,7 +390,7 @@ public abstract class LogAggregationFileController { remoteFS.setPermission(qualified, new FsPermission(TLDIR_PERMISSIONS)); } catch ( UnsupportedOperationException use) { LOG.info("Unable to set permissions for configured filesystem since" - + " it does not support this", remoteFS.getScheme()); + + " it does not support this {}", remoteFS.getScheme()); fsSupportsChmod = false; } @@ -437,7 +437,7 @@ public abstract class LogAggregationFileController { remoteFS.setPermission(permissionCheckFile, new FsPermission(TLDIR_PERMISSIONS)); } catch (UnsupportedOperationException use) { LOG.info("Unable to set permissions for configured filesystem since" -+ " it does not support this", remoteFS.getScheme()); ++ " it does not support this {}", remoteFS.getScheme()); fsSupportsChmod = false; } catch (IOException e) { LOG.warn("Failed to check if FileSystem supports permissions on " - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[hadoop] branch trunk updated: YARN-10913. AbstractCSQueue: Group preemption methods and fields into a separate class (#3420)
This is an automated email from the ASF dual-hosted git repository. snemeth pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git The following commit(s) were added to refs/heads/trunk by this push: new aa74a30 YARN-10913. AbstractCSQueue: Group preemption methods and fields into a separate class (#3420) aa74a30 is described below commit aa74a303ed30a057893c6d2d9fb1e07e7d1f4a7d Author: Szilard Nemeth <954799+szilard-nem...@users.noreply.github.com> AuthorDate: Sun Sep 19 13:11:56 2021 +0200 YARN-10913. AbstractCSQueue: Group preemption methods and fields into a separate class (#3420) --- .../scheduler/capacity/AbstractCSQueue.java| 100 ++--- .../scheduler/capacity/CSQueuePreemption.java | 119 + 2 files changed, 129 insertions(+), 90 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java index 75aebfe..f0d0639 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java @@ -36,7 +36,6 @@ import org.apache.hadoop.yarn.api.records.QueueState; import org.apache.hadoop.yarn.api.records.QueueStatistics; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.ResourceInformation; -import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import org.apache.hadoop.yarn.factories.RecordFactory; @@ -106,10 +105,6 @@ public abstract class AbstractCSQueue implements CSQueue { Map acls = new HashMap(); volatile boolean reservationsContinueLooking; - private volatile boolean preemptionDisabled; - // Indicates if the in-queue preemption setting is ever disabled within the - // hierarchy of this queue. - private boolean intraQueuePreemptionDisabledInHierarchy; // Track resource usage-by-label like used-resource/pending-resource, etc. volatile ResourceUsage queueUsage; @@ -129,6 +124,7 @@ public abstract class AbstractCSQueue implements CSQueue { // Indicates if this queue's default lifetime was set by a config property, // either at this level or anywhere in the queue's hierarchy. private volatile boolean defaultAppLifetimeWasSpecifiedInConfig = false; + private CSQueuePreemption preemptionSettings; public enum CapacityConfigType { // FIXME, from what I can see, Percentage mode can almost apply to weighted @@ -401,10 +397,7 @@ public abstract class AbstractCSQueue implements CSQueue { this, labelManager, null); // Store preemption settings - this.preemptionDisabled = isQueueHierarchyPreemptionDisabled(this, - configuration); - this.intraQueuePreemptionDisabledInHierarchy = - isIntraQueueHierarchyPreemptionDisabled(this, configuration); + this.preemptionSettings = new CSQueuePreemption(this, csContext, configuration); this.priority = configuration.getQueuePriority( getQueuePath()); @@ -777,7 +770,7 @@ public abstract class AbstractCSQueue implements CSQueue { queueInfo.setDefaultNodeLabelExpression(defaultLabelExpression); queueInfo.setCurrentCapacity(getUsedCapacity()); queueInfo.setQueueStatistics(getQueueStatistics()); -queueInfo.setPreemptionDisabled(preemptionDisabled); +queueInfo.setPreemptionDisabled(getPreemptionDisabled()); queueInfo.setIntraQueuePreemptionDisabled( getIntraQueuePreemptionDisabled()); queueInfo.setQueueConfigurations(getQueueConfigurations()); @@ -902,17 +895,18 @@ public abstract class AbstractCSQueue implements CSQueue { @Private public boolean getPreemptionDisabled() { -return preemptionDisabled; +return preemptionSettings.isPreemptionDisabled(); } @Private public boolean getIntraQueuePreemptionDisabled() { -return intraQueuePreemptionDisabledInHierarchy || preemptionDisabled; +return preemptionSettings.isIntraQueuePreemptionDisabledInHierarchy() || +preemptionSettings.isPreemptionDisabled(); } @Private public boolean getIntraQueuePreemptionDisabledInHierarchy() { -return intraQueuePreemptionDisabledInHierarchy; +return preemptionSettings.isIntraQueuePreemptionDisabledInHierarchy(); } @Private @@ -935,43 +929,6 @@ public abstract class Abstrac