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

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

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

origin: com.h2database/h2

/**
 * Set the read cache size in MB.
 *
 * @param mb the cache size in MB.
 */
public void setCacheSize(int mb) {
  final long bytes = (long) mb * 1024 * 1024;
  if (cache != null) {
    cache.setMaxMemory(bytes);
    cache.clear();
  }
  if (cacheChunkRef != null) {
    cacheChunkRef.setMaxMemory(bytes / 4);
    cacheChunkRef.clear();
  }
}
origin: com.h2database/h2

/**
 * Create a new cache with the given memory size.
 *
 * @param config the configuration
 */
@SuppressWarnings("unchecked")
public CacheLongKeyLIRS(Config config) {
  setMaxMemory(config.maxMemory);
  this.nonResidentQueueSize = config.nonResidentQueueSize;
  DataUtils.checkArgument(
      Integer.bitCount(config.segmentCount) == 1,
      "The segment count must be a power of 2, is {0}", config.segmentCount);
  this.segmentCount = config.segmentCount;
  this.segmentMask = segmentCount - 1;
  this.stackMoveDistance = config.stackMoveDistance;
  segments = new Segment[segmentCount];
  clear();
  // use the high bits for the segment
  this.segmentShift = 32 - Integer.bitCount(segmentMask);
}
origin: org.wowtools/h2

/**
 * Set the read cache size in MB.
 *
 * @param mb the cache size in MB.
 */
public void setCacheSize(int mb) {
  if (cache != null) {
    cache.setMaxMemory((long) mb * 1024 * 1024);
    cache.clear();
  }
}
origin: com.eventsourcing/h2

/**
 * Set the read cache size in MB.
 *
 * @param mb the cache size in MB.
 */
public void setCacheSize(int mb) {
  if (cache != null) {
    cache.setMaxMemory((long) mb * 1024 * 1024);
    cache.clear();
  }
}
origin: com.h2database/h2-mvstore

/**
 * Set the read cache size in MB.
 *
 * @param mb the cache size in MB.
 */
public void setCacheSize(int mb) {
  final long bytes = (long) mb * 1024 * 1024;
  if (cache != null) {
    cache.setMaxMemory(bytes);
    cache.clear();
  }
  if (cacheChunkRef != null) {
    cacheChunkRef.setMaxMemory(bytes / 4);
    cacheChunkRef.clear();
  }
}
origin: com.eventsourcing/h2

/**
 * Create a new cache with the given memory size.
 *
 * @param config the configuration
 */
@SuppressWarnings("unchecked")
public CacheLongKeyLIRS(Config config) {
  setMaxMemory(config.maxMemory);
  this.nonResidentQueueSize = config.nonResidentQueueSize;
  DataUtils.checkArgument(
      Integer.bitCount(config.segmentCount) == 1,
      "The segment count must be a power of 2, is {0}", config.segmentCount);
  this.segmentCount = config.segmentCount;
  this.segmentMask = segmentCount - 1;
  this.stackMoveDistance = config.stackMoveDistance;
  segments = new Segment[segmentCount];
  clear();
  // use the high bits for the segment
  this.segmentShift = 32 - Integer.bitCount(segmentMask);
}
origin: com.h2database/h2-mvstore

/**
 * Create a new cache with the given memory size.
 *
 * @param config the configuration
 */
@SuppressWarnings("unchecked")
public CacheLongKeyLIRS(Config config) {
  setMaxMemory(config.maxMemory);
  this.nonResidentQueueSize = config.nonResidentQueueSize;
  DataUtils.checkArgument(
      Integer.bitCount(config.segmentCount) == 1,
      "The segment count must be a power of 2, is {0}", config.segmentCount);
  this.segmentCount = config.segmentCount;
  this.segmentMask = segmentCount - 1;
  this.stackMoveDistance = config.stackMoveDistance;
  segments = new Segment[segmentCount];
  clear();
  // use the high bits for the segment
  this.segmentShift = 32 - Integer.bitCount(segmentMask);
}
origin: org.wowtools/h2

/**
 * Create a new cache with the given memory size.
 *
 * @param config the configuration
 */
@SuppressWarnings("unchecked")
public CacheLongKeyLIRS(Config config) {
  setMaxMemory(config.maxMemory);
  this.nonResidentQueueSize = config.nonResidentQueueSize;
  DataUtils.checkArgument(
      Integer.bitCount(config.segmentCount) == 1,
      "The segment count must be a power of 2, is {0}", config.segmentCount);
  this.segmentCount = config.segmentCount;
  this.segmentMask = segmentCount - 1;
  this.stackMoveDistance = config.stackMoveDistance;
  segments = new Segment[segmentCount];
  clear();
  // use the high bits for the segment
  this.segmentShift = 32 - Integer.bitCount(segmentMask);
}
org.h2.mvstore.cacheCacheLongKeyLIRSsetMaxMemory

Javadoc

Set the maximum memory this cache should use. This will not immediately cause entries to get removed however; it will only change the limit. To resize the internal array, call the clear method.

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,
  • resizeIfNeeded,
  • size,
  • sizeOf,
  • getMaxItemSize

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top Sublime Text plugins
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