@Override public SmallLRUCache<String, String[]> getLobFileListCache() { if (lobFileListCache == null) { lobFileListCache = SmallLRUCache.newInstance(128); } return lobFileListCache; }
/** * Create a new object with all elements of the given collection. * * @param <K> the key type * @param <V> the value type * @param size the number of elements * @return the object */ public static <K, V> SmallLRUCache<K, V> newInstance(int size) { return new SmallLRUCache<K, V>(size); }
if (queryCacheSize > 0) { if (queryCache == null) { queryCache = SmallLRUCache.newInstance(queryCacheSize); modificationMetaID = database.getModificationMetaId(); } else { long newModificationMetaID = database.getModificationMetaId(); if (newModificationMetaID != modificationMetaID) { queryCache.clear(); modificationMetaID = newModificationMetaID; ps = queryCache.get(sql); if (ps != null && ps.canReuse()) { ps.reuse(); if (queryCache != null) { if (ps.isCacheable()) { queryCache.put(sql, ps);
lobs = SmallLRUCache.newInstance( Math.max(SysProperties.SERVER_CACHED_OBJECTS, SysProperties.SERVER_RESULT_SET_FETCH_SIZE * 5)); CachedInputStream in = lobs.get(lobId); if (in == null) { in = new CachedInputStream(null); lobs.put(lobId, in); InputStream lobIn = lobStorage.getInputStream(lob, hmac, -1); in = new CachedInputStream(lobIn); lobs.put(lobId, in); lobIn.skip(offset);
private synchronized void init(String querySQL, ArrayList<CommandParameter> params, String[] columnNames, ServerSession session, boolean recursive) { this.querySQL = querySQL; this.columnNames = columnNames; this.recursive = recursive; index = new ViewIndex(this, querySQL, params, recursive); SynchronizedVerifier.check(indexCache); indexCache.clear(); initColumnsAndTables(session); }
@Override protected boolean removeEldestEntry(Map.Entry<K, V> eldest) { return size() > size; }
indexCache.clear(); initColumnsAndTables(session); if (views != null) {
@Override public Index getScanIndex(ServerSession session) { if (createException != null) { String msg = createException.getMessage(); throw DbException.get(ErrorCode.VIEW_IS_INVALID_2, createException, getSQL(), msg); } // PlanItem item = getBestPlanItem(session, null, null, null); // return item.getIndex(); IntArray masksArray = new IntArray(Utils.EMPTY_INT_ARRAY); SynchronizedVerifier.check(indexCache); ViewIndex i2 = indexCache.get(masksArray); if (i2 == null || i2.getSession() != session) { i2 = new ViewIndex(this, index, session, null); indexCache.put(masksArray, i2); } return i2; }
protected CompareModeDefault(String name, int strength, boolean binaryUnsigned) { super(name, strength, binaryUnsigned); collator = CompareMode.getCollator(name); if (collator == null) { throw DbException.throwInternalError(name); } collator.setStrength(strength); int cacheSize = SysProperties.COLLATOR_CACHE_SIZE; if (cacheSize != 0) { collationKeys = SmallLRUCache.newInstance(cacheSize); } else { collationKeys = null; } }