JackieTien97 commented on code in PR #7276:
URL: https://github.com/apache/iotdb/pull/7276#discussion_r974940905
##########
server/src/main/java/org/apache/iotdb/db/tools/TsFileSplitByPartitionTool.java:
##########
@@ -492,10 +492,10 @@ protected boolean fileCheck() throws IOException {
protected TsFileResource endFileAndGenerateResource(TsFileIOWriter
tsFileIOWriter)
throws IOException {
- tsFileIOWriter.endFile();
- TsFileResource tsFileResource = new
TsFileResource(tsFileIOWriter.getFile());
Map<String, List<TimeseriesMetadata>> deviceTimeseriesMetadataMap =
tsFileIOWriter.getDeviceTimeseriesMetadataMap();
Review Comment:
There is no need to read all TimeSeriesMetadata at once here.
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java:
##########
@@ -508,4 +588,85 @@ public long getMaxPlanIndex() {
public void setMaxPlanIndex(long maxPlanIndex) {
this.maxPlanIndex = maxPlanIndex;
}
+
+ /**
+ * Check if the size of chunk metadata in memory is greater than the given
threshold. If so, the
+ * chunk metadata will be written to a temp files. <b>Notice! If you are
writing a aligned device
+ * in row, you should make sure all data of current writing device has been
written before this
+ * method is called. For writing not aligned series or writing aligned
series in column, you
+ * should make sure that all data of one series is written before you call
this function.</b>
+ *
+ * @throws IOException
+ */
+ public void checkMetadataSizeAndMayFlush() throws IOException {
+ // This function should be called after all data of an aligned device has
been written
+ if (enableMemoryControl && currentChunkMetadataSize > maxMetadataSize) {
+ try {
+ sortAndFlushChunkMetadata();
+ } catch (IOException e) {
+ logger.error("Meets exception when flushing metadata to temp file for
{}", file, e);
+ throw e;
+ }
+ }
+ }
+
+ /**
+ * Sort the chunk metadata by the lexicographical order and the start time
of the chunk, then
+ * flush them to a temp file.
+ *
+ * @throws IOException
+ */
+ protected void sortAndFlushChunkMetadata() throws IOException {
+ // group by series
+ List<Pair<Path, List<IChunkMetadata>>> sortedChunkMetadataList =
+ TSMIterator.sortChunkMetadata(
+ chunkGroupMetadataList, currentChunkGroupDeviceId,
chunkMetadataList);
+ if (tempOutput == null) {
+ tempOutput = new LocalTsFileOutput(new
FileOutputStream(chunkMetadataTempFile));
+ }
+ hasChunkMetadataInDisk = true;
+ // the file structure in temp file will be
+ // chunkSize | chunkBuffer
+ for (Pair<Path, List<IChunkMetadata>> pair : sortedChunkMetadataList) {
+ Path seriesPath = pair.left;
+ if (!seriesPath.equals(lastSerializePath)) {
Review Comment:
record the compare result here, and pass it to
`writeChunkMetadataToTempFile` instead of doing it again.
##########
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java:
##########
@@ -509,6 +510,8 @@ public void removeModFile() throws IOException {
public boolean remove() {
try {
fsFactory.deleteIfExists(file);
+ fsFactory.deleteIfExists(
+ new File(file.getAbsolutePath() +
TsFileIOWriter.CHUNK_METADATA_TEMP_FILE_SUFFIX));
Review Comment:
change the java doc of this method.
##########
example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileSequenceRead.java:
##########
@@ -53,7 +53,7 @@ public class TsFileSequenceRead {
"squid:S106"
}) // Suppress high Cognitive Complexity and Standard outputs warning
public static void main(String[] args) throws IOException {
- String filename = "test.tsfile";
+ String filename = "C:\\Users\\MARKLAU\\Desktop\\13-13-0-0.tsfile";
Review Comment:
change back
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/tsmiterator/DiskTSMIterator.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * 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.write.writer.tsmiterator;
+
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetadata;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.reader.LocalTsFileInput;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * This class read ChunkMetadata iteratively from disk(.cmt file) and
memory(list of
+ * ChunkGroupMetadata), and construct them as TimeseriesMetadata. It will read
ChunkMetadata in disk
+ * first, and after all ChunkMetadata in disk is read, it will read
ChunkMetadata in memory.
+ */
+public class DiskTSMIterator extends TSMIterator {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(DiskTSMIterator.class);
+
+ LinkedList<Long> endPosForEachDevice;
+ File cmtFile;
+ LocalTsFileInput input;
+ long fileLength = 0;
+ long currentPos = 0;
+ long nextEndPosForDevice = 0;
+ String currentDevice;
+ boolean remainsInFile = true;
Review Comment:
add private
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java:
##########
@@ -490,6 +546,30 @@ public TsFileOutput getIOWriterOut() {
* @return DeviceTimeseriesMetadataMap
*/
public Map<String, List<TimeseriesMetadata>>
getDeviceTimeseriesMetadataMap() {
+ Map<String, List<TimeseriesMetadata>> deviceTimeseriesMetadataMap = new
TreeMap<>();
+ Map<String, Map<String, List<IChunkMetadata>>> chunkMetadataMap = new
TreeMap<>();
+ for (ChunkGroupMetadata chunkGroupMetadata : chunkGroupMetadataList) {
+ for (ChunkMetadata chunkMetadata :
chunkGroupMetadata.getChunkMetadataList()) {
+ chunkMetadataMap
+ .computeIfAbsent(chunkGroupMetadata.getDevice(), x -> new
TreeMap<>())
+ .computeIfAbsent(chunkMetadata.getMeasurementUid(), x -> new
ArrayList<>())
+ .add(chunkMetadata);
+ }
+ }
+ for (String device : chunkMetadataMap.keySet()) {
+ Map<String, List<IChunkMetadata>> seriesToChunkMetadataMap =
chunkMetadataMap.get(device);
+ for (Map.Entry<String, List<IChunkMetadata>> entry :
seriesToChunkMetadataMap.entrySet()) {
+ try {
+ deviceTimeseriesMetadataMap
+ .computeIfAbsent(device, x -> new ArrayList<>())
+ .add(TSMIterator.constructOneTimeseriesMetadata(entry.getKey(),
entry.getValue()));
+ } catch (IOException e) {
+ logger.error("Failed to get device timeseries metadata map", e);
+ return null;
+ }
+ }
+ }
+
Review Comment:
It seems that this method only contains chunkmetadata in memory.
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/tsmiterator/TSMIterator.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.write.writer.tsmiterator;
+
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetadata;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.PublicBAOS;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * TSMIterator returns full path of series and its TimeseriesMetadata
iteratively. It accepts data
+ * source from memory or disk. Static method getTSMIteratorInMemory returns a
TSMIterator that reads
+ * from memory, and static method getTSMIteratorInDisk returns a TSMIterator
that reads from disk.
+ */
+public class TSMIterator implements Iterator<Pair<String, TimeseriesMetadata>>
{
+ private static Logger LOG = LoggerFactory.getLogger(TSMIterator.class);
Review Comment:
```suggestion
private static final Logger LOG =
LoggerFactory.getLogger(TSMIterator.class);
```
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/tsmiterator/DiskTSMIterator.java:
##########
@@ -0,0 +1,132 @@
+/*
+ * 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.write.writer.tsmiterator;
+
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetadata;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.reader.LocalTsFileInput;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * This class read ChunkMetadata iteratively from disk(.cmt file) and
memory(list of
+ * ChunkGroupMetadata), and construct them as TimeseriesMetadata. It will read
ChunkMetadata in disk
+ * first, and after all ChunkMetadata in disk is read, it will read
ChunkMetadata in memory.
+ */
+public class DiskTSMIterator extends TSMIterator {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(DiskTSMIterator.class);
+
+ LinkedList<Long> endPosForEachDevice;
+ File cmtFile;
+ LocalTsFileInput input;
+ long fileLength = 0;
+ long currentPos = 0;
+ long nextEndPosForDevice = 0;
+ String currentDevice;
+ boolean remainsInFile = true;
+
+ protected DiskTSMIterator(
+ File cmtFile,
+ List<ChunkGroupMetadata> chunkGroupMetadataList,
+ LinkedList<Long> endPosForEachDevice)
+ throws IOException {
+ super(chunkGroupMetadataList);
+ this.cmtFile = cmtFile;
+ this.endPosForEachDevice = endPosForEachDevice;
+ this.input = new LocalTsFileInput(cmtFile.toPath());
+ this.fileLength = cmtFile.length();
+ this.nextEndPosForDevice = endPosForEachDevice.removeFirst();
+ }
+
+ @Override
+ public boolean hasNext() {
+ return remainsInFile || iterator.hasNext();
+ }
+
+ @Override
+ public Pair<String, TimeseriesMetadata> next() {
+ try {
+ if (remainsInFile) {
+ // deserialize from file
+ return getTimeSerisMetadataFromFile();
+ } else {
+ // get from memory iterator
+ return super.next();
+ }
+ } catch (IOException e) {
+ LOG.error("Meets IOException when reading timeseries metadata from
disk", e);
+ return null;
Review Comment:
should not ignore the IOException, we should rethrow it and let the upper
layer to know that.
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/tsmiterator/TSMIterator.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.write.writer.tsmiterator;
+
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetadata;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.PublicBAOS;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * TSMIterator returns full path of series and its TimeseriesMetadata
iteratively. It accepts data
+ * source from memory or disk. Static method getTSMIteratorInMemory returns a
TSMIterator that reads
+ * from memory, and static method getTSMIteratorInDisk returns a TSMIterator
that reads from disk.
+ */
+public class TSMIterator implements Iterator<Pair<String, TimeseriesMetadata>>
{
+ private static Logger LOG = LoggerFactory.getLogger(TSMIterator.class);
+ protected List<Pair<Path, List<IChunkMetadata>>> sortedChunkMetadataList;
+ protected Iterator<Pair<Path, List<IChunkMetadata>>> iterator;
+
+ protected TSMIterator(List<ChunkGroupMetadata> chunkGroupMetadataList) {
+ this.sortedChunkMetadataList = sortChunkMetadata(chunkGroupMetadataList,
null, null);
+ this.iterator = sortedChunkMetadataList.iterator();
+ }
+
+ public static TSMIterator getTSMIteratorInMemory(
+ List<ChunkGroupMetadata> chunkGroupMetadataList) {
+ return new TSMIterator(chunkGroupMetadataList);
+ }
+
+ public static TSMIterator getTSMIteratorInDisk(
+ File cmtFile, List<ChunkGroupMetadata> chunkGroupMetadataList,
LinkedList<Long> serializePos)
+ throws IOException {
+ return new DiskTSMIterator(cmtFile, chunkGroupMetadataList, serializePos);
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public Pair<String, TimeseriesMetadata> next() {
+ Pair<Path, List<IChunkMetadata>> nextPair = iterator.next();
+ try {
+ return new Pair<>(
+ nextPair.left.getFullPath(),
+ constructOneTimeseriesMetadata(nextPair.left.getMeasurement(),
nextPair.right));
+ } catch (IOException e) {
+ LOG.error("Meets IOException when getting next TimeseriesMetadata", e);
+ return null;
+ }
+ }
+
+ public static TimeseriesMetadata constructOneTimeseriesMetadata(
+ String measurementId, List<IChunkMetadata> chunkMetadataList) throws
IOException {
+ // create TimeseriesMetaData
+ PublicBAOS publicBAOS = new PublicBAOS();
+ TSDataType dataType = chunkMetadataList.get(chunkMetadataList.size() -
1).getDataType();
+ Statistics seriesStatistics = Statistics.getStatsByType(dataType);
+
+ int chunkMetadataListLength = 0;
+ boolean serializeStatistic = (chunkMetadataList.size() > 1);
+ // flush chunkMetadataList one by one
+ for (IChunkMetadata chunkMetadata : chunkMetadataList) {
+ if (!chunkMetadata.getDataType().equals(dataType)) {
+ continue;
+ }
+ chunkMetadataListLength += chunkMetadata.serializeTo(publicBAOS,
serializeStatistic);
+ seriesStatistics.mergeStatistics(chunkMetadata.getStatistics());
+ }
+
+ TimeseriesMetadata timeseriesMetadata =
+ new TimeseriesMetadata(
+ (byte)
+ ((serializeStatistic ? (byte) 1 : (byte) 0) |
chunkMetadataList.get(0).getMask()),
+ chunkMetadataListLength,
+ measurementId,
+ dataType,
+ seriesStatistics,
+ publicBAOS);
+ return timeseriesMetadata;
+ }
+
+ public static List<Pair<Path, List<IChunkMetadata>>> sortChunkMetadata(
+ List<ChunkGroupMetadata> chunkGroupMetadataList,
+ String currentDevice,
+ List<ChunkMetadata> chunkMetadataList) {
Review Comment:
It seems that `chunkGroupMetadataList` and `chunkMetadataList` has already
been in order, there is no need to be sorted again here.
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/tsmiterator/TSMIterator.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.write.writer.tsmiterator;
+
+import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetadata;
+import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.TimeseriesMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.utils.Pair;
+import org.apache.iotdb.tsfile.utils.PublicBAOS;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * TSMIterator returns full path of series and its TimeseriesMetadata
iteratively. It accepts data
+ * source from memory or disk. Static method getTSMIteratorInMemory returns a
TSMIterator that reads
+ * from memory, and static method getTSMIteratorInDisk returns a TSMIterator
that reads from disk.
+ */
+public class TSMIterator implements Iterator<Pair<String, TimeseriesMetadata>>
{
+ private static Logger LOG = LoggerFactory.getLogger(TSMIterator.class);
+ protected List<Pair<Path, List<IChunkMetadata>>> sortedChunkMetadataList;
+ protected Iterator<Pair<Path, List<IChunkMetadata>>> iterator;
+
+ protected TSMIterator(List<ChunkGroupMetadata> chunkGroupMetadataList) {
+ this.sortedChunkMetadataList = sortChunkMetadata(chunkGroupMetadataList,
null, null);
+ this.iterator = sortedChunkMetadataList.iterator();
+ }
+
+ public static TSMIterator getTSMIteratorInMemory(
+ List<ChunkGroupMetadata> chunkGroupMetadataList) {
+ return new TSMIterator(chunkGroupMetadataList);
+ }
+
+ public static TSMIterator getTSMIteratorInDisk(
+ File cmtFile, List<ChunkGroupMetadata> chunkGroupMetadataList,
LinkedList<Long> serializePos)
+ throws IOException {
+ return new DiskTSMIterator(cmtFile, chunkGroupMetadataList, serializePos);
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public Pair<String, TimeseriesMetadata> next() {
+ Pair<Path, List<IChunkMetadata>> nextPair = iterator.next();
+ try {
+ return new Pair<>(
+ nextPair.left.getFullPath(),
+ constructOneTimeseriesMetadata(nextPair.left.getMeasurement(),
nextPair.right));
+ } catch (IOException e) {
+ LOG.error("Meets IOException when getting next TimeseriesMetadata", e);
+ return null;
Review Comment:
should not ignore the IOException, we should rethrow it and let the upper
layer to know that.
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java:
##########
@@ -93,6 +104,20 @@ public class TsFileIOWriter implements AutoCloseable {
private long minPlanIndex;
private long maxPlanIndex;
+ // the following variable is used for memory control
+ protected long maxMetadataSize;
+ protected long currentChunkMetadataSize = 0L;
+ protected File chunkMetadataTempFile;
+ protected LocalTsFileOutput tempOutput;
+ protected volatile boolean hasChunkMetadataInDisk = false;
+ protected String currentSeries = null;
+ // record the total num of path in order to make bloom filter
+ protected int pathCount = 0;
+ protected boolean enableMemoryControl = false;
+ Path lastSerializePath = null;
Review Comment:
private or protect
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]