Package org.apache.flume

Examples of org.apache.flume.ChannelException


      channelCounter.incrementEventPutAttemptCount();
      int eventByteSize = (int)Math.ceil(estimateEventSize(event)/byteCapacitySlotSize);

      if (bytesRemaining.tryAcquire(eventByteSize, keepAlive, TimeUnit.SECONDS)) {
        if(!putList.offer(event)) {
          throw new ChannelException("Put queue for MemoryTransaction of capacity " +
              putList.size() + " full, consider committing more frequently, " +
              "increasing capacity or increasing thread count");
        }
      } else {
        throw new ChannelException("Put queue for MemoryTransaction of byteCapacity " +
            (lastByteCapacity * (int)byteCapacitySlotSize) + " bytes cannot add an " +
            " event of size " + estimateEventSize(event) + " bytes because " +
             (bytesRemaining.availablePermits() * (int)byteCapacitySlotSize) + " bytes are already used." +
            " Try consider comitting more frequently, increasing byteCapacity or increasing thread count");
      }
View Full Code Here


    @Override
    protected Event doTake() throws InterruptedException {
      channelCounter.incrementEventTakeAttemptCount();
      if(takeList.remainingCapacity() == 0) {
        throw new ChannelException("Take list for MemoryTransaction, capacity " +
            takeList.size() + " full, consider committing more frequently, " +
            "increasing capacity, or increasing thread count");
      }
      if(!queueStored.tryAcquire(keepAlive, TimeUnit.SECONDS)) {
        return null;
View Full Code Here

    @Override
    protected void doCommit() throws InterruptedException {
      int remainingChange = takeList.size() - putList.size();
      if(remainingChange < 0) {
        if(!queueRemaining.tryAcquire(-remainingChange, keepAlive, TimeUnit.SECONDS)) {
          throw new ChannelException("Space for commit to queue couldn't be acquired" +
              " Sinks are likely not keeping up with sources, or the buffer size is too tight");
        }
      }
      int puts = putList.size();
      int takes = takeList.size();
View Full Code Here

          txnErrors = true;
          logger.warn("Error in fanout commit" + ch.getName(), e);
        }
      }
      if (txnErrors == true) {
        throw new ChannelException("Errors in fanout begin");
      }
    }
View Full Code Here

          txnErrors = true;
          logger.warn("Error in fanout close" + ch.getName(), e);
        }
      }
      if (txnErrors == true) {
        throw new ChannelException("Errors in fanout close");
      }
    }
View Full Code Here

        "No queue defined (Did you forget to configure me?");

    try {
      queue.put(event);
    } catch (InterruptedException ex) {
      throw new ChannelException("Failed to put(" + event + ")", ex);
    }
  }
View Full Code Here

        "No queue defined (Did you forget to configure me?");

    try {
      return queue.poll(keepAlive, TimeUnit.SECONDS);
    } catch (InterruptedException ex) {
      throw new ChannelException("Failed to take()", ex);
    }
  }
View Full Code Here

      Preconditions.checkState(myTxn != null, "Transaction not started");

      int myStamp = currentStamp.getAndIncrement();
      StampedEvent stampedEvent = new StampedEvent(myStamp, event);
      if (queue.offer(stampedEvent,keepAlive, TimeUnit.SECONDS) == false)
        throw new ChannelException("put(" + event + ") timed out");
      myTxn.logPut(stampedEvent, myStamp);

    } catch (InterruptedException ex) {
      throw new ChannelException("Failed to put(" + event + ")", ex);
    }
  }
View Full Code Here

          event = e.getEvent();
        }
      }
      return event;
    } catch (InterruptedException ex) {
      throw new ChannelException("Failed to take()", ex);
    }
  }
View Full Code Here

  }

  @Override
  public Event take() throws ChannelException {
    // fanout is really for sources, we don't want to support take
    throw new ChannelException("Can't take from fanout channel");
  }
View Full Code Here

TOP

Related Classes of org.apache.flume.ChannelException

Copyright © 2018 www.massapicom. 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.