Package io.stargate.grpcexample
Class GrpcClientExecuteQuery
- java.lang.Object
-
- io.stargate.grpcexample.GrpcClientExecuteQuery
-
public class GrpcClientExecuteQuery extends Object
This is a runnable code example explained in detail in the README.md file in this repo. To run this example, you need to have a running Stargate instance. On default, it assumes that the Stargate instance is running on localhost:8090. If you need to change it, please adapt theSTARGATE_HOSTand/orSTARGATE_GRPC_PORT. Lastly, it requires the Stargate Token to perform auth logic. Please set it in the:STARGATE_TOKEN.It executes:
- DDL to setup keyspace and table
- Blocking insert and data retrieval for single element
- Blocking insert and data retrieval for batch of elements
- Async query
-
-
Constructor Summary
Constructors Constructor Description GrpcClientExecuteQuery()Construct client for accessing StargateGrpc server using a new channel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.ManagedChannelcreateChannel(String host, int port)voidexecuteSingleQuery()voidexecuteSingleQueryParameterized()static voidmain(String[] args)Runner of the GrpcClientExample
-
-
-
Method Detail
-
main
public static void main(String[] args) throws InterruptedException
Runner of the GrpcClientExample- Throws:
InterruptedException
-
executeSingleQuery
public void executeSingleQuery()
-
executeSingleQueryParameterized
public void executeSingleQueryParameterized()
-
createChannel
public io.grpc.ManagedChannel createChannel(String host, int port)
-
-