public boolean waitForAppliedEvent(String event,long timeout) throws Exception {
  long seqno=new Long(event);
  if (pipeline == null)   throw new ReplicatorException("Invalid replicator state for this operation. Cannot wait for event " + seqno + " to be committed.");
  Future<ReplDBMSHeader> expectedEvent=pipeline.watchForCommittedSequenceNumber(seqno,false);
  ReplDBMSHeader replEvent=null;
  try {
    if (timeout <= 0)     replEvent=expectedEvent.get();
 else     replEvent=expectedEvent.get(timeout,TimeUnit.SECONDS);
    logger.info("SyncEvent-WaitSeqno: Sequence number " + seqno + " found or surpassed with sequence number: "+ replEvent.getSeqno());
  }
 catch (  TimeoutException e) {
    return false;
  }
 finally {
    expectedEvent.cancel(true);
  }
  return true;
}

public boolean waitForAppliedEvent ( String event , long timeout ) throws Exception { long seqno = new Long ( event ) ; if ( pipeline == null ) throw new ReplicatorException ( "Invalid replicator state for this operation. Cannot wait for event " + seqno + " to be committed." ) ; Future < ReplDBMSHeader > expectedEvent = pipeline . watchForCommittedSequenceNumber ( seqno , false ) ; ReplDBMSHeader replEvent = null ; try { if ( timeout <= 0 ) replEvent = expectedEvent . get ( ) ; else replEvent = expectedEvent . get ( timeout , TimeUnit . SECONDS ) ; logger . info ( "SyncEvent-WaitSeqno: Sequence number " + seqno + " found or surpassed with sequence number: " + replEvent . getSeqno ( ) ) ; } catch ( TimeoutException e ) { return false ; } finally { expectedEvent . cancel ( true ) ; } return true ; }
wait for a particular event to be applied on the slave .
