示例#1
0
  public void startFlush(boolean automatic_resume) throws Exception {
    if (!flushSupported())
      throw new IllegalStateException(
          "Flush is not supported, add pbcast.FLUSH protocol to your configuration");

    try {
      down(new Event(Event.SUSPEND));
    } catch (Exception e) {
      throw new Exception("Flush failed", e.getCause());
    } finally {
      if (automatic_resume) stopFlush();
    }
  }
示例#2
0
 public void startFlush(List<Address> flushParticipants, boolean automatic_resume)
     throws Exception {
   if (!flushSupported())
     throw new IllegalStateException(
         "Flush is not supported, add pbcast.FLUSH protocol to your configuration");
   View v = getView();
   boolean validParticipants = v != null && v.getMembers().containsAll(flushParticipants);
   if (!validParticipants)
     throw new IllegalArgumentException(
         "Current view " + v + " does not contain all flush participants " + flushParticipants);
   try {
     down(new Event(Event.SUSPEND, flushParticipants));
   } catch (Exception e) {
     throw new Exception("Flush failed", e.getCause());
   } finally {
     if (automatic_resume) stopFlush(flushParticipants);
   }
 }