Codota Logo
Bucket
Code IndexAdd Codota to your IDE (free)

How to use
Bucket
in
com.oberasoftware.jasdb.api.caching

Best Java code snippets using com.oberasoftware.jasdb.api.caching.Bucket (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: oberasoftware/jasdb

public void shutdownCacheManager() {
  for(Bucket bucket : buckets.values()) {
    bucket.closeBucket();
  }
  
  buckets.clear();
}

origin: oberasoftware/jasdb

@Override
public void writeRecord(UUIDKey documentId, ClonableDataStream dataStream) throws JasDBStorageException {
  wrappedWriter.writeRecord(documentId, dataStream);
  String cachingKey = storeName + "_" + documentId.toString();
  if(bucket.containsItem(cachingKey)) {
    bucket.remove(cachingKey);
  }
}
origin: oberasoftware/jasdb

@Override
public RecordResult readRecord(UUIDKey documentId) throws JasDBStorageException {
  String cachingKey = storeName + "_" + documentId.toString();
  if(!bucket.containsItem(cachingKey)) {
    return readRecordFromStore(cachingKey, documentId);
  } else {
    log.debug("Cache hit for record: {} key: {}", documentId, cachingKey);
    CachableRecord cachedRecord = (CachableRecord) bucket.getItem(cachingKey);
    if(cachedRecord != null) {
      return cachedRecord.getResult();
    } else {
      return readRecordFromStore(cachingKey, documentId);
    }
  }
}
origin: oberasoftware/jasdb

@Override
public void removeRecord(UUIDKey documentId) throws JasDBStorageException {
  wrappedWriter.removeRecord(documentId);
  String cachingKey = storeName + "_" + documentId.toString();
  bucket.remove(cachingKey);
}
origin: oberasoftware/jasdb

private RecordResult readRecordFromStore(String cachingKey, UUIDKey key) throws JasDBStorageException {
  log.debug("Cache miss for record: {}", key);
  RecordResult result = wrappedWriter.readRecord(key);
  if(!result.isRecordFound()) {
    bucket.put(cachingKey, new CachableRecord(result));
  }
  return result;
}
origin: oberasoftware/jasdb

  private Bucket createOrGetBucket(String bucketName) throws CoreConfigException {
    if(!buckets.containsKey(bucketName)) {
      CacheConfig usedConfig = null;
      if(bucketConfigs.containsKey(bucketName)) {
        usedConfig = bucketConfigs.get(bucketName);
      } else {
        usedConfig = defaultConfig;
      }
      
      Bucket bucket;
      if(usedConfig.isEnabled()) {
         bucket = new CacheBucket(bucketName);
      } else {
        bucket = new DummyBucket();
      }
      bucket.configure(usedConfig);
      buckets.put(bucketName, bucket);
      return bucket;
    } else {
      return buckets.get(bucketName);
    }
  }
}
origin: oberasoftware/jasdb

  @Override
  public void updateRecord(UUIDKey documentId, ClonableDataStream dataStream) throws JasDBStorageException {
    wrappedWriter.updateRecord(documentId, dataStream);

    String cachingKey = storeName + "_" + documentId.toString();
    bucket.remove(cachingKey);
  }
}
com.oberasoftware.jasdb.api.cachingBucket

Most used methods

  • closeBucket
  • configure
  • containsItem
  • getItem
  • put
  • remove

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • orElseThrow (Optional)
  • getContentResolver (Context)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JPanel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
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