本文整理汇总了Java中com.basho.riak.client.bucket.Bucket类的典型用法代码示例。如果您正苦于以下问题:Java Bucket类的具体用法?Java Bucket怎么用?Java Bucket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bucket类属于com.basho.riak.client.bucket包,在下文中一共展示了Bucket类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: delete
import com.basho.riak.client.bucket.Bucket; //导入依赖的package包/类
public static void delete(String bucket, String key) {
Bucket b;
try {
b = getBucket(bucket);
if (b != null)
b.delete(key).rw(3).execute();
} catch (RiakException e) {
e.printStackTrace();
}
}
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:11,代码来源:Riak.java
示例2: getValue
import com.basho.riak.client.bucket.Bucket; //导入依赖的package包/类
static private byte[] getValue(String bucket, String key) {
try {
Bucket b = riak.fetchBucket(bucket).execute();
if (b != null) {
IRiakObject obj = b.fetch(key).execute();
if (obj != null)
return obj.getValue();
}
} catch (RiakRetryFailedException e) {
e.printStackTrace();
}
return null;
}
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:14,代码来源:Riak.java
示例3: getBucket
import com.basho.riak.client.bucket.Bucket; //导入依赖的package包/类
static private Bucket getBucket(String bucket) throws RiakException {
Bucket res = riak.fetchBucket(bucket).execute();
if (res == null) {
return riak.createBucket("bucket").execute();
} else
return res;
}
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:8,代码来源:Riak.java
示例4: executeReadQuery
import com.basho.riak.client.bucket.Bucket; //导入依赖的package包/类
private StringToStringMap executeReadQuery(IRiakClient client, String bucketName, String key) {
try {
Bucket bucket = client.fetchBucket(bucketName).execute();
FetchObject<StringToStringMap> fetchObj = bucket.fetch(key, StringToStringMap.class);
return fetchObj.r(DEFAULT_READ_QUORUM).execute();
} catch (Exception exc) {
System.out.println("EXCEPTION: " + exc);
return null;
}
}
开发者ID:arnaudsjs,项目名称:YCSB-riak-binding,代码行数:11,代码来源:RiakClient.java
示例5: executeWriteQuery
import com.basho.riak.client.bucket.Bucket; //导入依赖的package包/类
private int executeWriteQuery(IRiakClient client, String bucketName, String key, StringToStringMap dataToWrite){
try {
Bucket bucket = client.fetchBucket(bucketName).execute();
StoreObject<StringToStringMap> storeObject = bucket.store(key, dataToWrite);
storeObject.w(DEFAULT_WRITE_QUORUM).execute();
} catch (Exception e) {
return ERROR;
}
return OK;
}
开发者ID:arnaudsjs,项目名称:YCSB-riak-binding,代码行数:11,代码来源:RiakClient.java
注:本文中的com.basho.riak.client.bucket.Bucket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论