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

feat(C++): Enable Windows C++ CI and fix some compilation errors #1326

Closed
wants to merge 1 commit into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -305,33 +304,26 @@ public void initialize() {

private void addDefaultSerializers() {
// primitive types will be boxed.
addDefaultSerializer(String.class, new StringSerializer(fury));
StringSerializer.registerDefaultSerializers(fury);
PrimitiveSerializers.registerDefaultSerializers(fury);
Serializers.registerDefaultSerializers(fury);
ArraySerializers.registerDefaultSerializers(fury);
TimeSerializers.registerDefaultSerializers(fury);
OptionalSerializers.registerDefaultSerializers(fury);
CollectionSerializers.registerDefaultSerializers(fury);
MapSerializers.registerDefaultSerializers(fury);
addDefaultSerializer(Locale.class, new LocaleSerializer(fury));
addDefaultSerializer(
LambdaSerializer.ReplaceStub.class,
new LambdaSerializer(fury, LambdaSerializer.ReplaceStub.class));
addDefaultSerializer(
JdkProxySerializer.ReplaceStub.class,
new JdkProxySerializer(fury, JdkProxySerializer.ReplaceStub.class));
addDefaultSerializer(
ReplaceResolveSerializer.ReplaceStub.class,
new ReplaceResolveSerializer(fury, ReplaceResolveSerializer.ReplaceStub.class));
LocaleSerializer.registerDefaultSerializers(fury);
LambdaSerializer.registerDefaultSerializers(fury);
JdkProxySerializer.registerDefaultSerializers(fury);
ReplaceResolveSerializer.registerDefaultSerializers(fury);
SynchronizedSerializers.registerSerializers(fury);
UnmodifiableSerializers.registerSerializers(fury);
ImmutableCollectionSerializers.registerSerializers(fury);
if (fury.getConfig().registerGuavaTypes()) {
GuavaCollectionSerializers.registerDefaultSerializers(fury);
}
if (metaContextShareEnabled) {
addDefaultSerializer(
UnexistedMetaSharedClass.class, new UnexistedClassSerializer(fury, null));
UnexistedClassSerializer.registerDefaultSerializers(fury);
// Those class id must be known in advance, here is two bytes, so
// `UnexistedClassSerializer.writeClassDef`
// can overwrite written classinfo and replace with real classinfo.
Expand All @@ -343,15 +335,6 @@ private void addDefaultSerializers() {
}
}

private void addDefaultSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
addDefaultSerializer(type, Serializers.newSerializer(fury, type, serializerClass));
}

private void addDefaultSerializer(Class type, Serializer serializer) {
registerSerializer(type, serializer);
register(type);
}

/** Register common class ahead to get smaller class id for serialization. */
private void registerCommonUsedClasses() {
register(Class.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,11 @@ public Object read(MemoryBuffer buffer) {
return proxy;
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(
JdkProxySerializer.ReplaceStub.class,
new JdkProxySerializer(fury, JdkProxySerializer.ReplaceStub.class));
}

public static class ReplaceStub {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ private Serializer getDataSerializer() {
return dataSerializer;
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(
LambdaSerializer.ReplaceStub.class,
new LambdaSerializer(fury, LambdaSerializer.ReplaceStub.class));
}

/**
* Class name of dynamic generated class is not fixed, so we use a stub class to mock dynamic
* class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ static boolean isSame(Locale locale, String language, String country, String var
&& locale.getCountry().equals(country)
&& locale.getVariant().equals(variant));
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(Locale.class, new LocaleSerializer(fury));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,10 @@ private Object readObject(MemoryBuffer buffer) {
return o;
}
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(
ReplaceResolveSerializer.ReplaceStub.class,
new ReplaceResolveSerializer(fury, ReplaceResolveSerializer.ReplaceStub.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,8 @@ public String readUTF8String(MemoryBuffer buffer) {
return new String(tmpArray, 0, numBytes, StandardCharsets.UTF_8);
}
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(String.class, new StringSerializer(fury));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,10 @@ public Object read(MemoryBuffer buffer) {
obj.setEntries(entries);
return obj;
}

public static void registerDefaultSerializers(Fury fury) {
fury.registerSerializer(
UnexistedMetaSharedClass.class, new UnexistedClassSerializer(fury, null));
}
}
}
Loading