SerializableHashTable implements ISerializableTable { @Override public void insert(int entry, TuplePointer pointer) throws HyracksDataException { int hFrameIndex = getHeaderFrameIndex(entry); int headerOffset = getHeaderFrameOffset(entry); IntSerDeBuffer header = headers[hFrameIndex]; if (header == null) { header = new IntSerDeBuffer(ctx.allocateFrame().array()); headers[hFrameIndex] = header; resetFrame(header); headerFrameCount++; } int frameIndex = header.getInt(headerOffset); int offsetIndex = header.getInt(headerOffset + 1); if (frameIndex < 0) { insertNewEntry(header, headerOffset, INIT_ENTRY_SIZE, pointer); } else { insertNonFirstTuple(header, headerOffset, frameIndex, offsetIndex, pointer); } tupleCount++; } SerializableHashTable(int tableSize, final IHyracksFrameMgrContext ctx); @Override void insert(int entry, TuplePointer pointer); @Override void delete(int entry); @Override boolean getTuplePointer(int entry, int offset, TuplePointer dataPointer); @Override void reset(); @Override int getFrameCount(); int getTupleCount(); @Override int getTupleCount(int entry); @Override void close();  }
@Test public void testInsert() throws Exception { for (int i = 0; i < num; i++) { pointer.reset(i, i); nsTable.insert(i % NUM_PART, pointer); } assertGetValue(); }