class IndexSyncService extends LifecycleSupport {

  @VisibleForTesting
  OLogSequenceNumber loadCheckpoint() throws IOException {
    try (InputStream in = new FileInputStream(checkpointFile)) {
      byte[] nexusLsnBytes = ByteStreams.toByteArray(in);
      if (Arrays.equals(nexusLsnBytes, INDEX_UPGRADE_MARKER.getBytes(StandardCharsets.UTF_8))) {
        throw new UnknownDeltaException("Index upgrade indicator found in Elasticsearch marker file");
      }
      return new OLogSequenceNumber(ByteStreams.newDataInput(nexusLsnBytes));
    }
  }

  @Inject public  IndexSyncService(@Named(COMPONENT) final Provider<DatabaseInstance> componentDatabase,
                          final ComponentEntityAdapter componentEntityAdapter,
                          final AssetEntityAdapter assetEntityAdapter,
                          final ApplicationDirectories directories,
                          final NodeAccess nodeAccess,
                          final IndexRequestProcessor indexRequestProcessor,
                          final IndexRebuildManager indexRebuildManager);

}