-
Notifications
You must be signed in to change notification settings - Fork 135
IGNITE-15361 Thin 3.0: Add KeyValueBinaryView #328
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
# Conflicts: # modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java # modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTuple.java # modules/client/src/test/java/org/apache/ignite/client/ClientTableTest.java
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.ignite.client.proto; |
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.
Do you mean 'proto' is a public package?
Let's move it into 'internal' package or write javadoc to all enum values. WDYT?
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.
Agree
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
| 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)); |
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.
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?
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.
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.
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've updated the PR description to clarify this point.
| public enum TuplePart { | ||
| KEY, | ||
| VAL, | ||
| KEY_AND_VAL |
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.
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.
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.
Maybe we should add a separate ticket for this part.
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.
Good catch, added ClientOp.TUPLE_CONTAINS_KEY.
isapego
left a comment
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.
Looks good to me.
…est, update contains implementation
KeyValueBinaryViewfor Java thin client (ignite.tables().table(..).kvView()).TUPLE_GETpasses the key to the server, and server used to return full tuple: key and value columns. It is not necessary to pass the key back, and the server won't do that anymore.TableandKvViewAPIs - the same operations are used for both. The difference is only on the client side -Tablereturns all columns in a singleTuple, andKvViewsplits key/val columns into separateTuples.IEP updated accordingly: https://cwiki.apache.org/confluence/display/IGNITE/IEP-76+Thin+Client+Protocol+for+Ignite+3.0