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
11 files changed
tree: 6557794e40d37ef9b301c22e2de0f5d3975bb16d
  1. .gitignore
  2. .mailmap
  3. .settings/
  4. BUILD
  5. LICENSE
  6. src/