VPartitionTupleBufferManager implements IPartitionedTupleBufferManager { @Override public void clearPartition(int partitionId) throws HyracksDataException { IFrameBufferManager partition = partitionArray[partitionId]; if (partition != null) { for (int i = 0; i < partition.getNumFrames(); ++i) { framePool.deAllocateBuffer(partition.getFrame(i, tempInfo).getBuffer()); } partition.reset(); } numTuples[partitionId] = 0; } VPartitionTupleBufferManager(IPartitionedMemoryConstrain constrain, int partitions,
            IDeallocatableFramePool framePool);  VPartitionTupleBufferManager(IHyracksFrameMgrContext ctx, IPartitionedMemoryConstrain constrain,
            int partitions, int frameLimitInBytes); @Override void setConstrain(IPartitionedMemoryConstrain constrain); @Override void reset(); @Override int getNumPartitions(); @Override int getNumTuples(int partition); @Override int getPhysicalSize(int partitionId); @Override void clearPartition(int partitionId); @Override boolean insertTuple(int partition, byte[] byteArray, int[] fieldEndOffsets, int start, int size,
            TuplePointer pointer); @Override boolean insertTuple(int partition, IFrameTupleAccessor tupleAccessor, int tupleId, TuplePointer pointer); @Override void cancelInsertTuple(int partition); static int calculateActualSize(int[] fieldEndOffsets, int size); @Override void close(); @Override ITuplePointerAccessor getTuplePointerAccessor(final RecordDescriptor recordDescriptor); @Override void flushPartition(int pid, IFrameWriter writer); static final IPartitionedMemoryConstrain NO_CONSTRAIN; }
@Test public void testClearPartition() throws Exception { Map<Integer, Integer> inMap = prepareFixedSizeTuples(10, 0, 0); for (int pid = 0; pid < PARTITION; pid++) { assertInsertOnePartitionToFull(pid, inMap); assertClearFullPartitionIsTheSameAsReset(); } }