-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Provide actions for text-based streamers #578
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
Conversation
In most cases it should be same actions like for binary I/O, but several special cases will be implemented. Also in such list original (not-compressed) list of data members will be used. This will solve problem of unfolding such compressed members later
Main difference - it is not-optimized list, therefore there is no need to unfold compressed data members
When such classes stored, class streamer called directly. Such approach does not work with text storage, therefore special actions required.
When TObject instance was stored as is, wrong output was produced. Now UniqueID, fBits and process ID stored normally
Required for special handling of kStreamerLoop members. Special case when empty arrays should be stored - binary I/O completely ignores such containers, but text representaion need normal array structure arround nulls
isText boolean parameter let provide customization for text-based streaming. Potentially same action can be used for binary I/O
It should be handled as normal array.
Just reuse postprocessing code for TObject. Makes output more readable, but TRef need much more work to be supported with JSON and JSROOT
In original code direct class streamer is called, which is impossible to handle with TBufferJSON. Keep binary code as well in the action to have possibility use same code-base for binary use-case
|
Starting build on |
| // TODO: subinfo used for WriteBufferSTL call, which is private for the moment | ||
| //TStreamerInfo *subinfo = (TStreamerInfo*)vClass->GetStreamerInfo(); | ||
|
|
||
| //for (int k = 0; k < narr; ++k) { |
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.
This line is comment-out, I assume it is not in the original. Is that the correct change (and if so, it should be explained) or is that inadvertently removing support for C-style array of STL vectors?
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.
potentially can be used later for non-text streaming
To verify that the code is indeed correct (at least as far as roottest can tell), I recommend to go ahead and also use those for the binary case.
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.
For the moment this part is not used - it is only for binary I/O.
To enable this, one should made subinfo->WriteBufferSTL() public
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.
Why would it need to become public? In the contrary, isn't the action making WriteBufferSTL obsolete?
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.
WriteBufferSTL still used in normal I/O.
Once we implement correspondent actions (including writing branches data), WriteBufferSTL can be removed.
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.
Once we implement correspondent actions
I was pushing you in that direction as it will increase the test coverage and benefit all users ;)
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.
I was pushing you in that direction as it will increase the test coverage and benefit all users ;)
I prefer do it in small steps.
We have functional code and can incrementally improve it.
My main motivation now - clearly separate binary and text streaming from each other.
Once it is done, we could remove many workarounds from both.
|
Please merge this into master only after the branch of v6-10-00-patches (which is imminent). |
io/io/src/TStreamerInfoActions.cxx
Outdated
|
|
||
| /** Direct copy of code from TStreamerInfo::WriteBufferAux, | ||
| * potentially can be used later for non-text streaming */ | ||
| template<bool isText> |
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.
this should read kIsTestT (k for constant, trailing T for template parameter).
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.
You mean: template<bool kIsTextT> ?
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.
yes.
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.
Done
|
And be careful about "Merge branch 'master' into json"... |
|
Build failed on mac1012/native. Warnings:
|
I can remove this merge commit |
|
Starting build on |
|
Should I create new PR without merge commit? |
|
yes, we can not include the PR with a merge commit. |
|
I closing PR and prepare new |
|
I think so... You should rebase (it's what Vassil told me...) |
|
There are not that many commits, I can cherry-pick them |
|
As you prefer |
This PR solves most of known problems with TBufferJSON and does not touch basic I/O. |
Idea to create separate actions list, which will be used only for text-based streaming.
Most actions functions can be reused from normal I/O,
only several cases should be implemented slightly different.
On the long run one could create complimentary actions list for reading data with TBufferXML or TBufferSQL2 and fully isolate text-based and binary I/O
That is in PR:
PR solves several existing problem with JSON:
With provided code all my test classes working. I can provide patch for roottest.
P.S. Most probably, Travis-CI check will be unhappy about source-code formatting.