Search in sources :

Example 1 with GeodeRedisServer

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();
    }
}
Also used : GeodeRedisServer(org.apache.geode.redis.GeodeRedisServer) SimpleExtensionPoint(org.apache.geode.internal.cache.extension.SimpleExtensionPoint) ExtensionPoint(org.apache.geode.internal.cache.extension.ExtensionPoint)

Example 2 with GeodeRedisServer

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);
}
Also used : GeodeRedisServer(org.apache.geode.redis.GeodeRedisServer) CacheFactory(org.apache.geode.cache.CacheFactory) JedisDataException(redis.clients.jedis.exceptions.JedisDataException) JedisDataException(redis.clients.jedis.exceptions.JedisDataException) IOException(java.io.IOException) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 3 with GeodeRedisServer

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);
}
Also used : Jedis(redis.clients.jedis.Jedis) GeodeRedisServer(org.apache.geode.redis.GeodeRedisServer) CacheFactory(org.apache.geode.cache.CacheFactory) BeforeClass(org.junit.BeforeClass)

Example 4 with GeodeRedisServer

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());
}
Also used : GeodeRedisServer(org.apache.geode.redis.GeodeRedisServer)

Example 5 with GeodeRedisServer

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);
}
Also used : Jedis(redis.clients.jedis.Jedis) GeodeRedisServer(org.apache.geode.redis.GeodeRedisServer) CacheFactory(org.apache.geode.cache.CacheFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

GeodeRedisServer (org.apache.geode.redis.GeodeRedisServer)8 CacheFactory (org.apache.geode.cache.CacheFactory)6 BeforeClass (org.junit.BeforeClass)4 Jedis (redis.clients.jedis.Jedis)4 IOException (java.io.IOException)1 Random (java.util.Random)1 ExtensionPoint (org.apache.geode.internal.cache.extension.ExtensionPoint)1 SimpleExtensionPoint (org.apache.geode.internal.cache.extension.SimpleExtensionPoint)1 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)1 Test (org.junit.Test)1 JedisDataException (redis.clients.jedis.exceptions.JedisDataException)1