[MINOR][CORE] Cleanup dead code and duplication in Mem. Management
## What changes were proposed in this pull request? * Removed the method `org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter#alignToWords`. It became unused as a result of 85b0a157 (SPARK-15962) introducing word alignment for unsafe arrays. * Cleaned up duplicate code in memory management and unsafe sorters * The change extracting the exception paths is more than just cosmetics since it def. reduces the size the affected methods compile to ## How was this patch tested? * Build still passes after removing the method, grepping the codebase for `alignToWords` shows no reference to it anywhere either. * Dried up code is covered by existing tests. Author: Armin <me@obrown.io> Closes #19254 from original-brownbear/cleanup-mem-consumer.
Showing
- core/src/main/java/org/apache/spark/memory/MemoryConsumer.java 12 additions, 14 deletions...src/main/java/org/apache/spark/memory/MemoryConsumer.java
- core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java 10 additions, 14 deletions...ain/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
- core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java 15 additions, 17 deletions...ark/util/collection/unsafe/sort/UnsafeExternalSorter.java
- sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeRowWriter.java 0 additions, 16 deletions...ark/sql/catalyst/expressions/codegen/UnsafeRowWriter.java
Loading
Please register or sign in to comment