本文整理匯總了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();
}
}