This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fury-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b574b73 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
9b574b73 is described below

commit 9b574b7323b35c8225eb1e6ce42e8e9955a59995
Author: chaokunyang <[email protected]>
AuthorDate: Tue Jan 7 13:36:50 2025 +0000

    🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
 docs/guide/java_serialization_guide.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/docs/guide/java_serialization_guide.md 
b/docs/guide/java_serialization_guide.md
index 52703901..70764393 100644
--- a/docs/guide/java_serialization_guide.md
+++ b/docs/guide/java_serialization_guide.md
@@ -102,7 +102,7 @@ public class Example {
 | `compressLong`                      | Enables or disables long compression 
for smaller size.                                                               
                                                                                
                                                                                
                                                                                
                                                                                
                [...]
 | `compressString`                    | Enables or disables string compression 
for smaller size.                                                               
                                                                                
                                                                                
                                                                                
                                                                                
              [...]
 | `classLoader`                       | The classloader should not be updated; 
Fury caches class metadata. Use `LoaderBinding` or `ThreadSafeFury` for 
classloader updates.                                                            
                                                                                
                                                                                
                                                                                
                      [...]
-| `compatibleMode`                    | Type forward/backward compatibility 
config. Also Related to `checkClassVersion` config. `SCHEMA_CONSISTENT`: Class 
schema must be consistent between serialization peer and deserialization peer. 
`COMPATIBLE`: Class schema can be different between serialization peer and 
deserialization peer. They can add/delete fields independently.                 
                                                                                
                        [...]
+| `compatibleMode`                    | Type forward/backward compatibility 
config. Also Related to `checkClassVersion` config. `SCHEMA_CONSISTENT`: Class 
schema must be consistent between serialization peer and deserialization peer. 
`COMPATIBLE`: Class schema can be different between serialization peer and 
deserialization peer. They can add/delete fields independently. [See 
more](#class-inconsistency-and-class-version-check).                            
                                   [...]
 | `checkClassVersion`                 | Determines whether to check the 
consistency of the class schema. If enabled, Fury checks, writes, and checks 
consistency using the `classVersionHash`. It will be automatically disabled 
when `CompatibleMode#COMPATIBLE` is enabled. Disabling is not recommended 
unless you can ensure the class won't evolve.                                   
                                                                                
                                  [...]
 | `checkJdkClassSerializable`         | Enables or disables checking of 
`Serializable` interface for classes under `java.*`. If a class under `java.*` 
is not `Serializable`, Fury will throw an `UnsupportedOperationException`.      
                                                                                
                                                                                
                                                                                
                      [...]
 | `registerGuavaTypes`                | Whether to pre-register Guava types 
such as `RegularImmutableMap`/`RegularImmutableList`. These types are not 
public API, but seem pretty stable.                                             
                                                                                
                                                                                
                                                                                
                       [...]
@@ -518,6 +518,13 @@ fury with
 `CompatibleMode.COMPATIBLE` has more performance and space cost, do not set it 
by default if your classes are always
 consistent between serialization and deserialization.
 
+### Deserialize POJO into another type
+
+Fury allows you to serialize one POJO and deserialize it into a different 
POJO. To achieve this, configure Fury with
+`CompatibleMode` set to `org.apache.fury.config.CompatibleMode.COMPATIBLE`. 
Additionally, you only need to register the
+specific classes you want to serialize or deserialize to setup type mapping 
relationship; there's no need to register any nested classes within them.
+[See example 
here](/java/fury-core/src/test/java/org/apache/fury/serializer/compatible/DifferentPOJOCompatibleSerializerTest.java)
+
 ### Use wrong API for deserialization
 
 If you serialize an object by invoking `Fury#serialize`, you should invoke 
`Fury#deserialize` for deserialization


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to