Package com.ocient.util
Class MockOcientCluster
java.lang.Object
com.ocient.util.MockOcientCluster
- All Implemented Interfaces:
SimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>
public class MockOcientCluster
extends Object
implements SimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvides a mechanism for simulating result set production with minimal overhead.classRepresents a TCP connection to the backing server instance. -
Method Summary
Modifier and TypeMethodDescriptionCompletionStage<TransportResult<SimplexTransport<io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf>>> connect(String host, int port, XGConnection.Tls tls, int connectTimeout) Connects to a remote host using the specified transport and configuration.static io.netty.buffer.ByteBuferror(SQLException ex) static MockOcientClusterok()static io.netty.buffer.ByteBufvoidregisterQuery(String sql, MockOcientCluster.IdempotentResultSetProvider provider) Registers a SQL query with an associatedMockOcientCluster.IdempotentResultSetProviderto ensure performant, replayable operations.voidsetVersion(String version) Assign the version to this server.
-
Method Details
-
getInstance
-
connect
public CompletionStage<TransportResult<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> connect(String host, int port, XGConnection.Tls tls, int connectTimeout) Description copied from interface:SimplexTransportFactoryConnects to a remote host using the specified transport and configuration.- Specified by:
connectin interfaceSimplexTransportFactory<SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>> - Parameters:
host- the hostname or IP address of the remote hostport- the port number of the remote hosttls- the TLS configuration to use for the connection, or null if TLS is not requiredconnectTimeout- the maximum time to wait for the connection to be established, in milliseconds- Returns:
- a new
SimplexTransportobject representing the connection to the remote host
-
registerQuery
Registers a SQL query with an associatedMockOcientCluster.IdempotentResultSetProviderto ensure performant, replayable operations. -
setVersion
Assign the version to this server. -
ok
-
error
-
pingBuffer
public static io.netty.buffer.ByteBuf pingBuffer() -
demBuffer
public static io.netty.buffer.ByteBuf demBuffer()
-