/** * Removes messages with flags DONT_BUNDLE and OOB set and executes them in the oob or internal thread pool. JGRP-1737 */ protected void removeAndDispatchNonBundledMessages(MessageBatch oob_batch) { if(oob_batch == null) return; AsciiString tmp=oob_batch.clusterName(); byte[] cname=tmp != null? tmp.chars() : null; for(Iterator<Message> it=oob_batch.iterator(); it.hasNext();) { Message msg=it.next(); if(msg.isFlagSet(Message.Flag.DONT_BUNDLE) && msg.isFlagSet(Message.Flag.OOB)) { boolean internal=msg.isFlagSet(Message.Flag.INTERNAL); it.remove(); if(tp.statsEnabled()) tp.getMessageStats().incrNumOOBMsgsReceived(1); tp.submitToThreadPool(new SingleMessageHandlerWithClusterName(msg, cname), internal); } } }
public void run() { Address dest=msg.getDest(); boolean multicast=dest == null; try { if(tp.statsEnabled()) { MsgStats msg_stats=tp.getMessageStats(); if(msg.isFlagSet(Message.Flag.OOB)) msg_stats.incrNumOOBMsgsReceived(1); else if(msg.isFlagSet(Message.Flag.INTERNAL)) msg_stats.incrNumInternalMsgsReceived(1); else msg_stats.incrNumMsgsReceived(1); msg_stats.incrNumBytesReceived(msg.getLength()); } byte[] cname=getClusterName(); tp.passMessageUp(msg, cname, true, multicast, true); } catch(Throwable t) { log.error(Util.getMessage("PassUpFailure"), t); } }
public void run() { if(batch == null || (!batch.multicast() && tp.unicastDestMismatch(batch.dest()))) return; if(tp.statsEnabled()) { int batch_size=batch.size(); MsgStats msg_stats=tp.getMessageStats(); if(batch.getMode() == MessageBatch.Mode.OOB) msg_stats.incrNumOOBMsgsReceived(batch_size); else if(batch.getMode() == MessageBatch.Mode.INTERNAL) msg_stats.incrNumInternalMsgsReceived(batch_size); else msg_stats.incrNumMsgsReceived(batch_size); msg_stats.incrNumBatchesReceived(1); msg_stats.incrNumBytesReceived(batch.length()); tp.avgBatchSize().add(batch_size); } passBatchUp(); }
/** * Removes messages with flags DONT_BUNDLE and OOB set and executes them in the oob or internal thread pool. JGRP-1737 */ protected void removeAndDispatchNonBundledMessages(MessageBatch oob_batch) { if(oob_batch == null) return; AsciiString tmp=oob_batch.clusterName(); byte[] cname=tmp != null? tmp.chars() : null; for(Iterator<Message> it=oob_batch.iterator(); it.hasNext();) { Message msg=it.next(); if(msg.isFlagSet(Message.Flag.DONT_BUNDLE) && msg.isFlagSet(Message.Flag.OOB)) { boolean internal=msg.isFlagSet(Message.Flag.INTERNAL); it.remove(); if(tp.statsEnabled()) tp.getMessageStats().incrNumOOBMsgsReceived(1); tp.submitToThreadPool(new SingleMessageHandlerWithClusterName(msg, cname), internal); } } }
public void run() { Address dest=msg.getDest(); boolean multicast=dest == null; try { if(tp.statsEnabled()) { MsgStats msg_stats=tp.getMessageStats(); if(msg.isFlagSet(Message.Flag.OOB)) msg_stats.incrNumOOBMsgsReceived(1); else if(msg.isFlagSet(Message.Flag.INTERNAL)) msg_stats.incrNumInternalMsgsReceived(1); else msg_stats.incrNumMsgsReceived(1); msg_stats.incrNumBytesReceived(msg.getLength()); } byte[] cname=getClusterName(); tp.passMessageUp(msg, cname, true, multicast, true); } catch(Throwable t) { log.error(Util.getMessage("PassUpFailure"), t); } }
public void run() { if(batch == null || (!batch.multicast() && tp.unicastDestMismatch(batch.dest()))) return; if(tp.statsEnabled()) { int batch_size=batch.size(); MsgStats msg_stats=tp.getMessageStats(); if(batch.getMode() == MessageBatch.Mode.OOB) msg_stats.incrNumOOBMsgsReceived(batch_size); else if(batch.getMode() == MessageBatch.Mode.INTERNAL) msg_stats.incrNumInternalMsgsReceived(batch_size); else msg_stats.incrNumMsgsReceived(batch_size); msg_stats.incrNumBatchesReceived(1); msg_stats.incrNumBytesReceived(batch.length()); tp.avgBatchSize().add(batch_size); } passBatchUp(); }