NSAmelchev commented on code in PR #12009: URL: https://github.com/apache/ignite/pull/12009#discussion_r2102455920
########## modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java: ########## @@ -3083,6 +3086,49 @@ public static void detachAllowedIfPossible(Object o) { ((BinaryObjectImpl)o).detachAllowed(true); } + /** + * @param meta Binary metadata. + * @return Schemas identifiers of the specified {@link BinaryMetadata}. + */ + public static Collection<T2<Integer, int[]>> schemasAndFieldsIds(BinaryMetadata meta) { + return F.viewReadOnly(meta.schemas(), s -> new T2<>(s.schemaId(), s.fieldIds())); + } + + /** + * Gets field by its order. + * + * @param reader Reader. + * @param order Order. + */ + public static int fieldId(BinaryReaderEx reader, int order) { + return ((BinaryReaderExImpl)reader).getOrCreateSchema().fieldId(order); + } + + /** + * @param typeId Type ID. + * @param typeName Type name. + * @param fields Fields map. + * @param affKeyFieldName Affinity key field name. + * @param schemasAndFieldIds Schemas and fields identifiers. + * @param isEnum Enum flag. + * @param enumMap Enum name to ordinal mapping. + * @return New instance of {@link BinaryMetadata}. + */ + public static BinaryMetadata binaryMetadata( + int typeId, + String typeName, + @Nullable Map<String, BinaryFieldMetadata> fields, + @Nullable String affKeyFieldName, + @Nullable Collection<T2<Integer, List<Integer>>> schemasAndFieldIds, + boolean isEnum, + @Nullable Map<String, Integer> enumMap) { + List<BinarySchema> schemas = schemasAndFieldIds.stream() Review Comment: The `schemasAndFieldIds` param can be null and NPE is possible. -- 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