public Event removeEvent()

in flume-jdbc-channel/src/main/java/org/apache/flume/channel/jdbc/impl/JdbcChannelProviderImpl.java [321:353]


  public Event removeEvent(String channelName) {
    PersistableEvent result = null;
    JdbcTransactionImpl tx = null;
    try {
      tx = getTransaction();
      tx.begin();

      // Retrieve the persistableEvent
      result = schemaHandler.fetchAndDeleteEvent(
          channelName, tx.getConnection());

      if (result != null) {
        tx.incrementRemovedEventCount();
      }

      tx.commit();
    } catch (Exception ex) {
      tx.rollback();
      throw new JdbcChannelException("Failed to persist event", ex);
    } finally {
      if (tx != null) {
        tx.close();
      }
    }

    if (result != null) {
      LOGGER.debug("Removed event: {}", ((PersistableEvent) result).getEventId());
    } else {
      LOGGER.debug("No event found for removal");
    }

    return result;
  }