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 2021/09/09 16:57:46 UTC

[GitHub] [ignite-3] ptupitsyn opened a new pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

ptupitsyn opened a new pull request #328:
URL: https://github.com/apache/ignite-3/pull/328


   Implement KeyValueBinaryView for Java thin client (`ignite.tables().table(..).kvView()`).


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706078244



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;

Review comment:
       Do you mean 'proto' is a public package? 
   Let's move it into 'internal' package or write javadoc to all enum values. WDYT?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706777831



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;

Review comment:
       Done




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706790490



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;
+
+/**
+ * Defines tuple part to write or read - key, value, or both.
+ */
+public enum TuplePart {
+    KEY,
+    VAL,
+    KEY_AND_VAL

Review comment:
       Good catch, added `ClientOp.TUPLE_CONTAINS_KEY`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706082359



##########
File path: modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleGetAndDeleteRequest.java
##########
@@ -46,6 +47,6 @@
         var table = readTable(in, tables);
         var tuple = readTuple(in, table, true);
 
-        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple));
+        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple, TuplePart.VAL));

Review comment:
       Do you plan to reuse this (and similar) methods in Table binary view?
   I think user expects TableView.get(t) will return full row (key+value parts), but KvView will return "value" part only, thought.
   Shouldn't TuplePart be passed from outside?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706084695



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;
+
+/**
+ * Defines tuple part to write or read - key, value, or both.
+ */
+public enum TuplePart {
+    KEY,
+    VAL,
+    KEY_AND_VAL

Review comment:
       What about 'contains' operation?  It don't require any key or value to be returned.
   It's ok if you plan to optimize it later.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] isapego commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
isapego commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706129759



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;
+
+/**
+ * Defines tuple part to write or read - key, value, or both.
+ */
+public enum TuplePart {
+    KEY,
+    VAL,
+    KEY_AND_VAL

Review comment:
       Maybe we should add a separate ticket for this part.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] isapego commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
isapego commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706128505



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;

Review comment:
       Agree




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ptupitsyn merged pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
ptupitsyn merged pull request #328:
URL: https://github.com/apache/ignite-3/pull/328


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706779249



##########
File path: modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleGetAndDeleteRequest.java
##########
@@ -46,6 +47,6 @@
         var table = readTable(in, tables);
         var tuple = readTuple(in, table, true);
 
-        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple));
+        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple, TuplePart.VAL));

Review comment:
       > Do you plan to reuse this (and similar) methods in Table binary view?
   
   This is a server-side handler. `Table` and `KvView` APIs only differ in the way they return data to the user, but the data is the same. There is nothing specific to `Table` or `KvView` on the protocol level - all operations are shared.
   
   For `Get*` operations we only return the value part from the server, because the client already knows the key. For the `Table` view, we combine returned value columns with known key columns to create the full row and return it to the user.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706781860



##########
File path: modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTupleGetAndDeleteRequest.java
##########
@@ -46,6 +47,6 @@
         var table = readTable(in, tables);
         var tuple = readTuple(in, table, true);
 
-        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple));
+        return table.getAndDeleteAsync(tuple).thenAccept(resTuple -> writeTuple(out, resTuple, TuplePart.VAL));

Review comment:
       I've updated the PR description to clarify this point.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov commented on a change in pull request #328: IGNITE-15361 Thin 3.0: Add KeyValueBinaryView

Posted by GitBox <gi...@apache.org>.
AMashenkov commented on a change in pull request #328:
URL: https://github.com/apache/ignite-3/pull/328#discussion_r706078244



##########
File path: modules/client-common/src/main/java/org/apache/ignite/client/proto/TuplePart.java
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.proto;

Review comment:
       Do you mean 'proto' is a public package? 
   Let move it into 'internal' package or write javadoc to all enum values. WDYT?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org