/** * @param args a base file path for the database and a compaction target */ public static void main(String[] args) throws Exception { Database db = Database.open(new DatabaseConfig() .baseFilePath(args[0]) .checkpointSizeThreshold(0)); double target = Double.parseDouble(args[1]); System.out.println("Before: " + db.stats()); db.compactFile(null, target); System.out.println("After: " + db.stats()); }
/** * @param args a base file path for the database and a compaction target */ public static void main(String[] args) throws Exception { Database db = Database.open(new DatabaseConfig() .baseFilePath(args[0]) .checkpointSizeThreshold(0)); double target = Double.parseDouble(args[1]); System.out.println("Before: " + db.stats()); db.compactFile(null, target); System.out.println("After: " + db.stats()); }
public DatabaseConfig() { createFilePath(true); durabilityMode(null); lockTimeout(1, TimeUnit.SECONDS); checkpointRate(1, TimeUnit.SECONDS); checkpointSizeThreshold(1024 * 1024); checkpointDelayThreshold(1, TimeUnit.MINUTES); }
public DatabaseConfig() { createFilePath(true); durabilityMode(null); lockTimeout(1, TimeUnit.SECONDS); checkpointRate(1, TimeUnit.SECONDS); checkpointSizeThreshold(1024 * 1024); checkpointDelayThreshold(1, TimeUnit.MINUTES); }
public DatabaseConfig() { createFilePath(true); durabilityMode(null); lockTimeout(1, TimeUnit.SECONDS); checkpointRate(1, TimeUnit.SECONDS); checkpointSizeThreshold(1024 * 1024); checkpointDelayThreshold(1, TimeUnit.MINUTES); }
/** * @param args a base file path for the database, a compaction target, and an optional * cache size */ public static void main(String[] args) throws Exception { DatabaseConfig config = new DatabaseConfig() .baseFilePath(args[0]) .eventListener(new EventPrinter().ignore(EventType.Category.CHECKPOINT)) .checkpointSizeThreshold(0); double target = Double.parseDouble(args[1]); if (args.length > 2) { config.minCacheSize(Long.parseLong(args[2])); } Database db = Database.open(config); System.out.println("Before: " + db.stats()); db.compactFile(null, target); System.out.println("After: " + db.stats()); }
.checkpointRate(checkpointRate, TimeUnit.MILLISECONDS) .checkpointDelayThreshold(checkpointDelayThreshold, TimeUnit.MILLISECONDS) .checkpointSizeThreshold(checkpointSizeThreshold);