/** * Sorts the data currently in the add buffer, writes it to the object * store, and clears the buffer. */ private void flushAddBuffer() { if (addBuffer.size() >= 0) { // Sort the chunk prior to writing. Collections.sort(addBuffer, comparator); // Write all entities in the buffer to entity storage. for (T entity : addBuffer) { chunkedEntityStore.add(entity); } addBuffer.clear(); // Close the chunk in the underlying data store so that it can be // read separately. chunkedEntityStore.closeChunk(); } }
/** * Sorts the data currently in the add buffer, writes it to the object * store, and clears the buffer. */ private void flushAddBuffer() { if (addBuffer.size() >= 0) { // Sort the chunk prior to writing. Collections.sort(addBuffer, comparator); // Write all entities in the buffer to entity storage. for (T entity : addBuffer) { chunkedEntityStore.add(entity); } addBuffer.clear(); // Close the chunk in the underlying data store so that it can be // read separately. chunkedEntityStore.closeChunk(); } }