Package org.apache.flume

Examples of org.apache.flume.Transaction.rollback()


      }
      batchMap.clear();
      transaction.commit();
      return Status.READY;
    } catch (IOException eIO) {
      transaction.rollback();
      LOG.warn("HDFS IO error", eIO);
      return Status.BACKOFF;
    } catch (Exception e) {
      transaction.rollback();
      LOG.error("process failed", e);
View Full Code Here


    } catch (IOException eIO) {
      transaction.rollback();
      LOG.warn("HDFS IO error", eIO);
      return Status.BACKOFF;
    } catch (Exception e) {
      transaction.rollback();
      LOG.error("process failed", e);
      throw new EventDeliveryException(e.getMessage());
    } finally {
      // clear any leftover writes in the given transaction
      for (Entry<String, BucketWriter> e : batchMap.entrySet()) {
View Full Code Here

      channel.put(EventBuilder.withBody(String.valueOf(sequence++).getBytes()));
      transaction.commit();

      counterGroup.incrementAndGet("events.successful");
    } catch (Exception e) {
      transaction.rollback();
      counterGroup.incrementAndGet("events.failed");
    } finally {
      transaction.close();
    }
View Full Code Here

          tx.begin();
          source.getChannel().put(event);
          tx.commit();
        } catch (Exception e) {
          ex = e;
          tx.rollback();
        } finally {
          tx.close();
        }

        if (ex == null) {
View Full Code Here

      channel.put(event);
      counterGroup.incrementAndGet("rpc.events");

      transaction.commit();
    } catch (ChannelException e) {
      transaction.rollback();
      return Status.FAILED;
    } finally {
      transaction.close();
    }
View Full Code Here

        counterGroup.incrementAndGet("rpc.events");
      }

      transaction.commit();
    } catch (ChannelException e) {
      transaction.rollback();
      return Status.FAILED;
    } finally {
      transaction.close();
    }
View Full Code Here

            transaction.begin();
            Event event = EventBuilder.withBody(line.getBytes());
            channel.put(event);
            transaction.commit();
          } catch (ChannelException e) {
            transaction.rollback();
            throw e;
          } catch (Exception e) {
            transaction.rollback();
            throw e;
          }
View Full Code Here

            transaction.commit();
          } catch (ChannelException e) {
            transaction.rollback();
            throw e;
          } catch (Exception e) {
            transaction.rollback();
            throw e;
          }
          finally {
            transaction.close();
          }
View Full Code Here

                sinkCounter.incrementBatchEmptyCount();
                status = Status.BACKOFF;
            }
            txn.commit();
        } catch (final TTransportException e) {
            txn.rollback();
            LOGGER.info("Got a TTransportException. Will close current Transport and create new connection/client.");
            try {
                connect();
                LOGGER.info("Reconnect succeeded.");
            } catch (final TTransportException e1) {
View Full Code Here

            } catch (final TTransportException e1) {
                LOGGER.warn("Trying to reconnect failed when recovering from " + e.getMessage(), e1);
                throw new EventDeliveryException(e1);
            }
        } catch (final Throwable e) {
            txn.rollback();
            throw new EventDeliveryException(e);
        } finally {
            txn.close();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.