Codota Logo
SharedCache.sizeBytes
Code IndexAdd Codota to your IDE (free)

How to use
sizeBytes
method
in
org.locationtech.geogig.storage.cache.SharedCache

Best Java code snippets using org.locationtech.geogig.storage.cache.SharedCache.sizeBytes (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: locationtech/geogig

@Override
public long getSizeBytes() {
  return sharedCache().sizeBytes();
}
origin: org.locationtech.geogig/geogig-core

@Override
public long getSizeBytes() {
  return sharedCache().sizeBytes();
}
origin: locationtech/geogig

public TestResult run(RevObjectSerializer encoder, List<? extends RevObject> objects) {
  sharedCache.setEncoder(encoder);
  final Stopwatch put = put(objects);
  Collections.shuffle(objects);
  final Stopwatch get = Stopwatch.createStarted();
  int hits = query(objects);
  get.stop();
  long sizeBytes = sharedCache.sizeBytes();
  String displayName = encoder.getDisplayName();
  int size = objects.size();
  long insertTimeMillis = put.elapsed(TimeUnit.MILLISECONDS);
  long queryTimeMillis = get.elapsed(TimeUnit.MILLISECONDS);
  TestResult result = new TestResult(displayName, size, hits, insertTimeMillis,
      queryTimeMillis, sizeBytes);
  return result;
}
origin: locationtech/geogig

  public @Test void testStats() {
    SharedCache sharedCache = mock(SharedCache.class);
    CacheStats stats = mock(CacheStats.class);
    when(stats.evictionCount()).thenReturn(1L);
    when(stats.missCount()).thenReturn(1L);
    when(stats.hitCount()).thenReturn(1L);
    when(stats.missRate()).thenReturn(0.5);
    when(stats.hitRate()).thenReturn(0.5);

    when(sharedCache.getStats()).thenReturn(stats);
    when(sharedCache.sizeBytes()).thenReturn(1000L);
    when(sharedCache.objectCount()).thenReturn(100L);
    cacheManager._SHARED_CACHE = sharedCache;

    assertEquals(1, cacheManager.getEvictionCount());
    assertEquals(1, cacheManager.getMissCount());
    assertEquals(0.5d, cacheManager.getMissRate(), 1e-9);
    assertEquals(1, cacheManager.getHitCount());
    assertEquals(0.5d, cacheManager.getHitRate(), 1e-9);
    assertEquals(1000, cacheManager.getSizeBytes());
    assertEquals(100, cacheManager.getSize());
    assertEquals(1000 / (1024D * 1024D), cacheManager.getSizeMB(), 1e-9);
  }
}
origin: org.locationtech.geogig/geogig-core

  public @Test void testStats() {
    SharedCache sharedCache = mock(SharedCache.class);
    CacheStats stats = new CacheStats(1, 1, 1, 1, 1, 1);
    when(sharedCache.getStats()).thenReturn(stats);
    when(sharedCache.sizeBytes()).thenReturn(1000L);
    when(sharedCache.objectCount()).thenReturn(100L);
    cacheManager._SHARED_CACHE = sharedCache;

    assertEquals(1, cacheManager.getEvictionCount());
    assertEquals(1, cacheManager.getMissCount());
    assertEquals(0.5d, cacheManager.getMissRate(), 1e-9);
    assertEquals(1, cacheManager.getHitCount());
    assertEquals(0.5d, cacheManager.getHitRate(), 1e-9);
    assertEquals(1000, cacheManager.getSizeBytes());
    assertEquals(100, cacheManager.getSize());
    assertEquals(1000 / (1024D * 1024D), cacheManager.getSizeMB(), 1e-9);
  }
}
origin: org.locationtech.geogig/geogig-core

public @Test void testCacheDisabled() {
  SharedCache cache = SharedCache.build(0L);
  Key k1 = repo1Id.create(obj.getId());
  cache.put(k1, obj);
  assertFalse(cache.contains(k1));
  assertEquals(0L, cache.sizeBytes());
}
origin: locationtech/geogig

public @Test void testCacheDisabled() {
  cache = createCache(0, 0L);
  CacheKey k1 = repo1Id.create(obj.getId());
  cache.put(k1, obj);
  assertFalse(cache.contains(k1));
  assertEquals(0L, cache.sizeBytes());
}
org.locationtech.geogig.storage.cacheSharedCachesizeBytes

Popular methods of SharedCache

  • invalidateAll
  • build
    Creates and returns a shared cache with the given maximum heap memory capacity in bytes. This factor
  • contains
  • getIfPresent
  • getStats
  • invalidate
  • objectCount
  • put
  • setEncoder
  • dispose

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
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