You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/11/23 12:18:20 UTC

[GitHub] [cassandra] azotcsit opened a new pull request #1338: Expose Auth Caches metrics

azotcsit opened a new pull request #1338:
URL: https://github.com/apache/cassandra/pull/1338


   patch by Aleksei Zotov; reviewed by XXX for CASSANDRA-17062


-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra] azotcsit commented on a change in pull request #1338: Expose Auth Caches metrics

Posted by GitBox <gi...@apache.org>.
azotcsit commented on a change in pull request #1338:
URL: https://github.com/apache/cassandra/pull/1338#discussion_r773847556



##########
File path: src/java/org/apache/cassandra/cache/ChunkCache.java
##########
@@ -166,7 +166,7 @@ public void onRemoval(Key key, Buffer buffer, RemovalCause cause)
         buffer.release();
     }
 
-    public void close()
+    public void clear()

Review comment:
       It makes naming similar to other caches.

##########
File path: src/java/org/apache/cassandra/auth/AuthCache.java
##########
@@ -382,4 +399,23 @@ public boolean awaitTermination(long timeout, TimeUnit units) throws Interrupted
     {
         return cacheRefreshExecutor.awaitTermination(timeout, units);
     }
+
+    @Override
+    public long capacity()
+    {
+        return getMaxEntries();
+    }
+
+    @Override
+    public void setCapacity(long capacity)
+    {
+        setMaxEntries(Math.toIntExact(capacity));

Review comment:
       Just to highlight: it is impossible set capacity more then `Integer.MAX_VALUE`.

##########
File path: test/unit/org/apache/cassandra/db/virtual/CachesTableTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.db.virtual;
+
+import com.google.common.collect.ImmutableList;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.cassandra.cache.ChunkCache;
+import org.apache.cassandra.cql3.CQLTester;
+import org.apache.cassandra.service.CacheService;
+
+public class CachesTableTest extends CQLTester

Review comment:
       I did not touch _caches_ VT implementation, however, mentioned that it had no tests. Therefore, I've created this very basic test. It just tests the overall table structure.




-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org