Search in sources :

Example 1 with KeyStringValueList

use of com.moilioncircle.redis.replicator.rdb.datatype.KeyStringValueList in project rocketmq-externals by apache.

the class RedisEventHandlerTest method handlerTest.

private <T> KVEntry handlerTest(int rdbType, ValueSetter<T> setter) {
    KVEntry res = null;
    Exception ex = null;
    Config config = getConfig();
    RedisEventHandler handler = new DefaultRedisEventHandler(config);
    KeyValuePair keyValuePair = new KeyStringValueList();
    keyValuePair.setValueRdbType(rdbType);
    keyValuePair.setKey("key".getBytes());
    Object value = setter.getValue();
    keyValuePair.setValue(value);
    try {
        res = handler.handleKVString(replId, offset, keyValuePair);
    } catch (Exception e) {
        e.printStackTrace();
        ex = e;
    }
    Assert.assertNull(ex);
    return res;
}
Also used : KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) RedisEventHandler(org.apache.rocketmq.connect.redis.handler.RedisEventHandler) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler) BatchedKeyValuePair(com.moilioncircle.redis.replicator.rdb.iterable.datatype.BatchedKeyValuePair) KeyValuePair(com.moilioncircle.redis.replicator.rdb.datatype.KeyValuePair) Config(org.apache.rocketmq.connect.redis.common.Config) KeyStringValueList(com.moilioncircle.redis.replicator.rdb.datatype.KeyStringValueList) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler)

Aggregations

KeyStringValueList (com.moilioncircle.redis.replicator.rdb.datatype.KeyStringValueList)1 KeyValuePair (com.moilioncircle.redis.replicator.rdb.datatype.KeyValuePair)1 BatchedKeyValuePair (com.moilioncircle.redis.replicator.rdb.iterable.datatype.BatchedKeyValuePair)1 Config (org.apache.rocketmq.connect.redis.common.Config)1 DefaultRedisEventHandler (org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler)1 RedisEventHandler (org.apache.rocketmq.connect.redis.handler.RedisEventHandler)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1