@@ -54,41 +54,45 @@ public void testValidateBlockShardSizesValid() {
5454 // Test case 1: shard size equals block size
5555 long [] dimensions = new long []{100 , 200 , 300 };
5656 int [] shardSize = new int []{64 , 64 , 64 };
57- int [] blockSize = new int []{64 , 64 , 64 };
57+ int [] chunkSize = new int []{64 , 64 , 64 };
5858 DataType dataType = DataType .UINT8 ;
5959
6060 // This should not throw any exception
61- DatasetAttributes attrs = shardDatasetAttributes (dimensions , shardSize , blockSize , dataType );
62- assertEquals (blockSize , attrs .getBlockSize ());
61+ DatasetAttributes attrs = shardDatasetAttributes (dimensions , shardSize , chunkSize , dataType );
62+ assertEquals (chunkSize , attrs .getChunkSize ());
63+ assertEquals (shardSize , attrs .getBlockSize ());
6364 NestedGrid grid = attrs .getNestedBlockGrid ();
64- assertEquals (blockSize , grid .getBlockSize (0 ));
65+ assertEquals (chunkSize , grid .getBlockSize (0 ));
6566 assertEquals (shardSize , grid .getBlockSize (1 ));
6667
6768 // Test case 2: shard size is a multiple of block size
6869 shardSize = new int []{128 };
69- blockSize = new int []{64 };
70- attrs = shardDatasetAttributes (new long []{128 }, shardSize , blockSize , dataType );
71- assertEquals (blockSize , attrs .getBlockSize ());
70+ chunkSize = new int []{64 };
71+ attrs = shardDatasetAttributes (new long []{128 }, shardSize , chunkSize , dataType );
72+ assertEquals (chunkSize , attrs .getChunkSize ());
73+ assertEquals (shardSize , attrs .getBlockSize ());
7274 grid = attrs .getNestedBlockGrid ();
73- assertEquals (blockSize , grid .getBlockSize (0 ));
75+ assertEquals (chunkSize , grid .getBlockSize (0 ));
7476 assertEquals (shardSize , grid .getBlockSize (1 ));
7577
7678 // Test case 3: different multiples per dimension
7779 shardSize = new int []{128 , 256 , 32 , 2 };
78- blockSize = new int []{32 , 64 , 32 , 1 };
79- attrs = shardDatasetAttributes (new long []{128 , 128 , 128 , 128 }, shardSize , blockSize , dataType );
80- assertEquals (blockSize , attrs .getBlockSize ());
80+ chunkSize = new int []{32 , 64 , 32 , 1 };
81+ attrs = shardDatasetAttributes (new long []{128 , 128 , 128 , 128 }, shardSize , chunkSize , dataType );
82+ assertEquals (chunkSize , attrs .getChunkSize ());
83+ assertEquals (shardSize , attrs .getBlockSize ());
8184 grid = attrs .getNestedBlockGrid ();
82- assertEquals (blockSize , grid .getBlockSize (0 ));
85+ assertEquals (chunkSize , grid .getBlockSize (0 ));
8386 assertEquals (shardSize , grid .getBlockSize (1 ));
8487
8588 // Test case 4: large multiples
8689 shardSize = new int []{1024 , 2048 , 512 };
87- blockSize = new int []{32 , 64 , 16 };
88- attrs = shardDatasetAttributes (dimensions , shardSize , blockSize , dataType );
89- assertEquals (blockSize , attrs .getBlockSize ());
90+ chunkSize = new int []{32 , 64 , 16 };
91+ attrs = shardDatasetAttributes (dimensions , shardSize , chunkSize , dataType );
92+ assertEquals (chunkSize , attrs .getChunkSize ());
93+ assertEquals (shardSize , attrs .getBlockSize ());
9094 grid = attrs .getNestedBlockGrid ();
91- assertEquals (blockSize , grid .getBlockSize (0 ));
95+ assertEquals (chunkSize , grid .getBlockSize (0 ));
9296 assertEquals (shardSize , grid .getBlockSize (1 ));
9397 }
9498
0 commit comments