当前位置: 首页>>代码示例>>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;未经允许,请勿转载。