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");
}