org.apache.avro.ipc.HttpServer.getPort()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中org.apache.avro.ipc.HttpServer.getPort()方法的一些代码示例,展示了HttpServer.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.getPort()方法的具体详情如下:
包路径:org.apache.avro.ipc.HttpServer
类名称:HttpServer
方法名:getPort

HttpServer.getPort介绍

暂无

代码示例

代码示例来源:origin: apache/avro

/** Sends RPCs and returns nanos elapsed. */
private static long sendRpcs(boolean withPlugin) throws IOException {
 HttpServer server = createServer(withPlugin);
 Transceiver t =
  new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
 GenericRequestor requestor = new GenericRequestor(NULL_PROTOCOL, t);
 long now = System.nanoTime();
 for (int i = 0; i < COUNT; ++i) {
  requestor.request("null", null);
 }
 long elapsed = System.nanoTime() - now;
 t.close();
 server.close();
 return elapsed;
}

代码示例来源:origin: org.apache.hadoop/avro

out.println("Port: " + server.getPort());
return 0;

代码示例来源:origin: org.apache.cassandra.deps/avro

server = new HttpServer(new SinkResponder(protocol), uri.getPort());
server.start();
out.println("Port: " + server.getPort());
return 0;

相关文章