You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "funky-eyes (via GitHub)" <gi...@apache.org> on 2024/07/31 15:33:22 UTC

[PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

funky-eyes opened a new pull request, #1780:
URL: https://github.com/apache/fury/pull/1780

   <!--
   **Thanks for contributing to Fury.**
   
   **If this is your first time opening a PR on fury, you can refer to [CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).**
   
   Contribution Checklist
   
       - The **Apache Fury (incubating)** community has restrictions on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fury/blob/main/CONTRIBUTING.md).
   
       - Fury has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here.
   -->
   
   ## What does this PR do?
   
   <!-- Describe the purpose of this PR. -->
   Because using ThreadSafeFury cannot get ClassResolver, so I submitted this pr to increase some checklistener and other behavior
   
   ## Related issues
   
   
   
   ## Does this PR introduce any user-facing change?
   
   <!--
   If any user-facing interface changes, please [open an issue](https://github.com/apache/fury/issues/new/choose) describing the need to do so and update the document if necessary.
   -->
   
   - [ ] Does this PR introduce any public API change?
   - [ ] Does this PR introduce any binary protocol compatibility change?
   
   
   ## Benchmark
   
   <!--
   When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here.
   -->
   


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701837686


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -266,8 +268,18 @@ public ClassLoader getClassLoader() {
   }
 
   @Override
-  public ClassResolver getClassResolver() {
-    return bindingThreadLocal.get().get().getClassResolver();
+  public void setClassChecker(ClassChecker classChecker) {
+    bindingThreadLocal.get().get().getClassResolver().setClassChecker(classChecker);

Review Comment:
   > You can take `setSerializerFactory` as an example:
   > 
   > ```java
   >   public void setSerializerFactory(SerializerFactory serializerFactory) {
   >     processCallback(fury -> fury.setSerializerFactory(serializerFactory));
   >   }
   > ```
   
   I feel doing it this way might be simpler.



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701907373


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   I think you can create ClassChecker first and set it to Fury. Then you don't need to add any API to Fury. We won't add such API to get Classchecker or ClassResolver/SerializerFactory



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701865784


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   > Please implement this in AbstractThreadSafeFury
   
   AbstractThreadSafeFury does not have bindingThreadLocal, so it seems unable to implement this interface.



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1698727632


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   This won't set set class checker for other fury instance. We could set Class checker when building threadsafefury by creating threadlocalfury directly 



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701907919


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   We can only allow set ClassChecker



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1699261293


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   > If so, maybe we need to add `setClassChecker` to BaseFury/ThreadSafeFur directly.
   
   That's a good idea. I will make modifications based on this suggestion



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701739952


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -266,8 +268,18 @@ public ClassLoader getClassLoader() {
   }
 
   @Override
-  public ClassResolver getClassResolver() {
-    return bindingThreadLocal.get().get().getClassResolver();
+  public void setClassChecker(ClassChecker classChecker) {
+    bindingThreadLocal.get().get().getClassResolver().setClassChecker(classChecker);

Review Comment:
   You can take `setSerializerFactory` as an example:
   ```java
     public void setSerializerFactory(SerializerFactory serializerFactory) {
       processCallback(fury -> fury.setSerializerFactory(serializerFactory));
     }
   ```



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1698736881


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   Such as the usage in Dubbo
   https://github.com/apache/dubbo-spi-extensions/blob/master/dubbo-serialization-extensions/dubbo-serialization-fury/src/main/java/org/apache/dubbo/common/serialize/fury/dubbo/BaseFurySerialization.java



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701467139


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -266,8 +268,18 @@ public ClassLoader getClassLoader() {
   }
 
   @Override
-  public ClassResolver getClassResolver() {
-    return bindingThreadLocal.get().get().getClassResolver();
+  public void setClassChecker(ClassChecker classChecker) {
+    bindingThreadLocal.get().get().getClassResolver().setClassChecker(classChecker);

Review Comment:
   > We need to use processCallback
   
   I don't quite understand what you mean. Could you give me an example?



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701845857


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {
+    return bindingThreadLocal.get().get().getClassResolver().getClassChecker();
+  }
+
+  @Override
+  public SerializerFactory getSerializerFactory() {

Review Comment:
   We should not provide this api. It may return different object when classloader changes or we invoke It from another thread



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "LiangliangSui (via GitHub)" <gi...@apache.org>.
LiangliangSui commented on PR #1780:
URL: https://github.com/apache/fury/pull/1780#issuecomment-2263032207

   Hi @funky-eyes , the rust ci failure is not related to your changes, I will fix this soon, track the ci failure issue at https://github.com/apache/fury/issues/1781


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #1780:
URL: https://github.com/apache/fury/pull/1780#issuecomment-2263226656

   > Hi @funky-eyes , the rust ci failure is not related to your changes, I will fix this soon, track the ci failure issue at #1781
   
   thx


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701856105


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {
+    return bindingThreadLocal.get().get().getClassResolver().getClassChecker();
+  }
+
+  @Override
+  public SerializerFactory getSerializerFactory() {

Review Comment:
   You are correct; I will proceed with the corrections



##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   ok



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes closed pull request #1780: feat(java): ThreadSafeFury add getClassResolver method
URL: https://github.com/apache/fury/pull/1780


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701870791


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   You can invoke processCallback instead



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1702522149


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   > We can only allow set ClassChecker
   
   ok



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

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


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701741779


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -266,8 +268,18 @@ public ClassLoader getClassLoader() {
   }
 
   @Override
-  public ClassResolver getClassResolver() {
-    return bindingThreadLocal.get().get().getClassResolver();
+  public void setClassChecker(ClassChecker classChecker) {
+    bindingThreadLocal.get().get().getClassResolver().setClassChecker(classChecker);

Review Comment:
   And maybe we can add following API for extending:
   ```java
   
   public void configureClassResolver(Consumer<ClassResolver> apply);
   
   ```



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1700394413


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -266,8 +268,18 @@ public ClassLoader getClassLoader() {
   }
 
   @Override
-  public ClassResolver getClassResolver() {
-    return bindingThreadLocal.get().get().getClassResolver();
+  public void setClassChecker(ClassChecker classChecker) {
+    bindingThreadLocal.get().get().getClassResolver().setClassChecker(classChecker);

Review Comment:
   We need to use processCallback



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1698732290


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   > This won't set set class checker for other fury instance. We could set Class checker when building threadsafefury by creating threadlocalfury directly
   
   I believe that in some cases, adding check listeners and serializers involves dynamically adding or modifying them at runtime, which cannot be predicted with absolute certainty



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1700009680


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   done



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes closed pull request #1780: feat(java): ThreadSafeFury add getClassResolver method
URL: https://github.com/apache/fury/pull/1780


-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1698770068


##########
java/fury-core/src/test/java/org/apache/fury/FuryCopyTest.java:
##########
@@ -137,8 +137,10 @@ public void threadLocalCopyTest() {
     BeanA beanA = BeanA.createBeanA(2);
     ExecutorService executor = Executors.newSingleThreadExecutor();
     AtomicReference<Throwable> ex = new AtomicReference<>();
-    ThreadLocalFury threadLocalFury =
-        builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    ThreadLocalFury threadLocalFury = builder().withCodegen(false).withRefCopy(true).buildThreadLocalFury();
+    threadLocalFury.getClassResolver().setClassChecker((classResolver, className1) -> true);

Review Comment:
   If so, maybe we need to add `setClassChecker` to BaseFury/ThreadSafeFur directly.



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701846528


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   Please implement this in AbstractThreadSafeFury



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [PR] feat(java): ThreadSafeFury add getClassResolver method [fury]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #1780:
URL: https://github.com/apache/fury/pull/1780#discussion_r1701880338


##########
java/fury-core/src/main/java/org/apache/fury/ThreadLocalFury.java:
##########
@@ -265,6 +267,16 @@ public ClassLoader getClassLoader() {
     return bindingThreadLocal.get().getClassLoader();
   }
 
+  @Override
+  public ClassChecker getClassChecker() {

Review Comment:
   > You can invoke processCallback instead
   
   processCallback ReturnType is void



-- 
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: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org