Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/20607 )

Change subject: KUDU-613: Introduce SLRU cache
......................................................................


Patch Set 14:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/20607/14//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/20607/14//COMMIT_MSG@21
PS14, Line 21: TODO:
             : - Add performance tests
Do I understand correctly that this is still a WIP patch, i.e. do you plan to 
add those performance tests as a part of this patch, or whatever is in 
slru_cache-test.cc in PS14 are those performance tests referred to?


http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/cache.h
File src/kudu/util/cache.h:

http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/cache.h@228
PS14, Line 228:   // Sets probationary and protected segments metrics to update 
corresponding counters accordingly.
              :   //
              :   // An upgrade of one entry will increment the number of 
evictions from the probationary segment by
              :   // one and the number of insertions into the protected 
segment by one.
              :   //
              :   // A downgrade of one entry will increment the number of 
evictions from the protected segment by
              :   // one and the number of insertions into the probationary 
segment by one.
              :   //
              :   // To calculate the number of inserts for the SLRU cache, 
subtract the number of evictions
              :   // of the protected segment from the number of inserts of the 
probationary segment.
              :   //
              :   // To calculate the number of evictions for the SLRU cache, 
subtract the number of insertions
              :   // of the protected segment from the number of evictions of 
the probationary segment.
              :   //
              :   // Other than insertions and evictions, to calculate the 
metric for the SLRU cache, add the
              :   // corresponding metric from the probationary and protected 
segment together.
              :   virtual void SetSegmentMetrics(std::unique_ptr<CacheMetrics> 
probationary_metrics,
              :                                  std::unique_ptr<CacheMetrics> 
protected_metrics,
              :                                  ExistingMetricsPolicy 
metrics_policy) = 0;
I'm not sure I understand the premise of introducing this method in the base 
Cache class.

So far it seems the only place it's used is slru_cache-test.cc.  And there, why 
not to store the instance as std::unique_ptr<ShardedSLRUCache> ?


http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.h
File src/kudu/util/slru_cache.h:

http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.h@35
PS14, Line 35: Creates a new SLRU cache with 'probationary_capacity' being the 
capacity of
             : // the probationary segment, 'protected_capacity' being the 
capacity
Is the capacity in bytes, kBytes, number of entries in the cache?  It would be 
nice to clarify in the comment.


http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.h@40
PS14, Line 40: Cache
Why not to return this as ShardedSLRUCache*?


http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.cc
File src/kudu/util/slru_cache.cc:

http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.cc@62
PS14, Line 62: GetCapacity
nit: capacity

In most of the Kudu's code, accessor methods follow the convention mentioned in 
the C++ style guide at 
https://google.github.io/styleguide/cppguide.html#Function_Names


http://gerrit.cloudera.org:8080/#/c/20607/14/src/kudu/util/slru_cache.cc@131
PS14, Line 131: size_t capacity_;
Could this be 'const'?



--
To view, visit http://gerrit.cloudera.org:8080/20607
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I45531534a2049dd38c002f4dc7982df9fd46e0bb
Gerrit-Change-Number: 20607
Gerrit-PatchSet: 14
Gerrit-Owner: Mahesh Reddy <mre...@cloudera.com>
Gerrit-Reviewer: Abhishek Chennaka <achenn...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <ale...@apache.org>
Gerrit-Reviewer: Attila Bukor <abu...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mre...@cloudera.com>
Gerrit-Reviewer: Marton Greber <greber...@gmail.com>
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Tue, 09 Apr 2024 19:07:42 +0000
Gerrit-HasComments: Yes

Reply via email to