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

How to use
BlockCacheKey
in
com.nearinfinity.blur.store.blockcache

Best Java code snippets using com.nearinfinity.blur.store.blockcache.BlockCacheKey (Showing top 4 results out of 315)

origin: altamiracorp/blur

@Override
public void update(String name, long blockId, byte[] buffer) {
 Integer file = _names.get(name);
 if (file == null) {
  file = _counter.incrementAndGet();
  _names.put(name, file);
 }
 BlockCacheKey blockCacheKey = new BlockCacheKey();
 blockCacheKey.setBlock(blockId);
 blockCacheKey.setFile(file);
 _blockCache.store(blockCacheKey, buffer);  
}
origin: altamiracorp/blur

public boolean store(BlockCacheKey blockCacheKey, byte[] data) {
 checkLength(data);
 BlockCacheLocation location = _cache.get(blockCacheKey);
 boolean newLocation = false;
 if (location == null) {
  newLocation = true;
  location = new BlockCacheLocation();
  if (!findEmptyLocation(location)) {
   return false;
  }
 }
 if (location.isRemoved()) {
  return false;
 }
 int slabId = location.getSlabId();
 int offset = location.getBlock() * _blockSize;
 ByteBuffer slab = getSlab(slabId);
 slab.position(offset);
 slab.put(data, 0, _blockSize);
 if (newLocation) {
  releaseLocation(_cache.put(blockCacheKey.clone(), location));
  _metrics.blockCacheSize.incrementAndGet();
 }
 return true;
}
origin: altamiracorp/blur

@Override
public boolean fetch(String name, long blockId, int blockOffset, byte[] b, int off, int lengthToReadInBlock) {
 Integer file = _names.get(name);
 if (file == null) {
  return false;
 }
 BlockCacheKey blockCacheKey = new BlockCacheKey();
 blockCacheKey.setBlock(blockId);
 blockCacheKey.setFile(file);
 boolean fetch = _blockCache.fetch(blockCacheKey, b, blockOffset, off, lengthToReadInBlock);
 if (fetch) {
  _blurMetrics.blockCacheHit.incrementAndGet();
 } else {
  _blurMetrics.blockCacheMiss.incrementAndGet();
 }
 return fetch;
}
origin: altamiracorp/blur

int passes = 10000;
BlockCacheKey blockCacheKey = new BlockCacheKey();
 blockCacheKey.setBlock(block);
 blockCacheKey.setFile(file);
com.nearinfinity.blur.store.blockcacheBlockCacheKey

Most used methods

  • <init>
  • setBlock
  • setFile
  • clone

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • String (java.lang)
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JOptionPane (javax.swing)
  • Top plugins for Android Studio
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