@Override protected void doInit(Map<String, ?> config) { schemaCache = CacheBuilder.newBuilder() .maximumSize(getCacheMaxSize(config)) .expireAfterAccess(getCacheExpiryInSecs(config), TimeUnit.SECONDS) .build(new CacheLoader<SchemaVersionKey, S>() { @Override public S load(SchemaVersionKey schemaVersionKey) { try { return getParsedSchema(schemaVersionKey); } catch (SchemaNotFoundException | InvalidSchemaException e) { throw new RegistryException(e); } } }); }