From bb934e5c79b5d4031bb2f7aed4c66acdf86d43db Mon Sep 17 00:00:00 2001 From: lijinglun Date: Thu, 25 Dec 2025 12:16:55 +0800 Subject: [PATCH 1/2] feat(java): add builder-style scalar index params --- .../lance/index/scalar/BTreeIndexParams.java | 91 ++++++ .../lance/index/scalar/BitmapIndexParams.java | 39 +++ .../index/scalar/InvertedIndexParams.java | 286 ++++++++++++++++++ .../org/lance/index/scalar/JsonUtils.java | 33 ++ .../index/scalar/LabelListIndexParams.java | 39 +++ .../lance/index/scalar/NGramIndexParams.java | 39 +++ .../index/scalar/ZoneMapIndexParams.java | 71 +++++ 7 files changed, 598 insertions(+) create mode 100755 java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java create mode 100644 java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java create mode 100755 java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java create mode 100755 java/src/main/java/org/lance/index/scalar/JsonUtils.java create mode 100644 java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java create mode 100644 java/src/main/java/org/lance/index/scalar/NGramIndexParams.java create mode 100755 java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java diff --git a/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java b/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java new file mode 100755 index 0000000000..13e4318acf --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java @@ -0,0 +1,91 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Builder-style configuration for B-Tree scalar index parameters. + */ +public final class BTreeIndexParams { + + private static final String INDEX_TYPE = "btree"; + + private BTreeIndexParams() {} + + /** + * Create a new builder for B-Tree index parameters. + * + * @return a new {@link Builder} + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private Long zoneSize; + private Integer rangeId; + + /** + * Configure the number of rows per zone. + * + * @param zoneSize number of rows per zone, must be positive + * @return this builder + * @throws IllegalArgumentException + */ + public Builder zoneSize(long zoneSize) { + if (zoneSize <= 0) { + throw new IllegalArgumentException("zoneSize must be positive"); + } + this.zoneSize = zoneSize; + return this; + } + + /** + * Configure the ordinal ID of a data partition for building a large, distributed BTree index. + * + * @param rangeId non-negative range identifier + * @return this builder + * @throws IllegalArgumentException + */ + public Builder rangeId(int rangeId) { + if (rangeId < 0) { + throw new IllegalArgumentException("rangeId must be non-negative"); + } + this.rangeId = rangeId; + return this; + } + + /** + * Build a {@link ScalarIndexParams} instance for a B-Tree index. + */ + public ScalarIndexParams build() { + Map params = new LinkedHashMap<>(); + if (zoneSize != null) { + params.put("zone_size", zoneSize); + } + if (rangeId != null) { + params.put("range_id", rangeId); + } + + if (params.isEmpty()) { + return ScalarIndexParams.create(INDEX_TYPE); + } + + String json = JsonUtils.toJson(params); + return ScalarIndexParams.create(INDEX_TYPE, json); + } + } +} diff --git a/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java b/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java new file mode 100644 index 0000000000..0bc6a036d8 --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java @@ -0,0 +1,39 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +/** + * Builder-style configuration for Bitmap scalar index parameters. + */ +public final class BitmapIndexParams { + private static final String INDEX_TYPE = "bitmap"; + + private BitmapIndexParams() {} + + /** + * Create a new builder for Bitmap index parameters. + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + /** + * Build a {@link ScalarIndexParams} instance for a Bitmap index. + */ + public ScalarIndexParams build() { + return ScalarIndexParams.create(INDEX_TYPE); + } + } +} \ No newline at end of file diff --git a/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java b/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java new file mode 100755 index 0000000000..2e6cc691ee --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java @@ -0,0 +1,286 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Builder-style configuration for inverted (full-text) scalar index parameters. + */ +public final class InvertedIndexParams { + + private static final String INDEX_TYPE = "inverted"; + + private InvertedIndexParams() {} + + /** + * Create a new builder for inverted index parameters. + * + * @return a new {@link Builder} + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for inverted scalar index parameters. */ + public static final class Builder { + private String baseTokenizer; + private String language; + private Boolean withPosition; + private Integer maxTokenLength; + private Boolean lowerCase; + private Boolean stem; + private Boolean removeStopWords; + private List customStopWords; + private Boolean asciiFolding; + private Integer minNgramLength; + private Integer maxNgramLength; + private Boolean prefixOnly; + private Boolean skipMerge; + + /** + * Configure the base tokenizer. + * + *

Supported values include: + * + *

    + *
  • {@code "simple"} (default): splits tokens on whitespace and punctuation + *
  • {@code "whitespace"}: splits tokens on whitespace + *
  • {@code "raw"}: no tokenization + *
  • {@code "ngram"}: N-Gram tokenizer + *
  • {@code "lindera/*"}: Lindera tokenizer + *
  • {@code "jieba/*"}: Jieba tokenizer + *
+ * + * @param baseTokenizer tokenizer identifier string + * @return this builder + * @throws IllegalArgumentException + */ + public Builder baseTokenizer(String baseTokenizer) { + Objects.requireNonNull(baseTokenizer, "baseTokenizer must not be null"); + if (baseTokenizer.isEmpty()) { + throw new IllegalArgumentException("baseTokenizer must not be empty"); + } + this.baseTokenizer = baseTokenizer; + return this; + } + + /** + * Configure the language used for stemming and stop words. + * + * @param language language name understood by Tantivy, for example {@code "English"} + * @return this builder + * @throws IllegalArgumentException + */ + public Builder language(String language) { + Objects.requireNonNull(language, "language must not be null"); + if (language.isEmpty()) { + throw new IllegalArgumentException("language must not be empty"); + } + this.language = language; + return this; + } + + /** + * Configure whether to store token positions in the index. + * + * @param withPosition whether to store term positions + * @return this builder + */ + public Builder withPosition(boolean withPosition) { + this.withPosition = withPosition; + return this; + } + + /** + * Configure the maximum token length. + * + * @param maxTokenLength maximum token length, must be positive + * @return this builder + * @throws IllegalArgumentException + */ + public Builder maxTokenLength(Integer maxTokenLength) { + if (maxTokenLength == null || maxTokenLength <= 0) { + throw new IllegalArgumentException("maxTokenLength must be positive when specified"); + } + this.maxTokenLength = maxTokenLength; + return this; + } + + /** + * Configure whether to lower case tokens. + * + * @param lowerCase whether to lower case tokens + * @return this builder + */ + public Builder lowerCase(boolean lowerCase) { + this.lowerCase = lowerCase; + return this; + } + + /** + * Configure whether to apply stemming. + * + * @param stem whether to apply stemming + * @return this builder + */ + public Builder stem(boolean stem) { + this.stem = stem; + return this; + } + + /** + * Configure whether to remove stop words. + * + * @param removeStopWords whether to remove stop words + * @return this builder + */ + public Builder removeStopWords(boolean removeStopWords) { + this.removeStopWords = removeStopWords; + return this; + } + + /** + * Configure custom stop words. When set, these override the built-in stop word list for the + * configured language. + * + * @param customStopWords list of stop words + * @return this builder + */ + public Builder customStopWords(List customStopWords) { + Objects.requireNonNull(customStopWords, "customStopWords must not be null"); + this.customStopWords = new ArrayList<>(customStopWords); + return this; + } + + /** + * Configure whether to apply ASCII folding + * + * @param asciiFolding whether to enable ASCII folding + * @return this builder + */ + public Builder asciiFolding(boolean asciiFolding) { + this.asciiFolding = asciiFolding; + return this; + } + + /** + * Configure the minimum N-gram length (only used when {@code baseTokenizer = "ngram"}). + * + * @param minNgramLength minimum N-gram length, must be > 0 and <= {@code maxNgramLength} + * @return this builder + * @throws IllegalArgumentException + */ + public Builder minNgramLength(int minNgramLength) { + if (minNgramLength <= 0) { + throw new IllegalArgumentException("minNgramLength must be positive"); + } + this.minNgramLength = minNgramLength; + return this; + } + + /** + * Configure the maximum N-gram length (only used when {@code baseTokenizer = "ngram"}). + * + * @param maxNgramLength maximum N-gram length, must be > 0 and >= {@code minNgramLength} + * @return this builder + * @throws IllegalArgumentException + */ + public Builder maxNgramLength(int maxNgramLength) { + if (maxNgramLength <= 0) { + throw new IllegalArgumentException("maxNgramLength must be positive"); + } + this.maxNgramLength = maxNgramLength; + return this; + } + + /** + * Configure whether only prefix N-grams are generated (only used when {@code baseTokenizer = + * "ngram"}). + * + * @param prefixOnly whether to generate only prefix N-grams + * @return this builder + */ + public Builder prefixOnly(boolean prefixOnly) { + this.prefixOnly = prefixOnly; + return this; + } + + /** + * Configure whether to skip the partition merge stage after indexing. If true, skip the + * partition merge stage after indexing. This can be useful for distributed indexing where + * merge is handled separately. + * + * @param skipMerge whether to skip partition merge + * @return this builder + */ + public Builder skipMerge(boolean skipMerge) { + this.skipMerge = skipMerge; + return this; + } + + /** + * Build a {@link ScalarIndexParams} instance for an inverted index. + */ + public ScalarIndexParams build() { + Map params = new LinkedHashMap<>(); + if (baseTokenizer != null) { + params.put("base_tokenizer", baseTokenizer); + } + if (language != null) { + params.put("language", language); + } + if (withPosition != null) { + params.put("with_position", withPosition); + } + if (maxTokenLength != null) { + params.put("max_token_length", maxTokenLength); + } + if (lowerCase != null) { + params.put("lower_case", lowerCase); + } + if (stem != null) { + params.put("stem", stem); + } + if (removeStopWords != null) { + params.put("remove_stop_words", removeStopWords); + } + if (customStopWords != null) { + params.put("custom_stop_words", new ArrayList<>(customStopWords)); + } + if (asciiFolding != null) { + params.put("ascii_folding", asciiFolding); + } + if (minNgramLength != null) { + params.put("min_ngram_length", minNgramLength); + } + if (maxNgramLength != null) { + params.put("max_ngram_length", maxNgramLength); + } + if (prefixOnly != null) { + params.put("prefix_only", prefixOnly); + } + if (skipMerge != null) { + params.put("skip_merge", skipMerge); + } + + String json = JsonUtils.toJson(params); + return ScalarIndexParams.create(INDEX_TYPE, json); + } + } +} diff --git a/java/src/main/java/org/lance/index/scalar/JsonUtils.java b/java/src/main/java/org/lance/index/scalar/JsonUtils.java new file mode 100755 index 0000000000..8fe34c7471 --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/JsonUtils.java @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.Map; + +final class JsonUtils { + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + + private JsonUtils() {} + + static String toJson(Map params) { + try { + return OBJECT_MAPPER.writeValueAsString(params); + } catch (JsonProcessingException e) { + throw new IllegalStateException("Failed to serialize to JSON", e); + } + } +} diff --git a/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java b/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java new file mode 100644 index 0000000000..8b0ae23ad5 --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java @@ -0,0 +1,39 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +/** + * Builder-style configuration for LabelList scalar index parameters. + */ +public final class LabelListIndexParams { + private static final String INDEX_TYPE = "labellist"; + + private LabelListIndexParams() {} + + /** + * Create a new builder for LabelList index parameters. + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + /** + * Build a {@link ScalarIndexParams} instance for a LabelList index. + */ + public ScalarIndexParams build() { + return ScalarIndexParams.create(INDEX_TYPE); + } + } +} \ No newline at end of file diff --git a/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java b/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java new file mode 100644 index 0000000000..f1a42bcf64 --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java @@ -0,0 +1,39 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +/** + * Builder-style configuration for NGram scalar index parameters. + */ +public final class NGramIndexParams { + private static final String INDEX_TYPE = "ngram"; + + private NGramIndexParams() {} + + /** + * Create a new builder for NGram index parameters. + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + /** + * Build a {@link ScalarIndexParams} instance for a NGram index. + */ + public ScalarIndexParams build() { + return ScalarIndexParams.create(INDEX_TYPE); + } + } +} \ No newline at end of file diff --git a/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java b/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java new file mode 100755 index 0000000000..4a94d2475f --- /dev/null +++ b/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.lance.index.scalar; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Builder-style configuration for ZoneMap scalar index parameters. + */ +public final class ZoneMapIndexParams { + + private static final String INDEX_TYPE = "zonemap"; + + private ZoneMapIndexParams() {} + + /** + * Create a new builder for ZoneMap index parameters. + * + * @return a new {@link Builder} + */ + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private Long rowsPerZone; + private final Map extraParams = new LinkedHashMap<>(); + + /** + * Configure the approximate number of rows per zone. + * + * @param rowsPerZone number of rows per zone, must be positive + * @return this builder + * @throws IllegalArgumentException + */ + public Builder rowsPerZone(long rowsPerZone) { + if (rowsPerZone <= 0) { + throw new IllegalArgumentException("rowsPerZone must be positive"); + } + this.rowsPerZone = rowsPerZone; + return this; + } + + /** + * Build a {@link ScalarIndexParams} instance for a ZoneMap index. + */ + public ScalarIndexParams build() { + Map params = new LinkedHashMap<>(); + if (rowsPerZone != null) { + params.put("rows_per_zone", rowsPerZone); + } + params.putAll(extraParams); + + String json = JsonUtils.toJson(params); + return ScalarIndexParams.create(INDEX_TYPE, json); + } + } +} From fb8f441b6837f4547736ae2d7489dae441cd7d8e Mon Sep 17 00:00:00 2001 From: jinglun Date: Thu, 25 Dec 2025 22:02:56 +0800 Subject: [PATCH 2/2] fmt --- .../org/lance/index/scalar/BTreeIndexParams.java | 8 ++------ .../org/lance/index/scalar/BitmapIndexParams.java | 14 ++++---------- .../lance/index/scalar/InvertedIndexParams.java | 12 ++++-------- .../lance/index/scalar/LabelListIndexParams.java | 14 ++++---------- .../org/lance/index/scalar/NGramIndexParams.java | 14 ++++---------- .../org/lance/index/scalar/ZoneMapIndexParams.java | 9 ++------- 6 files changed, 20 insertions(+), 51 deletions(-) diff --git a/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java b/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java index 13e4318acf..be7ab79a14 100755 --- a/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/BTreeIndexParams.java @@ -16,9 +16,7 @@ import java.util.LinkedHashMap; import java.util.Map; -/** - * Builder-style configuration for B-Tree scalar index parameters. - */ +/** Builder-style configuration for B-Tree scalar index parameters. */ public final class BTreeIndexParams { private static final String INDEX_TYPE = "btree"; @@ -68,9 +66,7 @@ public Builder rangeId(int rangeId) { return this; } - /** - * Build a {@link ScalarIndexParams} instance for a B-Tree index. - */ + /** Build a {@link ScalarIndexParams} instance for a B-Tree index. */ public ScalarIndexParams build() { Map params = new LinkedHashMap<>(); if (zoneSize != null) { diff --git a/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java b/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java index 0bc6a036d8..b5e18be507 100644 --- a/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/BitmapIndexParams.java @@ -13,27 +13,21 @@ */ package org.lance.index.scalar; -/** - * Builder-style configuration for Bitmap scalar index parameters. - */ +/** Builder-style configuration for Bitmap scalar index parameters. */ public final class BitmapIndexParams { private static final String INDEX_TYPE = "bitmap"; private BitmapIndexParams() {} - /** - * Create a new builder for Bitmap index parameters. - */ + /** Create a new builder for Bitmap index parameters. */ public static Builder builder() { return new Builder(); } public static final class Builder { - /** - * Build a {@link ScalarIndexParams} instance for a Bitmap index. - */ + /** Build a {@link ScalarIndexParams} instance for a Bitmap index. */ public ScalarIndexParams build() { return ScalarIndexParams.create(INDEX_TYPE); } } -} \ No newline at end of file +} diff --git a/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java b/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java index 2e6cc691ee..8639e44d49 100755 --- a/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java @@ -19,9 +19,7 @@ import java.util.Map; import java.util.Objects; -/** - * Builder-style configuration for inverted (full-text) scalar index parameters. - */ +/** Builder-style configuration for inverted (full-text) scalar index parameters. */ public final class InvertedIndexParams { private static final String INDEX_TYPE = "inverted"; @@ -223,8 +221,8 @@ public Builder prefixOnly(boolean prefixOnly) { /** * Configure whether to skip the partition merge stage after indexing. If true, skip the - * partition merge stage after indexing. This can be useful for distributed indexing where - * merge is handled separately. + * partition merge stage after indexing. This can be useful for distributed indexing where merge + * is handled separately. * * @param skipMerge whether to skip partition merge * @return this builder @@ -234,9 +232,7 @@ public Builder skipMerge(boolean skipMerge) { return this; } - /** - * Build a {@link ScalarIndexParams} instance for an inverted index. - */ + /** Build a {@link ScalarIndexParams} instance for an inverted index. */ public ScalarIndexParams build() { Map params = new LinkedHashMap<>(); if (baseTokenizer != null) { diff --git a/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java b/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java index 8b0ae23ad5..bcb7dba224 100644 --- a/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/LabelListIndexParams.java @@ -13,27 +13,21 @@ */ package org.lance.index.scalar; -/** - * Builder-style configuration for LabelList scalar index parameters. - */ +/** Builder-style configuration for LabelList scalar index parameters. */ public final class LabelListIndexParams { private static final String INDEX_TYPE = "labellist"; private LabelListIndexParams() {} - /** - * Create a new builder for LabelList index parameters. - */ + /** Create a new builder for LabelList index parameters. */ public static Builder builder() { return new Builder(); } public static final class Builder { - /** - * Build a {@link ScalarIndexParams} instance for a LabelList index. - */ + /** Build a {@link ScalarIndexParams} instance for a LabelList index. */ public ScalarIndexParams build() { return ScalarIndexParams.create(INDEX_TYPE); } } -} \ No newline at end of file +} diff --git a/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java b/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java index f1a42bcf64..60bc11641c 100644 --- a/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/NGramIndexParams.java @@ -13,27 +13,21 @@ */ package org.lance.index.scalar; -/** - * Builder-style configuration for NGram scalar index parameters. - */ +/** Builder-style configuration for NGram scalar index parameters. */ public final class NGramIndexParams { private static final String INDEX_TYPE = "ngram"; private NGramIndexParams() {} - /** - * Create a new builder for NGram index parameters. - */ + /** Create a new builder for NGram index parameters. */ public static Builder builder() { return new Builder(); } public static final class Builder { - /** - * Build a {@link ScalarIndexParams} instance for a NGram index. - */ + /** Build a {@link ScalarIndexParams} instance for a NGram index. */ public ScalarIndexParams build() { return ScalarIndexParams.create(INDEX_TYPE); } } -} \ No newline at end of file +} diff --git a/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java b/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java index 4a94d2475f..d32eb98366 100755 --- a/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java +++ b/java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java @@ -15,11 +15,8 @@ import java.util.LinkedHashMap; import java.util.Map; -import java.util.Objects; -/** - * Builder-style configuration for ZoneMap scalar index parameters. - */ +/** Builder-style configuration for ZoneMap scalar index parameters. */ public final class ZoneMapIndexParams { private static final String INDEX_TYPE = "zonemap"; @@ -54,9 +51,7 @@ public Builder rowsPerZone(long rowsPerZone) { return this; } - /** - * Build a {@link ScalarIndexParams} instance for a ZoneMap index. - */ + /** Build a {@link ScalarIndexParams} instance for a ZoneMap index. */ public ScalarIndexParams build() { Map params = new LinkedHashMap<>(); if (rowsPerZone != null) {