當前位置: 首頁>>代碼示例>>Java>>正文


Java EtcdKeyDeleteRequest類代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:17,代碼來源:EtcdKeysProducer.java

示例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);
}
 
開發者ID:silentbalanceyh,項目名稱:vertx-zero,代碼行數:9,代碼來源:EtcdData.java

示例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);
    }
}
 
開發者ID:codeabovelab,項目名稱:haven-platform,代碼行數:14,代碼來源:EtcdClientWrapper.java

示例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);
    }
}
 
開發者ID:codeabovelab,項目名稱:haven-platform,代碼行數:10,代碼來源:EtcdClientWrapper.java

示例5: setRequestRecursive

import mousio.etcd4j.requests.EtcdKeyDeleteRequest; //導入依賴的package包/類
private void setRequestRecursive(EtcdKeyDeleteRequest request, Exchange exchange) {
    if (isRecursive(exchange)) {
        request.recursive();
    }
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:6,代碼來源:EtcdKeysProducer.java


注:本文中的mousio.etcd4j.requests.EtcdKeyDeleteRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。