Skip to content

Conversation

@jt2594838
Copy link
Contributor

@jt2594838 jt2594838 commented Jan 20, 2019

Implemented deletion-related interfaces in FileNodeProcessor and FileNodeManager.

@jt2594838 jt2594838 changed the title delete develop phase 2 delete development phase 2 Jan 20, 2019
@jt2594838 jt2594838 changed the title delete development phase 2 Combine deletion with FileNodeProcessor and FileNodeManage Jan 20, 2019
@jt2594838 jt2594838 changed the title Combine deletion with FileNodeProcessor and FileNodeManage Combine deletion with FileNodeProcessor and FileNodeManager Jan 21, 2019
@jt2594838 jt2594838 changed the title Combine deletion with FileNodeProcessor and FileNodeManager [IOTDB-5]Combine deletion with FileNodeProcessor and FileNodeManager Jan 21, 2019
jt2594838 and others added 11 commits January 21, 2019 15:45
# Conflicts:
#	iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorNewTest.java
#	iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessorTest.java
# Conflicts:
#	iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
#	iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowResource.java
#	iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/ioV2/OverflowSupport.java
File[] versionFiles = directory.listFiles((dir, name) -> name.startsWith(FILE_PREFIX));
File versionFile = null;
if (versionFiles != null && versionFiles.length > 0) {
Arrays.sort(versionFiles, Comparator.comparing(File::getName));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose there are two version files: 900 and 1000. Then Comparator.comparing(File.getName) is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with scan-and-find-maximum.

if (isFlush) {
// flushing MemTable cannot be directly modified since another thread is reading it
flushMemTable = flushMemTable.copy();
flushMemTable.delele(deviceId, measurementId, timestamp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... so is this operation is just for guaranteeing queryBufferWriteData() ?
Actually, flushMemTable = flushMemTable.copy(); can not affect the flushing memtable... so you have to add the Deletion operation in the modification file at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.

statMonitor.registStatistics(statStorageDeltaName, this);
}
try {
versionController = new SimpleFileVersionController(fileNodeDirPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about create a VersionControllerFactory.
Latter we can modify the factory to switch the implementation of the versionController, otherwith SysTimestampVersionController is meaningless..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite necessary, SysTimestampVersionController is for test.

* @return A reduced copy of chunk if chunk contains data with timestamp less than 'timestamp',
* of null.
*/
private IWritableMemChunk filterChunk(IWritableMemChunk chunk, long timestamp) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about using the concept of Page?
Suppose a Chunk consists of page1, page2, page3,...., page n, and you will delete page 1, 2 and a part of page 3.
Then, just re-compress page 3 (and as a result, this page will have just a few points), and keep page 4~n into the new Chunk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but unfortunately IWritableMemChunk does not provide such interfaces. I would suggest you issue this and improve it later.

}

fileWriter.endChunkGroup(chunkGroupFooter);
fileWriter.endChunkGroup(chunkGroupFooter, version++);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose we have many TsFiles, and they are generated by different programs..
When we put all of them into an IoTDB instance (e.g., using Postback module), maybe we need a version repairing tool .
(There is no need to add the function into this PR, but if so, we need record an issue at least.)

Copy link
Contributor Author

@jt2594838 jt2594838 Feb 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a big issue. Stand-alone TsFile does not support deletion. After importing all the TsFiles, any new deletion takes effect on all of them. So the only thing we need to do is to make the version of new deletions greater than those of all existing TsFiles, which is straight-forward.

@jixuan1989 jixuan1989 closed this Feb 19, 2019
@jt2594838 jt2594838 deleted the delete_dev2 branch February 21, 2019 03:36
mzp0514 pushed a commit to mzp0514/iotdb that referenced this pull request Apr 26, 2021
# This is the 1st commit message:

Fix query one sensor in a vector from memtable (apache#3056)

Fix query one sensor in a vector from memtable
# This is the commit message apache#2:

[IOTDB-1310] Enable docker, docker-compose and testcontainer for End to end test (apache#3024)

* enable TestCongtainer for E2E test for (singleNode and cluster)

* remove duplicated operations in integration-test phase

* move spotless:apply to a profile `spotless`, which is enabled by default.

Co-authored-by: xiangdong huang <sainthxd@gmail.com>
# This is the commit message apache#3:

add sink interface

# This is the commit message apache#4:

3 new event sinks

# This is the commit message apache#5:

add ts sink

# This is the commit message apache#6:

add ts sink

# This is the commit message apache#7:

add mqtt sink

# This is the commit message apache#8:

refactor sink module

# This is the commit message apache#9:

init package sink.manager

# This is the commit message apache#10:

rename SinkException

# This is the commit message apache#11:

remove id in config

# This is the commit message apache#12:

fix doc

# This is the commit message apache#13:

add test framework

# This is the commit message apache#14:

add alertmanager sink & test & doc

# This is the commit message apache#15:

beautify the doc
SpriCoder referenced this pull request in SpriCoder/iotdb Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants