reswqa commented on code in PR #20371:
URL: https://github.com/apache/flink/pull/20371#discussion_r931181113


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HybridShuffleConfiguration.java:
##########
@@ -135,8 +146,23 @@ public float getFullStrategyReleaseBufferRatio() {
         return fullStrategyReleaseBufferRatio;
     }
 
+    /** Get {@link HsSelectiveSpillingStrategy} for hybrid shuffle mode. */
+    public HsSpillingStrategy getSpillingStrategy() {
+        switch (spillingStrategyName.toLowerCase()) {
+            case FULL_SPILLING_STRATEGY_NAME:
+                return new HsFullSpillingStrategy(this);
+
+            case SELECTIVE_SPILLING_STRATEGY_NAME:
+                return new HsSelectiveSpillingStrategy(this);
+
+            default:
+                throw new IllegalConfigurationException(
+                        "Unknown spilling strategy: " + spillingStrategyName);
+        }
+    }

Review Comment:
   As offline discuss, we will decide spilling strategy by 
`ResultPartitionType`(HYBRID_FULL & HYBRID_SELECTIVE). I think using string 
value to load spilling strategy just for temporary may also be acceptable, as 
it will be removed in next PR.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HybridShuffleConfiguration.java:
##########
@@ -135,8 +146,23 @@ public float getFullStrategyReleaseBufferRatio() {
         return fullStrategyReleaseBufferRatio;
     }
 
+    /** Get {@link HsSelectiveSpillingStrategy} for hybrid shuffle mode. */
+    public HsSpillingStrategy getSpillingStrategy() {
+        switch (spillingStrategyName.toLowerCase()) {
+            case FULL_SPILLING_STRATEGY_NAME:
+                return new HsFullSpillingStrategy(this);
+
+            case SELECTIVE_SPILLING_STRATEGY_NAME:
+                return new HsSelectiveSpillingStrategy(this);
+
+            default:
+                throw new IllegalConfigurationException(
+                        "Unknown spilling strategy: " + spillingStrategyName);
+        }
+    }

Review Comment:
   done.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to