cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [15/30] cayenne git commit: CAY-2377. Cleanup JCacheQueryCache and NestedQueryCache
Date Thu, 07 Dec 2017 10:09:44 GMT
CAY-2377. Cleanup JCacheQueryCache  and NestedQueryCache


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/5904907e
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/5904907e
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/5904907e

Branch: refs/heads/master
Commit: 5904907e10c907b495f8f7daad9d3975550d3e87
Parents: 060340b
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Fri Nov 10 10:40:45 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Nov 15 10:27:47 2017 +0300

----------------------------------------------------------------------
 .../apache/cayenne/CayenneContextWithDataContextIT.java  |  5 -----
 .../cayenne/access/ClientServerChannelQueryIT.java       |  7 -------
 .../java/org/apache/cayenne/jcache/JCacheQueryCache.java |  6 ------
 .../java/org/apache/cayenne/cache/NestedQueryCache.java  | 11 -----------
 .../main/java/org/apache/cayenne/cache/QueryCache.java   | 11 +----------
 docs/doc/src/main/resources/UPGRADE.txt                  |  2 ++
 6 files changed, 3 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextWithDataContextIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextWithDataContextIT.java
b/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextWithDataContextIT.java
index 5449531..6bddc00 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextWithDataContextIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextWithDataContextIT.java
@@ -106,16 +106,11 @@ public class CayenneContextWithDataContextIT extends ClientCase {
         SelectQuery query = new SelectQuery(ClientMtTable1.class);
         query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
 
-        assertEquals(0, clientContext.getQueryCache().size());
-        assertEquals(0, serverContext.getQueryCache().size());
-
         List<?> results = clientContext.performQuery(query);
 
-        assertEquals(1, clientContext.getQueryCache().size());
         assertSame(results, clientContext.getQueryCache().get(
                 query.getMetaData(clientContext.getEntityResolver())));
 
-        assertEquals(0, serverContext.getQueryCache().size());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelQueryIT.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelQueryIT.java
b/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelQueryIT.java
index 967d679..d5afa0a 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelQueryIT.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelQueryIT.java
@@ -97,13 +97,6 @@ public class ClientServerChannelQueryIT extends ClientCase {
         // read page 1
         assertTrue(results.get(0) instanceof ClientMtTable1);
 
-        // now kick out the server-side list from local cache, and see if the query would
-        // recover...
-        QueryCache qc = serverChannel.getQueryCache();
-        assertEquals(1, qc.size());
-        qc.clear();
-        assertEquals(0, qc.size());
-
         assertTrue(results.get(3) instanceof ClientMtTable1);
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheQueryCache.java
----------------------------------------------------------------------
diff --git a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheQueryCache.java
b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheQueryCache.java
index a91efc4..a6d0e17 100644
--- a/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheQueryCache.java
+++ b/cayenne-jcache/src/main/java/org/apache/cayenne/jcache/JCacheQueryCache.java
@@ -106,12 +106,6 @@ public class JCacheQueryCache implements QueryCache {
         }
     }
 
-    @Override
-    @Deprecated
-    public int size() {
-        return -1;
-    }
-
     protected Cache<String, List> createIfAbsent(QueryMetadata metadata) {
         return createIfAbsent(cacheName(metadata));
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/cayenne-server/src/main/java/org/apache/cayenne/cache/NestedQueryCache.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/cache/NestedQueryCache.java b/cayenne-server/src/main/java/org/apache/cayenne/cache/NestedQueryCache.java
index 8b96057..7f50e5d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/cache/NestedQueryCache.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/cache/NestedQueryCache.java
@@ -114,17 +114,6 @@ public class NestedQueryCache implements QueryCache {
         delegate.removeGroup(groupKey, keyType, valueType);
     }
 
-    /**
-     * Returns a shared cache size.
-     * @see QueryCache#size()
-     * @deprecated since 4.0
-     */
-    @Override
-    @Deprecated
-    public int size() {
-        return delegate.size();
-    }
-
     private String qualifiedKey(String key) {
         return key != null ? namespace + key : null;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/cayenne-server/src/main/java/org/apache/cayenne/cache/QueryCache.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/cache/QueryCache.java b/cayenne-server/src/main/java/org/apache/cayenne/cache/QueryCache.java
index fb21b83..cdcf436 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/cache/QueryCache.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/cache/QueryCache.java
@@ -73,7 +73,7 @@ public interface QueryCache {
      *
      * @since 4.0
      */
-    void removeGroup(String groupKey, Class<?> keyType, Class<?> valueType);
+    void removeGroup(String grou3pKey, Class<?> keyType, Class<?> valueType);
 
     /**
      * Clears all cache entries.
@@ -82,13 +82,4 @@ public interface QueryCache {
      */
     @Deprecated
     void clear();
-
-    /**
-     * Returns the number of entries currently in the cache, including expired but not
-     * removed entries.
-     *
-     * @deprecated since 4.0. Please use implementation specific methods to perform cache
management tasks.
-     */
-    @Deprecated
-    int size();
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/5904907e/docs/doc/src/main/resources/UPGRADE.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/UPGRADE.txt b/docs/doc/src/main/resources/UPGRADE.txt
index 38ed27b..357972a 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -244,6 +244,8 @@ UPGRADING TO 4.1.M2
       - removed ClientMultiTier and _ClientMultiTier in org.apache.cayenne.testdo.mt;
       - removed NamedQueryTest in org.apache.cayenne.query.NamedQueryTest;
       - removed NamedQuery in org.apache.cayenne.query;
+      - removed int size() in org.apache.cayenne.jcache.JCacheQueryCache and org.apache.cayenne.cache.NestedQueryCache;
+      - removed int size() in org.apache.cayenne.cache.QueryCache;
 
 UPGRADING TO 4.1.M1
 


Mime
View raw message