test_class.declarator: byteBuf
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ByteBuf byteBuf;
test_class.type: ByteBuf
test_class.var_name: byteBuf
test_class.declarator: tableMapEventPacket
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MySQLBinlogTableMapEventPacket tableMapEventPacket;
test_class.type: MySQLBinlogTableMapEventPacket
test_class.var_name: tableMapEventPacket
test_class.declarator: binlogContext
test_class.modifier: private
test_class.original_string: private BinlogContext binlogContext;
test_class.type: BinlogContext
test_class.var_name: binlogContext
test_class.declarator: binlogEventPacketDecoder
test_class.modifier: private
test_class.original_string: private MySQLBinlogEventPacketDecoder binlogEventPacketDecoder;
test_class.type: MySQLBinlogEventPacketDecoder
test_class.var_name: binlogEventPacketDecoder
test_class.file: shardingsphere-scaling/shardingsphere-scaling-mysql/src/test/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLBinlogEventPacketDecoderTest.java
test_class.identifier: MySQLBinlogEventPacketDecoderTest
test_case.body: @Test
      public void assertDecodeRotateEvent() {
          when(byteBuf.readUnsignedByte()).thenReturn((short) 0, (short) 0, (short) MySQLBinlogEventType.ROTATE_EVENT.getValue());
          List<Object> decodedEvents = new ArrayList<>();
          binlogEventPacketDecoder.decode(null, byteBuf, decodedEvents);
          assertThat(decodedEvents.size(), is(0));
          assertThat(binlogContext.getFileName(), is(""));
      }
