Fire DfsPacksChangedEvents when committing packs.
Once a pack has been committed with commitPack(), we know that the pack list has changed but we don't re-scan the underlying storage. Change-Id: Ia7b35df4442a5f5dfe7e817edcc77b44b5410d08
This commit is contained in:
parent
9f66137716
commit
84c80be1dc
|
@ -198,6 +198,10 @@ protected abstract DfsPackDescription newPack(PackSource source)
|
||||||
* During pack compaction or GC the new pack file may be replacing other
|
* During pack compaction or GC the new pack file may be replacing other
|
||||||
* older files. Implementations should remove those older files (if any) as
|
* older files. Implementations should remove those older files (if any) as
|
||||||
* part of the commit of the new file.
|
* part of the commit of the new file.
|
||||||
|
* <p>
|
||||||
|
* This method is a trivial wrapper around
|
||||||
|
* {@link #commitPackImpl(Collection, Collection)} that calls the
|
||||||
|
* implementation and fires events.
|
||||||
*
|
*
|
||||||
* @param desc
|
* @param desc
|
||||||
* description of the new packs.
|
* description of the new packs.
|
||||||
|
@ -207,7 +211,25 @@ protected abstract DfsPackDescription newPack(PackSource source)
|
||||||
* the packs cannot be committed. On failure a rollback must
|
* the packs cannot be committed. On failure a rollback must
|
||||||
* also be attempted by the caller.
|
* also be attempted by the caller.
|
||||||
*/
|
*/
|
||||||
protected abstract void commitPack(Collection<DfsPackDescription> desc,
|
protected void commitPack(Collection<DfsPackDescription> desc,
|
||||||
|
Collection<DfsPackDescription> replaces) throws IOException {
|
||||||
|
commitPackImpl(desc, replaces);
|
||||||
|
getRepository().fireEvent(new DfsPacksChangedEvent());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of pack commit.
|
||||||
|
*
|
||||||
|
* @see #commitPack(Collection, Collection)
|
||||||
|
*
|
||||||
|
* @param desc
|
||||||
|
* description of the new packs.
|
||||||
|
* @param replaces
|
||||||
|
* if not null, list of packs to remove.
|
||||||
|
* @throws IOException
|
||||||
|
* the packs cannot be committed.
|
||||||
|
*/
|
||||||
|
protected abstract void commitPackImpl(Collection<DfsPackDescription> desc,
|
||||||
Collection<DfsPackDescription> replaces) throws IOException;
|
Collection<DfsPackDescription> replaces) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -79,7 +79,7 @@ protected DfsPackDescription newPack(PackSource source) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected synchronized void commitPack(
|
protected synchronized void commitPackImpl(
|
||||||
Collection<DfsPackDescription> desc,
|
Collection<DfsPackDescription> desc,
|
||||||
Collection<DfsPackDescription> replace) {
|
Collection<DfsPackDescription> replace) {
|
||||||
List<DfsPackDescription> n;
|
List<DfsPackDescription> n;
|
||||||
|
|
Loading…
Reference in New Issue