From 36c6fe35e7fea7723ca16a75d09a22558f07577c Mon Sep 17 00:00:00 2001 From: Shawn Yang Date: Thu, 28 Dec 2023 08:46:09 +0800 Subject: [PATCH] [Java][Doc] Switch Option and Description column for better readability (#1267) --- docs/guide/java_object_graph_guide.md | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/guide/java_object_graph_guide.md b/docs/guide/java_object_graph_guide.md index fbcf918bb5..9ab05b1786 100644 --- a/docs/guide/java_object_graph_guide.md +++ b/docs/guide/java_object_graph_guide.md @@ -94,28 +94,28 @@ public class Example { } ``` -## Advanced Usage +## FuryBuilder options + +| Option Name | Description | Default Value | +|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------| +| `timeRefIgnored` | Whether to ignore reference tracking of all time types registered in `TimeSerializers` and subclasses of those types when ref tracking is enabled. If ignored, ref tracking of every time type can be enabled by invoking `Fury#registerSerializer(Class, Serializer)`. For example, `fury.registerSerializer(Date.class, new DateSerializer(fury, true))`. Note that enabling ref tracking should happen before serializer codegen of any types which contain time fields. Otherwise, those fields will still skip ref tracking. | `true` | +| `compressInt` | Enables or disables int compression for smaller size. | `true` | +| `compressLong` | Enables or disables long compression for smaller size. | `true` | +| `compressString` | Enables or disables string compression for smaller size. | `true` | +| `classLoader` | The classloader should not be updated; Fury caches class metadata. Use `LoaderBinding` or `ThreadSafeFury` for classloader updates. | `Thread.currentThread().getContextClassLoader()` | +| `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.SCHEMA_CONSISTENT` | +| `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. | `false` | +| `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`. | `true` | +| `registerGuavaTypes` | Whether to pre-register Guava types such as `RegularImmutableMap`/`RegularImmutableList`. These types are not public API, but seem pretty stable. | `true` | +| `requireClassRegistration` | Disabling may allow unknown classes to be deserialized, potentially causing security risks. | `true` | +| `suppressClassRegistrationWarnings` | Whether to suppress class registration warnings when class registration is disabled. The warnings can be used for security audit, but may be annoying. When `requireClassRegistration=false`, this suppression will be enabled by default. | `!requireClassRegistration` | +| `shareMetaContext` | Enables or disables meta share mode. | `false` | +| `deserializeUnexistedClass` | Enables or disables deserialization/skipping of data for non-existent classes. | `false` | +| `codeGenEnabled` | Disabling may result in faster initial serialization but slower subsequent serializations. | `true` | +| `asyncCompilationEnabled` | If enabled, serialization uses interpreter mode first and switches to JIT serialization after async serializer JIT for a class is finished. | `false` | +| `scalaOptimizationEnabled` | Enables or disables Scala-specific serialization optimization. | `false` | -### FuryBuilder options - -| Option Name | Default Value | Description | -| ---------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `timeRefIgnored` | `true` | Whether to ignore reference tracking of all time types registered in `TimeSerializers` and subclasses of those types when ref tracking is enabled. If ignored, ref tracking of every time type can be enabled by invoking `Fury#registerSerializer(Class, Serializer)`. For example, `fury.registerSerializer(Date.class, new DateSerializer(fury, true))`. Note that enabling ref tracking should happen before serializer codegen of any types which contain time fields. Otherwise, those fields will still skip ref tracking. | -| `compressInt` | `true` | Enables or disables int compression for smaller size. | -| `compressLong` | `true` | Enables or disables long compression for smaller size. | -| `compressString` | `true` | Enables or disables string compression for smaller size. | -| `classLoader` | `Thread.currentThread().getContextClassLoader()` | The classloader should not be updated; Fury caches class metadata. Use `LoaderBinding` or `ThreadSafeFury` for classloader updates. | -| `compatibleMode` | `CompatibleMode.SCHEMA_CONSISTENT` | 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. | -| `checkClassVersion` | `false` | 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` | `true` | 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` | `true` | Whether to pre-register Guava types such as `RegularImmutableMap`/`RegularImmutableList`. These types are not public API, but seem pretty stable. | -| `requireClassRegistration` | `true` | Disabling may allow unknown classes to be deserialized, potentially causing security risks. | -| `suppressClassRegistrationWarnings` | `!requireClassRegistration` | Whether to suppress class registration warnings when class registration is disabled. The warnings can be used for security audit, but may be annoying. When `requireClassRegistration=false`, this suppression will be enabled by default. | -| `shareMetaContext` | `false` | Enables or disables meta share mode. | -| `deserializeUnexistedClass` | `false` | Enables or disables deserialization/skipping of data for non-existent classes. | -| `codeGenEnabled` | `true` | Disabling may result in faster initial serialization but slower subsequent serializations. | -| `asyncCompilationEnabled` | `false` | If enabled, serialization uses interpreter mode first and switches to JIT serialization after async serializer JIT for a class is finished. | -| `scalaOptimizationEnabled` | `false` | Enables or disables Scala-specific serialization optimization. | +## Advanced Usage ### Fury creation