Skip to content

Commit 6b15d62

Browse files
authored
Merge pull request #81 from buptyzc/fixTooManyEndPeriodMarker
Fix too many end period marker
2 parents 237cb1c + 27a0b14 commit 6b15d62

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusEventBuffer.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,6 +3331,7 @@ private int readEventsInternal(ReadableByteChannel readChannel,
33313331

33323332
readBuffer.flip();
33333333
boolean hasMoreInStgBuffer = true;
3334+
boolean preEndPeriodEvent = false;
33343335
while (hasMoreInStgBuffer && readPos.hasNext())
33353336
{
33363337
writePos.startNewIteration();
@@ -3347,6 +3348,22 @@ private int readEventsInternal(ReadableByteChannel readChannel,
33473348
{
33483349
case OK:
33493350
{
3351+
if (readPos.getCurEvent().isEndOfPeriodMarker())
3352+
{
3353+
if (preEndPeriodEvent)
3354+
{
3355+
readPos.eventSkipped();
3356+
break;
3357+
}
3358+
else
3359+
{
3360+
preEndPeriodEvent = true;
3361+
}
3362+
}
3363+
else
3364+
{
3365+
preEndPeriodEvent = false;
3366+
}
33503367
final int curEventSize = readPos.getCurEvent().size();
33513368
if (readPos.bytesProcessed() + curEventSize > contiguousCapacity)
33523369
{

0 commit comments

Comments
 (0)