use of org.apache.geode.redis.GeodeRedisServer in project geode by apache.
the class GemFireCacheImpl method startRedisServer.
private void startRedisServer() {
int port = this.system.getConfig().getRedisPort();
if (port != 0) {
String bindAddress = this.system.getConfig().getRedisBindAddress();
assert bindAddress != null;
if (bindAddress.equals(DistributionConfig.DEFAULT_REDIS_BIND_ADDRESS)) {
getLoggerI18n().info(LocalizedStrings.GemFireCacheImpl_STARTING_GEMFIRE_REDIS_SERVER_ON_PORT_0, new Object[] { port });
} else {
getLoggerI18n().info(LocalizedStrings.GemFireCacheImpl_STARTING_GEMFIRE_REDIS_SERVER_ON_BIND_ADDRESS_0_PORT_1, new Object[] { bindAddress, port });
}
this.redisServer = new GeodeRedisServer(bindAddress, port);
this.redisServer.start();
}
}
use of org.apache.geode.redis.GeodeRedisServer in project geode by apache.
the class AuthJUnitTest method testAuthNoPwd.
@Test
public void testAuthNoPwd() {
CacheFactory cf = new CacheFactory();
cf.set(LOG_LEVEL, "error");
cf.set(MCAST_PORT, "0");
cf.set(LOCATORS, "");
cache = cf.create();
server = new GeodeRedisServer("localhost", port);
server.start();
Exception ex = null;
try {
jedis.auth(PASSWORD);
} catch (JedisDataException e) {
ex = e;
}
assertNotNull(ex);
}
use of org.apache.geode.redis.GeodeRedisServer in project geode by apache.
the class StringsJunitTest method setUp.
@BeforeClass
public static void setUp() throws IOException {
rand = new Random();
CacheFactory cf = new CacheFactory();
// cf.set("log-file", "redis.log");
cf.set(LOG_LEVEL, "error");
cf.set(MCAST_PORT, "0");
cf.set(LOCATORS, "");
cache = cf.create();
port = AvailablePortHelper.getRandomAvailableTCPPort();
server = new GeodeRedisServer("localhost", port);
server.start();
jedis = new Jedis("localhost", port, 10000000);
}
use of org.apache.geode.redis.GeodeRedisServer in project geode by apache.
the class ConcurrentStartTest method runNServers.
private void runNServers(int n) throws InterruptedException {
final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(numServers);
final Thread[] threads = new Thread[n];
for (int i = 0; i < n; i++) {
final int j = i;
Runnable r = new Runnable() {
@Override
public void run() {
GeodeRedisServer s = new GeodeRedisServer(ports[j]);
s.start();
s.shutdown();
}
};
Thread t = new Thread(r);
t.setDaemon(true);
t.start();
threads[i] = t;
}
for (Thread t : threads) t.join();
this.cache = GemFireCacheImpl.getInstance();
assertFalse(this.cache.isClosed());
}
use of org.apache.geode.redis.GeodeRedisServer in project geode by apache.
the class HashesJUnitTest method setUp.
@BeforeClass
public static void setUp() throws IOException {
rand = new Random();
CacheFactory cf = new CacheFactory();
// cf.set("log-file", "redis.log");
cf.set(LOG_LEVEL, "error");
cf.set(MCAST_PORT, "0");
cf.set(LOCATORS, "");
cache = cf.create();
port = AvailablePortHelper.getRandomAvailableTCPPort();
server = new GeodeRedisServer("localhost", port);
server.start();
jedis = new Jedis("localhost", port, 10000000);
}
Aggregations