private ReftableWriter.Stats compactTopOfStack(OutputStream out, ReftableConfig cfg, byte[] newTable) throws IOException { List<Reftable> stack = refdb.stack().readers(); Reftable last = stack.get(stack.size() - 1); List<Reftable> tables = new ArrayList<>(2); tables.add(last); tables.add(new ReftableReader(BlockSource.from(newTable))); ReftableCompactor compactor = new ReftableCompactor(); compactor.setConfig(cfg); compactor.setIncludeDeletes(true); compactor.addAll(tables); compactor.compact(out); return compactor.getStats(); }
private void compactReftables(DfsReader ctx) throws IOException { DfsObjDatabase objdb = repo.getObjectDatabase(); Collections.sort(srcReftables, objdb.reftableComparator()); try (ReftableStack stack = ReftableStack.open(ctx, srcReftables)) { initOutDesc(objdb); ReftableCompactor compact = new ReftableCompactor(); compact.addAll(stack.readers()); compact.setIncludeDeletes(true); writeReftable(objdb, outDesc, compact); } }
private void writeReftable(DfsPackDescription pack) throws IOException { if (convertToReftable && !hasGcReftable()) { writeReftable(pack, refsBefore); return; } try (ReftableStack stack = ReftableStack.open(ctx, reftablesBefore)) { ReftableCompactor compact = new ReftableCompactor(); compact.addAll(stack.readers()); compact.setIncludeDeletes(includeDeletes); compactReftable(pack, compact); } }
private ReftableWriter.Stats compactTopOfStack(OutputStream out, ReftableConfig cfg, byte[] newTable) throws IOException { List<Reftable> stack = refdb.stack().readers(); Reftable last = stack.get(stack.size() - 1); List<Reftable> tables = new ArrayList<>(2); tables.add(last); tables.add(new ReftableReader(BlockSource.from(newTable))); ReftableCompactor compactor = new ReftableCompactor(); compactor.setConfig(cfg); compactor.setIncludeDeletes(true); compactor.addAll(tables); compactor.compact(out); return compactor.getStats(); }
private void compactReftables(DfsReader ctx) throws IOException { DfsObjDatabase objdb = repo.getObjectDatabase(); Collections.sort(srcReftables, objdb.reftableComparator()); try (ReftableStack stack = ReftableStack.open(ctx, srcReftables)) { initOutDesc(objdb); ReftableCompactor compact = new ReftableCompactor(); compact.addAll(stack.readers()); compact.setIncludeDeletes(true); writeReftable(objdb, outDesc, compact); } }
private void writeReftable(DfsPackDescription pack) throws IOException { if (convertToReftable && !hasGcReftable()) { writeReftable(pack, refsBefore); return; } try (ReftableStack stack = ReftableStack.open(ctx, reftablesBefore)) { ReftableCompactor compact = new ReftableCompactor(); compact.addAll(stack.readers()); compact.setIncludeDeletes(includeDeletes); compactReftable(pack, compact); } }