[
https://issues.apache.org/jira/browse/IGNITE-8718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697259#comment-16697259
]
ASF GitHub Bot commented on IGNITE-8718:
----------------------------------------
GitHub user isapego opened a pull request:
https://github.com/apache/ignite/pull/5490
IGNITE-8718: Updated C++ doxygen comments about BinaryWriter/BinaryReader
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gridgain/apache-ignite ignite-8718
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/5490.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5490
----
commit a8d8637bb342a6e4e254d755fbcd11d90a02ba97
Author: Igor Sapego <isapego@...>
Date: 2018-11-23T14:31:13Z
IGNITE-8718: Fixed comments for BinaryWriter
commit 79729136d648bd7c65a68cf67e9017c20bb32b7f
Author: Igor Sapego <isapego@...>
Date: 2018-11-23T15:02:26Z
IGNITE-8718: Added comments for BinaryReader and BinaryRawReader
----
> Documentation about using of the C++ BinaryWriter/BinaryReader should be
> updated
> --------------------------------------------------------------------------------
>
> Key: IGNITE-8718
> URL: https://issues.apache.org/jira/browse/IGNITE-8718
> Project: Ignite
> Issue Type: Improvement
> Components: documentation
> Affects Versions: 2.5
> Reporter: Andrey Aleksandrov
> Assignee: Igor Sapego
> Priority: Major
> Labels: c++
> Fix For: 2.7
>
>
> The usage that should be documented:
> 1)In case if you get some writer from BinaryWriter then you started writing
> session. Until method close will not be called for this writer you can't get
> another writer.
>
> For example, next code isn't correct:
> {code:java}
> BinaryMapWriter<int64_t, int64_t> field1Writer = writer.WriteMap<int64_t,
> int64_t>("field1", MapType::HASH_MAP); //here you start writing session
> BinaryMapWriter<int64_t, int64_t> field2Writer = writer.WriteMap<int64_t,
> int64_t>("field2", MapType::HASH_MAP); //here you start another writing
> session - error
> {code}
> Should be:
>
> {code:java}
> BinaryMapWriter<int64_t, int64_t> field1Writer = writer.WriteMap<int64_t,
> int64_t>("field1", MapType::HASH_MAP); //here you start writing session
> //do something
> field1Writer.Close() //here you end writing session
> BinaryMapWriter<int64_t, int64_t> field2Writer = writer.WriteMap<int64_t,
> int64_t>("field2", MapType::HASH_MAP); //here you start another writing
> session
> //do something
> field2Writer.Close() //here you end another writing session
> {code}
>
> 2) In case if you get some reader from BinaryWriter then you started reading
> session. Until something will not be read from this reader you can't get
> another reader.
>
> For example, next code isn't correct:
>
> {code:java}
> BinaryMapReader<int64_t, int64_t> field1Reader = reader.ReadMap<int64_t,
> int64_t>("field1"); //start reading session
> BinaryMapReader<int64_t, int64_t> field2Reader = reader.ReadMap<int64_t,
> int64_t>("field2"); //start another read session - error
> {code}
> Should be for example:
> {code:java}
> BinaryMapReader<int64_t, int64_t> field1Reader = reader.ReadMap<int64_t,
> int64_t>("field1"); //start reading session
> ...
> field1Reader.GetNext(key, val); //reading done
> ...
> BinaryMapReader<int64_t, int64_t> field2Reader = reader.ReadMap<int64_t,
> int64_t>("field2"); //start another read session
> ...
> field2Reader.GetNext(key, val); //reading done
> ...{code}
>
>
>
> In the case of the writer, it looks like expected. In case of the reader, it
> looks a little bit confusing.
>
> These two behaviors should be described in the documentation as well.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)