Skip to content

Commit

Permalink
ns
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Feb 25, 2013
1 parent a61dceb commit e851638
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
14 changes: 13 additions & 1 deletion src/org/jgroups/Message.java
Expand Up @@ -244,6 +244,13 @@ final public byte[] getBuffer() {
}
}

/**
* <em>
* Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the
* message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would
* retransmit a changed byte[] buffer !
* </em>
*/
final public Message setBuffer(byte[] b) {
buf=b;
if(buf != null) {
Expand All @@ -256,7 +263,12 @@ final public Message setBuffer(byte[] b) {
}

/**
* Set the internal buffer to point to a subset of a given buffer
* Sets the internal buffer to point to a subset of a given buffer.<p/>
* <em>
* Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the
* message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would
* retransmit a changed byte[] buffer !
* </em>
*
* @param b The reference to a given buffer. If null, we'll reset the buffer to null
* @param offset The initial position
Expand Down
2 changes: 1 addition & 1 deletion src/org/jgroups/protocols/RSVP.java
Expand Up @@ -220,7 +220,7 @@ protected void handleResponse(Address member, short id) {
protected void sendResponse(Address dest, short id) {
try {
Message msg=new Message(dest);
msg.setFlag(Message.Flag.RSVP, Message.Flag.OOB);
msg.setFlag(Message.Flag.RSVP, Message.Flag.DONT_BUNDLE);
RsvpHeader hdr=new RsvpHeader(RsvpHeader.RSP,id);
msg.putHeader(this.id, hdr);
if(log.isTraceEnabled())
Expand Down
16 changes: 0 additions & 16 deletions src/org/jgroups/protocols/pbcast/STABLE.java
Expand Up @@ -262,33 +262,17 @@ protected void handleUpEvent(StableHeader hdr, Address sender) {
}
}

@ManagedAttribute int num_stable_batch_events=0;

@ManagedAttribute int num_stability_batch_events=0;


public void up(MessageBatch batch) {
StableHeader hdr;

int stable=0, stability=0;
for(Message msg: batch) { // remove and handle messages with flow control headers (STABLE_GOSSIP, STABILITY)
if((hdr=(StableHeader)msg.getHeader(id)) != null) {
batch.remove(msg);
if(hdr.type == StableHeader.STABLE_GOSSIP)
stable++;
if(hdr.type == StableHeader.STABILITY)
stability++;

handleUpEvent(hdr, batch.sender());
}
}

if(stable > 1)
num_stable_batch_events++;
if(stability > 1)
num_stability_batch_events++;


// only if message counting is on, and only for multicast messages (http://jira.jboss.com/jira/browse/JGRP-233)
if(max_bytes > 0 && batch.dest() == null && !batch.isEmpty()) {
boolean send_stable_msg=false;
Expand Down

0 comments on commit e851638

Please sign in to comment.