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 30da456b 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
30da456b is described below
commit 30da456b75cd83ede72f51dd3bc3ee5cb2559eae
Author: chaokunyang <[email protected]>
AuthorDate: Sun Feb 9 15:18:54 2025 +0000
🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
docs/guide/java_serialization_guide.md | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/docs/guide/java_serialization_guide.md
b/docs/guide/java_serialization_guide.md
index c4ee8f1d..be477b06 100644
--- a/docs/guide/java_serialization_guide.md
+++ b/docs/guide/java_serialization_guide.md
@@ -312,7 +312,7 @@ should have same registration order.
```java
Fury fury = xxx;
fury.register(SomeClass.class);
-fury.register(SomeClass1.class,200);
+fury.register(SomeClass1.class, 200);
```
If you invoke `FuryBuilder#requireClassRegistration(false)` to disable class
registration check,
@@ -342,6 +342,21 @@ simplify
the customization of class check mechanism. You can use this checker or
implement more sophisticated checker by
yourself.
+### Register class by name
+
+Register class by id will have better performance and smaller space overhead.
But in some cases, management for a bunch
+of type id is complex. In such cases, registering class by name using API
+`register(Class<?> cls, String namespace, String typeName)` is recommended.
+
+```java
+fury.register(Foo.class, "demo", "Foo");
+```
+
+If there are no duplicate name for type, `namespace` can be left as empty to
reduce serialized size.
+
+**Do not use this API to register class since it will increase serialized size
a lot compared to register
+class by id**
+
### Serializer Registration
You can also register a custom serializer for a class by
`Fury#registerSerializer` API.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]