test_class.declarator: timeout = Duration.ofSeconds(1)
test_class.modifier: private final
test_class.original_string: private final Duration timeout = Duration.ofSeconds(1);
test_class.type: Duration
test_class.var_name: timeout
test_class.file: ndbc-mysql/src/test/java/io/trane/ndbc/mysql/ConnectionTest.java
test_class.identifier: ConnectionTest
test_case.body: @Test
    public void query() throws CheckedFutureException {
      final List<Row> result = new ArrayList<>();
      final String query = "query";
      final Supplier<Connection> sup = new ConnectionSupplier() {
        @Override
        Function<String, Exchange<List<Row>>> simpleQueryExchange() {
          return q -> {
            assertEquals(query, q);
            return Exchange.value(result);
          };
        }
      };
      assertEquals(result, sup.get().query(query).get(timeout));
    }
test_case.class_method_signature: ConnectionTest.query()
test_case.full_signature: @Test public void query()
test_case.identifier: query
test_case.invocations: assertEquals value assertEquals get query get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void query()
focal_class.declarator: log = LoggerFactory.getLogger(Connection.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(Connection.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: isValidQuery = PreparedStatement.create("SELECT 1")
focal_class.modifier: private static final
focal_class.original_string: private static final PreparedStatement isValidQuery = PreparedStatement.create("SELECT 1");
focal_class.type: PreparedStatement
focal_class.var_name: isValidQuery
focal_class.declarator: channel
focal_class.modifier: private final
focal_class.original_string: private final Channel                                                 channel;
focal_class.type: Channel
focal_class.var_name: channel
focal_class.declarator: connectionId
focal_class.modifier: private final
focal_class.original_string: private final Long                                                    connectionId;
focal_class.type: Long
focal_class.var_name: connectionId
focal_class.declarator: queryTimeout
focal_class.modifier: private final
focal_class.original_string: private final Optional<Duration>                                      queryTimeout;
focal_class.type: Optional<Duration>
focal_class.var_name: queryTimeout
focal_class.declarator: scheduler
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService                                scheduler;
focal_class.type: ScheduledExecutorService
focal_class.var_name: scheduler
focal_class.declarator: simpleQueryExchange
focal_class.modifier: private final
focal_class.original_string: private final Function<String, Exchange<List<Row>>>                   simpleQueryExchange;
focal_class.type: Function<String, Exchange<List<Row>>>
focal_class.var_name: simpleQueryExchange
focal_class.declarator: simpleExecuteExchange
focal_class.modifier: private final
focal_class.original_string: private final Function<String, Exchange<Long>>                        simpleExecuteExchange;
focal_class.type: Function<String, Exchange<Long>>
focal_class.var_name: simpleExecuteExchange
focal_class.declarator: extendedQueryExchange
focal_class.modifier: private final
focal_class.original_string: private final BiFunction<String, List<Value<?>>, Exchange<List<Row>>> extendedQueryExchange;
focal_class.type: BiFunction<String, List<Value<?>>, Exchange<List<Row>>>
focal_class.var_name: extendedQueryExchange
focal_class.declarator: extendedQueryStreamExchange
focal_class.modifier: private final
focal_class.original_string: private final BiFunction<String, List<Value<?>>, Exchange<Fetch>>     extendedQueryStreamExchange;
focal_class.type: BiFunction<String, List<Value<?>>, Exchange<Fetch>>
focal_class.var_name: extendedQueryStreamExchange
focal_class.declarator: extendedExecuteExchange
focal_class.modifier: private final
focal_class.original_string: private final BiFunction<String, List<Value<?>>, Exchange<Long>>      extendedExecuteExchange;
focal_class.type: BiFunction<String, List<Value<?>>, Exchange<Long>>
focal_class.var_name: extendedExecuteExchange
focal_class.declarator: dataSourceSupplier
focal_class.modifier: private final
focal_class.original_string: private final Supplier<DataSource<PreparedStatement, Row>>            dataSourceSupplier;
focal_class.type: Supplier<DataSource<PreparedStatement, Row>>
focal_class.var_name: dataSourceSupplier
focal_class.declarator: mutex = new AtomicReference<>()
focal_class.modifier: private final
focal_class.original_string: private final AtomicReference<Future<?>> mutex = new AtomicReference<>();
focal_class.type: AtomicReference<Future<?>>
focal_class.var_name: mutex
focal_class.file: ndbc-mysql/src/main/java/io/trane/ndbc/mysql/Connection.java
focal_class.identifier: Connection
focal_class.interfaces: implements io.trane.ndbc.datasource.Connection
focal_class.class_method_signature: Connection.Connection(final Channel channel, final Long connectionId, final Marshallers marshallers,
        final Optional<Duration> queryTimeout, final ScheduledExecutorService scheduler,
        final Function<String, Exchange<List<Row>>> simpleQueryExchange,
        final Function<String, Exchange<Long>> simpleExecuteExchange,
        final BiFunction<String, List<Value<?>>, Exchange<List<Row>>> extendedQueryExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Fetch>> extendedQueryStreamExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Long>> extendedExecuteExchange,
        final Supplier<DataSource<PreparedStatement, Row>> dataSourceSupplier)
focal_class.full_signature: public  Connection(final Channel channel, final Long connectionId, final Marshallers marshallers,
        final Optional<Duration> queryTimeout, final ScheduledExecutorService scheduler,
        final Function<String, Exchange<List<Row>>> simpleQueryExchange,
        final Function<String, Exchange<Long>> simpleExecuteExchange,
        final BiFunction<String, List<Value<?>>, Exchange<List<Row>>> extendedQueryExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Fetch>> extendedQueryStreamExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Long>> extendedExecuteExchange,
        final Supplier<DataSource<PreparedStatement, Row>> dataSourceSupplier)
focal_class.identifier: Connection
focal_class.modifiers: public
focal_class.parameters: (final Channel channel, final Long connectionId, final Marshallers marshallers,
        final Optional<Duration> queryTimeout, final ScheduledExecutorService scheduler,
        final Function<String, Exchange<List<Row>>> simpleQueryExchange,
        final Function<String, Exchange<Long>> simpleExecuteExchange,
        final BiFunction<String, List<Value<?>>, Exchange<List<Row>>> extendedQueryExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Fetch>> extendedQueryStreamExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Long>> extendedExecuteExchange,
        final Supplier<DataSource<PreparedStatement, Row>> dataSourceSupplier)
focal_class.signature:  Connection(final Channel channel, final Long connectionId, final Marshallers marshallers,
        final Optional<Duration> queryTimeout, final ScheduledExecutorService scheduler,
        final Function<String, Exchange<List<Row>>> simpleQueryExchange,
        final Function<String, Exchange<Long>> simpleExecuteExchange,
        final BiFunction<String, List<Value<?>>, Exchange<List<Row>>> extendedQueryExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Fetch>> extendedQueryStreamExchange,
        final BiFunction<String, List<Value<?>>, Exchange<Long>> extendedExecuteExchange,
        final Supplier<DataSource<PreparedStatement, Row>> dataSourceSupplier)
focal_class.class_method_signature: Connection.isValid()
focal_class.full_signature: @Override public Future<Boolean> isValid()
focal_class.identifier: isValid
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Boolean>
focal_class.signature: Future<Boolean> isValid()
focal_class.class_method_signature: Connection.close()
focal_class.full_signature: @Override public Future<Void> close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Void>
focal_class.signature: Future<Void> close()
focal_class.class_method_signature: Connection.query(final String query)
focal_class.full_signature: @Override public Future<List<Row>> query(final String query)
focal_class.identifier: query
focal_class.modifiers: @Override public
focal_class.parameters: (final String query)
focal_class.return: Future<List<Row>>
focal_class.signature: Future<List<Row>> query(final String query)
focal_class.class_method_signature: Connection.execute(final String command)
focal_class.full_signature: @Override public Future<Long> execute(final String command)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (final String command)
focal_class.return: Future<Long>
focal_class.signature: Future<Long> execute(final String command)
focal_class.class_method_signature: Connection.query(final PreparedStatement query)
focal_class.full_signature: @Override public final Future<List<Row>> query(final PreparedStatement query)
focal_class.identifier: query
focal_class.modifiers: @Override public final
focal_class.parameters: (final PreparedStatement query)
focal_class.return: Future<List<Row>>
focal_class.signature: Future<List<Row>> query(final PreparedStatement query)
focal_class.class_method_signature: Connection.stream(PreparedStatement query)
focal_class.full_signature: @Override public Flow<Row> stream(PreparedStatement query)
focal_class.identifier: stream
focal_class.modifiers: @Override public
focal_class.parameters: (PreparedStatement query)
focal_class.return: Flow<Row>
focal_class.signature: Flow<Row> stream(PreparedStatement query)
focal_class.class_method_signature: Connection.execute(final PreparedStatement command)
focal_class.full_signature: @Override public Future<Long> execute(final PreparedStatement command)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (final PreparedStatement command)
focal_class.return: Future<Long>
focal_class.signature: Future<Long> execute(final PreparedStatement command)
focal_class.class_method_signature: Connection.run(final Exchange<T> exchange)
focal_class.full_signature: private final Future<T> run(final Exchange<T> exchange)
focal_class.identifier: run
focal_class.modifiers: private final
focal_class.parameters: (final Exchange<T> exchange)
focal_class.return: Future<T>
focal_class.signature: Future<T> run(final Exchange<T> exchange)
focal_class.class_method_signature: Connection.execute(final Exchange<T> exchange)
focal_class.full_signature: private final Future<T> execute(final Exchange<T> exchange)
focal_class.identifier: execute
focal_class.modifiers: private final
focal_class.parameters: (final Exchange<T> exchange)
focal_class.return: Future<T>
focal_class.signature: Future<T> execute(final Exchange<T> exchange)
focal_class.class_method_signature: Connection.handler(final Promise<T> p)
focal_class.full_signature: private final InterruptHandler handler(final Promise<T> p)
focal_class.identifier: handler
focal_class.modifiers: private final
focal_class.parameters: (final Promise<T> p)
focal_class.return: InterruptHandler
focal_class.signature: InterruptHandler handler(final Promise<T> p)
focal_class.class_method_signature: Connection.beginTransaction()
focal_class.full_signature: @Override public Future<Void> beginTransaction()
focal_class.identifier: beginTransaction
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Void>
focal_class.signature: Future<Void> beginTransaction()
focal_class.class_method_signature: Connection.commit()
focal_class.full_signature: @Override public Future<Void> commit()
focal_class.identifier: commit
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Void>
focal_class.signature: Future<Void> commit()
focal_class.class_method_signature: Connection.rollback()
focal_class.full_signature: @Override public Future<Void> rollback()
focal_class.identifier: rollback
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Void>
focal_class.signature: Future<Void> rollback()
focal_method.body: @Override
    public Future<List<Row>> query(final String query) {
      return run(simpleQueryExchange.apply(query));
    }
focal_method.class_method_signature: Connection.query(final String query)
focal_method.full_signature: @Override public Future<List<Row>> query(final String query)
focal_method.identifier: query
focal_method.invocations: run apply
focal_method.modifiers: @Override public
focal_method.parameters: (final String query)
focal_method.return: Future<List<Row>>
focal_method.signature: Future<List<Row>> query(final String query)