tsfile
tsfile copied to clipboard
How to append content to an existing tsFile?
I have a question, After I first wrote the content to tsFile, and executed the tsFile. Close () operation, how can I append other content to this tsFile file next time? And it make sure that the content I have inserted previous twice is available. please !
@xingtanzjr can you answer the question?
-
The design of Tsfile is: once been finished, never modify it. So, once you close a tsfile, you cannot append anything any more.
-
The sentence
And it make sure that the content I have inserted previous twice is available
confuses me, what do you mean?
Besides, tsfile API has no ability to help you to sort data in the time order, or filter duplicate timestamps. Users must make sure that they writing data by the time order. Otherwise the query result is undefined. If your application may generate data out-of-time-order, you can use IoTDB with SQL, then you do not need to consider the out-of-order problem. You can download IoTDB from http://tsfile.org
It means that the previous two inserted data can be queried. Now, The query action occurs after the tsfile.close () action. It means I can't append data into this tsFile any more while a query action occurs. Is the query action only available for a finished file?
Thanks for your answer, it is practical for my problem.
It means that the previous two inserted data can be queried. Now, The query action occurs after the tsfile.close () action. It means I can't append data into this tsFile any more while a query action occurs. Is the query action only available for a finished file?
Yes. If you want to query without closing the TsFile, you have to use IoTDB (which supports read data from an opened TsFile)