You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "Reamer (via GitHub)" <gi...@apache.org> on 2023/04/25 18:13:15 UTC

[GitHub] [zeppelin] Reamer opened a new pull request, #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Reamer opened a new pull request, #4590:
URL: https://github.com/apache/zeppelin/pull/4590

   ### What is this PR for?
   This pull request adds a cache cleanup method that attempts to remove an item from the cache that is not the eldest item and also does not have a read flag.
   
   ### What type of PR is it?
   Bug Fix
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/ZEPPELIN-5903
   
   ### How should this be tested?
   * CI
   
   ### Questions:
   * Does the license files need to update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [zeppelin] Reamer merged pull request #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Posted by "Reamer (via GitHub)" <gi...@apache.org>.
Reamer merged PR #4590:
URL: https://github.com/apache/zeppelin/pull/4590


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [zeppelin] huage1994 commented on pull request #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Posted by "huage1994 (via GitHub)" <gi...@apache.org>.
huage1994 commented on PR #4590:
URL: https://github.com/apache/zeppelin/pull/4590#issuecomment-1527113642

   The changes look very good.  I just have a minor code suggestion.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [zeppelin] Reamer commented on a diff in pull request #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Posted by "Reamer (via GitHub)" <gi...@apache.org>.
Reamer commented on code in PR #4590:
URL: https://github.com/apache/zeppelin/pull/4590#discussion_r1180032048


##########
zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NoteManagerTest.java:
##########
@@ -162,6 +162,14 @@ public void testLruCache() throws IOException {
     noteManager.removeNote(noteNew2.getId(), AuthenticationInfo.ANONYMOUS);
     assertFalse(noteManager.containsNote(noteNew2.getPath()));
     assertEquals(cacheThreshold, noteManager.getCacheSize());
+
+    // add cache + 1 without read flag
+    Note noteNew3 = createNote("/prod/notenew3");
+    noteManager.addNote(noteNew3, AuthenticationInfo.ANONYMOUS);
+
+    // since all dirty notes in the cache are with a read flag, the cache removes noteNew3, because it has no read flag
+    assertEquals(cacheThreshold, noteManager.getCacheSize());
+    System.out.println(noteManager.containsNote(noteNew3.getPath()));

Review Comment:
   Ohh my goodness, some debug code got through. Thanks for your review.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [zeppelin] Reamer commented on pull request #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Posted by "Reamer (via GitHub)" <gi...@apache.org>.
Reamer commented on PR #4590:
URL: https://github.com/apache/zeppelin/pull/4590#issuecomment-1527052137

   Need a review. I have tested this function in my environment and it does what it is supposed to.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [zeppelin] huage1994 commented on a diff in pull request #4590: [ZEPPELIN-5903] Improve LRU NoteCache - Add a cleanup

Posted by "huage1994 (via GitHub)" <gi...@apache.org>.
huage1994 commented on code in PR #4590:
URL: https://github.com/apache/zeppelin/pull/4590#discussion_r1180017995


##########
zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NoteManagerTest.java:
##########
@@ -162,6 +162,14 @@ public void testLruCache() throws IOException {
     noteManager.removeNote(noteNew2.getId(), AuthenticationInfo.ANONYMOUS);
     assertFalse(noteManager.containsNote(noteNew2.getPath()));
     assertEquals(cacheThreshold, noteManager.getCacheSize());
+
+    // add cache + 1 without read flag
+    Note noteNew3 = createNote("/prod/notenew3");
+    noteManager.addNote(noteNew3, AuthenticationInfo.ANONYMOUS);
+
+    // since all dirty notes in the cache are with a read flag, the cache removes noteNew3, because it has no read flag
+    assertEquals(cacheThreshold, noteManager.getCacheSize());
+    System.out.println(noteManager.containsNote(noteNew3.getPath()));

Review Comment:
   ```suggestion
       assertTrue(noteManager.containsNote(noteNew3.getPath()));
   ```



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org