Package org.apache.blur.store.blockcache_v2.cachevalue

Examples of org.apache.blur.store.blockcache_v2.cachevalue.UnsafeCacheValue


        }
        return defaultWriteCaching;
      }
    };

    Quiet quiet = new Quiet() {
      @Override
      public boolean shouldBeQuiet(CacheDirectory directory, String fileName) {
        Thread thread = Thread.currentThread();
        String name = thread.getName();
        if (name.startsWith(SHARED_MERGE_SCHEDULER)) {
View Full Code Here


  protected Directory setupDirectory() throws IOException {
    int totalNumberOfBytes = 1000000;
    final int fileBufferSizeInt = numberBetween(113, 215);
    final int cacheBlockSizeInt = numberBetween(111, 251);

    Size fileBufferSize = new Size() {
      @Override
      public int getSize(CacheDirectory directory, String fileName) {
        return fileBufferSizeInt;
      }
    };

    Size cacheBlockSize = new Size() {
      @Override
      public int getSize(CacheDirectory directory, String fileName) {
        return cacheBlockSizeInt;
      }
    };
View Full Code Here

   
    final boolean defaultWriteCaching = configuration.getBoolean(BLUR_SHARD_BLOCK_CACHE_V2_WRITE_DEFAULT, true);
    LOG.info("{0}={1}", BLUR_SHARD_BLOCK_CACHE_V2_WRITE_DEFAULT, defaultWriteCaching);
   

    Size fileBufferSize = new Size() {
      @Override
      public int getSize(CacheDirectory directory, String fileName) {
        return fileBufferSizeInt;
      }
    };

    Size cacheBlockSize = new Size() {
      @Override
      public int getSize(CacheDirectory directory, String fileName) {
        String ext = getExt(fileName);
        Integer size = cacheBlockSizeMap.get(ext);
        if (size != null) {
View Full Code Here

  }

  private CacheValue createCacheValue(int cacheBlockSize) {
    switch (_store) {
    case ON_HEAP:
      return new ByteArrayCacheValue(cacheBlockSize);
    case OFF_HEAP:
      return new UnsafeCacheValue(cacheBlockSize);
    default:
      throw new RuntimeException("Unknown type [" + _store + "]");
    }
View Full Code Here

    return _quiet.shouldBeQuiet(directory, fileName);
  }

  @Override
  public CacheValue newInstance(CacheDirectory directory, String fileName, int cacheBlockSize) {
    return new DetachableCacheValue(_cacheValueBufferPool.getCacheValue(cacheBlockSize));
  }
View Full Code Here

  private CacheValue createCacheValue(int cacheBlockSize) {
    switch (_store) {
    case ON_HEAP:
      return new ByteArrayCacheValue(cacheBlockSize);
    case OFF_HEAP:
      return new UnsafeCacheValue(cacheBlockSize);
    default:
      throw new RuntimeException("Unknown type [" + _store + "]");
    }
  }
View Full Code Here

        .weigher(weigher).maximumWeightedCapacity(maximumWeightedCapacity).listener(listener).build();
    Cache cacheFactory = new Cache() {

      @Override
      public CacheValue newInstance(CacheDirectory directory, String fileName, int cacheBlockSize) {
        return new UnsafeCacheValue(cacheBlockSize);
      }

      @Override
      public long getFileId(CacheDirectory directory, String fileName) {
        return fileName.hashCode();
View Full Code Here

TOP

Related Classes of org.apache.blur.store.blockcache_v2.cachevalue.UnsafeCacheValue

Copyright © 2018 www.massapicom. 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.