Skip to content

Commit

Permalink
Use composite cumulator in MessageAccumulator
Browse files Browse the repository at this point in the history
This seem to give great performance boost for very large tx ( > 16 MB)

We did not see any degradation for smaller tx sized.

It is possible to reset to the old cumulator through a feature toggle.
  • Loading branch information
RagnarW committed Sep 18, 2018
1 parent 81255c0 commit d54bc35
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,25 @@

import java.util.List;

import org.neo4j.util.FeatureToggles;

public class MessageAccumulator extends ByteToMessageDecoder
{
private static final boolean USE_MERGE_CUMULATOR = FeatureToggles.flag( MessageAccumulator.class, "mergeCumulator", false );
private boolean readMessageBoundary;

public MessageAccumulator()
{
if ( USE_MERGE_CUMULATOR )
{
setCumulator( MERGE_CUMULATOR );
}
else
{
setCumulator( COMPOSITE_CUMULATOR );
}
}

@Override
public void channelRead( ChannelHandlerContext ctx, Object msg ) throws Exception
{
Expand Down

0 comments on commit d54bc35

Please sign in to comment.