forked from Qortal/qortal
Use a lower file size target (10MB instead of 100MB) when using archive V2, as the average block size is over 90% smaller.
This commit is contained in:
parent
c5c0dcf0f2
commit
0388626e42
@ -39,7 +39,8 @@ public class BlockArchiveWriter {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(BlockArchiveWriter.class);
|
||||
|
||||
public static final long DEFAULT_FILE_SIZE_TARGET = 100 * 1024 * 1024; // 100MiB
|
||||
public static final long DEFAULT_FILE_SIZE_TARGET_V1 = 100 * 1024 * 1024; // 100MiB
|
||||
public static final long DEFAULT_FILE_SIZE_TARGET_V2 = 10 * 1024 * 1024; // 10MiB
|
||||
|
||||
private int startHeight;
|
||||
private final int endHeight;
|
||||
@ -47,7 +48,7 @@ public class BlockArchiveWriter {
|
||||
private final Path archivePath;
|
||||
private final Repository repository;
|
||||
|
||||
private long fileSizeTarget = DEFAULT_FILE_SIZE_TARGET;
|
||||
private long fileSizeTarget = DEFAULT_FILE_SIZE_TARGET_V1;
|
||||
private boolean shouldEnforceFileSizeTarget = true;
|
||||
|
||||
// Default data source to BLOCK_REPOSITORY; can optionally be overridden
|
||||
@ -75,6 +76,12 @@ public class BlockArchiveWriter {
|
||||
// When serialization version isn't specified, fetch it from the existing archive
|
||||
serializationVersion = this.findSerializationVersion();
|
||||
}
|
||||
|
||||
// Reduce default file size target if we're using V2, as the average block size is over 90% smaller
|
||||
if (serializationVersion == 2) {
|
||||
this.setFileSizeTarget(DEFAULT_FILE_SIZE_TARGET_V2);
|
||||
}
|
||||
|
||||
this.serializationVersion = serializationVersion;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user