Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1517#discussion_r64668798
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/ReduceCombineDriver.java
 ---
    @@ -114,85 +118,133 @@ public void prepare() throws Exception {
     
                MemoryManager memManager = this.taskContext.getMemoryManager();
                final int numMemoryPages = memManager.computeNumberOfPages(
    -                           
this.taskContext.getTaskConfig().getRelativeMemoryDriver());
    +                   
this.taskContext.getTaskConfig().getRelativeMemoryDriver());
                this.memory = 
memManager.allocatePages(this.taskContext.getOwningNepheleTask(), 
numMemoryPages);
     
    -           // instantiate a fix-length in-place sorter, if possible, 
otherwise the out-of-place sorter
    -           if (this.comparator.supportsSerializationWithKeyNormalization() 
&&
    -                   this.serializer.getLength() > 0 && 
this.serializer.getLength() <= THRESHOLD_FOR_IN_PLACE_SORTING)
    -           {
    -                   this.sorter = new 
FixedLengthRecordSorter<T>(this.serializer, this.comparator, memory);
    -           } else {
    -                   this.sorter = new 
NormalizedKeySorter<T>(this.serializer, this.comparator.duplicate(), memory);
    -           }
    -
                ExecutionConfig executionConfig = 
taskContext.getExecutionConfig();
                this.objectReuseEnabled = 
executionConfig.isObjectReuseEnabled();
     
                if (LOG.isDebugEnabled()) {
                        LOG.debug("ReduceCombineDriver object reuse: " + 
(this.objectReuseEnabled ? "ENABLED" : "DISABLED") + ".");
                }
    +
    +           switch (strategy) {
    +                   case SORTED_PARTIAL_REDUCE:
    +                           // instantiate a fix-length in-place sorter, if 
possible, otherwise the out-of-place sorter
    +                           if 
(this.comparator.supportsSerializationWithKeyNormalization() &&
    +                                   this.serializer.getLength() > 0 && 
this.serializer.getLength() <= THRESHOLD_FOR_IN_PLACE_SORTING) {
    +                                   this.sorter = new 
FixedLengthRecordSorter<T>(this.serializer, this.comparator, memory);
    --- End diff --
    
    Use a duplicated comparator.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to