private void readReftablesBefore() throws IOException { DfsReftable[] tables = objdb.getReftables(); reftablesBefore = new ArrayList<>(Arrays.asList(tables)); }
@Override boolean exists() throws IOException { DfsObjDatabase odb = getRepository().getObjectDatabase(); return odb.getReftables().length > 0; }
/** * Obtain a handle to the stack of reftables. * * @return (possibly cached) handle to the stack. * @throws java.io.IOException * if tables cannot be opened. */ protected ReftableStack stack() throws IOException { lock.lock(); try { if (tableStack == null) { DfsObjDatabase odb = getRepository().getObjectDatabase(); if (ctx == null) { ctx = odb.newReader(); } tableStack = ReftableStack.open(ctx, Arrays.asList(odb.getReftables())); } return tableStack; } finally { lock.unlock(); } }
/** * Automatically select pack and reftables to be included, and add them. * <p> * Packs are selected based on size, smaller packs get included while bigger * ones are omitted. * * @return {@code this} * @throws java.io.IOException * existing packs cannot be read. */ public DfsPackCompactor autoAdd() throws IOException { DfsObjDatabase objdb = repo.getObjectDatabase(); for (DfsPackFile pack : objdb.getPacks()) { DfsPackDescription d = pack.getPackDescription(); if (d.getFileSize(PACK) < autoAddSize) add(pack); else exclude(pack); } if (reftableConfig != null) { for (DfsReftable table : objdb.getReftables()) { DfsPackDescription d = table.getPackDescription(); if (d.getPackSource() != GC && d.getFileSize(REFTABLE) < autoAddSize) { add(table); } } } return this; }
private void readReftablesBefore() throws IOException { DfsReftable[] tables = objdb.getReftables(); reftablesBefore = new ArrayList<>(Arrays.asList(tables)); }
@Override boolean exists() throws IOException { DfsObjDatabase odb = getRepository().getObjectDatabase(); return odb.getReftables().length > 0; }
/** * Obtain a handle to the stack of reftables. * * @return (possibly cached) handle to the stack. * @throws java.io.IOException * if tables cannot be opened. */ protected ReftableStack stack() throws IOException { lock.lock(); try { if (tableStack == null) { DfsObjDatabase odb = getRepository().getObjectDatabase(); if (ctx == null) { ctx = odb.newReader(); } tableStack = ReftableStack.open(ctx, Arrays.asList(odb.getReftables())); } return tableStack; } finally { lock.unlock(); } }
/** * Automatically select pack and reftables to be included, and add them. * <p> * Packs are selected based on size, smaller packs get included while bigger * ones are omitted. * * @return {@code this} * @throws java.io.IOException * existing packs cannot be read. */ public DfsPackCompactor autoAdd() throws IOException { DfsObjDatabase objdb = repo.getObjectDatabase(); for (DfsPackFile pack : objdb.getPacks()) { DfsPackDescription d = pack.getPackDescription(); if (d.getFileSize(PACK) < autoAddSize) add(pack); else exclude(pack); } if (reftableConfig != null) { for (DfsReftable table : objdb.getReftables()) { DfsPackDescription d = table.getPackDescription(); if (d.getPackSource() != GC && d.getFileSize(REFTABLE) < autoAddSize) { add(table); } } } return this; }