Examples of ChannelException


Examples of org.apache.catalina.tribes.ChannelException

        return completed;

    }

    private void connect(NioSender[] senders) throws ChannelException {
        ChannelException x = null;
        for (int i=0; i<senders.length; i++ ) {
            try {
                senders[i].connect();
            }catch ( IOException io ) {
                if ( x==null ) x = new ChannelException(io);
                x.addFaultyMember(senders[i].getDestination(),io);
            }
        }
        if ( x != null ) throw x;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.ChannelException

        }
        if ( x != null ) throw x;
    }

    private void setData(NioSender[] senders, byte[] data) throws ChannelException {
        ChannelException x = null;
        for (int i=0; i<senders.length; i++ ) {
            try {
                senders[i].setMessage(data);
            }catch ( IOException io ) {
                if ( x==null ) x = new ChannelException(io);
                x.addFaultyMember(senders[i].getDestination(),io);
            }
        }
        if ( x != null ) throw x;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.ChannelException

        if ( x != null ) throw x;
    }


    private NioSender[] setupForSend(Member[] destination) throws ChannelException {
        ChannelException cx = null;
        NioSender[] result = new NioSender[destination.length];
        for ( int i=0; i<destination.length; i++ ) {
            NioSender sender = nioSenders.get(destination[i]);
            try {

                if (sender == null) {
                    sender = new NioSender();
                    AbstractSender.transferProperties(this, sender);
                    nioSenders.put(destination[i], sender);
                }
                sender.reset();
                sender.setDestination(destination[i]);
                sender.setSelector(selector);
                sender.setUdpBased(isUdpBased());
                result[i] = sender;
            }catch ( UnknownHostException x ) {
                if (cx == null) cx = new ChannelException("Unable to setup NioSender.", x);
                cx.addFaultyMember(destination[i], x);
            }
        }
        if ( cx != null ) throw cx;
        else return result;
    }
View Full Code Here

Examples of org.apache.catalina.tribes.ChannelException

        setConnected(true);
    }


    private synchronized void close() throws ChannelException  {
        ChannelException x = null;
        Object[] members = nioSenders.keySet().toArray();
        for (int i=0; i<members.length; i++ ) {
            Member mbr = (Member)members[i];
            try {
                NioSender sender = nioSenders.get(mbr);
                sender.disconnect();
            }catch ( Exception e ) {
                if ( x == null ) x = new ChannelException(e);
                x.addFaultyMember(mbr,e);
            }
            nioSenders.remove(mbr);
        }
        if ( x != null ) throw x;
    }
View Full Code Here

Examples of org.apache.flume.ChannelException

   * @throws IOException
   */
    private synchronized void roll(int index, ByteBuffer buffer)
      throws IOException {
    if (!tryLockShared()) {
      throw new ChannelException("Failed to obtain lock for writing to the "
          + "log. Try increasing the log write timeout value. " +
          channelNameDescriptor);
    }

    try {
View Full Code Here

Examples of org.apache.flume.ChannelException

      transaction.begin();
    }
    @Override
    protected void doPut(Event event) throws InterruptedException {
      if(!channel.open) {
        throw new ChannelException("Channel not open");
      }
      if(!channel.queueRemaining.tryAcquire(channel.keepAlive, TimeUnit.SECONDS)) {
        throw new ChannelException("Cannot acquire capacity");
      }
      RecoverableMemoryChannelEvent sequencedEvent =
          new RecoverableMemoryChannelEvent(event, channel.nextSequenceID());
      memoryChannel.put(sequencedEvent);
      events.add(sequencedEvent);
View Full Code Here

Examples of org.apache.flume.ChannelException

    }

    @Override
    protected Event doTake() throws InterruptedException {
      if(!channel.open) {
        throw new ChannelException("Channel not open");
      }
      RecoverableMemoryChannelEvent event = (RecoverableMemoryChannelEvent)memoryChannel.take();
      if(event != null) {
        sequenceIds.add(event.sequenceId);
        takes++;
View Full Code Here

Examples of org.apache.flume.ChannelException

    }

    @Override
    protected void doCommit() throws InterruptedException {
      if(!channel.open) {
        throw new ChannelException("Channel not open");
      }
      if(sequenceIds.size() > 0) {
        try {
          channel.commitSequenceID(sequenceIds);
        } catch (IOException e) {
          throw new ChannelException("Unable to commit", e);
        }
      }
      if(!events.isEmpty()) {
        try {
          channel.commitEvents(events);
        } catch (IOException e) {
          throw new ChannelException("Unable to commit", e);
        }
      }
      transaction.commit();
      channel.queueRemaining.release(takes);
    }
View Full Code Here

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

Examples of org.apache.flume.ChannelException

    @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
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.