我正在尝试从基本教程(https://docs.basho.com/riak/kv/2.0.0/developing/getting-started/java/)执行TasteOfRiak.java,但Riak在执行期间记录错误:
602441 [nioEventLoopGroup-2-2] ERROR com.basho.riak.client.core.RiakNode - Channel closed while operation in progress; id:-1014012123 127.0.0.1:8098
代码如下:
private static RiakCluster setUpCluster() throws UnknownHostException {
RiakNode node = new RiakNode.Builder()
.withRemoteAddress("127.0.0.1")
.withRemotePort(8098)
.build();
RiakCluster cluster = new RiakCluster.Builder(node)
.build();
cluster.start();
return cluster;
}
public static void main( String[] args ) {
try {
RiakObject quoteObject = new RiakObject()
.setContentType("text/plain")
.setValue(BinaryValue.create("You're dangerous, Maverick"));
System.out.println("Basic object created");
Namespace quotesBucket = new Namespace("quotes");
Location quoteObjectLocation = new Location(quotesBucket, "Iceman");
System.out.println("Location object created for quote object");
StoreValue storeOp = new StoreValue.Builder(quoteObject)
.withLocation(quoteObjectLocation)
.build();
System.out.println("StoreValue operation created");
RiakCluster cluster = setUpCluster();
RiakClient client = new RiakClient(cluster);
System.out.println("Client object successfully created");
StoreValue.Response storeOpResp = client.execute(storeOp);
System.out.println("Object storage operation successfully completed");
'客户端对象已成功创建'是错误之前的最后一条打印消息。你知道修复它的方法吗?