@@ -0,0 +1,1625 @@
+package org.schedoscope.export.outputformat;%0A%0Aimport java.io.DataInput;%0Aimport java.io.DataOutput;%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.apache.hadoop.io.ArrayWritable;%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.io.Writable;%0A%0Aimport redis.clients.jedis.Jedis;%0Aimport redis.clients.jedis.Pipeline;%0A%0Apublic class RedisListWritable implements RedisWritable, Writable %7B%0A%0A%09private Text key;%0A%0A%09private ArrayWritable value;%0A%0A%09public RedisListWritable() %7B%0A%09%09key = new Text();%0A%09%09value = new ArrayWritable(Text.class);%0A%09%7D%0A%0A%09public RedisListWritable(String key, List%3CString%3E value) %7B%0A%09%09this.key = new Text(String.valueOf(key));%0A%09%09this.value = toArrayWritable(value);%0A%09%7D%0A%0A%09public RedisListWritable(Text key, ArrayWritable value) %7B%0A%09%09this.key = key;%0A%09%09this.value = value;%0A%09%7D%0A%0A%09@Override%0A%09public void write(Pipeline jedis) %7B%0A%09%09for (String v : fromArrayWritable(value)) %7B%0A%09%09%09jedis.lpush(key.toString(), v);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void readFields(Jedis jedis, String key) %7B%0A%09%09this.value = toArrayWritable(jedis.lrange(key, 0, -1));%0A%09%09this.key = new Text(key);%0A%09%7D%0A%0A%09@Override%0A%09public void write(DataOutput out) throws IOException %7B%0A%09%09key.write(out);%0A%09%09value.write(out);%0A%09%7D%0A%0A%09@Override%0A%09public void readFields(DataInput in) throws IOException %7B%0A%09%09key.readFields(in);%0A%09%09value.readFields(in);%0A%09%7D%0A%0A%09ArrayWritable toArrayWritable(List%3CString%3E value) %7B%0A%0A%09%09String%5B%5D v = new String%5Bvalue.size()%5D;%0A%09%09value.toArray(v);%0A%09%09ArrayWritable aw = new ArrayWritable(v);%0A%09%09return aw;%0A%09%7D%0A%0A%09List%3CString%3E fromArrayWritable(ArrayWritable value) %7B%0A%09%09return Arrays.asList(value.toStrings());%0A%09%7D%0A%7D%0A

add RedisListWritable