This is an automated email from the ASF dual-hosted git repository. hui pushed a commit to branch lmh/extendFilter in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit c611d3b2c9fb2b10b47485f9fa13ceb48c2aa88c Author: Minghui Liu <[email protected]> AuthorDate: Tue Dec 5 17:54:24 2023 +0800 delete IStatisticsProvider & fix seder --- .../tsfile/file/metadata/IStatisticsProvider.java | 54 ---------------------- .../read/filter/basic/BinaryLogicalFilter.java | 5 +- .../iotdb/tsfile/read/filter/operator/Not.java | 3 +- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/IStatisticsProvider.java b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/IStatisticsProvider.java deleted file mode 100644 index 5dc304a733f..00000000000 --- a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/IStatisticsProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.iotdb.tsfile.file.metadata; - -import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics; - -import java.io.Serializable; -import java.util.Optional; - -public interface IStatisticsProvider { - - Statistics<? extends Serializable> getTimeStatistics(); - - Optional<Statistics<? extends Serializable>> getMeasurementStatistics(int measurementIndex); - - int getMeasurementCount(); - - default boolean hasNullValue(int measurementIndex) { - long rowCount = getTimeStatistics().getCount(); - Optional<Statistics<? extends Serializable>> statistics = - getMeasurementStatistics(measurementIndex); - return statistics.map(stat -> stat.hasNullValue(rowCount)).orElse(true); - } - - default boolean isAllNulls(int measurementIndex) { - return false; - } - - default boolean timeAllSelected() { - for (int index = 0; index < getMeasurementCount(); index++) { - if (!hasNullValue(index)) { - return true; - } - } - return false; - } -} diff --git a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/basic/BinaryLogicalFilter.java b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/basic/BinaryLogicalFilter.java index 18c7d70d74c..8a947404318 100644 --- a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/basic/BinaryLogicalFilter.java +++ b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/basic/BinaryLogicalFilter.java @@ -19,8 +19,6 @@ package org.apache.iotdb.tsfile.read.filter.basic; -import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; - import java.io.DataOutputStream; import java.io.IOException; import java.util.Objects; @@ -44,8 +42,9 @@ public abstract class BinaryLogicalFilter extends Filter { return right; } + @Override public void serialize(DataOutputStream outputStream) throws IOException { - ReadWriteIOUtils.write(getOperatorType().ordinal(), outputStream); + super.serialize(outputStream); left.serialize(outputStream); right.serialize(outputStream); } diff --git a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Not.java b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Not.java index 1f8e71f03b5..add3f3bf3b4 100644 --- a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Not.java +++ b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Not.java @@ -23,7 +23,6 @@ import org.apache.iotdb.tsfile.file.metadata.IMetadata; import org.apache.iotdb.tsfile.read.common.TimeRange; import org.apache.iotdb.tsfile.read.filter.basic.Filter; import org.apache.iotdb.tsfile.read.filter.basic.OperatorType; -import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; import java.io.DataOutputStream; import java.io.IOException; @@ -122,7 +121,7 @@ public class Not extends Filter { @Override public void serialize(DataOutputStream outputStream) throws IOException { - ReadWriteIOUtils.write(getOperatorType().ordinal(), outputStream); + super.serialize(outputStream); filter.serialize(outputStream); }
