Skip to content

Commit

Permalink
Fix for incorrect backport of serialization optimization (https://iss…
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jun 1, 2016
1 parent 2e37ba7 commit fe29f05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
7 changes: 4 additions & 3 deletions src/org/jgroups/protocols/FlowControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ protected long getMaxBlockTime(long length) {
*/
protected abstract boolean handleMulticastMessage();

protected abstract void handleCredit(Address sender, long increase);
protected abstract void handleCredit(Address sender, long increase);

protected abstract Header getReplenishHeader();
protected abstract Header getCreditRequestHeader();


/**
Expand Down Expand Up @@ -502,7 +505,6 @@ protected void sendCredit(Address dest, long credits) {
num_credit_responses_sent++;
}

protected abstract Header getReplenishHeader();

/**
* We cannot send this request as OOB message, as the credit request needs to queue up behind the regular messages;
Expand All @@ -519,7 +521,6 @@ protected void sendCreditRequest(final Address dest, long credits_needed) {
num_credit_requests_sent++;
}

protected abstract Header getCreditRequestHeader();


protected void handleViewChange(List<Address> mbrs) {
Expand Down
17 changes: 4 additions & 13 deletions src/org/jgroups/protocols/MFC.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
@MBean(description="Simple flow control protocol based on a credit system")
public class MFC extends FlowControl {
protected final static FcHeader MFC_REPLENISH_HDR = new FcHeader(FcHeader.REPLENISH);
protected final static FcHeader MFC_REPLENISH_HDR = new FcHeader(FcHeader.REPLENISH);
protected final static FcHeader MFC_CREDIT_REQUEST_HDR = new FcHeader(FcHeader.CREDIT_REQUEST);


Expand Down Expand Up @@ -82,9 +82,9 @@ public double getAverageTimeBlocked() {
return credits.getAverageBlockTime();
}

protected boolean handleMulticastMessage() {
return true;
}
protected boolean handleMulticastMessage() {return true;}
@Override protected Header getReplenishHeader() {return MFC_REPLENISH_HDR;}
@Override protected Header getCreditRequestHeader() {return MFC_CREDIT_REQUEST_HDR;}


public void init() throws Exception {
Expand Down Expand Up @@ -123,15 +123,6 @@ protected Object handleDownMessage(final Event evt, final Message msg, Address d
return down_prot.down(evt);
}

@Override
protected Header getReplenishHeader() {
return MFC_REPLENISH_HDR;
}

@Override
protected Header getCreditRequestHeader() {
return MFC_CREDIT_REQUEST_HDR;
}


protected synchronized boolean needToSendCreditRequest() {
Expand Down
15 changes: 3 additions & 12 deletions src/org/jgroups/protocols/UFC.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ public Map<String, Object> dumpStats() {
return retval;
}


protected boolean handleMulticastMessage() {
return false;
}
protected boolean handleMulticastMessage() {return false;}
@Override protected Header getReplenishHeader() {return UFC_REPLENISH_HDR;}
@Override protected Header getCreditRequestHeader() {return UFC_CREDIT_REQUEST_HDR;}



Expand Down Expand Up @@ -138,15 +137,7 @@ protected Object handleDownMessage(final Event evt, final Message msg, Address d
return down_prot.down(evt);
}

@Override
protected Header getReplenishHeader() {
return UFC_REPLENISH_HDR;
}

@Override
protected Header getCreditRequestHeader() {
return UFC_CREDIT_REQUEST_HDR;
}


protected void handleViewChange(List<Address> mbrs) {
Expand Down

0 comments on commit fe29f05

Please sign in to comment.