|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.storage.dfs.DfsPackCompactor
public class DfsPackCompactor
Combine several pack files into one pack.
The compactor combines several pack files together by including all objects contained in each pack file into the same output pack. If an object appears multiple times, it is only included once in the result. Because the new pack is constructed by enumerating the indexes of the source packs, it is quicker than doing a full repack of the repository, however the result is not nearly as space efficient as new delta compression is disabled.
This method is suitable for quickly combining several packs together after receiving a number of small fetch or push operations into a repository, allowing the system to maintain reasonable read performance without expending a lot of time repacking the entire repository.
Constructor Summary | |
---|---|
DfsPackCompactor(DfsRepository repository)
Initialize a pack compactor. |
Method Summary | |
---|---|
DfsPackCompactor |
add(DfsPackFile pack)
Add a pack to be compacted. |
DfsPackCompactor |
autoAdd()
Automatically select packs to be included, and add them. |
void |
compact(ProgressMonitor pm)
Compact the pack files together. |
List<DfsPackDescription> |
getNewPacks()
|
List<PackWriter.Statistics> |
getNewPackStatistics()
|
List<DfsPackDescription> |
getSourcePacks()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DfsPackCompactor(DfsRepository repository)
repository
- repository objects to be packed will be read from.Method Detail |
---|
public DfsPackCompactor add(DfsPackFile pack)
All of the objects in this pack will be copied into the resulting pack. The resulting pack will order objects according to the source pack's own description ordering (which is based on creation date), and then by the order the objects appear in the source pack.
pack
- a pack to combine into the resulting pack.
this
public DfsPackCompactor autoAdd() throws IOException
Packs are selected based on size, smaller packs get included while bigger ones are omitted.
this
IOException
- existing packs cannot be read.public void compact(ProgressMonitor pm) throws IOException
pm
- progress monitor to receive updates on as packing may take a
while, depending on the size of the repository.
IOException
- the packs cannot be compacted.public List<DfsPackDescription> getSourcePacks()
public List<DfsPackDescription> getNewPacks()
public List<PackWriter.Statistics> getNewPackStatistics()
getNewPacks()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |