You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/09/14 14:56:04 UTC
[GitHub] [ignite] xtern opened a new pull request #8245: IGNITE-12977 Documentation.
xtern opened a new pull request #8245:
URL: https://github.com/apache/ignite/pull/8245
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] SomeFire commented on a change in pull request #8245: IGNITE-12977 Documentation.
Posted by GitBox <gi...@apache.org>.
SomeFire commented on a change in pull request #8245:
URL: https://github.com/apache/ignite/pull/8245#discussion_r490185735
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache named 'testCache' as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for resolving JSON object field types.
+* If the type name is of a `query entity` type, the field types will be resolved according to the field type defined in the `query entity`.
+* Otherwise, the field types will be resolved according to regular JSON types.
+
+For example, if there is no definition of the "Person" type on the server, the fields will be converted in accordance with the standard JSON types:
+[source, javascript]
+"uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac", // string
+"name": "John Doe", // string
+"organization": 5678901, // int
+"married": false, // boolean
+"salary": 156.1 // double
+
+If the `query entity` is set
Review comment:
```suggestion
If the `query entity` is set, query fields will be filled with given values.
```
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache named 'testCache' as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for resolving JSON object field types.
+* If the type name is of a `query entity` type, the field types will be resolved according to the field type defined in the `query entity`.
+* Otherwise, the field types will be resolved according to regular JSON types.
+
+For example, if there is no definition of the "Person" type on the server, the fields will be converted in accordance with the standard JSON types:
+[source, javascript]
+"uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac", // string
+"name": "John Doe", // string
+"organization": 5678901, // int
+"married": false, // boolean
+"salary": 156.1 // double
+
+If the `query entity` is set
+[source,xml]
+ <bean class="org.apache.ignite.cache.QueryEntity">
+ <property name="keyType" value="java.lang.Integer"/>
+ <property name="valueType" value="Person"/>
+ <property name="fields">
+ <map>
+ <entry key="uid" value="java.util.UUID"/>
+ <entry key="name" value="java.lang.String"/>
+ <entry key="organization" value="java.lang.Long"/>
+ <entry key="married" value="java.lang.Boolean"/>
+ <entry key="salary" value="java.lang.Float"/>
+ </map>
+ </property>
+ </bean>
+
+or Java class "Person" is loaded on the server.
Review comment:
```suggestion
If Java class "Person" is loaded on the server, class fields will be filled with given values.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] xtern commented on a change in pull request #8245: IGNITE-12977 Documentation.
Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #8245:
URL: https://github.com/apache/ignite/pull/8245#discussion_r490096591
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for JSON object field types resolving.
Review comment:
fixed, thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #8245: IGNITE-12977 Documentation.
Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #8245:
URL: https://github.com/apache/ignite/pull/8245#discussion_r490045074
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
Review comment:
'...cache named 'testCache' as a value...'
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for JSON object field types resolving.
+* If the type name is a `query entity` type, the field types will be resolved according to the field type defined in the `query entity`.
+* Otherwise, the field types will be resolved according to regular JSON types.
+
+For example, if there is no definition of the "Person" type on the server, the fields will be converted in accordance with the standard JSON types:
+[source, javascript]
+"uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac", // string
+"name": "John Doe", // string
+"organization": 5678901, // int
+"married": false, // boolean
+"salary": 156.1 // double
+
+In case the `query entity` was set
Review comment:
If the `query entity` is set
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for JSON object field types resolving.
+* If the type name is a `query entity` type, the field types will be resolved according to the field type defined in the `query entity`.
+* Otherwise, the field types will be resolved according to regular JSON types.
+
+For example, if there is no definition of the "Person" type on the server, the fields will be converted in accordance with the standard JSON types:
+[source, javascript]
+"uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac", // string
+"name": "John Doe", // string
+"organization": 5678901, // int
+"married": false, // boolean
+"salary": 156.1 // double
+
+In case the `query entity` was set
+[source,xml]
+ <bean class="org.apache.ignite.cache.QueryEntity">
+ <property name="keyType" value="java.lang.Integer"/>
+ <property name="valueType" value="Person"/>
+ <property name="fields">
+ <map>
+ <entry key="uid" value="java.util.UUID"/>
+ <entry key="name" value="java.lang.String"/>
+ <entry key="organization" value="java.lang.Long"/>
+ <entry key="married" value="java.lang.Boolean"/>
+ <entry key="salary" value="java.lang.Float"/>
+ </map>
+ </property>
+ </bean>
+
+or Java class "Person" loaded on the server.
Review comment:
'...is loaded on the server.'
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for JSON object field types resolving.
Review comment:
'...will be used for resolving JSON object field types.'
##########
File path: docs/_docs/restapi.adoc
##########
@@ -240,6 +243,69 @@ Similarly, the `get` command with `keyType=int` and `valueType=date` would be:
http://[host]:[port]/ignite?cmd=get&key=1&cacheName=myCache&keyType=int&valueType=date
----
+=== Custom user defined types
+
+For custom objects, the JSON format is used. For example, we can work with the following object using the REST API:
+[source, javascript]
+ {
+ "uid": "7e51118b-eb15-4373-b57f-4984cb9cd7ac",
+ "name": "John Doe",
+ "organization": 5678901,
+ "married": false,
+ "salary": 156.1
+ }
+
+The following request puts this object into the cache `testCache` as a value with a type name `Person` and a key `1`.
+
+ http://[host]:[port]/ignite?cacheName=testCache&cmd=put&keyType=int&key=1&valueType=Person&val=%7B%0A+++++%22uid%22%3A+%227e51118b-eb15-4373-b57f-4984cb9cd7ac%22%2C%0A+++++%22name%22%3A+%22John+Doe%22%2C%0A+++++%22organization%22%3A+5678901%2C%0A+++++%22married%22%3A+false%2C%0A+++++%22salary%22%3A+156.1%0A++%7D&
+
+On the server side, the JSON value from this request will be converted to link:/docs/data-modeling/data-modeling#binary-object-format[binary object]. Field types are resolved in the following order:
+
+* If the type name is a `Java class` available on the server, the class field types with corresponding names will be used for JSON object field types resolving.
+* If the type name is a `query entity` type, the field types will be resolved according to the field type defined in the `query entity`.
Review comment:
'If the type name is of a `query entity` type,...'
##########
File path: docs/_docs/restapi.adoc
##########
@@ -169,10 +169,13 @@ To set a custom expire time, set the system variable: `IGNITE_REST_SESSION_TIMEO
====
== Data Types
-The REST API also supports Java built-in types for put/get operations via `keyType` and `valueType` optional parameters.
-Note that unless one of the below mentioned types are explicitly specified, the REST protocol exchanges the key-value data in `String` format.
+The REST API also supports <<Java built-in types>> and <<Custom user defined types>> for put/get operations via `keyType` and `valueType` optional parameters.
+
+Note that unless one of the mentioned below types are explicitly specified, the REST protocol exchanges the key-value data in `String` format.
Review comment:
'...unless one of the types mentioned below is explicitly specified, the REST protocol will exchange the key-value data in 'String' format.'
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] xtern commented on a change in pull request #8245: IGNITE-12977 Documentation.
Posted by GitBox <gi...@apache.org>.
xtern commented on a change in pull request #8245:
URL: https://github.com/apache/ignite/pull/8245#discussion_r490096235
##########
File path: docs/_docs/restapi.adoc
##########
@@ -169,10 +169,13 @@ To set a custom expire time, set the system variable: `IGNITE_REST_SESSION_TIMEO
====
== Data Types
-The REST API also supports Java built-in types for put/get operations via `keyType` and `valueType` optional parameters.
-Note that unless one of the below mentioned types are explicitly specified, the REST protocol exchanges the key-value data in `String` format.
+The REST API also supports <<Java built-in types>> and <<Custom user defined types>> for put/get operations via `keyType` and `valueType` optional parameters.
+
+Note that unless one of the mentioned below types are explicitly specified, the REST protocol exchanges the key-value data in `String` format.
Review comment:
fixed, thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] dmagda merged pull request #8245: IGNITE-12977 Documentation.
Posted by GitBox <gi...@apache.org>.
dmagda merged pull request #8245:
URL: https://github.com/apache/ignite/pull/8245
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org