Search in sources :

Example 11 with AerospikeClient

use of com.aerospike.client.AerospikeClient in project XRTB by benmfaul.

the class RedissonClient method get.

/**
	 * Given a key, return the string value.
	 * @param skey String.
	 * @return String. The value of the key.
	 */
public String get(String skey) throws Exception {
    if (ae == null) {
        return (String) cache.peek(skey);
    }
    AerospikeClient client = ae.getClient();
    if (client == null) {
        throw new Exception("NULL POINTER FOR GET");
    }
    Key key = new Key("test", "cache", skey);
    Record record = null;
    record = client.get(null, key);
    if (record == null) {
        return null;
    }
    return (String) record.bins.get("value");
}
Also used : AerospikeClient(com.aerospike.client.AerospikeClient) Record(com.aerospike.client.Record) Key(com.aerospike.client.Key)

Aggregations

AerospikeClient (com.aerospike.client.AerospikeClient)11 ClientPolicy (com.aerospike.client.policy.ClientPolicy)5 Host (com.aerospike.client.Host)4 Key (com.aerospike.client.Key)4 Record (com.aerospike.client.Record)3 NettyEventLoops (com.aerospike.client.async.NettyEventLoops)3 NioEventLoops (com.aerospike.client.async.NioEventLoops)3 EventLoopGroup (io.netty.channel.EventLoopGroup)3 EpollEventLoopGroup (io.netty.channel.epoll.EpollEventLoopGroup)3 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)3 Bin (com.aerospike.client.Bin)2 Args (com.aerospike.test.util.Args)2 BeforeClass (org.junit.BeforeClass)2 AerospikeException (com.aerospike.client.AerospikeException)1 EventLoop (com.aerospike.client.async.EventLoop)1 EventLoops (com.aerospike.client.async.EventLoops)1 EventPolicy (com.aerospike.client.async.EventPolicy)1 WritePolicy (com.aerospike.client.policy.WritePolicy)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1