diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/PipelinedSorter.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/PipelinedSorter.java index d0eeadca06..937f898ad4 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/PipelinedSorter.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/PipelinedSorter.java @@ -945,8 +945,7 @@ public SortSpan(ByteBuffer source, int maxItems, int perItem, RawComparator comp // try to allocate less meta space, because we have sample data metasize = METASIZE*(capacity/(perItem+METASIZE)); } - ByteBuffer reserved = source.duplicate(); - reserved.mark(); + ByteBuffer reserved = (ByteBuffer) source.duplicate().mark(); LOG.info(outputContext.getInputOutputVertexNames() + ": " + "reserved.remaining()=" + reserved.remaining() + ", reserved.metasize=" + metasize); reserved.position(metasize);