ptupitsyn commented on a change in pull request #497:
URL: https://github.com/apache/ignite-3/pull/497#discussion_r765473306
##########
File path:
modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientSchema.java
##########
@@ -118,4 +153,103 @@ public int version() {
public int keyColumnCount() {
return keyColumnCount;
}
+
+ public <T> Marshaller getMarshaller(Mapper mapper, TuplePart part) {
+ return getMarshallerCache(part).computeIfAbsent(mapper, m ->
createMarshaller(m, part));
+ }
+
+ private Map<Mapper, Marshaller> getMarshallerCache(TuplePart part) {
+ switch (part) {
+ case KEY:
+ return keyMarshallers;
+
+ case VAL:
+ return valMarshallers;
+
+ default:
+ return marshallers;
+ }
+ }
+
+ private Marshaller createMarshaller(Mapper mapper, TuplePart part) {
+ int colCount = columns.length;
+ int firstColIdx = 0;
+
+ if (part == TuplePart.KEY) {
+ colCount = keyColumnCount();
+ } else if (part == TuplePart.VAL) {
+ colCount = columns.length - keyColumnCount;
+ firstColIdx = keyColumnCount;
Review comment:
Fixed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]