Skip to content

Commit a9a4612

Browse files
tpietzschcmhulbert
authored andcommitted
more renaming in comments
1 parent ed03434 commit a9a4612

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/main/java/org/janelia/saalfeldlab/n5/shard/DefaultDatasetAccess.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public List<DataBlock<T>> readChunks(final PositionValueAccess pva, final List<l
131131
* Bulk Read operation on a shard.
132132
*
133133
* @param readData for the corresponding shard
134-
* @param requests for blocks within the shard to be read
134+
* @param requests for chunks within the shard to be read
135135
*/
136136
private void readChunksRecursive(
137137
final ReadData readData,
@@ -247,7 +247,7 @@ public void writeChunks(final PositionValueAccess pva, final List<DataBlock<T>>
247247
* Bulk Write operation on a shard.
248248
*
249249
* @param existingReadData encoded existing shard data (to decode and partially override)
250-
* @param requests for blocks within the shard to be written
250+
* @param requests for chunks within the shard to be written
251251
*/
252252
private ReadData writeChunksRecursive(
253253
final ReadData existingReadData, // may be null
@@ -302,7 +302,7 @@ public void writeRegion(
302302
final ReadData modifiedData;
303303
try (final VolatileReadData existingData = nestedWriteFully ? null : pva.get(key)) {
304304
modifiedData = writeRegionRecursive(existingData, region, chunkSupplier, pos);
305-
// Here, we are about to write the shard data, but with the new block modified.
305+
// Here, we are about to write the shard data, but with the new shard modified.
306306
// Need to make sure that the read operations happen now before pva.set acquires a write lock
307307
if (existingData != null && modifiedData != null) {
308308
modifiedData.materialize();
@@ -369,8 +369,8 @@ private ReadData writeRegionRecursive(
369369
}
370370
final DataBlock<T> chunk = chunkSupplier.get(gridPosition, existingChunk);
371371

372-
// null blocks may be provided when they contain only the fill value
373-
// and only non-empty blocks should be written, for example
372+
// null chunks may be provided when they contain only the fill value
373+
// and only non-empty chunks should be written, for example
374374
if (chunk == null)
375375
return null;
376376

@@ -415,13 +415,13 @@ public boolean deleteChunk(final PositionValueAccess pva, final long[] gridPosit
415415
// nothing changed, the blocks we wanted to delete didn't exist anyway
416416
return false;
417417
} else if (modifiedData != null) {
418-
// Here, we are about to write the shard data, but without the block to be deleted.
418+
// Here, we are about to write the shard data, but without the chunk to be deleted.
419419
// Need to make sure that the read operations happen now before pva.set acquires a write lock
420420
modifiedData.materialize();
421421
}
422422
} catch (final N5NoSuchKeyException e) {
423423
// the key didn't exist (as we found out when lazy-reading the index)
424-
// so nothing changed, the blocks we wanted to delete didn't exist anyway
424+
// so nothing changed, the chunks we wanted to delete didn't exist anyway
425425
return false;
426426
}
427427
if (modifiedData == null) {
@@ -447,7 +447,7 @@ private ReadData deleteChunkRecursive(
447447
final long[] elementPos = position.relative(level - 1);
448448
final ReadData existingElementData = shard.getElementData(elementPos);
449449
if (existingElementData == null) {
450-
// The DataBlock (or the whole nested shard containing it) does not exist.
450+
// The chunk (or the whole nested shard containing it) does not exist.
451451
// This shard remains unchanged.
452452
return existingReadData;
453453
} else {
@@ -459,7 +459,7 @@ private ReadData deleteChunkRecursive(
459459
}
460460
shard.setElementData(modifiedElementData, elementPos);
461461
if (modifiedElementData == null) {
462-
// The DataBlock or nested shard was removed.
462+
// The chunk or nested shard was removed.
463463
// Check whether this shard becomes empty.
464464
if (shard.isEmpty()) {
465465
// This shard is empty and should be removed.
@@ -477,7 +477,7 @@ private ReadData deleteChunkRecursive(
477477
@Override
478478
public boolean deleteChunks(final PositionValueAccess pva, final List<long[]> gridPositions) throws N5IOException {
479479

480-
// for non-sharded datasets, just delete the blocks individually
480+
// for non-sharded datasets, just delete the chunks individually
481481
if (grid.numLevels() == 1) {
482482
boolean deleted = false;
483483
for (long[] pos : gridPositions) {
@@ -510,7 +510,7 @@ public boolean deleteChunks(final PositionValueAccess pva, final List<long[]> gr
510510
}
511511
} catch (final N5NoSuchKeyException e) {
512512
// the key didn't exist (as we found out when lazy-reading the index)
513-
// so nothing changed, the blocks we wanted to delete didn't exist anyway
513+
// so nothing changed, the chunks we wanted to delete didn't exist anyway
514514
continue;
515515
}
516516
if (modifiedData == null) {
@@ -735,7 +735,7 @@ public void writeBlock(
735735
final DataBlockFactory<T> blockFactory = DataBlockFactory.of(shardData);
736736

737737
final int n = grid.numDimensions();
738-
final int[] chunkSize = grid.getBlockSize(0); // size of a standard (non-truncated) DataBlock
738+
final int[] chunkSize = grid.getBlockSize(0); // size of a standard (non-truncated) chunk
739739
final long[] datasetChunkSize = grid.getDatasetSizeInChunks();
740740

741741
final long[] shardPixelMin = grid.pixelPosition(dataBlock.getGridPosition(), level);
@@ -770,7 +770,7 @@ public void writeBlock(
770770
destSize[d] = Math.min(chunkSize[d], (int) (regionBound[d] - pixelMin[d]));
771771
}
772772

773-
// This extracting DataBlocks will not work if num_array_elements != num_block_elements.
773+
// This extracting chunks will not work if num_array_elements != num_block_elements.
774774
// But we'll deal with that later if it becomes a problem...
775775
final DataBlock<T> chunk = blockFactory.createDataBlock(destSize, chunkPos);
776776
SubArrayCopy.copy(shardData, shardPixelSize, srcPos, chunk.getData(), destSize, destPos, destSize);

0 commit comments

Comments
 (0)