Skip to content

Commit a8170e4

Browse files
committed
Removed unneeded method from PackInput
Method `#messageBoundaryHook()` was only useful for blocking connections is is unused for netty-based async IO.
1 parent 1490c81 commit a8170e4

File tree

4 files changed

+2
-40
lines changed

4 files changed

+2
-40
lines changed

driver/src/main/java/org/neo4j/driver/internal/async/inbound/ByteBufInput.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,6 @@ public byte peekByte()
8888
return buf.getByte( buf.readerIndex() );
8989
}
9090

91-
@Override
92-
public Runnable messageBoundaryHook()
93-
{
94-
return new Runnable()
95-
{
96-
@Override
97-
public void run()
98-
{
99-
}
100-
};
101-
}
102-
10391
private void assertNotStarted()
10492
{
10593
if ( buf != null )

driver/src/main/java/org/neo4j/driver/internal/messaging/PackStreamMessageFormatV1.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public MessageFormat.Writer newWriter( PackOutput output, boolean byteArraySuppo
8484
@Override
8585
public MessageFormat.Reader newReader( PackInput input )
8686
{
87-
return new Reader( input, input.messageBoundaryHook() );
87+
return new Reader( input );
8888
}
8989

9090
@Override
@@ -370,12 +370,10 @@ private void packProperties( Entity entity ) throws IOException
370370
public static class Reader implements MessageFormat.Reader
371371
{
372372
private final PackStream.Unpacker unpacker;
373-
private final Runnable onMessageComplete;
374373

375-
public Reader( PackInput input, Runnable onMessageComplete )
374+
public Reader( PackInput input )
376375
{
377376
unpacker = new PackStream.Unpacker( input );
378-
this.onMessageComplete = onMessageComplete;
379377
}
380378

381379
@Override
@@ -429,19 +427,16 @@ public void read( MessageHandler handler ) throws IOException
429427
private void unpackResetMessage( MessageHandler handler ) throws IOException
430428
{
431429
handler.handleResetMessage();
432-
onMessageComplete.run();
433430
}
434431

435432
private void unpackInitMessage( MessageHandler handler ) throws IOException
436433
{
437434
handler.handleInitMessage( unpacker.unpackString(), unpackMap() );
438-
onMessageComplete.run();
439435
}
440436

441437
private void unpackIgnoredMessage( MessageHandler output ) throws IOException
442438
{
443439
output.handleIgnoredMessage();
444-
onMessageComplete.run();
445440
}
446441

447442
private void unpackFailureMessage( MessageHandler output ) throws IOException
@@ -450,34 +445,29 @@ private void unpackFailureMessage( MessageHandler output ) throws IOException
450445
String code = params.get( "code" ).asString();
451446
String message = params.get( "message" ).asString();
452447
output.handleFailureMessage( code, message );
453-
onMessageComplete.run();
454448
}
455449

456450
private void unpackRunMessage( MessageHandler output ) throws IOException
457451
{
458452
String statement = unpacker.unpackString();
459453
Map<String,Value> params = unpackMap();
460454
output.handleRunMessage( statement, params );
461-
onMessageComplete.run();
462455
}
463456

464457
private void unpackDiscardAllMessage( MessageHandler output ) throws IOException
465458
{
466459
output.handleDiscardAllMessage();
467-
onMessageComplete.run();
468460
}
469461

470462
private void unpackPullAllMessage( MessageHandler output ) throws IOException
471463
{
472464
output.handlePullAllMessage();
473-
onMessageComplete.run();
474465
}
475466

476467
private void unpackSuccessMessage( MessageHandler output ) throws IOException
477468
{
478469
Map<String,Value> map = unpackMap();
479470
output.handleSuccessMessage( map );
480-
onMessageComplete.run();
481471
}
482472

483473
private void unpackRecordMessage(MessageHandler output) throws IOException
@@ -489,7 +479,6 @@ private void unpackRecordMessage(MessageHandler output) throws IOException
489479
fields[i] = unpackValue();
490480
}
491481
output.handleRecordMessage( fields );
492-
onMessageComplete.run();
493482
}
494483

495484
private Value unpackValue() throws IOException

driver/src/main/java/org/neo4j/driver/internal/packstream/PackInput.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,4 @@ public interface PackInput
4949

5050
/** Get the next byte without forwarding the internal pointer */
5151
byte peekByte() throws IOException;
52-
53-
// todo: remove this method! it is temporary!
54-
Runnable messageBoundaryHook();
5552
}

driver/src/test/java/org/neo4j/driver/internal/packstream/BufferedChannelInput.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ public byte peekByte() throws IOException
114114
return buffer.get( buffer.position() );
115115
}
116116

117-
@Override
118-
public Runnable messageBoundaryHook()
119-
{
120-
return new Runnable()
121-
{
122-
@Override
123-
public void run()
124-
{
125-
}
126-
};
127-
}
128-
129117
private boolean attempt( int numBytes ) throws IOException
130118
{
131119
if ( buffer.remaining() >= numBytes )

0 commit comments

Comments
 (0)