Examples of Cacheable


Examples of org.apache.hadoop.hbase.io.hfile.Cacheable

        lockEntry = offsetLock.getLockEntry(bucketEntry.offset());
        if (bucketEntry.equals(backingMap.get(key))) {
          int len = bucketEntry.getLength();
          ByteBuffer bb = ByteBuffer.allocate(len);
          ioEngine.read(bb, bucketEntry.offset());
          Cacheable cachedBlock = bucketEntry.deserializerReference(
              deserialiserMap).deserialize(bb, true);
          long timeTaken = System.nanoTime() - start;
          cacheStats.hit(caching);
          cacheStats.ioHit(timeTaken);
          bucketEntry.access(accessCount.incrementAndGet());
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.Cacheable

    if (cachedBlock == null) {
      if (!repeat) stats.miss(caching);
      return null;
    }

    Cacheable contentBlock = cachedBlock.getBlock(key, caching, false);

    if (contentBlock != null) {
      stats.hit(caching);
    } else {
      if (!repeat) stats.miss(caching);
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.Cacheable

        lockEntry = offsetLock.getLockEntry(bucketEntry.offset());
        if (bucketEntry.equals(backingMap.get(key))) {
          int len = bucketEntry.getLength();
          ByteBuffer bb = ByteBuffer.allocate(len);
          ioEngine.read(bb, bucketEntry.offset());
          Cacheable cachedBlock = bucketEntry.deserializerReference(
              deserialiserMap).deserialize(bb, true);
          long timeTaken = System.nanoTime() - start;
          cacheStats.hit(caching);
          cacheStats.ioHit(timeTaken);
          bucketEntry.access(accessCount.incrementAndGet());
View Full Code Here

Examples of org.exist.storage.cache.Cacheable

    protected void removeOne(Cacheable item) {
        boolean removed = false;
        SequencedLongHashMap.Entry<Cacheable> next = map.getFirstEntry();
        int tries = 0;
        do {
            final Cacheable cached = next.getValue();
            if(cached.getKey() != item.getKey()) {
                final Collection old = (Collection) cached;
                final Lock lock = old.getLock();
                if (lock.attempt(Lock.READ_LOCK)) {
                    try {
                        if (cached.allowUnload()) {
                            if(pool.getConfigurationManager()!=null) { // might be null during db initialization
                                pool.getConfigurationManager().invalidate(old.getURI(), null);
                            }
                            names.remove(old.getURI().getRawCollectionPath());
                            cached.sync(true);
                            map.remove(cached.getKey());
                            removed = true;
                        }
                    } finally {
                        lock.release(Lock.READ_LOCK);
                    }
View Full Code Here

Examples of org.springframework.cache.annotation.Cacheable

                break;
            }
        }
        assertTrue("TeamService is advised, but does not have caching advisor", hasCachingAdvisor);
        ReflectionUtils.doWithMethods(TeamService.class, method -> {
            Cacheable cacheable = AnnotationUtils.findAnnotation(method, Cacheable.class);
            String methodName = method.getName();
            if (methodName.equals("fetchMemberProfileUsername") || methodName.equals("fetchActiveMembers")) {
                assertNotNull("Method " + methodName + " was expected to have Cacheable annotation.", cacheable);
                String[] cacheName = cacheable.value();
                assertThat(cacheName[0], equalTo(DatabaseConfig.CACHE_NAME));
            } else {
                assertNull("Method " + methodName + " was not expected to have Cacheable annotation.", cacheable);
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.