odraese commented on a change in pull request #944: [Hive-22760] Adding Clock 
based eviction strategy.
URL: https://github.com/apache/hive/pull/944#discussion_r395924117
 
 

 ##########
 File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LlapCacheableBuffer.java
 ##########
 @@ -26,39 +26,71 @@
  * using a real programming language.
  */
 public abstract class LlapCacheableBuffer {
-  protected static final int IN_LIST = -2, NOT_IN_CACHE = -1;
-
-  /** Priority for cache policy (should be pretty universal). */
-  public double priority;
-  /** Last priority update time for cache policy (should be pretty universal). 
*/
-  public long lastUpdate = -1;
+  public static final int INVALIDATE_OK = 0, INVALIDATE_FAILED = 1, 
INVALIDATE_ALREADY_INVALID = 2;
 
-  // TODO: remove some of these fields as needed?
+  public CacheAttribute cacheAttribute;
   /** Linked list pointers for LRFU/LRU cache policies. Given that each block 
is in cache
    * that might be better than external linked list. Or not, since this is not 
concurrent. */
   public LlapCacheableBuffer prev = null;
   /** Linked list pointers for LRFU/LRU cache policies. Given that each block 
is in cache
    * that might be better than external linked list. Or not, since this is not 
concurrent. */
   public LlapCacheableBuffer next = null;
-  /** Index in heap for LRFU/LFU cache policies. */
-  public int indexInHeap = NOT_IN_CACHE;
 
-  public static final int INVALIDATE_OK = 0, INVALIDATE_FAILED = 1, 
INVALIDATE_ALREADY_INVALID = 2;
+  /**
+   * @return result of invalidation.
+   */
   protected abstract int invalidate();
+
+  /**
+   * @return size of the buffer in bytes.
+   */
   public abstract long getMemoryUsage();
+
+  /**
+   * @param evictionDispatcher dispatcher object to be notified.
+   */
   public abstract void notifyEvicted(EvictionDispatcher evictionDispatcher);
 
+  /**
 
 Review comment:
   As mentioned in the LlapAllocatorBuffer: we should keep the CachableBuffer 
clear of eviction policy specific methods. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to