Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: relocate Maven GAV and Java package #1259

Merged
merged 8 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,35 @@ Nightly snapshot:
</repository>
</repositories>
<dependency>
<groupId>org.furyio</groupId>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
<version>0.5.0-SNAPSHOT</version>
</dependency>
<!-- row/arrow format support -->
<!-- <dependency>
<groupId>org.furyio</groupId>
<groupId>org.apache.fury</groupId>
<artifactId>fury-format</artifactId>
<version>0.5.0-SNAPSHOT</version>
</dependency> -->
```
Release version:
```xml
<dependency>
<groupId>org.furyio</groupId>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
<version>0.4.1</version>
</dependency>
<!-- row/arrow format support -->
<!-- <dependency>
<groupId>org.furyio</groupId>
<groupId>org.apache.fury</groupId>
<artifactId>fury-format</artifactId>
<version>0.4.1</version>
</dependency> -->
```

### Scala
```sbt
libraryDependencies += "org.furyio" % "fury-core" % "0.4.1"
libraryDependencies += "org.apache.fury" % "fury-core" % "0.4.1"
```

### Python
Expand All @@ -148,8 +148,8 @@ Here we give a quick start about how to use fury, see [user guide](https://githu
If you don't have cross-language requirements, using this mode will
have better performance.
```java
import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;
import java.util.*;

