|
|
|
@ -17,14 +17,14 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.remote.serialize; |
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
|
|
import io.protostuff.LinkedBuffer; |
|
|
|
|
import io.protostuff.ProtostuffIOUtil; |
|
|
|
|
import io.protostuff.Schema; |
|
|
|
|
import io.protostuff.runtime.RuntimeSchema; |
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* ProtoStuffUtils |
|
|
|
|
*/ |
|
|
|
@ -49,14 +49,7 @@ public class ProtoStuffUtils {
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
private static <T> Schema<T> getSchema(Class<T> clazz) { |
|
|
|
|
Schema<T> schema = (Schema<T>) schemaCache.get(clazz); |
|
|
|
|
if (schema == null) { |
|
|
|
|
schema = RuntimeSchema.getSchema(clazz); |
|
|
|
|
if (schema != null) { |
|
|
|
|
schemaCache.put(clazz, schema); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return schema; |
|
|
|
|
return (Schema<T>) schemaCache.computeIfAbsent(clazz, RuntimeSchema::createFrom); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static <T> T deserialize(byte[] bytes, Class<T> clazz) { |
|
|
|
|