/** * Creates a new fastest {@link ConcurrentMap} implementaion for the current platform. */ public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap() { if (CAN_USE_CHM_V8) { return new ConcurrentHashMapV8<K, V>(); } else { return new ConcurrentHashMap<K, V>(); } }
/** * Creates a new fastest {@link ConcurrentMap} implementaion for the current platform. */ public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity) { if (CAN_USE_CHM_V8) { return new ConcurrentHashMapV8<K, V>(initialCapacity); } else { return new ConcurrentHashMap<K, V>(initialCapacity); } }
/** * Creates a new fastest {@link ConcurrentMap} implementaion for the current platform. */ public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity, float loadFactor) { if (CAN_USE_CHM_V8) { return new ConcurrentHashMapV8<K, V>(initialCapacity, loadFactor); } else { return new ConcurrentHashMap<K, V>(initialCapacity, loadFactor); } }
/** * Creates a new fastest {@link ConcurrentMap} implementaion for the current platform. */ public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap( int initialCapacity, float loadFactor, int concurrencyLevel) { if (CAN_USE_CHM_V8) { return new ConcurrentHashMapV8<K, V>(initialCapacity, loadFactor, concurrencyLevel); } else { return new ConcurrentHashMap<K, V>(initialCapacity, loadFactor, concurrencyLevel); } }
/** * Creates a new fastest {@link ConcurrentMap} implementaion for the current platform. */ public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap(Map<? extends K, ? extends V> map) { if (CAN_USE_CHM_V8) { return new ConcurrentHashMapV8<K, V>(map); } else { return new ConcurrentHashMap<K, V>(map); } }
/** * Creates a new MetricMeta * @param hashCode The meta's long hash code * @param name The name of the meta pair to initialize with * @param value The value of the meta pair to initialize with */ MetricMeta(final long hashCode, final String name, final String value) { this.hashCode = hashCode; pairs = new ConcurrentHashMapV8<String, String>(8); addPair(name, value); lastUpdate.set(System.currentTimeMillis()); }