congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CacheLongKeyLIRS.resizeIfNeeded
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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: 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

/**
 * 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-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);
  }
}
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);
  }
}
org.h2.mvstore.cacheCacheLongKeyLIRSresizeIfNeeded

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
  • getSegmentIndex
  • getSegment,
  • getSegmentIndex,
  • keySet,
  • setMaxMemory,
  • size,
  • sizeOf,
  • getMaxItemSize

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Github Copilot alternatives
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