本文整理汇总了Java中mousio.etcd4j.requests.EtcdKeyDeleteRequest类的典型用法代码示例。如果您正苦于以下问题:Java EtcdKeyDeleteRequest类的具体用法?Java EtcdKeyDeleteRequest怎么用?Java EtcdKeyDeleteRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EtcdKeyDeleteRequest类属于mousio.etcd4j.requests包,在下文中一共展示了EtcdKeyDeleteRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processDel
import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //导入依赖的package包/类
private void processDel(EtcdClient client, String path, boolean dir, Exchange exchange) throws Exception {
EtcdKeyDeleteRequest request = client.delete(path);
setRequestTimeout(request, exchange);
setRequestRecursive(request, exchange);
if (dir) {
request.dir();
}
try {
exchange.getIn().setHeader(EtcdConstants.ETCD_NAMESPACE, getNamespace());
exchange.getIn().setBody(request.send().get());
} catch (TimeoutException e) {
throw new ExchangeTimedOutException(exchange, configuration.getTimeout());
}
}
示例2: delete
import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //导入依赖的package包/类
public boolean delete(final String path) {
return Fn.getJvm(Boolean.FALSE, () -> {
final EtcdKeyDeleteRequest request = this.client.delete(path);
final EtcdResponsePromise<EtcdKeysResponse> promise = request.send();
final EtcdKeysResponse response = promise.get();
return null != response.getNode();
}, path);
}
示例3: delete
import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //导入依赖的package包/类
@Override
public KvNode delete(String key, WriteOptions ops) {
EtcdKeyDeleteRequest req = etcd.delete(key);
fillDeleteReq(ops, req);
try {
EtcdKeysResponse resp = executeRequest(req);
log.debug("deleted key {}", resp.node.key);
return toNode(resp);
} catch (Exception e) {
throw Throwables.asRuntime(e);
}
}
示例4: fillDeleteReq
import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //导入依赖的package包/类
private void fillDeleteReq(WriteOptions ops, EtcdKeyDeleteRequest req) {
if(ops == null) {
return;
}
final int prevIndex = ops.getPrevIndex();
if(prevIndex > 0) {
req.prevIndex(prevIndex);
}
}
示例5: setRequestRecursive
import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //导入依赖的package包/类
private void setRequestRecursive(EtcdKeyDeleteRequest request, Exchange exchange) {
if (isRecursive(exchange)) {
request.recursive();
}
}