riak-java-client是Riak的Java客户端开发类库,示例代码:
//createaclient(seeConfigurationbelowinthisREADMEformoredetails)IRiakClientriakClient=RiakFactory.pbcClient();//orRiakFactory.httpClient();//createanewbucketBucketmyBucket=riakClient.createBucket("myBucket").execute();//adddatatothebucketmyBucket.store("key1","value1").execute();//fetchitbackIRiakObjectmyData=myBucket.fetch("key1").execute();//youcanspecifyextraparameterstothestoreoperationusingthe//fluentbuilderstyleAPImyData=myBucket.store("key1","value2").returnBody(true).execute();//deletemyBucket.delete("key1").rw(3).execute();点击空白处退出提示
评论