test_case.class_method_signature: MySQLBinlogEventPacketDecoderTest.assertDecodeRotateEvent()
test_case.full_signature: @Test public void assertDecodeRotateEvent()
test_case.identifier: assertDecodeRotateEvent
test_case.invocations: thenReturn when readUnsignedByte getValue decode assertThat size is assertThat getFileName is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertDecodeRotateEvent()
focal_class.declarator: binlogContext
focal_class.modifier: private final
focal_class.original_string: private final BinlogContext binlogContext;
focal_class.type: BinlogContext
focal_class.var_name: binlogContext
focal_class.file: shardingsphere-scaling/shardingsphere-scaling-mysql/src/main/java/org/apache/shardingsphere/scaling/mysql/client/netty/MySQLBinlogEventPacketDecoder.java
focal_class.identifier: MySQLBinlogEventPacketDecoder
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.MySQLBinlogEventPacketDecoder(final int checksumLength)
focal_class.full_signature: public  MySQLBinlogEventPacketDecoder(final int checksumLength)
focal_class.identifier: MySQLBinlogEventPacketDecoder
focal_class.modifiers: public
focal_class.parameters: (final int checksumLength)
focal_class.signature:  MySQLBinlogEventPacketDecoder(final int checksumLength)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_class.full_signature: @Override protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_class.identifier: decode
focal_class.modifiers: @Override protected
focal_class.parameters: (final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_class.return: void
focal_class.signature: void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.skipSequenceId(final MySQLPacketPayload payload)
focal_class.full_signature: private void skipSequenceId(final MySQLPacketPayload payload)
focal_class.identifier: skipSequenceId
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void skipSequenceId(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.checkError(final MySQLPacketPayload payload)
focal_class.full_signature: private void checkError(final MySQLPacketPayload payload)
focal_class.identifier: checkError
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void checkError(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.readRemainPacket(final MySQLPacketPayload payload)
focal_class.full_signature: private String readRemainPacket(final MySQLPacketPayload payload)
focal_class.identifier: readRemainPacket
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: String
focal_class.signature: String readRemainPacket(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.removeChecksum(final int eventType, final ByteBuf in)
focal_class.full_signature: private void removeChecksum(final int eventType, final ByteBuf in)
focal_class.identifier: removeChecksum
focal_class.modifiers: private
focal_class.parameters: (final int eventType, final ByteBuf in)
focal_class.return: void
focal_class.signature: void removeChecksum(final int eventType, final ByteBuf in)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decodeRotateEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.full_signature: private void decodeRotateEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.identifier: decodeRotateEvent
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void decodeRotateEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decodeTableMapEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.full_signature: private void decodeTableMapEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.identifier: decodeTableMapEvent
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void decodeTableMapEvent(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decodeDeleteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.full_signature: private DeleteRowsEvent decodeDeleteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.identifier: decodeDeleteRowsEventV2
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.return: DeleteRowsEvent
focal_class.signature: DeleteRowsEvent decodeDeleteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decodeUpdateRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.full_signature: private UpdateRowsEvent decodeUpdateRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.identifier: decodeUpdateRowsEventV2
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.return: UpdateRowsEvent
focal_class.signature: UpdateRowsEvent decodeUpdateRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.decodeWriteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.full_signature: private WriteRowsEvent decodeWriteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.identifier: decodeWriteRowsEventV2
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.return: WriteRowsEvent
focal_class.signature: WriteRowsEvent decodeWriteRowsEventV2(final MySQLBinlogEventHeader binlogEventHeader, final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.initRowsEvent(final AbstractRowsEvent rowsEvent, final MySQLBinlogEventHeader binlogEventHeader, final long tableId)
focal_class.full_signature: private void initRowsEvent(final AbstractRowsEvent rowsEvent, final MySQLBinlogEventHeader binlogEventHeader, final long tableId)
focal_class.identifier: initRowsEvent
focal_class.modifiers: private
focal_class.parameters: (final AbstractRowsEvent rowsEvent, final MySQLBinlogEventHeader binlogEventHeader, final long tableId)
focal_class.return: void
focal_class.signature: void initRowsEvent(final AbstractRowsEvent rowsEvent, final MySQLBinlogEventHeader binlogEventHeader, final long tableId)
focal_class.class_method_signature: MySQLBinlogEventPacketDecoder.createPlaceholderEvent(final MySQLBinlogEventHeader binlogEventHeader)
focal_class.full_signature: private PlaceholderEvent createPlaceholderEvent(final MySQLBinlogEventHeader binlogEventHeader)
focal_class.identifier: createPlaceholderEvent
focal_class.modifiers: private
focal_class.parameters: (final MySQLBinlogEventHeader binlogEventHeader)
focal_class.return: PlaceholderEvent
focal_class.signature: PlaceholderEvent createPlaceholderEvent(final MySQLBinlogEventHeader binlogEventHeader)
focal_class.superclass: extends ByteToMessageDecoder
focal_method.body: @Override
      protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
          MySQLPacketPayload payload = new MySQLPacketPayload(in);
          skipSequenceId(payload);
          checkError(payload);
          MySQLBinlogEventHeader binlogEventHeader = new MySQLBinlogEventHeader(payload);
          removeChecksum(binlogEventHeader.getEventType(), in);
          switch (MySQLBinlogEventType.valueOf(binlogEventHeader.getEventType())) {
              case ROTATE_EVENT:
                  decodeRotateEvent(binlogEventHeader, payload);
                  break;
              case FORMAT_DESCRIPTION_EVENT:
                  new MySQLBinlogFormatDescriptionEventPacket(binlogEventHeader, payload);
                  break;
              case TABLE_MAP_EVENT:
                  decodeTableMapEvent(binlogEventHeader, payload);
                  break;
              case WRITE_ROWS_EVENTv1:
              case WRITE_ROWS_EVENTv2:
                  out.add(decodeWriteRowsEventV2(binlogEventHeader, payload));
                  break;
              case UPDATE_ROWS_EVENTv1:
              case UPDATE_ROWS_EVENTv2:
                  out.add(decodeUpdateRowsEventV2(binlogEventHeader, payload));
                  break;
              case DELETE_ROWS_EVENTv1:
              case DELETE_ROWS_EVENTv2:
                  out.add(decodeDeleteRowsEventV2(binlogEventHeader, payload));
                  break;
              default:
                  out.add(createPlaceholderEvent(binlogEventHeader));
                  payload.skipReserved(payload.getByteBuf().readableBytes());
          }
          if (in.isReadable()) {
              throw new UnsupportedOperationException(String.format("Do not parse binlog event fully, eventHeader: %s, remaining packet %s", binlogEventHeader, readRemainPacket(payload)));
          }
      }
focal_method.class_method_signature: MySQLBinlogEventPacketDecoder.decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_method.full_signature: @Override protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_method.identifier: decode
focal_method.invocations: skipSequenceId checkError removeChecksum getEventType valueOf getEventType decodeRotateEvent decodeTableMapEvent add decodeWriteRowsEventV2 add decodeUpdateRowsEventV2 add decodeDeleteRowsEventV2 add createPlaceholderEvent skipReserved readableBytes getByteBuf isReadable format readRemainPacket
focal_method.modifiers: @Override protected
focal_method.parameters: (final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
focal_method.return: void
focal_method.signature: void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)