congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CacheManager.getMaximumHeapSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getMaximumHeapSize
method
in
org.locationtech.geogig.storage.cache.CacheManager

Best Java code snippets using org.locationtech.geogig.storage.cache.CacheManager.getMaximumHeapSize (Showing top 18 results out of 315)

origin: org.locationtech.geogig/geogig-core

long getAbsoluteMaximumSize() {
  double maxMemory = getMaximumHeapSize();
  return (long) (maxMemory * 0.9);
}
origin: locationtech/geogig

long getAbsoluteMaximumSize() {
  double maxMemory = getMaximumHeapSize();
  return (long) (maxMemory * 0.9);
}
origin: locationtech/geogig

long getCacheSizePercent(double percent) {
  checkArgument(percent >= 0d && percent <= 0.9,
      "percent must be between zero and 90% (0.9)");
  final long maxMemory = getMaximumHeapSize();
  // Use up to 10% of the heap by default
  return (long) (maxMemory * percent);
}
origin: org.locationtech.geogig/geogig-core

long getCacheSizePercent(double percent) {
  checkArgument(percent >= 0d && percent <= 0.9,
      "percent must be between zero and 90% (0.9)");
  final long maxMemory = getMaximumHeapSize();
  // Use up to 10% of the heap by default
  return (long) (maxMemory * percent);
}
origin: locationtech/geogig

@Override
public double getMaximumSizePercent() {
  final long maxMemory = getMaximumHeapSize();
  double percent = (double) getMaximumSize() / maxMemory;
  return percent;
}
origin: org.locationtech.geogig/geogig-core

@Override
public double getMaximumSizePercent() {
  final long maxMemory = getMaximumHeapSize();
  double percent = (double) getMaximumSize() / maxMemory;
  return percent;
}
origin: org.locationtech.geogig/geogig-core

public @Test void resolveDefaultMaxSizeInvalidTooBigArgumentFallsBackToDefaultPercent() {
  final long maxHeapSize = 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  doReturn("1025").when(cacheManager).getMaximumSizeSystemProperty();
  doReturn("1.5K").when(cacheManager).getMaximumSizeEnvVariable();
  double expected = maxHeapSize * CacheManagerBean.DEFAULT_CACHE_SIZE_PERCENT;
  assertEquals(expected, cacheManager.resolveDefaultMaxSize(), 1e-9);
}
origin: locationtech/geogig

public @Test void getAbsoluteMaximumSizeMB() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals("AbsoluteMaximumSizeMB should be 90% of max heap size", 9,
      cacheManager.getAbsoluteMaximumSizeMB(), 1e-9);
}
origin: locationtech/geogig

public @Test void getDefaultSizeMB() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  doReturn("").when(cacheManager).getMaximumSizeSystemProperty();
  doReturn("").when(cacheManager).getMaximumSizeEnvVariable();
  double expected = 10 * CacheManagerBean.DEFAULT_CACHE_SIZE_PERCENT;
  assertEquals(expected, cacheManager.getDefaultSizeMB(), 1e-9);
}
origin: org.locationtech.geogig/geogig-core

public @Test void getAbsoluteMaximumSizeMB() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals("AbsoluteMaximumSizeMB should be 90% of max heap size", 9,
      cacheManager.getAbsoluteMaximumSizeMB(), 1e-9);
}
origin: locationtech/geogig

public @Test void resolveDefaultMaxSizeInvalidTooBigArgumentFallsBackToDefaultPercent() {
  final long maxHeapSize = 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  doReturn("1025").when(cacheManager).getMaximumSizeSystemProperty();
  doReturn("1.5K").when(cacheManager).getMaximumSizeEnvVariable();
  double expected = maxHeapSize * CacheManagerBean.DEFAULT_CACHE_SIZE_PERCENT;
  assertEquals(expected, cacheManager.resolveDefaultMaxSize(), 1e-9);
}
origin: org.locationtech.geogig/geogig-core

public @Test void getDefaultSizeMB() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  doReturn("").when(cacheManager).getMaximumSizeSystemProperty();
  doReturn("").when(cacheManager).getMaximumSizeEnvVariable();
  double expected = 10 * CacheManagerBean.DEFAULT_CACHE_SIZE_PERCENT;
  assertEquals(expected, cacheManager.getDefaultSizeMB(), 1e-9);
}
origin: locationtech/geogig

