Skip to content

Commit

Permalink
Dont toString every message
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarW authored and martinfurmanski committed Jun 11, 2018
1 parent 4b33f67 commit 60f9103
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -77,21 +77,21 @@ else if ( msg instanceof RaftMessageDecoder.RaftMessageCreator )
RaftMessages.ClusterIdAwareMessage clusterIdAwareMessage = messageCreator.maybeCompose( clock, raftLogEntries, replicatedContents ); RaftMessages.ClusterIdAwareMessage clusterIdAwareMessage = messageCreator.maybeCompose( clock, raftLogEntries, replicatedContents );
if ( clusterIdAwareMessage != null ) if ( clusterIdAwareMessage != null )
{ {
clear( clusterIdAwareMessage.toString() ); clear( clusterIdAwareMessage );
out.add( clusterIdAwareMessage ); out.add( clusterIdAwareMessage );
} }
} }
} }


private void clear( String messageDescription ) private void clear( RaftMessages.ClusterIdAwareMessage message )
{ {
messageCreator = null; messageCreator = null;
if ( !replicatedContents.isEmpty() || !raftLogEntries.isEmpty() ) if ( !replicatedContents.isEmpty() || !raftLogEntries.isEmpty() )
{ {
throw new IllegalStateException( String.format( throw new IllegalStateException( String.format(
"Message [%s] was composed without using all resources in the pipeline. " + "Message [%s] was composed without using all resources in the pipeline. " +
"Pipeline still contains Replicated contents[%s] and RaftLogEntries [%s]", "Pipeline still contains Replicated contents[%s] and RaftLogEntries [%s]",
messageDescription, stringify( replicatedContents ), stringify( raftLogEntries ) ) ); message, stringify( replicatedContents ), stringify( raftLogEntries ) ) );
} }
} }


Expand Down

0 comments on commit 60f9103

Please sign in to comment.