本文整理了Java中org.mongodb.morphia.query.Query.asList
方法的一些代码示例,展示了Query.asList
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.asList
方法的具体详情如下:
包路径:org.mongodb.morphia.query.Query
类名称:Query
方法名:asList
暂无
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getDeadJobs(long deadline) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.filter("gmtModified < ", deadline);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getDeadJobs(long deadline) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.filter("gmtModified < ", deadline);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<NodeGroupPo> getNodeGroup(NodeType nodeType) {
Query<NodeGroupPo> query = template.createQuery(NodeGroupPo.class);
query.field("nodeType").equal(nodeType);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<NodeGroupPo> getNodeGroup(NodeType nodeType) {
Query<NodeGroupPo> query = template.createQuery(NodeGroupPo.class);
query.field("nodeType").equal(nodeType);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobFeedbackPo> fetchTop(String jobClientNodeGroup, int top) {
Query<JobFeedbackPo> query = createQuery(jobClientNodeGroup);
query.order("gmtCreated").limit(top);
return query.asList();
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getJobs(String taskTrackerIdentity) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.field("taskTrackerIdentity").equal(taskTrackerIdentity);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobFeedbackPo> fetchTop(String jobClientNodeGroup, int top) {
Query<JobFeedbackPo> query = createQuery(jobClientNodeGroup);
query.order("gmtCreated").limit(top);
return query.asList();
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getJobs(String taskTrackerIdentity) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.field("taskTrackerIdentity").equal(taskTrackerIdentity);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getDeadJob(String taskTrackerNodeGroup, long deadline) {
String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
Query<JobPo> query = template.createQuery(tableName, JobPo.class);
query.field("isRunning").equal(true).
filter("gmtCreated < ", deadline);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getDeadJob(String taskTrackerNodeGroup, long deadline) {
String tableName = JobQueueUtils.getExecutableQueueName(taskTrackerNodeGroup);
Query<JobPo> query = template.createQuery(tableName, JobPo.class);
query.field("isRunning").equal(true).
filter("gmtCreated < ", deadline);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getNeedGenerateJobPos(Long checkTime, int topSize) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.field("relyOnPrevCycle").equal(false);
query.field("lastGenerateTriggerTime").equal(checkTime);
query.offset(0).limit(topSize);
return query.asList();
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public List<JobPo> getNeedGenerateJobPos(Long checkTime, int topSize) {
Query<JobPo> query = template.createQuery(JobPo.class);
query.field("relyOnPrevCycle").equal(false);
query.field("lastGenerateTriggerTime").equal(checkTime);
query.offset(0).limit(topSize);
return query.asList();
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected List<JobPo> load(String loadTaskTrackerNodeGroup, int loadSize) {
// load
String tableName = JobQueueUtils.getExecutableQueueName(loadTaskTrackerNodeGroup);
Query<JobPo> query = template.createQuery(tableName, JobPo.class);
query.field("isRunning").equal(false)
.filter("triggerTime < ", SystemClock.now())
.order(" priority, triggerTime , gmtCreated").offset(0).limit(loadSize);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
protected List<JobPo> load(String loadTaskTrackerNodeGroup, int loadSize) {
// load
String tableName = JobQueueUtils.getExecutableQueueName(loadTaskTrackerNodeGroup);
Query<JobPo> query = template.createQuery(tableName, JobPo.class);
query.field("isRunning").equal(false)
.filter("triggerTime < ", SystemClock.now())
.order(" priority, triggerTime , gmtCreated").offset(0).limit(loadSize);
return query.asList();
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public PaginationRsp<NodeGroupPo> getNodeGroup(NodeGroupGetReq request) {
Query<NodeGroupPo> query = template.createQuery(NodeGroupPo.class);
if (request.getNodeType() != null) {
query.field("nodeType").equal(request.getNodeType());
}
if (StringUtils.isNotEmpty(request.getNodeGroup())) {
query.field("name").equal(request.getNodeGroup());
}
PaginationRsp<NodeGroupPo> response = new PaginationRsp<NodeGroupPo>();
Long results = template.getCount(query);
response.setResults(results.intValue());
if (results == 0) {
return response;
}
query.order("-gmtCreated").offset(request.getStart()).limit(request.getLimit());
response.setRows(query.asList());
return response;
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
@Override
public PaginationRsp<NodeGroupPo> getNodeGroup(NodeGroupGetReq request) {
Query<NodeGroupPo> query = template.createQuery(NodeGroupPo.class);
if (request.getNodeType() != null) {
query.field("nodeType").equal(request.getNodeType());
}
if (StringUtils.isNotEmpty(request.getNodeGroup())) {
query.field("name").equal(request.getNodeGroup());
}
PaginationRsp<NodeGroupPo> response = new PaginationRsp<NodeGroupPo>();
Long results = template.getCount(query);
response.setResults(results.intValue());
if (results == 0) {
return response;
}
query.order("-gmtCreated").offset(request.getStart()).limit(request.getLimit());
response.setRows(query.asList());
return response;
}
}
代码示例来源:origin: ltsopensource/light-task-scheduler
response.setRows(query.asList());
return response;
代码示例来源:origin: ltsopensource/light-task-scheduler
response.setRows(query.asList());
return response;
代码示例来源:origin: ltsopensource/light-task-scheduler
paginationRsp.setRows(query.asList());
代码示例来源:origin: ltsopensource/light-task-scheduler
paginationRsp.setRows(query.asList());
内容来源于网络,如有侵权,请联系作者删除!