本文整理了Java中com.baidu.hugegraph.backend.query.Query.paging
方法的一些代码示例,展示了Query.paging
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.paging
方法的具体详情如下:
包路径:com.baidu.hugegraph.backend.query.Query
类名称:Query
方法名:paging
暂无
代码示例来源:origin: hugegraph/hugegraph
@Override
protected final boolean fetch() {
assert this.current == null;
if (this.next != null) {
this.current = this.next;
this.next = null;
}
while (this.remaining > 0 && this.rows.hasNext()) {
if (this.query.paging()) {
this.remaining--;
}
Row row = this.rows.next();
BackendEntry merged = this.merger.apply(this.current, row);
if (this.current == null) {
// The first time to read
this.current = merged;
} else if (merged == this.current) {
// The next entry belongs to the current entry
assert merged != null;
} else {
// New entry
assert this.next == null;
this.next = merged;
break;
}
}
return this.current != null;
}
代码示例来源:origin: hugegraph/hugegraph
this.wrapOrderBy(selection, query);
if (query.paging()) {
this.wrapPage(selection, query);
} else if (query.limit() != Query.NO_LIMIT || query.offset() > 0) {
代码示例来源:origin: hugegraph/hugegraph
public BinaryEntryIterator(BackendIterator<Elem> results, Query query,
BiFunction<BackendEntry, Elem, BackendEntry> m) {
super(query);
E.checkNotNull(results, "results");
E.checkNotNull(m, "merger");
this.results = results;
this.merger = m;
this.next = null;
this.skipOffset();
if (query.paging()) {
this.skipPageOffset(query.page());
}
}
代码示例来源:origin: hugegraph/hugegraph
protected RowIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null);
} else {
return session.scan(this.table(), -1);
}
}
代码示例来源:origin: hugegraph/hugegraph
public CassandraEntryIterator(ResultSet results, Query query,
BiFunction<BackendEntry, Row, BackendEntry> merger) {
super(query);
this.results = results;
this.rows = results.iterator();
this.remaining = results.getAvailableWithoutFetching();
this.merger = merger;
this.next = null;
this.skipOffset();
if (query.paging()) {
E.checkState(this.remaining == query.limit() ||
results.isFullyFetched(),
"Unexpected fetched page size: %s", this.remaining);
}
}
代码示例来源:origin: hugegraph/hugegraph
protected BackendColumnIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null, Session.SCAN_ANY);
} else {
return session.scan(this.table());
}
}
代码示例来源:origin: hugegraph/hugegraph
@Override
public Iterator<BackendEntry> query(BackendSession session, Query query) {
if (query.paging()) {
throw new NotSupportException("paging by InMemoryDBStore");
代码示例来源:origin: com.baidu.hugegraph/hugegraph-cassandra
@Override
protected final boolean fetch() {
assert this.current == null;
if (this.next != null) {
this.current = this.next;
this.next = null;
}
while (this.remaining > 0 && this.rows.hasNext()) {
if (this.query.paging()) {
this.remaining--;
}
Row row = this.rows.next();
BackendEntry merged = this.merger.apply(this.current, row);
if (this.current == null) {
// The first time to read
this.current = merged;
} else if (merged == this.current) {
// The next entry belongs to the current entry
assert merged != null;
} else {
// New entry
assert this.next == null;
this.next = merged;
break;
}
}
return this.current != null;
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-mysql
this.wrapOrderBy(selection, query);
if (query.paging()) {
this.wrapPage(selection, query);
} else if (query.limit() != Query.NO_LIMIT || query.offset() > 0) {
代码示例来源:origin: com.baidu.hugegraph/hugegraph-core
public BinaryEntryIterator(BackendIterator<Elem> results, Query query,
BiFunction<BackendEntry, Elem, BackendEntry> m) {
super(query);
E.checkNotNull(results, "results");
E.checkNotNull(m, "merger");
this.results = results;
this.merger = m;
this.next = null;
this.skipOffset();
if (query.paging()) {
this.skipPageOffset(query.page());
}
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-cassandra
public CassandraEntryIterator(ResultSet results, Query query,
BiFunction<BackendEntry, Row, BackendEntry> merger) {
super(query);
this.results = results;
this.rows = results.iterator();
this.remaining = results.getAvailableWithoutFetching();
this.merger = merger;
this.next = null;
this.skipOffset();
if (query.paging()) {
E.checkState(this.remaining == query.limit() ||
results.isFullyFetched(),
"Unexpected fetched page size: %s", this.remaining);
}
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-rocksdb
protected BackendColumnIterator queryAll(Session session, Query query) {
if (query.paging()) {
PageState page = PageState.fromString(query.page());
byte[] begin = page.position();
return session.scan(this.table(), begin, null, Session.SCAN_ANY);
} else {
return session.scan(this.table());
}
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-core
@Override
public Iterator<BackendEntry> query(BackendSession session, Query query) {
if (query.paging()) {
throw new NotSupportException("paging by InMemoryDBStore");
内容来源于网络,如有侵权,请联系作者删除!