From 48e24cfe28b1862cd874a19305254e382e77ff94 Mon Sep 17 00:00:00 2001 From: zhangyi51 Date: Tue, 2 Apr 2019 16:21:20 +0800 Subject: [PATCH] change query.page_size range to (1, 80w) Change-Id: I0284b6ea7edd33898c54b5bf223ab069a229245d --- .../main/java/com/baidu/hugegraph/backend/query/Query.java | 5 ++--- .../main/java/com/baidu/hugegraph/config/CoreOptions.java | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/query/Query.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/query/Query.java index 12eaceadba..bdd35bc6c8 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/query/Query.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/query/Query.java @@ -22,6 +22,7 @@ import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.Set; import com.baidu.hugegraph.backend.BackendException; @@ -31,7 +32,6 @@ import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.type.define.HugeKeys; import com.baidu.hugegraph.util.E; -import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; public class Query implements Cloneable { @@ -260,8 +260,7 @@ public boolean equals(Object object) { this.orders.equals(other.orders) && this.offset == other.offset && this.limit == other.limit && - ((this.page == null && other.page == null) || - this.page.equals(other.page)) && + Objects.equals(this.page, other.page) && this.ids().equals(other.ids()) && this.conditions().equals(other.conditions()); } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java index b2cece77e8..8623df8bb6 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java @@ -19,6 +19,8 @@ package com.baidu.hugegraph.config; +import com.baidu.hugegraph.backend.query.Query; + import static com.baidu.hugegraph.backend.tx.GraphTransaction.COMMIT_BATCH; import static com.baidu.hugegraph.config.OptionChecker.disallowEmpty; import static com.baidu.hugegraph.config.OptionChecker.rangeInt; @@ -211,7 +213,7 @@ public static synchronized CoreOptions instance() { new ConfigOption<>( "query.page_size", "The size of each page when query using paging.", - rangeInt(0, 10000), + rangeInt(1, (int) Query.DEFAULT_CAPACITY), 500 );