Tabnine Logo
Cache.getIfPresent
Code IndexAdd Tabnine to your IDE (free)

How to use
getIfPresent
method
in
org.apache.carbondata.core.cache.Cache

Best Java code snippets using org.apache.carbondata.core.cache.Cache.getIfPresent (Showing top 3 results out of 315)

origin: org.apache.carbondata/carbondata-hadoop

/**
 * This method will return the value for the given key. It will not check and load
 * the data for the given key
 *
 * @param key
 * @return
 */
public V getIfPresent(K key) {
 V value = cache.getIfPresent(key);
 if (value != null) {
  segmentSet.add(key);
 }
 return value;
}
origin: org.apache.carbondata/carbondata-core

 @Override
 public List<DataMapDistributable> getAllUncachedDistributables(
   List<DataMapDistributable> distributables) throws IOException {
  List<DataMapDistributable> distributablesToBeLoaded = new ArrayList<>(distributables.size());
  for (DataMapDistributable distributable : distributables) {
   Segment segment = distributable.getSegment();
   Set<TableBlockIndexUniqueIdentifier> tableBlockIndexUniqueIdentifiers =
     getTableBlockIndexUniqueIdentifiers(segment);
   // filter out the tableBlockIndexUniqueIdentifiers based on distributable
   TableBlockIndexUniqueIdentifier validIdentifier = BlockletDataMapUtil
     .filterIdentifiersBasedOnDistributable(tableBlockIndexUniqueIdentifiers,
       (BlockletDataMapDistributable) distributable);
   if (null == cache.getIfPresent(
     new TableBlockIndexUniqueIdentifierWrapper(validIdentifier, this.getCarbonTable()))) {
    ((BlockletDataMapDistributable) distributable)
      .setTableBlockIndexUniqueIdentifier(validIdentifier);
    distributablesToBeLoaded.add(distributable);
   }
  }
  return distributablesToBeLoaded;
 }
}
origin: org.apache.carbondata/carbondata-core

@Override
public void clear(Segment segment) {
 Set<TableBlockIndexUniqueIdentifier> blockIndexes = segmentMap.remove(segment.getSegmentNo());
 if (blockIndexes != null) {
  for (TableBlockIndexUniqueIdentifier blockIndex : blockIndexes) {
   TableBlockIndexUniqueIdentifierWrapper blockIndexWrapper =
     new TableBlockIndexUniqueIdentifierWrapper(blockIndex, this.getCarbonTable());
   BlockletDataMapIndexWrapper wrapper = cache.getIfPresent(blockIndexWrapper);
   if (null != wrapper) {
    List<BlockDataMap> dataMaps = wrapper.getDataMaps();
    for (DataMap dataMap : dataMaps) {
     if (dataMap != null) {
      cache.invalidate(blockIndexWrapper);
      dataMap.clear();
     }
    }
   }
  }
 }
}
org.apache.carbondata.core.cacheCachegetIfPresent

Javadoc

This method will return the value for the given key. It will not check and load the data for the given key Access count of Cacheable entry will be incremented

Popular methods of Cache

  • get
    This method will get the value for the given key. If value does not exist for the given key, it will
  • invalidate
    This method will remove the cache for a given key
  • clearAccessCount
    Access count of Cacheable entry will be decremented
  • getAll
    This method will return a list of values for the given list of keys. For each key, this method will
  • put
    This method will add the value to the cache for the given key

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Permission (java.security)
    Legacy security code; do not use.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Top plugins for WebStorm
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