Codota Logo
CacheLongKeyLIRS.getSegmentIndex
Code IndexAdd Codota to your IDE (free)

How to use
getSegmentIndex
method
in
org.h2.mvstore.cache.CacheLongKeyLIRS

Best Java code snippets using org.h2.mvstore.cache.CacheLongKeyLIRS.getSegmentIndex (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: com.h2database/h2

private Segment<V> getSegment(int hash) {
  return segments[getSegmentIndex(hash)];
}
origin: com.h2database/h2

/**
 * Remove an entry. Both resident and non-resident entries can be
 * removed.
 *
 * @param key the key (may not be null)
 * @return the old value, or null if there was no resident entry
 */
public V remove(long key) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.remove(key, hash);
  }
}
origin: com.h2database/h2

/**
 * Add an entry to the cache. The entry may or may not exist in the
 * cache yet. This method will usually mark unknown entries as cold and
 * known entries as hot.
 *
 * @param key the key (may not be null)
 * @param value the value (may not be null)
 * @param memory the memory used for the given entry
 * @return the old value, or null if there was no resident entry
 */
public V put(long key, V value, int memory) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.put(key, hash, value, memory);
  }
}
origin: org.wowtools/h2

private Segment<V> getSegment(int hash) {
  return segments[getSegmentIndex(hash)];
}
origin: com.eventsourcing/h2

private Segment<V> getSegment(int hash) {
  return segments[getSegmentIndex(hash)];
}
origin: com.h2database/h2-mvstore

private Segment<V> getSegment(int hash) {
  return segments[getSegmentIndex(hash)];
}
origin: com.h2database/h2-mvstore

/**
 * Remove an entry. Both resident and non-resident entries can be
 * removed.
 *
 * @param key the key (may not be null)
 * @return the old value, or null if there was no resident entry
 */
public V remove(long key) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.remove(key, hash);
  }
}
origin: com.eventsourcing/h2

/**
 * Add an entry to the cache. The entry may or may not exist in the
 * cache yet. This method will usually mark unknown entries as cold and
 * known entries as hot.
 *
 * @param key the key (may not be null)
 * @param value the value (may not be null)
 * @param memory the memory used for the given entry
 * @return the old value, or null if there was no resident entry
 */
public V put(long key, V value, int memory) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.put(key, hash, value, memory);
  }
}
origin: org.wowtools/h2

/**
 * Remove an entry. Both resident and non-resident entries can be
 * removed.
 *
 * @param key the key (may not be null)
 * @return the old value, or null if there was no resident entry
 */
public V remove(long key) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.remove(key, hash);
  }
}
origin: com.eventsourcing/h2

/**
 * Remove an entry. Both resident and non-resident entries can be
 * removed.
 *
 * @param key the key (may not be null)
 * @return the old value, or null if there was no resident entry
 */
public V remove(long key) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.remove(key, hash);
  }
}
origin: org.wowtools/h2

/**
 * Add an entry to the cache. The entry may or may not exist in the
 * cache yet. This method will usually mark unknown entries as cold and
 * known entries as hot.
 *
 * @param key the key (may not be null)
 * @param value the value (may not be null)
 * @param memory the memory used for the given entry
 * @return the old value, or null if there was no resident entry
 */
public V put(long key, V value, int memory) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.put(key, hash, value, memory);
  }
}
origin: com.h2database/h2-mvstore

/**
 * Add an entry to the cache. The entry may or may not exist in the
 * cache yet. This method will usually mark unknown entries as cold and
 * known entries as hot.
 *
 * @param key the key (may not be null)
 * @param value the value (may not be null)
 * @param memory the memory used for the given entry
 * @return the old value, or null if there was no resident entry
 */
public V put(long key, V value, int memory) {
  int hash = getHash(key);
  int segmentIndex = getSegmentIndex(hash);
  Segment<V> s = segments[segmentIndex];
  // check whether resize is required: synchronize on s, to avoid
  // concurrent resizes (concurrent reads read
  // from the old segment)
  synchronized (s) {
    s = resizeIfNeeded(s, segmentIndex);
    return s.put(key, hash, value, memory);
  }
}
org.h2.mvstore.cacheCacheLongKeyLIRSgetSegmentIndex

Popular methods of CacheLongKeyLIRS

  • <init>
    Create a new cache with the given memory size.
  • clear
    Remove all entries.
  • get
    Get the value for the given key if the entry is cached. This method adjusts the internal state of th
  • getMaxMemory
    Get the maximum memory to use.
  • getUsedMemory
    Get the currently used memory.
  • put
    Add an entry to the cache. The entry may or may not exist in the cache yet. This method will usually
  • remove
    Remove an entry. Both resident and non-resident entries can be removed.
  • find
  • getHash
    Get the hash code for the given key. The hash code is further enhanced to spread the values more eve
  • getMap
    Convert this cache to a map.
  • getSegment
  • keySet
    Get the set of keys for resident entries.
  • getSegment,
  • keySet,
  • resizeIfNeeded,
  • setMaxMemory,
  • size,
  • sizeOf,
  • getMaxItemSize

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JComboBox (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now