[grizzly~memcached:466b3373] + upgraded grizzly-framework version(2.2.21->2.3.5)

  • From: carryel@...
  • To: commits@...
  • Subject: [grizzly~memcached:466b3373] + upgraded grizzly-framework version(2.2.21->2.3.5)
  • Date: Thu, 5 Sep 2013 04:11:44 +0000

Project:    grizzly
Repository: memcached
Revision:   466b3373354158b632df81b4551609f105e4d09a
Author:     carryel
Date:       2013-09-05 04:13:21 UTC
Link:       

Log Message:
------------
+ upgraded grizzly-framework version(2.2.21->2.3.5)
+ replaced ConcurrentHashMap into DataStructures.getConcurrentMap() for V8
+ resolved deprecated methods(framework's APIs)



Revisions:
----------
466b3373354158b632df81b4551609f105e4d09a


Modified Paths:
---------------
pom.xml
src/main/java/org/glassfish/grizzly/memcached/ConsistentHashStore.java
src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCache.java
src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCacheManager.java
src/main/java/org/glassfish/grizzly/memcached/MemcachedClientFilter.java
src/main/java/org/glassfish/grizzly/memcached/pool/BaseObjectPool.java
src/main/java/org/glassfish/grizzly/memcached/zookeeper/ZKClient.java


Diffs:
------
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,7 @@
     <groupId>org.glassfish.grizzly</groupId>
     <artifactId>grizzly-memcached</artifactId>
     <packaging>bundle</packaging>
-    <version>1.1.5-SNAPSHOT</version>
+    <version>1.3.0-SNAPSHOT</version>
     <name>grizzly-memcached</name>
     <url>http://grizzly.java.net</url>
     <issueManagement>
@@ -93,6 +93,10 @@
         <name>Project Grizzly</name>
         <url>http://grizzly.java.net</url>
     </organization>
+    <properties>
+        <grizzly-framework-version>2.3.5</grizzly-framework-version>
+        <zookeeper-version>3.3.4</zookeeper-version>
+    </properties>
     <build>
         <extensions>
             <extension>
@@ -308,12 +312,12 @@
         <dependency>
             <groupId>org.glassfish.grizzly</groupId>
             <artifactId>grizzly-framework</artifactId>
-            <version>2.2.21</version>
+            <version>${grizzly-framework-version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.zookeeper</groupId>
             <artifactId>zookeeper</artifactId>
-            <version>3.3.4</version>
+            <version>${zookeeper-version}</version>
             <exclusions>
                 <exclusion>
                     <groupId>com.sun.jmx</groupId>--- 
a/src/main/java/org/glassfish/grizzly/memcached/ConsistentHashStore.java
+++ b/src/main/java/org/glassfish/grizzly/memcached/ConsistentHashStore.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -41,13 +41,13 @@
 package org.glassfish.grizzly.memcached;
 
 import org.glassfish.grizzly.Grizzly;
+import org.glassfish.grizzly.utils.DataStructures;
 
 import java.nio.ByteBuffer;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.Collections;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -67,9 +67,9 @@ import java.util.zip.CRC32;
  * This class should be thread-safe.
  * <p/>
  * Example of use:
+ * See org.glassfish.grizzly.memcached.ConsistentHashStoreTest's test codes
  *
  * @author Bongjae Chang
- * @see org.glassfish.grizzly.memcached.ConsistentHashStoreTest's test codes
  */
 public class ConsistentHashStore<T> {
 
@@ -81,7 +81,7 @@ public class ConsistentHashStore<T> {
     private static final int REPLICA_NUMBER = 160;
 
     private final ConcurrentSkipListMap<Long, T> buckets = new 
ConcurrentSkipListMap<Long, T>();
-    private final Set<T> values = Collections.newSetFromMap(new 
ConcurrentHashMap<T, Boolean>());
+    private final Set<T> values = 
Collections.newSetFromMap(DataStructures.<T, Boolean>getConcurrentMap());
 
     /**
      * Add the value such as a server name--- 
a/src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCache.java
+++ b/src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCache.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -62,6 +62,7 @@ import org.glassfish.grizzly.memcached.zookeeper.ZKClient;
 import org.glassfish.grizzly.memcached.zookeeper.ZooKeeperSupportCache;
 import org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler;
 import org.glassfish.grizzly.nio.transport.TCPNIOTransport;
+import org.glassfish.grizzly.utils.DataStructures;
 
 import java.io.UnsupportedEncodingException;
 import java.net.SocketAddress;
@@ -71,7 +72,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -1642,7 +1642,7 @@ public class GrizzlyMemcachedCache<K, V> implements 
MemcachedCache<K, V>, ZooKee
             while (true) {
                 final ValueWithKey<String, String> value;
                 try {
-                    value = (ValueWithKey<String, String>) 
clientFilter.getCorrelatedResponse(connection, request, 
responseTimeoutInMillis);
+                    value = clientFilter.getCorrelatedResponse(connection, 
request, responseTimeoutInMillis);
                 } catch (TimeoutException te) {
                     if (logger.isLoggable(Level.SEVERE)) {
                         logger.log(Level.SEVERE, "failed to get the stats. 
timeout=" + responseTimeoutInMillis + "ms", te);
@@ -2413,8 +2413,8 @@ public class GrizzlyMemcachedCache<K, V> implements 
MemcachedCache<K, V>, ZooKee
 
     private class HealthMonitorTask implements Runnable {
 
-        private final Map<SocketAddress, Boolean> failures = new 
ConcurrentHashMap<SocketAddress, Boolean>();
-        private final Map<SocketAddress, Boolean> revivals = new 
ConcurrentHashMap<SocketAddress, Boolean>();
+        private final Map<SocketAddress, Boolean> failures = 
DataStructures.getConcurrentMap();
+        private final Map<SocketAddress, Boolean> revivals = 
DataStructures.getConcurrentMap();
         private final AtomicBoolean running = new AtomicBoolean();
 
         public boolean failure(final SocketAddress address) {
@@ -2655,9 +2655,9 @@ public class GrizzlyMemcachedCache<K, V> implements 
MemcachedCache<K, V>, ZooKee
         /**
          * Set health monitor's interval
          * <p/>
-         * This cache will schedule {@link HealthMonitorTask} with this 
interval.
-         * {@link HealthMonitorTask} will check the failure servers 
periodically and detect the revived server.
-         * If the given parameter is negative, this cache never schedules 
{@link HealthMonitorTask}
+         * This cache will schedule HealthMonitorTask with this interval.
+         * HealthMonitorTask will check the failure servers periodically and 
detect the revived server.
+         * If the given parameter is negative, this cache never schedules 
HealthMonitorTask
          * so this behavior is similar to seting {@code failover} to be 
false.
          * Default is 60.
          *--- 
a/src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCacheManager.java
+++ 
b/src/main/java/org/glassfish/grizzly/memcached/GrizzlyMemcachedCacheManager.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -49,9 +49,10 @@ import 
org.glassfish.grizzly.memcached.zookeeper.ZooKeeperConfig;
 import org.glassfish.grizzly.nio.transport.TCPNIOTransport;
 import org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder;
 import org.glassfish.grizzly.strategies.SameThreadIOStrategy;
+import org.glassfish.grizzly.utils.DataStructures;
 
 import java.io.IOException;
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Level;
@@ -70,8 +71,7 @@ public class GrizzlyMemcachedCacheManager implements 
CacheManager {
 
     private static final Logger logger = 
Grizzly.logger(GrizzlyMemcachedCacheManager.class);
 
-    private final ConcurrentHashMap<String, GrizzlyMemcachedCache<?, ?>> 
caches =
-            new ConcurrentHashMap<String, GrizzlyMemcachedCache<?, ?>>();
+    private final ConcurrentMap<String, GrizzlyMemcachedCache<?, ?>> caches 
= DataStructures.getConcurrentMap();
     private final TCPNIOTransport transport;
     private final boolean isExternalTransport;
     private final AtomicBoolean shutdown = new AtomicBoolean(false);--- 
a/src/main/java/org/glassfish/grizzly/memcached/MemcachedClientFilter.java
+++ b/src/main/java/org/glassfish/grizzly/memcached/MemcachedClientFilter.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -44,7 +44,6 @@ import org.glassfish.grizzly.Buffer;
 import org.glassfish.grizzly.Connection;
 import org.glassfish.grizzly.Grizzly;
 import org.glassfish.grizzly.attributes.Attribute;
-import org.glassfish.grizzly.attributes.NullaryFunction;
 import org.glassfish.grizzly.filterchain.BaseFilter;
 import org.glassfish.grizzly.filterchain.FilterChainContext;
 import org.glassfish.grizzly.filterchain.NextAction;
@@ -53,6 +52,7 @@ import org.glassfish.grizzly.memory.Buffers;
 import org.glassfish.grizzly.memory.CompositeBuffer;
 import org.glassfish.grizzly.memory.MemoryManager;
 import org.glassfish.grizzly.utils.DataStructures;
+import org.glassfish.grizzly.utils.NullaryFunction;
 
 import java.io.IOException;
 import java.net.SocketAddress;
@@ -110,7 +110,7 @@ public class MemcachedClientFilter extends BaseFilter {
                     });
 
     private final Attribute<BlockingQueue<MemcachedRequest>> 
requestQueueAttribute =
-            
Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute("MemcachedClientFilter.RequestQueue",
+            
Grizzly.DEFAULT_ATTRIBUTE_BUILDER.<BlockingQueue<MemcachedRequest>>createAttribute("MemcachedClientFilter.RequestQueue",
                     new NullaryFunction<BlockingQueue<MemcachedRequest>>() {
                         public BlockingQueue<MemcachedRequest> evaluate() {
                             return DataStructures.getLTQInstance();--- 
a/src/main/java/org/glassfish/grizzly/memcached/pool/BaseObjectPool.java
+++ b/src/main/java/org/glassfish/grizzly/memcached/pool/BaseObjectPool.java
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012-2013 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -44,7 +44,7 @@ import org.glassfish.grizzly.utils.DataStructures;
 
 import java.util.Map;
 import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.Executors;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ScheduledExecutorService;
@@ -57,7 +57,7 @@ import java.util.concurrent.atomic.AtomicInteger;
  * The basic implementation of {@link ObjectPool} for high performance and 
scalability
  *
  * Example of use:
- * @see org.glassfish.grizzly.memcached.BaseObjectPoolTest's test codes
+ * See org.glassfish.grizzly.memcached.pool.BaseObjectPoolTest's test codes
  *
  * This class should be thread-safe.
  *
@@ -76,8 +76,8 @@ public class BaseObjectPool<K, V> implements ObjectPool<K, 
V> {
     private final boolean disposable;
     private final long keepAliveTimeoutInSecs;
 
-    private final ConcurrentHashMap<K, QueuePool<V>> keyedObjectPool = new 
ConcurrentHashMap<K, QueuePool<V>>();
-    private final ConcurrentHashMap<V, K> managedActiveObjects = new 
ConcurrentHashMap<V, K>();
+    private final ConcurrentMap<K, QueuePool<V>> keyedObjectPool = 
DataStructures.getConcurrentMap();
+    private final ConcurrentMap<V, K> managedActiveObjects = 
DataStructures.getConcurrentMap();
     private final AtomicBoolean destroyed = new AtomicBoolean();
     private final ScheduledExecutorService scheduledExecutor;
     private final ScheduledFuture<?> scheduledFuture;
@@ -675,9 +675,9 @@ public class BaseObjectPool<K, V> implements 
ObjectPool<K, V> {
         /**
          * Set the KeepAliveTimeout of this pool
          * <p/>
-         * This pool will schedule {@link EvictionTask} with this interval.
-         * {@link EvictionTask} will evict idle objects if this pool has 
more than min objects.
-         * If the given parameter is negative, this pool never schedules 
{@link EvictionTask}.
+         * This pool will schedule EvictionTask with this interval.
+         * EvictionTask will evict idle objects if this pool has more than 
min objects.
+         * If the given parameter is negative, this pool never schedules 
EvictionTask.
          * Default is 1800.
          *
          * @param keepAliveTimeoutInSecs KeepAliveTimeout in seconds--- 
a/src/main/java/org/glassfish/grizzly/memcached/zookeeper/ZKClient.java
+++ b/src/main/java/org/glassfish/grizzly/memcached/zookeeper/ZKClient.java
@@ -49,6 +49,7 @@ import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 import org.glassfish.grizzly.Grizzly;
+import org.glassfish.grizzly.utils.DataStructures;
 
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
@@ -60,7 +61,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
@@ -134,7 +134,7 @@ public class ZKClient {
     private boolean connected;
     private Watcher.Event.KeeperState currentState;
     private AtomicBoolean running = new AtomicBoolean(true);
-    private final Map<String, BarrierListener> listenerMap = new 
ConcurrentHashMap<String, BarrierListener>();
+    private final Map<String, BarrierListener> listenerMap = 
DataStructures.getConcurrentMap();
     private final ScheduledExecutorService scheduledExecutor;
     private ZooKeeper zooKeeper;
 





[grizzly~memcached:466b3373] + upgraded grizzly-framework version(2.2.21->2.3.5)

carryel 09/05/2013
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20151030.c1dd42a)
 
 
Close
loading
Please Confirm
Close