/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject using 'seenSchemas' to resolve circular references */ public synchronized Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas) throws AvroSerdeException { if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString()); if(cache.containsKey(hv)) { if(LOG.isDebugEnabled()) LOG.debug("Returning cache result."); return cache.get(hv); } if(LOG.isDebugEnabled()) LOG.debug("Creating new instance and storing in cache"); Instance instance = makeInstance(hv, seenSchemas); cache.put(hv, instance); return instance; }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject */ public Instance retrieve(SeedObject hv) throws AvroSerdeException { if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString()); if(cache.containsKey(hv.hashCode())) { if(LOG.isDebugEnabled()) LOG.debug("Returning cache result."); return cache.get(hv.hashCode()); } if(LOG.isDebugEnabled()) LOG.debug("Creating new instance and storing in cache"); Instance instance = makeInstance(hv); cache.put(hv.hashCode(), instance); return instance; }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject using 'seenSchemas' to resolve circular references */ public synchronized Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas) throws AvroSerdeException { if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString()); if(cache.containsKey(hv)) { if(LOG.isDebugEnabled()) LOG.debug("Returning cache result."); return cache.get(hv); } if(LOG.isDebugEnabled()) LOG.debug("Creating new instance and storing in cache"); Instance instance = makeInstance(hv, seenSchemas); cache.put(hv, instance); return instance; }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject using 'seenSchemas' to resolve circular references */ public Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas) throws AvroSerdeException { if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString()); if(cache.containsKey(hv.hashCode())) { if(LOG.isDebugEnabled()) LOG.debug("Returning cache result."); return cache.get(hv.hashCode()); } if(LOG.isDebugEnabled()) LOG.debug("Creating new instance and storing in cache"); Instance instance = makeInstance(hv, seenSchemas); cache.put(hv.hashCode(), instance); return instance; }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject using 'seenSchemas' to resolve circular references */ public Instance retrieve(SeedObject hv, Set<SeedObject> seenSchemas) throws AvroSerdeException { if(LOG.isDebugEnabled()) LOG.debug("Checking for hv: " + hv.toString()); if(cache.containsKey(hv.hashCode())) { if(LOG.isDebugEnabled()) LOG.debug("Returning cache result."); return cache.get(hv.hashCode()); } if(LOG.isDebugEnabled()) LOG.debug("Creating new instance and storing in cache"); Instance instance = makeInstance(hv, seenSchemas); cache.put(hv.hashCode(), instance); return instance; }
public V retrieve(K hv, Set<K> seenSchemas) throws AvroSerdeException { V instance = cache.getIfPresent(hv); if (instance == null) { instance = makeInstance(hv, seenSchemas); cache.put(hv, instance); } return instance; }