Looked at the following code, it appears to be thread-safe.
Hoping to use it like
class Foo {
private static final GryoMapper MAPPER = GryoMapper.build().create();
}
instead of
class Foo {
private final GryoMapper MAPPER = GryoMapper.build().create();
}
Gryo is based on Kryo which is not thread-safe.
GryoMapperis basically just a builder forKryoinstances which means that you should be able to initialize it as a member variable without thestaticdeclaration. Just be sure that theKryoinstances that you spawn fromGryoMapperare not accessed by multiple threads concurrently as described in the Kryo link provided.