[ 
https://issues.apache.org/jira/browse/GEODE-9814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454199#comment-17454199
 ] 

ASF GitHub Bot commented on GEODE-9814:
---------------------------------------

ringles commented on a change in pull request #110:
URL: https://github.com/apache/geode-examples/pull/110#discussion_r763310985



##########
File path: 
geodeForRedis/src/main/java/org/apache/geode_examples/geodeForRedis/Example.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode_examples.geodeForRedis;
+
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import redis.clients.jedis.HostAndPort;
+import redis.clients.jedis.JedisCluster;
+
+public class Example {
+  public static final String SORTED_SET_KEY = "leaderboard";
+
+  public static void main(String[] args) {
+    JedisCluster jedis = new JedisCluster(new HostAndPort("127.0.0.1", 6379));
+
+    populateSortedSet(jedis);
+
+    System.out.println("Initial leaderboard with key '" + SORTED_SET_KEY + "': 
"

Review comment:
       Since the "jedis.zrangeWithScores(SORTED_SET_KEY, 0, Integer.MAX_VALUE)" 
is repeated, possibly make it a method, say:
   
   private static void printSortedSet(JedisCluster jedis, String message) {
            System.out.println(message + ": " +  
jedis.zrangeWithScores(SORTED_SET_KEY, 0, Integer.MAX_VALUE));
   }
   
   Very minor benefits, though.

##########
File path: 
geodeForRedis/src/main/java/org/apache/geode_examples/geodeForRedis/Example.java
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode_examples.geodeForRedis;
+
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import redis.clients.jedis.HostAndPort;
+import redis.clients.jedis.JedisCluster;
+
+public class Example {
+  public static final String SORTED_SET_KEY = "leaderboard";
+
+  public static void main(String[] args) {
+    JedisCluster jedis = new JedisCluster(new HostAndPort("127.0.0.1", 6379));
+
+    populateSortedSet(jedis);
+
+    System.out.println("Initial leaderboard with key '" + SORTED_SET_KEY + "': 
"
+        + jedis.zrangeWithScores(SORTED_SET_KEY, 0, Integer.MAX_VALUE));
+    System.out.println("Updating scores...");

Review comment:
       Purely cosmetic, but possibly move the "Updating scores", "Removing", 
etc. closer to the lines that do so, and setting apart the "set dump" lines?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add an example of geode-for-redis to the geode examples project
> ---------------------------------------------------------------
>
>                 Key: GEODE-9814
>                 URL: https://issues.apache.org/jira/browse/GEODE-9814
>             Project: Geode
>          Issue Type: Improvement
>          Components: redis
>            Reporter: Dan Smith
>            Assignee: Donal Evans
>            Priority: Major
>              Labels: pull-request-available
>
> Add an example to the geode-examples project/repo demonstrating how to turn 
> on and use geode-for-redis.
> This is just a script. User must download native Redis to get command line 
> tool.
> Cluster Mode must be used.
> Start Server with gfsh.
> Use JedisCluster client to:
>  * Perform Sets
>  * Perform Gets
> Have a readme that speaks to using native Redis.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to