use of org.apache.calcite.avatica.server.AvaticaProtobufHandler in project calcite-avatica by apache.
the class AvaticaServersForTest method startServers.
/**
* Starts an Avatica server for each serialization type.
*/
public void startServers() throws Exception {
// Bind to '0' to pluck an ephemeral port instead of expecting a certain one to be free
final HttpServer jsonServer = Main.start(SERVER_ARGS, 0, new Main.HandlerFactory() {
@Override
public AvaticaJsonHandler createHandler(Service service) {
return new AvaticaJsonHandler(service);
}
});
serversBySerialization.put(Serialization.JSON, jsonServer);
final HttpServer protobufServer = Main.start(SERVER_ARGS, 0, new Main.HandlerFactory() {
@Override
public AvaticaProtobufHandler createHandler(Service service) {
return new AvaticaProtobufHandler(service);
}
});
serversBySerialization.put(Serialization.PROTOBUF, protobufServer);
}
Aggregations