diff --git a/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java index 2f51e4ddc10..105365b9dd6 100644 --- a/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java +++ b/processing/src/main/java/io/druid/segment/ReferenceCountingSequence.java @@ -25,6 +25,8 @@ import com.metamx.common.guava.Yielder; import com.metamx.common.guava.YieldingAccumulator; import com.metamx.common.guava.YieldingSequenceBase; +import java.io.Closeable; + /** */ public class ReferenceCountingSequence extends YieldingSequenceBase @@ -43,6 +45,7 @@ public class ReferenceCountingSequence extends YieldingSequenceBase OutType initValue, YieldingAccumulator accumulator ) { - return new ResourceClosingYielder(baseSequence.toYielder(initValue, accumulator), segment.increment()); + Closeable closeable = segment.increment(); + return new ResourceClosingYielder(baseSequence.toYielder(initValue, accumulator), closeable); } } \ No newline at end of file