/**
   * Prepare prefetch store. {@inheritDoc}
   *
   * @see
   *     com.continuent.tungsten.replicator.plugin.ReplicatorPlugin#prepare(com.continuent.tungsten.replicator.plugin.PluginContext)
   */
  public void prepare(PluginContext context) throws ReplicatorException {
    // Perform super-class prepare.
    super.prepare(context);

    logger.info("Preparing PrefetchStore for slave catalog schema: " + slaveCatalogSchema);
    // Load defaults for connection
    if (url == null) url = context.getJdbcUrl("tungsten_" + context.getServiceName());
    if (user == null) user = context.getJdbcUser();
    if (password == null) password = context.getJdbcPassword();

    // Connect.
    try {
      conn = DatabaseFactory.createDatabase(url, user, password);
      conn.connect(true);

      seqnoStatement =
          conn.prepareStatement(
              "select seqno, fragno, last_Frag, source_id, epoch_number, eventid, applied_latency from "
                  + slaveCatalogSchema
                  + "."
                  + CommitSeqnoTable.TABLE_NAME);
    } catch (SQLException e) {
      throw new ReplicatorException(e);
    }

    // Show that we have started.
    startTimeMillis = System.currentTimeMillis();
    prefetchState = PrefetchState.active;
  }
 /** Puts an event in the queue, blocking if it is full. */
 public void put(ReplDBMSEvent event) throws InterruptedException, ReplicatorException {
   // See if we want the event and put it in the queue if so.
   if (filter(event) != null) {
     super.put(event);
   }
 }