本文整理汇总了Java中com.netflix.astyanax.retry.RetryPolicy类的典型用法代码示例。如果您正苦于以下问题:Java RetryPolicy类的具体用法?Java RetryPolicy怎么用?Java RetryPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RetryPolicy类属于com.netflix.astyanax.retry包,在下文中一共展示了RetryPolicy类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AstyanaxKeyColumnValueStore
import com.netflix.astyanax.retry.RetryPolicy; //导入依赖的package包/类
AstyanaxKeyColumnValueStore(String columnFamilyName,
Keyspace keyspace,
AstyanaxStoreManager storeManager,
RetryPolicy retryPolicy) {
this.keyspace = keyspace;
this.columnFamilyName = columnFamilyName;
this.retryPolicy = retryPolicy;
this.storeManager = storeManager;
entryGetter = new AstyanaxGetter(storeManager.getMetaDataSchema(columnFamilyName));
columnFamily = new ColumnFamily<ByteBuffer, ByteBuffer>(
this.columnFamilyName,
ByteBufferSerializer.get(),
ByteBufferSerializer.get());
}
示例2: getRetryPolicy
import com.netflix.astyanax.retry.RetryPolicy; //导入依赖的package包/类
private static RetryPolicy getRetryPolicy(String serializedRetryPolicy) throws BackendException {
String[] tokens = serializedRetryPolicy.split(",");
String policyClassName = tokens[0];
int argCount = tokens.length - 1;
Integer[] args = new Integer[argCount];
for (int i = 1; i < tokens.length; i++) {
args[i - 1] = Integer.valueOf(tokens[i]);
}
try {
RetryPolicy rp = instantiate(policyClassName, args, serializedRetryPolicy);
log.debug("Instantiated RetryPolicy object {} from config string \"{}\"", rp, serializedRetryPolicy);
return rp;
} catch (Exception e) {
throw new PermanentBackendException("Failed to instantiate Astyanax Retry Policy class", e);
}
}
示例3: executeWithFailover
import com.netflix.astyanax.retry.RetryPolicy; //导入依赖的package包/类
@Override
public <R> OperationResult<R> executeWithFailover(Operation<T, R> operation, RetryPolicy retryPolicy)
throws ConnectionException, OperationException {
Operation<T, R> pinnedOperation = new AbstractOperationFilter<T, R>(operation) {
@Override
public Host getPinnedHost() {
return _host;
}
};
return _delegate.executeWithFailover(pinnedOperation, retryPolicy);
}
示例4: getRetryPolicy
import com.netflix.astyanax.retry.RetryPolicy; //导入依赖的package包/类
@Override
public RetryPolicy getRetryPolicy() {
return retryPolicy;
}
示例5: duplicate
import com.netflix.astyanax.retry.RetryPolicy; //导入依赖的package包/类
public RetryPolicy duplicate() {
return new BoundedExponentialBackoffLog(keyspacename, baseSleepTimeMs, maxSleepTimeMs, max);
}