我写了一个EndPoint
服务器如下:
public class HelloWorldEndPoint extends ServerHelloworld.HelloWorld implements Coprocessor, CoprocessorService {
private RegionCoprocessorEnvironment env;
@Override
public void sendHello(RpcController controller, HelloRequest request,
RpcCallback<HelloResponse> done) {
System.out.println("request HelloRequest:" + request.getAskWord());
HelloResponse resp = HelloResponse.newBuilder().setRetWord(ByteString.copyFromUtf8("hello world!!!")).build();
done.run(resp);
}
@Override
public void question(RpcController controller, AskRequest request,
RpcCallback<AnsResponse> done) {
System.out.println("request question:" + request.getAsk());
AnsResponse resp = AnsResponse.newBuilder().setAns(ByteString.copyFromUtf8("helloworld," + request.getAsk().toStringUtf8())).build();
done.run(resp);
}
@Override
public Service getService() {
return this;
}
@Override
public void start(CoprocessorEnvironment env) throws IOException {
if (env instanceof RegionCoprocessorEnvironment) {
this.env = (RegionCoprocessorEnvironment) env;
} else {
throw new CoprocessorException("Must be loaded on a table region!");
}
}
}
问题是我无法看到我的日志,例如:
System.out.println("request question:" + request.getAsk());
我不知道在哪里可以看到这个
答案 0 :(得分:0)
端点正在RegionServer上运行。通常,regionserver日志存在于/var/log/hbase
目录下。您应该在sysout logfile中的该目录中找到Endpoint的日志。
此外,您需要locate the region server
(如果您在分布式群集上运行)正在接收端点客户端请求。