test_class.declarator: channelHandlerContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ChannelHandlerContext channelHandlerContext;
test_class.type: ChannelHandlerContext
test_class.var_name: channelHandlerContext
test_class.declarator: queryCommandExecutor
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private QueryCommandExecutor queryCommandExecutor;
test_class.type: QueryCommandExecutor
test_class.var_name: queryCommandExecutor
test_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngineTest.java
test_class.identifier: PostgreSQLCommandExecuteEngineTest
test_case.body: @Test
      public void assertWriteQueryDataWithUpdate() throws SQLException {
          PostgreSQLCommandExecuteEngine postgreSQLCommandExecuteEngine = new PostgreSQLCommandExecuteEngine();
          when(queryCommandExecutor.getResponseType()).thenReturn(ResponseType.UPDATE);
          postgreSQLCommandExecuteEngine.writeQueryData(channelHandlerContext, null, queryCommandExecutor, 0);
          verify(channelHandlerContext, times(1)).write(isA(PostgreSQLReadyForQueryPacket.class));
      }
test_case.class_method_signature: PostgreSQLCommandExecuteEngineTest.assertWriteQueryDataWithUpdate()
test_case.full_signature: @Test public void assertWriteQueryDataWithUpdate()
test_case.identifier: assertWriteQueryDataWithUpdate
test_case.invocations: thenReturn when getResponseType writeQueryData write verify times isA
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertWriteQueryDataWithUpdate()
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecuteEngine.java
focal_class.identifier: PostgreSQLCommandExecuteEngine
focal_class.interfaces: implements CommandExecuteEngine
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.getCommandPacketType(final PacketPayload payload)
focal_class.full_signature: @Override public PostgreSQLCommandPacketType getCommandPacketType(final PacketPayload payload)
focal_class.identifier: getCommandPacketType
focal_class.modifiers: @Override public
focal_class.parameters: (final PacketPayload payload)
focal_class.return: PostgreSQLCommandPacketType
focal_class.signature: PostgreSQLCommandPacketType getCommandPacketType(final PacketPayload payload)
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.getCommandPacket(final PacketPayload payload, final CommandPacketType type, final BackendConnection backendConnection)
focal_class.full_signature: @Override public PostgreSQLCommandPacket getCommandPacket(final PacketPayload payload, final CommandPacketType type, final BackendConnection backendConnection)
focal_class.identifier: getCommandPacket
focal_class.modifiers: @Override public
focal_class.parameters: (final PacketPayload payload, final CommandPacketType type, final BackendConnection backendConnection)
focal_class.return: PostgreSQLCommandPacket
focal_class.signature: PostgreSQLCommandPacket getCommandPacket(final PacketPayload payload, final CommandPacketType type, final BackendConnection backendConnection)
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.getCommandExecutor(final CommandPacketType type, final CommandPacket packet, final BackendConnection backendConnection)
focal_class.full_signature: @Override public CommandExecutor getCommandExecutor(final CommandPacketType type, final CommandPacket packet, final BackendConnection backendConnection)
focal_class.identifier: getCommandExecutor
focal_class.modifiers: @Override public
focal_class.parameters: (final CommandPacketType type, final CommandPacket packet, final BackendConnection backendConnection)
focal_class.return: CommandExecutor
focal_class.signature: CommandExecutor getCommandExecutor(final CommandPacketType type, final CommandPacket packet, final BackendConnection backendConnection)
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.getErrorPacket(final Exception cause)
focal_class.full_signature: @Override public DatabasePacket<?> getErrorPacket(final Exception cause)
focal_class.identifier: getErrorPacket
focal_class.modifiers: @Override public
focal_class.parameters: (final Exception cause)
focal_class.return: DatabasePacket<?>
focal_class.signature: DatabasePacket<?> getErrorPacket(final Exception cause)
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.getOtherPacket()
focal_class.full_signature: @Override public Optional<DatabasePacket<?>> getOtherPacket()
focal_class.identifier: getOtherPacket
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Optional<DatabasePacket<?>>
focal_class.signature: Optional<DatabasePacket<?>> getOtherPacket()
focal_class.class_method_signature: PostgreSQLCommandExecuteEngine.writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_class.full_signature: @Override public void writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_class.identifier: writeQueryData
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_class.return: void
focal_class.signature: void writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_method.body: @Override
      public void writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount) throws SQLException {
          if (ResponseType.QUERY == queryCommandExecutor.getResponseType() && !context.channel().isActive()) {
              context.write(new PostgreSQLCommandCompletePacket());
              context.write(new PostgreSQLReadyForQueryPacket());
              return;
          }
          if (ResponseType.UPDATE == queryCommandExecutor.getResponseType()) {
              context.write(new PostgreSQLReadyForQueryPacket());
              return;
          }
          int count = 0;
          int proxyFrontendFlushThreshold = ProxyContext.getInstance().getSchemaContexts().getProps().<Integer>getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD);
          while (queryCommandExecutor.next()) {
              count++;
              while (!context.channel().isWritable() && context.channel().isActive()) {
                  context.flush();
                  backendConnection.getResourceLock().doAwait();
              }
              DatabasePacket<?> resultValue = queryCommandExecutor.getQueryData();
              context.write(resultValue);
              if (proxyFrontendFlushThreshold == count) {
                  context.flush();
                  count = 0;
              }
          }
          context.write(new PostgreSQLCommandCompletePacket());
          context.write(new PostgreSQLReadyForQueryPacket());
      }
focal_method.class_method_signature: PostgreSQLCommandExecuteEngine.writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_method.full_signature: @Override public void writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_method.identifier: writeQueryData
focal_method.invocations: getResponseType isActive channel write write getResponseType write getValue getProps getSchemaContexts getInstance next isWritable channel isActive channel flush doAwait getResourceLock getQueryData write flush write write
focal_method.modifiers: @Override public
focal_method.parameters: (final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)
focal_method.return: void
focal_method.signature: void writeQueryData(final ChannelHandlerContext context,
                                 final BackendConnection backendConnection, final QueryCommandExecutor queryCommandExecutor, final int headerPackagesCount)