apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siyuanh <...@git.apache.org>
Subject [GitHub] incubator-apex-malhar pull request: MLHR-1877 #resolve #comment mo...
Date Sat, 07 Nov 2015 00:11:46 GMT
Github user siyuanh commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-malhar/pull/69#discussion_r44201682
  
    --- Diff: library/src/main/java/org/apache/hadoop/io/file/tfile/CacheManager.java ---
    @@ -110,41 +116,45 @@
         return buildCache(builder);
       }
     
    -  public static final void createDefaultCache(){
    -
    -    long availableMemory = (long) (ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax()
* DEFAULT_HEAP_MEMORY_PERCENTAGE);
    +  public static void createDefaultCache()
    +  {
    +    long availableMemory = (long)(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax()
* DEFAULT_HEAP_MEMORY_PERCENTAGE);
         CacheBuilder<String, BlockReader> builder = CacheBuilder.newBuilder().maximumWeight(availableMemory).weigher(new
KVWeigher());
     
    -    singleCache = buildCache(builder);
    +    SINGLE_CACHE = buildCache(builder);
       }
     
    -  public static final void put(String key, BlockReader blk){
    -    if (singleCache == null) {
    +  public static void put(String key, BlockReader blk)
    +  {
    +    if (SINGLE_CACHE == null) {
           createDefaultCache();
         }
    -    singleCache.put(key, blk);
    +    SINGLE_CACHE.put(key, blk);
       }
     
    -  public static final BlockReader get(String key){
    -    if (singleCache == null) {
    +  public static BlockReader get(String key)
    +  {
    +    if (SINGLE_CACHE == null) {
           return null;
         }
    -    return singleCache.getIfPresent(key);
    +    return SINGLE_CACHE.getIfPresent(key);
       }
     
    -  public static final void invalidateKeys(Collection<String> keys)
    +  public static void invalidateKeys(Collection<String> keys)
       {
    -    if (singleCache != null)
    -      singleCache.invalidateAll(keys);
    +    if (SINGLE_CACHE != null)
    +      SINGLE_CACHE.invalidateAll(keys);
    --- End diff --
    
    Fix the cs violation


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message