timoninmaxim commented on code in PR #12009: URL: https://github.com/apache/ignite/pull/12009#discussion_r2097780873
########## modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java: ########## @@ -387,4 +402,11 @@ public Map<String, Integer> enumMap() { @Override public String toString() { return S.toString(BinaryMetadata.class, this); } + + /** + * @return Schema IDs registered for this type. + */ + public Set<Integer> schemaIds() { + return Collections.unmodifiableSet(schemaIds); Review Comment: just schemaIds. Let's avoid creating useless wrappers. This is internal code, users can't change the collection and Ignite developers will not do it (we trust committers) ########## modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java: ########## @@ -121,119 +96,17 @@ static <E> void collection(E[] col, BinaryOutputStream out, BiConsumer<BinaryOut } } - /** - * @param in Input stream. - * @param elemReader Collection element deserializer. - * @return Deserialized collection. - */ - static <E> Collection<E> collection(BinaryInputStream in, Function<BinaryInputStream, E> elemReader) { - Collection<E> col = new LinkedList<>(); // needs to be ordered for some use cases - - int cnt = in.readInt(); - - for (int i = 0; i < cnt; i++) - col.add(elemReader.apply(in)); - - return col; - } - - /** - * @return Deserialized map - */ - private static <K, V> Map<K, V> map( - BinaryInputStream in, - Function<BinaryInputStream, K> keyReader, - Function<BinaryInputStream, V> valReader - ) { - int cnt = in.readInt(); - - Map<K, V> map = new HashMap<>(cnt); - - for (int i = 0; i < cnt; i++) - map.put(keyReader.apply(in), valReader.apply(in)); - - return map; - } - /** Deserialize binary type metadata from stream. */ BinaryMetadata binaryMetadata(BinaryInputStream in) throws IOException { Review Comment: Let's move full method to BinaryUtils. Looks strange method that just calls BinaryUtils twice. ########## modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientCache.java: ########## @@ -1580,7 +1580,7 @@ private void writePutAllConflict( writeCacheInfo(req); - ClientUtils.collection( + BinaryUtils.collection( Review Comment: It must not depend on BinaryUtils -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org