Thatās because the TTree object you pass through the message is only the header. Its data is in separate chunks; @pcanal might have an idea how to transfer those, too.
Hiļ¼ Axel ļ¼ļ¼Thank you for replyingļ¼ļ¼ļ¼ Did you mean pcanal can solve this problemļ¼ How can I ask him about this problemļ¼ Iāve been troubled by this problem for a long time.
There are a few ways to implement this, however they really depends on the circumstances.
Could you remind us what is your overload goal (that you are trying to accomplish by passing a TTree through a TMessage). What is the organization of your processes? What is the reason to pass the TTree? etcā¦
Hiļ¼
I want to serialize a TTree and then save the binary value into LevelDB. When I need it I read the binary value from LevelDB and deserialize it into a TTree.
Thank you for replying!!
Wei
I still do no understand the context and so I am likely to give sub-optimal advice.
What is the advantage of storing a TTree in LevelDB?
What is the purposed of storing a TTree in LevelDB?
What is the semantic of the data stored in this TTree?
When/How will you need to retrieve the data out of the TTree which in the LevelDB?
With which granularity?
What are the performance requirement and access pattern?
What is the total datasize in a TTree?
Does LevelDB support single entries that are that large?
I.e. eventhough you do what you requested it may or may not be the ārightā solution to your overall problem?
Iām working on a project as follows:
There are some physical events and they canāt be serialized. So I put them on a TTree and serialize the TTree. When someone wants to find an event on the disk, itās too slow. So I want to make a cache based on SSD and LevelDB to speed up the process of searching. Thatās why I want to save a TTree to Leveldb and when I need an event I read the binary then deserialize it into a TTree to find the event. Now I have the problem in deserializing a binary.
[quote]When someone wants to find an event on the disk, itās too slow. So I want to make a cache based on SSD[/quote]What about simply storing the file(s) on the SSD?
[quote]a cache based on SSD and LevelDB[/quote]The simplest way is to simply store all the bytes from the file into the database and then retrieve those bytes and attach them to a TMemFile.
[quote]to speed up the process of searching. [/quote]But this implies, that you actually need to go through the data to do some other of selection. As you described it, the solution you are pursuing is unlikely to be the most performance as it requires, dowload the TTree meta and data and all its data, then select base on that (the non-performant part is 'download all the data, most of which your probably donāt need).
An alternative (is LevelDB has an sql interface) would be to store a (partial) copy of the TTree natively in the database by using TTreeSQL (i.e. have a column per branch).