-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[IOTDB-2457] Fix Write is blocked after set time_index_level=FILE_TIM… #4935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ac9440d
[IOTDB-2457] Fix Write is blocked after set time_index_level=FILE_TIM…
JackieTien97 c556eb8
fix IT
JackieTien97 d869896
change from reviews
JackieTien97 26db68b
format cpde
JackieTien97 e841adc
change name and format code
JackieTien97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 169 additions & 0 deletions
169
...er/src/main/java/org/apache/iotdb/db/engine/storagegroup/timeindex/V012FileTimeIndex.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| /* | ||
| * 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.db.engine.storagegroup.timeindex; | ||
|
|
||
| import org.apache.iotdb.db.exception.PartitionViolationException; | ||
| import org.apache.iotdb.db.utils.SerializeUtils; | ||
| import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
| import java.io.OutputStream; | ||
| import java.nio.ByteBuffer; | ||
| import java.util.Set; | ||
|
|
||
| public class V012FileTimeIndex implements ITimeIndex { | ||
|
|
||
| /** devices */ | ||
| public V012FileTimeIndex() {} | ||
|
|
||
| @Override | ||
| public void serialize(OutputStream outputStream) throws IOException { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and serialize() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public FileTimeIndex deserialize(InputStream inputStream) throws IOException { | ||
| int size = ReadWriteIOUtils.readInt(inputStream); | ||
| for (int i = 0; i < size; i++) { | ||
| ReadWriteIOUtils.readString(inputStream); | ||
| } | ||
| return new FileTimeIndex( | ||
| ReadWriteIOUtils.readLong(inputStream), ReadWriteIOUtils.readLong(inputStream)); | ||
| } | ||
|
|
||
| @Override | ||
| public FileTimeIndex deserialize(ByteBuffer buffer) { | ||
| int size = buffer.getInt(); | ||
| for (int i = 0; i < size; i++) { | ||
| SerializeUtils.deserializeString(buffer); | ||
| } | ||
| return new FileTimeIndex(buffer.getLong(), buffer.getLong()); | ||
| } | ||
|
|
||
| @Override | ||
| public void close() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and close() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public Set<String> getDevices(String tsFilePath) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getDevices() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean endTimeEmpty() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and endTimeEmpty() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean stillLives(long timeLowerBound) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and stillLives() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long calculateRamSize() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and calculateRamSize() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getTimePartition(String tsFilePath) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getTimePartition() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getTimePartitionWithCheck(String tsFilePath) throws PartitionViolationException { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getTimePartitionWithCheck() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isSpanMultiTimePartitions() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and isSpanMultiTimePartitions() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public void updateStartTime(String deviceId, long time) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and updateStartTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public void updateEndTime(String deviceId, long time) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and updateEndTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public void putStartTime(String deviceId, long time) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and putStartTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public void putEndTime(String deviceId, long time) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and putEndTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getStartTime(String deviceId) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getStartTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getEndTime(String deviceId) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getEndTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean checkDeviceIdExist(String deviceId) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and checkDeviceIdExist() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getMinStartTime() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getMinStartTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public long getMaxEndTime() { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading and getMaxEndTime() method should not be called any more."); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareDegradePriority(ITimeIndex timeIndex) { | ||
| throw new UnsupportedOperationException( | ||
| "V012FileTimeIndex should be rewritten while upgrading."); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can also move the serialize() logic into deserialize of V012FileTimeIndex so that all update related logics are put together.