You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nizhikov (via GitHub)" <gi...@apache.org> on 2025/09/21 08:17:45 UTC

[PR] IGNITE-25090 Move binary classes to binary-api [ignite]

nizhikov opened a new pull request, #12362:
URL: https://github.com/apache/ignite/pull/12362

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


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


Re: [PR] IGNITE-25090 Move binary classes to binary-api [ignite]

Posted by "sergey-chugunov-1985 (via GitHub)" <gi...@apache.org>.
sergey-chugunov-1985 commented on code in PR #12362:
URL: https://github.com/apache/ignite/pull/12362#discussion_r2372011693


##########
modules/binary/api/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java:
##########
@@ -38,6 +38,9 @@ public class GridBinaryMarshaller {
     private static final ThreadLocal<BinaryContextHolder> BINARY_CTX =
         ThreadLocal.withInitial(BinaryContextHolder::new);
 
+    /** Binary context supplier. */
+    private static Supplier<BinaryContext> BINARY_CTX_SUPPLIER;

Review Comment:
   I have an idea for the future of how to get rid of this supplier.
   
   I scanned the code and found that `IgnitionEx.localIgnite().context().cacheObjects().binaryContext()` call returns the same instance of `BinaryContext` as arrives to `GridBinaryMarshaller` constructor.
   
   So we could replace this vague trick with supplier initialized from KernalContext implementations with a static atomic reference which we set from the constructor.
   
   But ultimately one would want to see this static `BINARY_CTX` stuff refactored to BinaryUtils or to some separate component.



##########
modules/binary/api/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java:
##########
@@ -2758,18 +2756,19 @@ public static void clearCache() {
     /**
      * Gets the schema.
      *
-     * @param cacheObjProc Cache object processor.
+     * @param ctx Binary context.
+     * @param metadataProvider Function to provide binary type metadata.
      * @param typeId Type id.
      * @param schemaId Schema id.
      */
-    public static int[] getSchema(IgniteCacheObjectProcessor cacheObjProc, int typeId, int schemaId) {
-        assert cacheObjProc != null;
+    public static int[] getSchema(BinaryContext ctx, IntFunction<BinaryType> metadataProvider, int typeId, int schemaId) {
+        assert ctx != null;
 
-        BinarySchemaRegistry schemaReg = cacheObjProc.binaryContext().schemaRegistry(typeId);
+        BinarySchemaRegistry schemaReg = ctx.schemaRegistry(typeId);
         BinarySchema schema = schemaReg.schema(schemaId);
 
         if (schema == null) {
-            BinaryTypeImpl meta = (BinaryTypeImpl)cacheObjProc.metadata(typeId);
+            BinaryTypeImpl meta = (BinaryTypeImpl)metadataProvider.apply(typeId);

Review Comment:
   I think you could use `BinaryContext#metadata` method to obtain `BinaryTypeImpl` here. From what I see call to `BinaryContext#metadata` goes exactly to `cacheObjProc#metadata(int)` in the end. If this is true then we don't need `metadataProvider` parameter at all.



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


Re: [PR] IGNITE-25090 Move binary classes to binary-api [ignite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12362:
URL: https://github.com/apache/ignite/pull/12362#issuecomment-3315730566

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [310 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 1)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [24 Duplicated Blocks on New Code](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 10)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


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


Re: [PR] IGNITE-25090 Move binary classes to binary-api [ignite]

Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov merged PR #12362:
URL: https://github.com/apache/ignite/pull/12362


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


Re: [PR] IGNITE-25090 Move binary classes to binary-api [ignite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12362:
URL: https://github.com/apache/ignite/pull/12362#issuecomment-3327532708

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [24 Duplicated Blocks on New Code](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 10)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [310 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 1)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


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


Re: [PR] IGNITE-25090 Move binary classes to binary-api [ignite]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12362:
URL: https://github.com/apache/ignite/pull/12362#issuecomment-3315987163

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [310 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 1)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [24 Duplicated Blocks on New Code](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362) (required ≤ 10)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12362)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


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