}
};
private ResolvingDecoder getResolver(Schema actual, Schema expected)
throws IOException {
ResolvingDecoder resolver = threadResolver.get();
if (resolver != null)
return resolver;
Map<Schema,ResolvingDecoder> cache = RESOLVER_CACHE.get().get(actual);
if (cache == null) {
cache = new WeakIdentityHashMap<Schema,ResolvingDecoder>();
RESOLVER_CACHE.get().put(actual, cache);
}
resolver = cache.get(expected);
if (resolver == null) {
resolver = new ResolvingDecoder(Schema.applyAliases(actual, expected),
expected, null);
cache.put(expected, resolver);
}
threadResolver.set(resolver);
return resolver;