Deprecated methods were removed

pull/337/head
Nikita 9 years ago
parent 4d4eabdb3a
commit 7bcd476d65

@ -70,9 +70,6 @@ class BaseConfig<T extends BaseConfig<T>> {
*/
private int failedAttempts = 3;
@Deprecated
private int closeConnectionAfterFailAttempts = -1;
/**
* Database index used for Redis connection
*/
@ -105,7 +102,6 @@ class BaseConfig<T extends BaseConfig<T>> {
setTimeout(config.getTimeout());
setClientName(config.getClientName());
setPingTimeout(config.getPingTimeout());
setRefreshConnectionAfterFails(config.getRefreshConnectionAfterFails());
setConnectTimeout(config.getConnectTimeout());
setIdleConnectionTimeout(config.getIdleConnectionTimeout());
setFailedAttempts(config.getFailedAttempts());
@ -224,22 +220,6 @@ class BaseConfig<T extends BaseConfig<T>> {
return pingTimeout;
}
/**
* Reconnect connection if it has <code>failAttemptsAmount</code>
* fails in a row during command sending. Turned off by default.
*
* @param failAttemptsAmount
*/
@Deprecated
public T setRefreshConnectionAfterFails(int failAttemptsAmount) {
this.closeConnectionAfterFailAttempts = failAttemptsAmount;
return (T) this;
}
@Deprecated
public int getRefreshConnectionAfterFails() {
return closeConnectionAfterFailAttempts;
}
/**
* Timeout during connecting to any Redis server.
*

@ -17,10 +17,8 @@ package org.redisson;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;
import org.redisson.api.RedissonReactiveClient;
import org.redisson.client.codec.Codec;
@ -440,123 +438,6 @@ public class Redisson implements RedissonClient {
return config;
}
/**
* Find keys by key search pattern
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
@Override
public Collection<String> findKeysByPattern(String pattern) {
return commandExecutor.get(findKeysByPatternAsync(pattern));
}
/**
* Find keys by key search pattern in async mode
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
@Override
public Future<Collection<String>> findKeysByPatternAsync(String pattern) {
return commandExecutor.readAllAsync(RedisCommands.KEYS, pattern);
}
/**
* Delete multiple objects by a key pattern
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
@Override
public long deleteByPattern(String pattern) {
return commandExecutor.get(deleteByPatternAsync(pattern));
}
/**
* Delete multiple objects by a key pattern in async mode
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
@Override
public Future<Long> deleteByPatternAsync(String pattern) {
return commandExecutor.evalWriteAllAsync(RedisCommands.EVAL_LONG, new SlotCallback<Long, Long>() {
AtomicLong results = new AtomicLong();
@Override
public void onSlotResult(Long result) {
results.addAndGet(result);
}
@Override
public Long onFinish() {
return results.get();
}
}, "local keys = redis.call('keys', ARGV[1]) "
+ "local n = 0 "
+ "for i=1, table.getn(keys),5000 do "
+ "n = n + redis.call('del', unpack(keys, i, math.min(i+4999, table.getn(keys)))) "
+ "end "
+ "return n;",Collections.emptyList(), pattern);
}
/**
* Delete multiple objects by name
*
* @param keys - object names
* @return
*/
// use RKeys.delete
@Deprecated
@Override
public long delete(String ... keys) {
return commandExecutor.get(deleteAsync(keys));
}
/**
* Delete multiple objects by name in async mode
*
* @param keys - object names
* @return
*/
// use RKeys.deleteAsync
@Deprecated
@Override
public Future<Long> deleteAsync(String ... keys) {
return commandExecutor.writeAllAsync(RedisCommands.DEL, new SlotCallback<Long, Long>() {
AtomicLong results = new AtomicLong();
@Override
public void onSlotResult(Long result) {
results.addAndGet(result);
}
@Override
public Long onFinish() {
return results.get();
}
}, (Object[])keys);
}
/**
* Get Redis nodes group for server operations
*

@ -15,7 +15,6 @@
*/
package org.redisson;
import java.util.Collection;
import java.util.List;
import org.redisson.client.codec.Codec;
@ -43,8 +42,6 @@ import org.redisson.core.RSet;
import org.redisson.core.RSortedSet;
import org.redisson.core.RTopic;
import io.netty.util.concurrent.Future;
public interface RedissonClient {
/**
@ -252,86 +249,6 @@ public interface RedissonClient {
*/
Config getConfig();
/**
* Find keys by key search pattern
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
// use RKeys.findKeysByPattern
@Deprecated
Collection<String> findKeysByPattern(String pattern);
/**
* Find keys by key search pattern in async mode
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
// use RKeys.findKeysByPatternAsync
@Deprecated
Future<Collection<String>> findKeysByPatternAsync(String pattern);
/**
* Delete multiple objects by a key pattern
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
// use RKeys.deleteByPattern
@Deprecated
long deleteByPattern(String pattern);
/**
* Delete multiple objects by a key pattern in async mode
*
* Supported glob-style patterns:
* h?llo subscribes to hello, hallo and hxllo
* h*llo subscribes to hllo and heeeello
* h[ae]llo subscribes to hello and hallo, but not hillo
*
* @param pattern
* @return
*/
// use RKeys.deleteByPatternAsync
@Deprecated
Future<Long> deleteByPatternAsync(String pattern);
/**
* Delete multiple objects by name
*
* @param keys - object names
* @return
*/
// use RKeys.delete
@Deprecated
long delete(String ... keys);
/**
* Delete multiple objects by name in async mode
*
* @param keys - object names
* @return
*/
// use RKeys.deleteAsync
@Deprecated
Future<Long> deleteAsync(String ... keys);
/**
* Get Redis nodes group for server operations
*

@ -43,8 +43,6 @@ public class RedisConnection implements RedisCommands {
private ReconnectListener reconnectListener;
private long lastUsageTime;
@Deprecated
private int failAttempts;
public RedisConnection(RedisClient redisClient, Channel channel) {
@ -75,18 +73,6 @@ public class RedisConnection implements RedisCommands {
return reconnectListener;
}
public void resetFailAttempt() {
failAttempts = 0;
}
public void incFailAttempt() {
failAttempts++;
}
public int getFailAttempts() {
return failAttempts;
}
public boolean isOpen() {
return channel.isOpen();
}
@ -103,7 +89,6 @@ public class RedisConnection implements RedisCommands {
public void updateChannel(Channel channel) {
this.channel = channel;
channel.attr(CONNECTION).set(this);
resetFailAttempt();
}
public RedisClient getRedisClient() {

@ -406,7 +406,6 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
c.setPassword(cfg.getPassword());
c.setDatabase(cfg.getDatabase());
c.setClientName(cfg.getClientName());
c.setRefreshConnectionAfterFails(cfg.getRefreshConnectionAfterFails());
c.setMasterConnectionPoolSize(cfg.getMasterConnectionPoolSize());
c.setSlaveConnectionPoolSize(cfg.getSlaveConnectionPoolSize());
c.setSlaveSubscriptionConnectionPoolSize(cfg.getSlaveSubscriptionConnectionPoolSize());

@ -224,12 +224,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
return;
}
if (!future.isSuccess()) {
conn.incFailAttempt();
} else {
conn.resetFailAttempt();
}
shutdownLatch.release();
timeout.get().cancel();
releaseWrite(source, conn);
@ -247,12 +241,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
return;
}
if (!future.isSuccess()) {
conn.incFailAttempt();
} else {
conn.resetFailAttempt();
}
shutdownLatch.release();
timeout.get().cancel();
releaseRead(source, conn);

@ -62,7 +62,6 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
c.setPassword(cfg.getPassword());
c.setDatabase(cfg.getDatabase());
c.setClientName(cfg.getClientName());
c.setRefreshConnectionAfterFails(cfg.getRefreshConnectionAfterFails());
c.setMasterConnectionPoolSize(cfg.getMasterConnectionPoolSize());
c.setSlaveConnectionPoolSize(cfg.getSlaveConnectionPoolSize());
c.setSlaveSubscriptionConnectionPoolSize(cfg.getSlaveSubscriptionConnectionPoolSize());

@ -65,7 +65,6 @@ public class SingleConnectionManager extends MasterSlaveConnectionManager {
newconfig.setPassword(cfg.getPassword());
newconfig.setDatabase(cfg.getDatabase());
newconfig.setClientName(cfg.getClientName());
newconfig.setRefreshConnectionAfterFails(cfg.getRefreshConnectionAfterFails());
newconfig.setMasterAddress(addr);
newconfig.setMasterConnectionPoolSize(cfg.getConnectionPoolSize());
newconfig.setSubscriptionsPerConnection(cfg.getSubscriptionsPerConnection());

@ -306,9 +306,6 @@ public class ConnectionPool<T extends RedisConnection> {
if (entry.isFreezed()) {
connection.closeAsync();
} else {
if (connection.getFailAttempts() == config.getRefreshConnectionAfterFails()) {
connection.forceReconnect();
}
releaseConnection(entry, connection);
}
releaseConnection(entry);

Loading…
Cancel
Save