[
https://issues.apache.org/jira/browse/BEAM-7286?focusedWorklogId=241654&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241654
]
ASF GitHub Bot logged work on BEAM-7286:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/May/19 10:14
Start Date: 14/May/19 10:14
Worklog Time Spent: 10m
Work Description: aromanenko-dev commented on pull request #8570:
[BEAM-7286] RedisIO support for INCR/DECR operations
URL: https://github.com/apache/beam/pull/8570#discussion_r283720832
##########
File path:
sdks/java/io/redis/src/test/java/org/apache/beam/sdk/io/redis/RedisIOTest.java
##########
@@ -242,6 +242,62 @@ public void testWriteUsingHLLMethod() throws Exception {
Assert.assertEquals(6, count);
}
+ @Test
+ public void testWriteUsingINCR() throws Exception {
+ String key = "key";
+
+ Jedis jedis =
+ RedisConnectionConfiguration.create(REDIS_HOST,
embeddedRedis.getPort()).connect();
+
+ PCollection<KV<String, String>> write =
+ writePipeline.apply(
+ Create.of(
+ KV.of(key, "0"),
+ KV.of(key, "1"),
+ KV.of(key, "2"),
+ KV.of(key, "-3"),
+ KV.of(key, "2"),
+ KV.of(key, "4"),
+ KV.of(key, "0"),
+ KV.of(key, "5")));
+
+ write.apply(
+ RedisIO.write().withEndpoint(REDIS_HOST,
embeddedRedis.getPort()).withMethod(Method.INCR));
+
+ writePipeline.run();
+
+ long count = Long.parseLong(jedis.get(key));
+ Assert.assertEquals(11, count);
+ }
+
+ @Test
+ public void testWriteUsingDECR() throws Exception {
Review comment:
Rename to `testWriteUsingDECRBY`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 241654)
Time Spent: 40m (was: 0.5h)
> RedisIO support for INCR/DECR operations
> ----------------------------------------
>
> Key: BEAM-7286
> URL: https://issues.apache.org/jira/browse/BEAM-7286
> Project: Beam
> Issue Type: Improvement
> Components: io-java-redis
> Affects Versions: 2.12.0
> Reporter: Varun Dhussa
> Assignee: Varun Dhussa
> Priority: Minor
> Time Spent: 40m
> Remaining Estimate: 0h
>
> An analytics use-case may require streaming INCR / DECR operations to a Redis
> key. These instructions are not currently supported in beam.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)