/** * Stops the current writing operation and begins a new one saving the * current position against a new interval index. */ public void closeChunk() { // We can only close a chunk if one is in progress. if (chunkInProgress) { // Create an interval in the underlying object store and note the // current position. newChunkFilePosition = objectStore.closeChunk(); // Flag that no chunk is in progress so that the next add will store // the start file index. chunkInProgress = false; // Write then reset the object count of the current chunk. indexStore.write(new LongLongIndexElement((chunkCount * 2) + 1, chunkObjectCount)); chunkObjectCount = 0; // Increment the chunk count. chunkCount++; } }
/** * Stops the current writing operation and begins a new one saving the * current position against a new interval index. */ public void closeChunk() { // We can only close a chunk if one is in progress. if (chunkInProgress) { // Create an interval in the underlying object store and note the // current position. newChunkFilePosition = objectStore.closeChunk(); // Flag that no chunk is in progress so that the next add will store // the start file index. chunkInProgress = false; // Write then reset the object count of the current chunk. indexStore.write(new LongLongIndexElement((chunkCount * 2) + 1, chunkObjectCount)); chunkObjectCount = 0; // Increment the chunk count. chunkCount++; } }