congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CacheLongKeyLIRS.getSegmentIndex
Code IndexAdd Tabnine 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)

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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now