Don't lose ref-updated events on plugin restart

When a ref-updated event is received, persist the event in the directory
defined by the replication.eventsDirectory. When the updated ref is
replicated deleted the persisted event.

If replication queue is non-empty and plugin gets stopped, ref updates
will not be replicated and, therefore, the persisted events will not get
deleted. When the plugin starts it will schedule replication for all
persisted events and delete them.

This change provides two benefits:
* no ref-updated events are lost on plugin restart
* eliminate need for the replicateOnStartup=true setting which schedules
  replication of all refs for all projects and typically creates a humongous
  replication queue on every plugin restart.

Change-Id: Ieacd084fabe703333241ffda11c8b6c78cced37a
(cherry picked from commit bdaea910694dd5a3474dbc051b298aaee9d77950)
11 files changed
tree: c155cc5477a72698a5a411c6a3b2b8f99937f442
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE