/** * @see IndexInput#clearCache() */ public void clearCache() { blockCache= new LRUCache(CACHE_SIZE); }
/** * @see IndexInput#clearCache() */ public void clearCache() { blockCache= new LRUCache(CACHE_SIZE); }
public BlocksIndexInput(VDBResource inputFile) { this.indexFile= inputFile; blockCache= new LRUCache(CACHE_SIZE); }
public BlocksIndexInput(VDBResource inputFile) { this.indexFile= inputFile; blockCache= new LRUCache(CACHE_SIZE); }
LocalCache(String cacheName, int maxSize) { cache = Collections.synchronizedMap(new LRUCache<>(maxSize < 0 ? Integer.MAX_VALUE : maxSize)); this.name = cacheName; }
public void setAccessible(AbstractMetadataRecord record, Boolean result) { if (this.globalState.accessible == null) { this.globalState.accessible = new LRUCache<>(1000); } this.globalState.accessible.put(record, result); }
public void setAccessible(AbstractMetadataRecord record, Boolean result) { if (this.globalState.accessible == null) { this.globalState.accessible = new LRUCache<>(1000); } this.globalState.accessible.put(record, result); }
public void setAccessible(AbstractMetadataRecord record, Boolean result) { if (this.globalState.accessible == null) { this.globalState.accessible = new LRUCache<>(1000); } this.globalState.accessible.put(record, result); }
Object setProperty(Object key, Object value) { if (this.getTableData().localCache == null) { this.getTableData().localCache = Collections.synchronizedMap(new LRUCache<Object, Object>(LOCAL_CACHE_SIZE)); } return this.getTableData().localCache.put(key, value); }
Object setProperty(Object key, Object value) { if (this.getTableData().localCache == null) { this.getTableData().localCache = Collections.synchronizedMap(new LRUCache<Object, Object>(LOCAL_CACHE_SIZE)); } return this.getTableData().localCache.put(key, value); }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
Object setProperty(Object key, Object value) { if (this.getTableData().localCache == null) { this.getTableData().localCache = Collections.synchronizedMap(new LRUCache<Object, Object>(LOCAL_CACHE_SIZE)); } return this.getTableData().localCache.put(key, value); }
/** * Compile a regular expression into a {@link java.util.regex.Pattern} and cache it in * the {@link CommandContext} for future use. * * @param context * @param regex Regular expression. * @param flags Bitmask flags like {@link java.util.regex.Pattern#CASE_INSENSITIVE}. * @return Compiled regex. */ public static Pattern getPattern(CommandContext context, String regex, int flags) { Pattern result = null; if (context != null) { if (context.globalState.patternCache == null) { context.globalState.patternCache = new LRUCache<Entry<String,Integer>,Pattern>(32); } else { result = context.globalState.patternCache.get(new SimpleEntry(result, flags)); } } if (result == null) { result = Pattern.compile(regex, flags); if (context != null) { context.globalState.patternCache.put(new SimpleEntry(result, flags), result); } } return result; }
/** * Compile a regular expression into a {@link java.util.regex.Pattern} and cache it in * the {@link CommandContext} for future use. * * @param context * @param regex Regular expression. * @param flags Bitmask flags like {@link java.util.regex.Pattern#CASE_INSENSITIVE}. * @return Compiled regex. */ public static Pattern getPattern(CommandContext context, String regex, int flags) { Pattern result = null; if (context != null) { if (context.globalState.patternCache == null) { context.globalState.patternCache = new LRUCache<Entry<String,Integer>,Pattern>(32); } else { result = context.globalState.patternCache.get(new SimpleEntry(result, flags)); } } if (result == null) { result = Pattern.compile(regex, flags); if (context != null) { context.globalState.patternCache.put(new SimpleEntry(result, flags), result); } } return result; }
public static SimpleDateFormat getDateFormat(CommandContext context, String format) { SimpleDateFormat result = null; if (context != null) { if (context.globalState.dateFormatCache == null) { context.globalState.dateFormatCache = new LRUCache<String, SimpleDateFormat>(32); } else { result = context.globalState.dateFormatCache.get(format); } } if (result == null) { result = new SimpleDateFormat(format); //TODO: could be locale sensitive if (context != null) { context.globalState.dateFormatCache.put(format, result); } } return result; }
/** * Compile a regular expression into a {@link java.util.regex.Pattern} and cache it in * the {@link CommandContext} for future use. * * @param context * @param regex Regular expression. * @param flags Bitmask flags like {@link java.util.regex.Pattern#CASE_INSENSITIVE}. * @return Compiled regex. */ public static Pattern getPattern(CommandContext context, String regex, int flags) { Pattern result = null; if (context != null) { if (context.globalState.patternCache == null) { context.globalState.patternCache = new LRUCache<Entry<String,Integer>,Pattern>(32); } else { result = context.globalState.patternCache.get(new SimpleEntry(result, flags)); } } if (result == null) { result = Pattern.compile(regex, flags); if (context != null) { context.globalState.patternCache.put(new SimpleEntry(result, flags), result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }
public static DecimalFormat getDecimalFormat(CommandContext context, String format) { DecimalFormat result = null; if (context != null) { if (context.globalState.decimalFormatCache == null) { context.globalState.decimalFormatCache = new LRUCache<String, DecimalFormat>(32); } else { result = context.globalState.decimalFormatCache.get(format); } } if (result == null) { result = new DecimalFormat(format); //TODO: could be locale sensitive result.setParseBigDecimal(true); if (context != null) { context.globalState.decimalFormatCache.put(format, result); } } return result; }