Skip to content

Commit

Permalink
Gson serializes packages that skip the disruptor
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinKirs committed Aug 1, 2023
1 parent fc1f216 commit 708814f
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,21 @@ public class GsonUtils {
.registerTypeAdapter(ImmutableMap.class, new ImmutableMapDeserializer())
.registerTypeAdapter(AtomicBoolean.class, new AtomicBooleanAdapter())
.registerTypeAdapter(PartitionKey.class, new PartitionKey.PartitionKeySerializer())
.registerTypeAdapter(Range.class, new RangeUtils.RangeSerializer());
.registerTypeAdapter(Range.class, new RangeUtils.RangeSerializer()).setExclusionStrategies(
new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return false;
}

@Override
public boolean shouldSkipClass(Class<?> clazz) {
/* due to java.lang.IllegalArgumentException: com.lmax.disruptor.RingBuffer
<org.apache.doris.scheduler.disruptor.TimerTaskEvent> declares multiple
JSON fields named p1 */
return clazz.getName().startsWith("com.lmax.disruptor.RingBuffer");
}
});

private static final GsonBuilder GSON_BUILDER_PRETTY_PRINTING = GSON_BUILDER.setPrettyPrinting();

Expand Down

0 comments on commit 708814f

Please sign in to comment.