public synchronized BBContainer getNextChunk() throws IOException
    {
        if (m_chunkReaderException != null) {
            throw m_chunkReaderException;
        }
        if (!m_hasMoreChunks.get()) {
            final Container c = m_availableChunks.poll();
            return c;
        }

        if (m_chunkReader == null) {
            m_chunkReader = new ChunkReader();
            m_chunkReaderThread = new Thread(m_chunkReader, "ChunkReader");
            m_chunkReaderThread.start();
        }

        Container c = null;
        while (c == null && (m_hasMoreChunks.get() || !m_availableChunks.isEmpty())) {
            c = m_availableChunks.poll();
            if (c == null) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    throw new IOException(e);
                }
            }
        }
        if (c != null) {
            m_chunkReads.release();
        } else {
            if (m_chunkReaderException != null) {
                throw m_chunkReaderException;
            }
        }
        return c;
    }
public synchronized BBContainer getNextChunk ( ) throws IOException { if ( m_chunkReaderException != null ) { throw m_chunkReaderException ; } if ( ! m_hasMoreChunks . get ( ) ) { final Container c = m_availableChunks . poll ( ) ; return c ; } if ( m_chunkReader == null ) { m_chunkReader = new ChunkReader ( ) ; m_chunkReaderThread = new Thread ( m_chunkReader , "ChunkReader" ) ; m_chunkReaderThread . start ( ) ; } Container c = null ; while ( c == null && ( m_hasMoreChunks . get ( ) || ! m_availableChunks . isEmpty ( ) ) ) { c = m_availableChunks . poll ( ) ; if ( c == null ) { try { wait ( ) ; } catch ( InterruptedException e ) { throw new IOException ( e ) ; } } } if ( c != null ) { m_chunkReads . release ( ) ; } else { if ( m_chunkReaderException != null ) { throw m_chunkReaderException ; } } return c ; }
Will get the next chunk of the table that is just over the chunk size