@@ -351,7 +351,7 @@ public static void compact(String fileName, boolean compress, FileStore<?> fileS
351351 * This fileStore will be closed here.
352352 */
353353 public static void compact (String sourceFileName , String targetFileName , boolean compress ,
354- FileStore <?> fileStore ) {
354+ FileStore <?> fileStore ) {
355355 try {
356356 FileUtils .delete (targetFileName );
357357 Builder targetBuilder = new Builder ();
@@ -408,7 +408,8 @@ private static void compact(MVStore source, MVStore target) {
408408 }
409409 }
410410
411- int poolSize = Integer .getInteger ("h2.compactThreads" , Math .max (1 , Runtime .getRuntime ().availableProcessors () / 4 ));
411+ int poolSize = Integer .getInteger ("h2.compactThreads" ,
412+ Math .max (1 , Runtime .getRuntime ().availableProcessors () / 4 ));
412413 ExecutorService pool = Executors .newFixedThreadPool (poolSize );
413414 CompletableFuture .allOf (
414415 // We are going to cheat a little bit in the copyFrom() by employing "incomplete" pages,
@@ -417,7 +418,7 @@ private static void compact(MVStore source, MVStore target) {
417418 // That's why it is important to preserve all chunks
418419 // created in the process, especially if retention time
419420 // is set to a lower value, or even 0.
420- source .getMapNames ().stream ().map (mapName ->
421+ source .getMapNames ().stream ().map (mapName ->
421422 CompletableFuture .runAsync (() -> {
422423 MVMap .Builder <Object , Object > mp = MVStoreTool .getGenericMapBuilder ();
423424 // This is a hack to preserve chunks occupancy rate accounting.
@@ -432,7 +433,8 @@ private static void compact(MVStore source, MVStore target) {
432433 MVMap <Object , Object > sourceMap = source .openMap (mapName , mp );
433434 MVMap <Object , Object > targetMap = target .openMap (mapName , mp );
434435 targetMap .copyFrom (sourceMap );
435- targetMeta .put (MVMap .getMapKey (targetMap .getId ()), sourceMeta .get (MVMap .getMapKey (sourceMap .getId ())));
436+ targetMeta .put (MVMap .getMapKey (targetMap .getId ()),
437+ sourceMeta .get (MVMap .getMapKey (sourceMap .getId ())));
436438 }, pool )
437439 ).toArray (CompletableFuture []::new )
438440 ).join ();
0 commit comments