use of com.aerospike.client.Bin in project XRTB by benmfaul.
the class RedissonClient method set.
/**
* Set a key value as string with an expiration (No expiration set on cache2k, it is already set
* @param skey String. The key name.
* @param value String. The value.
* @throws Exception on aerorpike or cache errors.
*/
public void set(String set, String skey, Object value) throws Exception {
WritePolicy policy = new WritePolicy();
Key key = new Key("test", set, skey);
Bin bin1 = new Bin("value", value);
ae.getClient().put(null, key, bin1);
}
use of com.aerospike.client.Bin in project XRTB by benmfaul.
the class RedissonClient method addList.
/**
* Add a list to the cach2k/Aerorpike
* @param id String. The name of the value.
* @param list List. The value to set, a list.
*/
public void addList(String id, List list) throws Exception {
if (ae == null) {
cacheDb.put(id, list);
return;
}
Key key = new Key("test", "cache", id);
Bin bin1 = new Bin("list", list);
ae.getClient().put(null, key, bin1);
}
use of com.aerospike.client.Bin in project XRTB by benmfaul.
the class RedissonClient method hmset.
/**
* Mimic a REDIS mhset operation.
* @param id String. The key of the map.
* @param m Map. The map to set.
*/
public void hmset(String id, Map m) throws Exception {
if (ae == null) {
cache.put(id, m);
return;
}
Key key = new Key("test", "cache", id);
Bin bin1 = new Bin("value", m);
ae.getClient().put(null, key, bin1);
}
use of com.aerospike.client.Bin in project XRTB by benmfaul.
the class RedissonClient method addSet.
/**
* Ass a set of strings to the cache or aerospike. Used for blacklists.
* @param name String. The name of the set of strings.
* @param set Set. The set of strings.
* @throws Exception
*/
public void addSet(String name, Set set) throws Exception {
if (ae == null) {
cacheDb.put(name, set);
return;
}
Key key = new Key("test", "database", "rtb4free");
String data = mapper.writer().writeValueAsString(set);
Bin bin1 = new Bin("set", data);
ae.getClient().put(null, key, bin1);
}
use of com.aerospike.client.Bin in project XRTB by benmfaul.
the class RedissonClient method addMap.
/**
* Add a map (a user map) to the the cache or aerorspike.
* @param name String. The name of the map.
* @param map Map. The map of the User object.
* @throws Exception on cache2k/aerospike errors
*/
public void addMap(String name, Map map) throws Exception {
if (ae == null) {
cacheDb.put(name, map);
return;
}
Key key = new Key("test", "database", "rtb4free");
String data = mapper.writer().writeValueAsString(map);
Bin bin1 = new Bin("map", data);
ae.getClient().put(null, key, bin1);
}
Aggregations