Tabnine Logo
Bucket
Code IndexAdd Tabnine 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)

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
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • From CI to AI: The AI layer in your organization
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