public class Example {
Expand Down Expand Up @@ -195,8 +195,8 @@ public class Example {
### Cross-language object graph serialization
**Java**
```java
import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;
import java.util.*;

public class ReferenceExample {
Expand All @@ -214,7 +214,7 @@ public class ReferenceExample {
return obj;
}

// mvn exec:java -Dexec.mainClass="io.fury.examples.ReferenceExample"
// mvn exec:java -Dexec.mainClass="org.apache.fury.examples.ReferenceExample"
public static void main(String[] args) {
Fury fury = Fury.builder().withLanguage(Language.XLANG)
.withRefTracking(true).build();
Expand Down Expand Up @@ -369,7 +369,7 @@ For example, the deserialization may invoke `init` constructor or `equals`/`hash
Fury provides a class registration option that is enabled by default for such protocols, allowing only deserialization of trusted registered types or built-in types.
**Do not disable class registration unless you can ensure your environment is secure**.

If this option is disabled, you are responsible for serialization security. You can configure `io.fury.resolver.ClassChecker` by
If this option is disabled, you are responsible for serialization security. You can configure `org.apache.fury.resolver.ClassChecker` by
`ClassResolver#setClassChecker` to control which classes are allowed for serialization.

## How to Build
Expand Down
4 changes: 2 additions & 2 deletions ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ integration_tests() {
export JAVA_HOME="$ROOT/$jdk"
export PATH=$JAVA_HOME/bin:$PATH
echo "First round for generate data: ${jdk}"
mvn -T10 --no-transfer-progress clean test -Dtest=io.fury.integration_tests.JDKCompatibilityTest
mvn -T10 --no-transfer-progress clean test -Dtest=org.apache.fury.integration_tests.JDKCompatibilityTest
done
for jdk in "${JDKS[@]}"; do
export JAVA_HOME="$ROOT/$jdk"
export PATH=$JAVA_HOME/bin:$PATH
echo "Second round for compatibility: ${jdk}"
mvn -T10 --no-transfer-progress clean test -Dtest=io.fury.integration_tests.JDKCompatibilityTest
mvn -T10 --no-transfer-progress clean test -Dtest=org.apache.fury.integration_tests.JDKCompatibilityTest
done
}

Expand Down
304 changes: 152 additions & 152 deletions docs/benchmarks/data/jmh-jdk-11-deserialization.csv

Large diffs are not rendered by default.

304 changes: 152 additions & 152 deletions docs/benchmarks/data/jmh-jdk-11-serialization.csv

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions docs/benchmarks/data/jmh-jdk-11-zerocopy.csv

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions docs/guide/graalvm_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ any extra cost, the performance is great.
In order to use Fury on graalvm native image, you must create Fury as an **static** field of a class, and **register** all classes at
the enclosing class initialize time. Then configure `native-image.properties` under
`resources/META-INF/native-image/$xxx/native-image.propertie` to tell graalvm to init the class at native image
build time. For example, here we configure `io.fury.graalvm.Example` class be init at build time:
build time. For example, here we configure `org.apache.fury.graalvm.Example` class be init at build time:
```properties
Args = --initialize-at-build-time=io.fury.graalvm.Example
Args = --initialize-at-build-time=org.apache.fury.graalvm.Example
```

Another benefit using fury is that you don't have to configure [reflection json](https://www.graalvm.org/latest/reference-manual/native-image/metadata/#specifying-reflection-metadata-in-json) and
[serialization json](https://www.graalvm.org/latest/reference-manual/native-image/metadata/#serialization), which is
very tedious, cumbersome and inconvenient. When using fury, you just need to invoke
`io.fury.Fury.register(Class<?>, boolean)` for every type you want to serialize.
`org.apache.fury.Fury.register(Class<?>, boolean)` for every type you want to serialize.

Note that Fury `asyncCompilationEnabled` option will be disabled automatically for graalvm native image since graalvm
native image doesn't support JIT at the image run time.

## Not thread-safe Fury
Example:
```java
import io.fury.Fury;
import io.fury.util.Preconditions;
import org.apache.fury.Fury;
import org.apache.fury.util.Preconditions;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -62,17 +62,17 @@ public class Example {
}
}
```
Then add `io.fury.graalvm.Example` build time init to `native-image.properties` configuration:
Then add `org.apache.fury.graalvm.Example` build time init to `native-image.properties` configuration:
```properties
Args = --initialize-at-build-time=io.fury.graalvm.Example
Args = --initialize-at-build-time=org.apache.fury.graalvm.Example
```

## Thread-safe Fury
```java
import io.fury.Fury;
import io.fury.ThreadLocalFury;
import io.fury.ThreadSafeFury;
import io.fury.util.Preconditions;
import org.apache.fury.Fury;
import org.apache.fury.ThreadLocalFury;
import org.apache.fury.ThreadSafeFury;
import org.apache.fury.util.Preconditions;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -108,15 +108,15 @@ public class ThreadSafeExample {
}
}
```
Then add `io.fury.graalvm.ThreadSafeExample` build time init to `native-image.properties` configuration:
Then add `org.apache.fury.graalvm.ThreadSafeExample` build time init to `native-image.properties` configuration:
```properties
Args = --initialize-at-build-time=io.fury.graalvm.ThreadSafeExample
Args = --initialize-at-build-time=org.apache.fury.graalvm.ThreadSafeExample
```

## Framework Integration
For framework developers, if you want to integrate fury for serialization, you can provided a configuration file to let
the users to list all the classes they want to serialize, then you can load those classes and invoke
`io.fury.Fury.register(Class<?>, boolean)` to register those classes in your Fury integration class, and configure that
`org.apache.fury.Fury.register(Class<?>, boolean)` to register those classes in your Fury integration class, and configure that
class be initialized at graalvm native image build time.

## Benchmark
Expand All @@ -130,7 +130,7 @@ When Fury compression is enabled:
- Struct: Fury is `24x speed, 31% size` compared to JDK.
- Pojo: Fury is `12x speed, 48% size` compared to JDK.

See [[Benchmark.java](../../integration_tests/graalvm_tests/src/main/java/io/fury/graalvm/Benchmark.java)] for benchmark code.
See [[Benchmark.java](../../integration_tests/graalvm_tests/src/main/java/org/apache/fury/graalvm/Benchmark.java)] for benchmark code.

### Struct Benchmark
#### Class Fields
Expand All @@ -154,7 +154,7 @@ public class Struct implements Serializable {
No compression:
```
Benchmark repeat number: 400000
Object type: class io.fury.graalvm.Struct
Object type: class org.apache.fury.graalvm.Struct
Compress number: false
Fury size: 76.0
JDK size: 178.0
Expand All @@ -166,7 +166,7 @@ Compare size: Fury is 0.43x size of JDK
Compress number:
```
Benchmark repeat number: 400000
Object type: class io.fury.graalvm.Struct
Object type: class org.apache.fury.graalvm.Struct
Compress number: true
Fury size: 55.0
JDK size: 178.0
Expand All @@ -190,7 +190,7 @@ public class Foo implements Serializable {
No compression:
```
Benchmark repeat number: 400000
Object type: class io.fury.graalvm.Foo
Object type: class org.apache.fury.graalvm.Foo
Compress number: false
Fury size: 541.0
JDK size: 964.0
Expand All @@ -202,7 +202,7 @@ Compare size: Fury is 0.56x size of JDK
Compress number:
```
Benchmark repeat number: 400000
Object type: class io.fury.graalvm.Foo
Object type: class org.apache.fury.graalvm.Foo
Compress number: true
Fury size: 459.0
JDK size: 964.0
Expand Down
30 changes: 15 additions & 15 deletions docs/guide/java_object_graph_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Fury for single-thread usage:
import java.util.List;
import java.util.Arrays;

import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;

public class Example {
public static void main(String[] args) {
Expand All @@ -48,8 +48,8 @@ Fury for multiple-thread usage:
import java.util.List;
import java.util.Arrays;

import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;

public class Example {
public static void main(String[] args) {
Expand All @@ -74,8 +74,8 @@ Fury instances reuse example:
import java.util.List;
import java.util.Arrays;

import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;

public class Example {
// reuse fury.
Expand Down Expand Up @@ -244,7 +244,7 @@ fury.register(SomeClass1.class, 200);
```

If you invoke `FuryBuilder#requireClassRegistration(false)` to disable class registration check,
you can set `io.fury.resolver.ClassChecker` by `ClassResolver#setClassChecker` to control which classes are allowed
you can set `org.apache.fury.resolver.ClassChecker` by `ClassResolver#setClassChecker` to control which classes are allowed
for serialization. For example,you can allow classes started with `org.example.*` by:
```java
Fury fury = xxx;
Expand All @@ -261,7 +261,7 @@ ThreadSafeFury fury = new ThreadLocalFury(classLoader -> {
checker.allowClass("org.example.*");
```

Fury also provided a `io.fury.resolver.AllowListChecker` which is white/blacklist based checker to simplify
Fury also provided a `org.apache.fury.resolver.AllowListChecker` which is white/blacklist based checker to simplify
the customization of class check mechanism. You can use this checker or implement more sophisticated checker by yourself.

### Serializer Registration
Expand All @@ -273,10 +273,10 @@ Or implement `java.io.Externalizable` for a class.
### Zero-Copy Serialization

```java
import io.fury.*;
import io.fury.config.*;
import io.fury.serializers.BufferObject;
import io.fury.memory.MemoryBuffer;
import org.apache.fury.*;
import org.apache.fury.config.*;
import org.apache.fury.serializers.BufferObject;
import org.apache.fury.memory.MemoryBuffer;

import java.util.*;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -355,7 +355,7 @@ returned.
### JDK migration

If you use jdk serialization before, and you can't upgrade your client and server at the same time, which is common for
online application. Fury provided an util method `io.fury.serializer.JavaSerializer.serializedByJDK` to check whether
online application. Fury provided an util method `org.apache.fury.serializer.JavaSerializer.serializedByJDK` to check whether
the binary are generated by jdk serialization, you use following pattern to make exiting serialization protocol-aware,
then upgrade serialization to fury in an async rolling-up way:

Expand Down Expand Up @@ -396,10 +396,10 @@ no need to `versioning` the data.

## Trouble shooting
### Class inconsistency and class version check
If you create fury without setting `CompatibleMode` to `io.fury.config.CompatibleMode.COMPATIBLE`, and you got a strange
If you create fury without setting `CompatibleMode` to `org.apache.fury.config.CompatibleMode.COMPATIBLE`, and you got a strange
serialization error, it may be caused by class inconsistency between serialization peer and deserialization peer.

In such cases, you can invoke `FuryBuilder#withClassVersionCheck` to create fury to validate it, if deserialization throws `io.fury.exception.ClassNotCompatibleException`, it shows class are inconsistent, and you should create fury with
In such cases, you can invoke `FuryBuilder#withClassVersionCheck` to create fury to validate it, if deserialization throws `org.apache.fury.exception.ClassNotCompatibleException`, it shows class are inconsistent, and you should create fury with
`FuryBuilder#withCompaibleMode(CompatibleMode.COMPATIBLE)`.

`CompatibleMode.COMPATIBLE` has more performance and space cost, do not set it by default if your classes are always consistent between serialization and deserialization.
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/scala_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Scala 2 and 3 are both supported.

## Install
```sbt
libraryDependencies += "org.furyio" % "fury-core" % "0.4.1"
libraryDependencies += "org.apache.fury" % "fury-core" % "0.4.1"
```

## Fury creation
Expand Down Expand Up @@ -112,7 +112,7 @@ Scala `pojo/bean/case/object` are supported by fury jit well, the performance is

Scala collections and generics doesn't follow java collection framework, and is not fully integrated with Fury JIT in current release version. The performance won't be as good as fury collections serialization for java.

The execution for scala collections will invoke Java serialization API `writeObject/readObject/writeReplace/readResolve/readObjectNoData/Externalizable` with fury `ObjectStream` implementation. Although `io.fury.serializer.ObjectStreamSerializer` is much faster than JDK `ObjectOutputStream/ObjectInputStream`, but it still doesn't know how use scala collection generics.
The execution for scala collections will invoke Java serialization API `writeObject/readObject/writeReplace/readResolve/readObjectNoData/Externalizable` with fury `ObjectStream` implementation. Although `org.apache.fury.serializer.ObjectStreamSerializer` is much faster than JDK `ObjectOutputStream/ObjectInputStream`, but it still doesn't know how use scala collection generics.

In future we plan to provide more optimization for scala types, see https://github.com/apache/incubator-fury/issues/682, stay tuned!

Expand Down
24 changes: 12 additions & 12 deletions docs/guide/xlang_object_graph_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Common types can be serialized automatically: primitive numeric types, string, b
**Java**

```java
import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;

import java.util.*;

Expand Down Expand Up @@ -131,8 +131,8 @@ Serializing user-defined types needs registering the custom type using the regis
**Java**

```java
import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;
import java.util.*;

public class Example2 {
Expand Down Expand Up @@ -176,7 +176,7 @@ public class Example2 {
return obj;
}

// mvn exec:java -Dexec.mainClass="io.fury.examples.Example2"
// mvn exec:java -Dexec.mainClass="org.apache.fury.examples.Example2"
public static void main(String[] args) {
Fury fury = Fury.builder().withLanguage(Language.XLANG).build();
fury.register(SomeClass1.class, "example.SomeClass1");
Expand Down Expand Up @@ -400,8 +400,8 @@ Shared reference and circular reference can be serialized automatically, no dupl
**Java**

```java
import io.fury.*;
import io.fury.config.*;
import org.apache.fury.*;
import org.apache.fury.config.*;
import java.util.*;

public class ReferenceExample {
Expand All @@ -419,7 +419,7 @@ public class ReferenceExample {
return obj;
}

// mvn exec:java -Dexec.mainClass="io.fury.examples.ReferenceExample"
// mvn exec:java -Dexec.mainClass="org.apache.fury.examples.ReferenceExample"
public static void main(String[] args) {
Fury fury = Fury.builder().withLanguage(Language.XLANG)
.withRefTracking(true).build();
Expand Down Expand Up @@ -521,10 +521,10 @@ Reference cannot be implemented because of rust ownership restrictions
**Java**

```java
import io.fury.*;
import io.fury.config.*;
import io.fury.serializers.BufferObject;
import io.fury.memory.MemoryBuffer;
import org.apache.fury.*;
import org.apache.fury.config.*;
import org.apache.fury.serializers.BufferObject;
import org.apache.fury.memory.MemoryBuffer;

import java.util.*;
import java.util.stream.Collectors;
Expand Down
Loading
Loading