DeletableFrameTupleAppender implements IAppendDeletableFrameTupleAccessor { @Override public void clear(ByteBuffer buffer) throws HyracksDataException { this.buffer = buffer; this.array = buffer.array(); tupleCountOffset = getTupleCountOffset(); setTupleCount(0); setDeleteSpace(0); resetCounts(); } DeletableFrameTupleAppender(RecordDescriptor recordDescriptor); @Override void clear(ByteBuffer buffer); @Override void reset(ByteBuffer buffer); @Override int append(IFrameTupleAccessor tupleAccessor, int tIndex); @Override void delete(int tupleIndex); @Override void reOrganizeBuffer(); @Override int getTotalFreeSpace(); @Override int getContiguousFreeSpace(); @Override int getFieldCount(); @Override int getFieldSlotsLength(); @Override int getFieldEndOffset(int tupleIndex, int fIdx); @Override int getFieldStartOffset(int tupleIndex, int fIdx); @Override int getFieldLength(int tupleIndex, int fIdx); @Override int getTupleLength(int tupleIndex); @Override int getTupleEndOffset(int tupleIndex); @Override int getTupleStartOffset(int tupleIndex); @Override int getAbsoluteFieldStartOffset(int tupleIndex, int fIdx); @Override int getTupleCount(); @Override ByteBuffer getBuffer();  }
@Test public void testClear() throws Exception { ByteBuffer buffer = ByteBuffer.allocate(cap); appender.clear(buffer); assertTrue(appender.getBuffer() == buffer); assertTrue(appender.getTupleCount() == 0); assertTrue(appender.getContiguousFreeSpace() == cap - 4 - 4); }