/** * {@inheritDoc} */ @Override public InterMineObject internalGetObjectById(Integer id, Class<? extends InterMineObject> clazz) throws ObjectStoreException { InterMineObject retval = super.internalGetObjectById(id, clazz); //Exception e = new Exception("internalGetObjectById called for " // + retval.getClass().toString() + " with id " + id); //e.fillInStackTrace(); //java.io.StringWriter sw = new java.io.StringWriter(); //java.io.PrintWriter pw = new java.io.PrintWriter(sw); //e.printStackTrace(pw); //pw.flush(); //LOG.error(sw.toString()); synchronized (cache) { Exception e = new Exception(); e.fillInStackTrace(); LOG.warn("Probable inefficiency: internalGetObjectById called " + (retval == null ? "" : "to fetch a " + Util.getFriendlyName(retval .getClass())) + " with id " + id + ", clazz " + clazz.toString() + ", cache size = " + cache.size() + " - maybe you should use" + " ObjectStoreFastCollectionsForTranslatorImpl", e); } internalGetObjectByIdCount++; if (internalGetObjectByIdCount % 1000 == 0) { LOG.info("internalGetObjectById run " + internalGetObjectByIdCount + " times"); } return retval; }
/** * {@inheritDoc} */ @Override public InterMineObject internalGetObjectById(Integer id, Class<? extends InterMineObject> clazz) throws ObjectStoreException { InterMineObject retval = super.internalGetObjectById(id, clazz); //Exception e = new Exception("internalGetObjectById called for " // + retval.getClass().toString() + " with id " + id); //e.fillInStackTrace(); //java.io.StringWriter sw = new java.io.StringWriter(); //java.io.PrintWriter pw = new java.io.PrintWriter(sw); //e.printStackTrace(pw); //pw.flush(); //LOG.error(sw.toString()); synchronized (cache) { Exception e = new Exception(); e.fillInStackTrace(); LOG.warn("Probable inefficiency: internalGetObjectById called " + (retval == null ? "" : "to fetch a " + Util.getFriendlyName(retval .getClass())) + " with id " + id + ", clazz " + clazz.toString() + ", cache size = " + cache.size() + " - maybe you should use" + " ObjectStoreFastCollectionsForTranslatorImpl", e); } internalGetObjectByIdCount++; if (internalGetObjectByIdCount % 1000 == 0) { LOG.info("internalGetObjectById run " + internalGetObjectByIdCount + " times"); } return retval; }