update spymemcached library

update spymemcached library
for fixes mainly related to -
1) memory leaks on reconnects
2) better handling of network issues
This commit is contained in:
nishantmonu51 2014-11-26 19:33:52 +05:30
parent 5bc1be5ba0
commit 76891d450e
3 changed files with 146 additions and 3 deletions

View File

@ -365,9 +365,9 @@
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
<version>2.8.4</version>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>

View File

@ -127,7 +127,7 @@
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
</dependency>
<dependency>

View File

@ -22,13 +22,17 @@ package io.druid.client.cache;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.primitives.Ints;
import net.spy.memcached.BroadcastOpFactory;
import net.spy.memcached.CASResponse;
import net.spy.memcached.CASValue;
import net.spy.memcached.CachedData;
import net.spy.memcached.ConnectionObserver;
import net.spy.memcached.MemcachedClientIF;
import net.spy.memcached.MemcachedNode;
import net.spy.memcached.NodeLocator;
import net.spy.memcached.internal.BulkFuture;
import net.spy.memcached.internal.BulkGetCompletionListener;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.ops.OperationStatus;
import net.spy.memcached.transcoders.SerializingTranscoder;
import net.spy.memcached.transcoders.Transcoder;
@ -43,6 +47,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@ -184,24 +189,52 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<Boolean> append(String s, Object o)
{
return null;
}
@Override
public <T> Future<Boolean> append(long cas, String key, T val, Transcoder<T> tc)
{
throw new UnsupportedOperationException("not implemented");
}
@Override
public <T> Future<Boolean> append(
String s, T t, Transcoder<T> tTranscoder
)
{
return null;
}
@Override
public Future<Boolean> prepend(long cas, String key, Object val)
{
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<Boolean> prepend(String s, Object o)
{
return null;
}
@Override
public <T> Future<Boolean> prepend(long cas, String key, T val, Transcoder<T> tc)
{
throw new UnsupportedOperationException("not implemented");
}
@Override
public <T> Future<Boolean> prepend(
String s, T t, Transcoder<T> tTranscoder
)
{
return null;
}
@Override
public <T> Future<CASResponse> asyncCAS(String key, long casId, T value, Transcoder<T> tc)
{
@ -214,6 +247,22 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<CASResponse> asyncCAS(
String s, long l, int i, Object o
)
{
return null;
}
@Override
public <T> OperationFuture<CASResponse> asyncCAS(
String s, long l, int i, T t, Transcoder<T> tTranscoder
)
{
return null;
}
@Override
public <T> CASResponse cas(String key, long casId, int exp, T value, Transcoder<T> tc)
{
@ -226,6 +275,20 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public CASResponse cas(String s, long l, int i, Object o)
{
return null;
}
@Override
public <T> CASResponse cas(
String s, long l, T t, Transcoder<T> tTranscoder
)
{
return null;
}
@Override
public <T> Future<Boolean> add(String key, int exp, T o, Transcoder<T> tc)
{
@ -437,6 +500,18 @@ class MockMemcachedClient implements MemcachedClientIF
return null;
}
@Override
public Future<Map<String, T>> addListener(BulkGetCompletionListener bulkGetCompletionListener)
{
return null;
}
@Override
public Future<Map<String, T>> removeListener(BulkGetCompletionListener bulkGetCompletionListener)
{
return null;
}
@Override
public boolean cancel(boolean b)
{
@ -622,6 +697,30 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<Long> asyncIncr(String s, long l, long l2, int i)
{
return null;
}
@Override
public Future<Long> asyncIncr(String s, int i, long l, int i2)
{
return null;
}
@Override
public Future<Long> asyncDecr(String s, long l, long l2, int i)
{
return null;
}
@Override
public Future<Long> asyncDecr(String s, int i, long l, int i2)
{
return null;
}
@Override
public Future<Long> asyncIncr(String key, long by)
{
@ -670,12 +769,42 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<Long> asyncIncr(String s, long l, long l2)
{
return null;
}
@Override
public Future<Long> asyncIncr(String s, int i, long l)
{
return null;
}
@Override
public Future<Long> asyncDecr(String s, long l, long l2)
{
return null;
}
@Override
public Future<Long> asyncDecr(String s, int i, long l)
{
return null;
}
@Override
public Future<Boolean> delete(String key)
{
throw new UnsupportedOperationException("not implemented");
}
@Override
public Future<Boolean> delete(String s, long l)
{
return null;
}
@Override
public Future<Boolean> flush(int delay)
{
@ -718,6 +847,20 @@ class MockMemcachedClient implements MemcachedClientIF
throw new UnsupportedOperationException("not implemented");
}
@Override
public CountDownLatch broadcastOp(BroadcastOpFactory broadcastOpFactory)
{
return null;
}
@Override
public CountDownLatch broadcastOp(
BroadcastOpFactory broadcastOpFactory, Collection<MemcachedNode> memcachedNodes
)
{
return null;
}
@Override
public Set<String> listSaslMechanisms()
{