public @Test void getCacheSizePercent() {
  final long maxHeapSize = 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals(0L, cacheManager.getCacheSizePercent(0));
  assertEquals(maxHeapSize / 2, cacheManager.getCacheSizePercent(0.5));
}
origin: org.locationtech.geogig/geogig-core

public @Test void getCacheSizePercent() {
  final long maxHeapSize = 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals(0L, cacheManager.getCacheSizePercent(0));
  assertEquals(maxHeapSize / 2, cacheManager.getCacheSizePercent(0.5));
}
origin: locationtech/geogig

public @Test void parseCacheSizeValidPercent() {
  final long maxHeapSize = 1000;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals(0L, cacheManager.parseCacheSizeArgument("0"));
  assertEquals(100L, cacheManager.parseCacheSizeArgument("0.1"));
  assertEquals(500L, cacheManager.parseCacheSizeArgument(".5"));
  assertEquals(900L, cacheManager.parseCacheSizeArgument("0.9"));
}
origin: org.locationtech.geogig/geogig-core

public @Test void parseCacheSizeValidPercent() {
  final long maxHeapSize = 1000;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  assertEquals(0L, cacheManager.parseCacheSizeArgument("0"));
  assertEquals(100L, cacheManager.parseCacheSizeArgument("0.1"));
  assertEquals(500L, cacheManager.parseCacheSizeArgument(".5"));
  assertEquals(900L, cacheManager.parseCacheSizeArgument("0.9"));
}
origin: locationtech/geogig

public @Test void setMaximumSizePercent() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  cacheManager.setMaximumSizePercent(0.0);
  assertEquals(0, cacheManager.getMaximumSize(), 1e-9);
  cacheManager.setMaximumSizePercent(0.1);
  assertEquals(maxHeapSize * 0.1, cacheManager.getMaximumSize(), 1e-9);
  cacheManager.setMaximumSizePercent(0.9);
  assertEquals(maxHeapSize * 0.9, cacheManager.getMaximumSize(), 1e-9);
  ex.expect(IllegalArgumentException.class);
  cacheManager.setMaximumSizePercent(0.91);
}
origin: org.locationtech.geogig/geogig-core

public @Test void setMaximumSizePercent() {
  final long maxHeapSize = 10 * 1024 * 1024;
  doReturn(maxHeapSize).when(cacheManager).getMaximumHeapSize();
  cacheManager.setMaximumSizePercent(0.0);
  assertEquals(0, cacheManager.getMaximumSize(), 1e-9);
  cacheManager.setMaximumSizePercent(0.1);
  assertEquals(maxHeapSize * 0.1, cacheManager.getMaximumSize(), 1e-9);
  cacheManager.setMaximumSizePercent(0.9);
  assertEquals(maxHeapSize * 0.9, cacheManager.getMaximumSize(), 1e-9);
  ex.expect(IllegalArgumentException.class);
  cacheManager.setMaximumSizePercent(0.91);
}
org.locationtech.geogig.storage.cacheCacheManagergetMaximumHeapSize

Popular methods of CacheManager

  • acquire
    Returns a RevObject cache Multiple invocations of this method for the same key are guaranteed to ret
  • getCacheSizePercent
  • getMaximumSize
  • getMaximumSizeEnvVariable
  • getMaximumSizeSystemProperty
  • getSizeBytes
  • parseCacheSizeArgument
    Format: * {float} between 0 and 0.9: Size as percentage of available heap (e.g. 0 for zero cache
  • release
    Indicates the client code that obtained the ObjectCache through the #acquiremethod does no longer ne
  • resolveDefaultMaxSize
    Resolves the default maximum cache size in bytes. If it's given by a valid value of the GEOGIG_CACHE
  • setMaximumSize
  • sharedCache
  • <init>
  • sharedCache,
  • <init>,
  • clear,
  • create,
  • doRelease,
  • getAbsoluteMaximumSize,
  • getAbsoluteMaximumSizeMB,
  • getDefaultSizeMB,
  • getEvictionCount

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • findViewById (Activity)
  • setContentView (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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