public void flush(final DbCollection coll, final String docName, final PropertyMap docProps)
throws IOException {
final File chunkFile = getChunkFile(coll, docName);
assert (!chunkFile.exists()) : "file already exists: " + chunkFile.getAbsolutePath();
final int splen = _strPool.size();
final Segments paged = new VarSegments(chunkFile, DescriptorType.hash);
for(int i = 0; i < splen; i++) {// big string
final String s = _strPool.get(i);
final byte[] b = compressor.compress(StringUtils.getBytes(s));
final int addr = stringKey(i);
paged.write(addr, b);
}
_strPool.clear();
final long lcclen = _cpointer >> BLOCK_SHIFT;
assert (lcclen <= Integer.MAX_VALUE) : lcclen;
final int cclen = Math.min((int) lcclen, _cchunks.length - 1);
for(int i = 0; i <= cclen; i++) {
final char[] c = _cchunks[i];
assert (c != null);
final byte[] b = compress(compressor, c);
final int addr = chunkKey(i * BLOCK_SIZE);
paged.write(addr, b);
_cchunks[i] = null;
}
docProps.setProperty(KEY_STRPOOL_WRITTEN, String.valueOf(splen));
docProps.setProperty(KEY_CHUNK_WRITTEN, String.valueOf(cclen));
paged.flush(false);
close();
LOG.info("write string chunk file:" + chunkFile.getAbsolutePath());
}