@Override
  public void write(MapJoinObjectSerDeContext context, ObjectOutputStream out)
  throws IOException, SerDeException {
    AbstractSerDe serde = context.getSerDe();
    ObjectInspector valueObjectInspector = context.getStandardOI();
    long numRows = rowCount();
    long numRowsWritten = 0L;
    out.writeLong(numRows);
    for (List<Object> row = first(); row != null; row = next()) {
      serde.serialize(row.toArray(), valueObjectInspector).write(out);
      ++numRowsWritten;      
    }
    if(numRows != rowCount()) {
      throw new ConcurrentModificationException("Values was modified while persisting");
    }
    if(numRowsWritten != numRows) {
      throw new IllegalStateException("Expected to write " + numRows + " but wrote " + numRowsWritten);
    }
  }
Remove all elements in the RowContainer.
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/MapJoinEagerRowContainer.java