当前位置: 首页>>代码示例>>Java>>正文


Java DataDeleteRequest类代码示例

本文整理汇总了Java中com.redhat.lightblue.client.request.data.DataDeleteRequest的典型用法代码示例。如果您正苦于以下问题:Java DataDeleteRequest类的具体用法?Java DataDeleteRequest怎么用?Java DataDeleteRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataDeleteRequest类属于com.redhat.lightblue.client.request.data包,在下文中一共展示了DataDeleteRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import com.redhat.lightblue.client.request.data.DataDeleteRequest; //导入依赖的package包/类
@Override
public void configure() throws Exception {
    from("timer:" + deleterLockResourceId + "?period=" + deleteInterval.toMillis())
    .routeId(deleterLockResourceId)
    .routePolicy(new LockingRoutePolicy(deleterLockResourceId, lockStrategy))
    .process(exchange -> {
        Instant tooOld = clock.instant().minus(deleteOlderThan);

        log.debug("Deleting {} entities with {} before {}", entityName, entityDateField, tooOld);

        DataDeleteRequest deleteRequest = new DataDeleteRequest(entityName, entityVersion);
        deleteRequest.where(Query.withValue(entityDateField, Query.BinOp.lt, Date.from(tooOld)));

        LightblueDataResponse response = client.data(deleteRequest);

        log.info("Deleted {} {} entities with {} before {}",
                response.parseModifiedCount(), entityName, entityDateField, tooOld);
    });
}
 
开发者ID:esbtools,项目名称:event-handler,代码行数:20,代码来源:PeriodicDeleteOldEntitiesRoute.java

示例2: removeTuple

import com.redhat.lightblue.client.request.data.DataDeleteRequest; //导入依赖的package包/类
@Override
public void removeTuple(EntityKey key, TupleContext tupleContext) {
    LightblueEntityMetadataId entityId = LightblueEntityMetadataId.extractEntityInfo(key.getMetadata());
    DataDeleteRequest request = new DataDeleteRequest(entityId.entityName, entityId.entityVersion);
    request.where(new ValueQuery("_id", ExpressionOperation.EQUALS, key.getColumnValues()[0].toString()));
    try {
        LightblueResponse data = provider.getLightblueClient().data(request);
        System.out.println(data.getJson());
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:kahowell,项目名称:lightblue-hibernate-ogm,代码行数:13,代码来源:LightblueDialect.java


注:本文中的com.redhat.lightblue.client.request.data.DataDeleteRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。