adoroszlai commented on code in PR #11311:
URL: https://github.com/apache/ozone/pull/11311#discussion_r4090883772
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/ContainerLayoutTestInfo.java:
##########
@@ -43,72 +43,42 @@
*/
public enum ContainerLayoutTestInfo {
- DUMMY {
- @Override
- public ChunkManager createChunkManager(boolean sync, BlockManager manager)
{
- return new ChunkManagerDummyImpl();
- }
+ DUMMY,
+ FILE_PER_CHUNK,
+ FILE_PER_BLOCK;
+
+ public ChunkManager createChunkManager(boolean sync, BlockManager manager) {
+ return switch (this) {
+ case DUMMY -> new ChunkManagerDummyImpl();
+ case FILE_PER_CHUNK -> new FilePerChunkStrategy(sync, manager);
+ case FILE_PER_BLOCK -> new FilePerBlockStrategy(sync, null);
+ };
+ }
- @Override
- public void validateFileCount(File dir, long blockCount, long chunkCount) {
- assertFileCount(dir, 0);
+ public void validateFileCount(File dir, long blockCount, long chunkCount) {
+ switch (this) {
+ case DUMMY -> assertFileCount(dir, 0);
+ case FILE_PER_CHUNK -> assertFileCount(dir, chunkCount);
+ case FILE_PER_BLOCK -> assertFileCount(dir, blockCount);
+ default -> throw new IllegalStateException();
Review Comment:
Checkstyle complains about missing `default` only for this method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]