[
https://issues.apache.org/jira/browse/GEODE-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15873465#comment-15873465
]
ASF GitHub Bot commented on GEODE-2469:
---------------------------------------
GitHub user ggreen opened a pull request:
https://github.com/apache/geode/pull/404
Geode 2469
The updated Geode Redis Adapter now works with a sample Spring Data Redis
Example
[GEODE-2469.pdf](https://github.com/apache/geode/files/785580/GEODE-2469.pdf)
These changes are focused on the HASH and Set Redis Data Types to support
Spring Data Redis sample code located at the following URL
https://github.com/Pivotal-Data-Engineering/gemfire9_examples/tree/person_example_sdg_Tracker139498217/redis/spring-data-redis-example/src/test/java/io/pivotal/redis/gemfire/example/repository
The Hash performance changes from this pull request had a 99.8% performance
improvement.
This is based on the Hashes JUNIT Tests.
https://github.com/Pivotal-Data-Engineering/gemfire9_examples/blob/person_example_sdg_Tracker139498217/redis/gemfire-streaming-client/src/test/java/io/pivotal/gemfire9/HashesJUnitTest.java
This code executed in 12.549s against Gemfire 9.0.1 code. After the
changes, the test executed in 0.022s with the GEODE-2469 pull request.
Redis Set related command performance had a 99.9% performance improvement.
See
https://github.com/Pivotal-Data-Engineering/gemfire9_examples/blob/person_example_sdg_Tracker139498217/redis/gemfire-streaming-client/src/test/java/io/pivotal/gemfire9/SetsJUnitTest.java
The previous Set Junit tests executed against GemFire 9.0.1 executed in
31.507 seconds. These same test executed in 0.036 seconds with the GEODE-2469
pull request changes.
The GemFire 9.0.1 Geode (1.1.0) version for the Geode Redis adapter created
a Geode Region for each key provided in the Redis Hash or Set related command.
Each Redis command to remove key entry previously destroyed the region. The big
performance gain is based on using a new ReDiS_HASH and ReDiS_SET region. Note
the changed will create or reuse an existing region with a matching name for
Redis HASH commands references objects. For Redis HASH object's key will have a
format of object:key
Please see https://redis.io/topics/data-types-intro HASH section on objects
for information on Redis objects.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ggreen/geode GEODE-2469
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/geode/pull/404.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #404
----
commit 44b90c4f3f8e1ec4fdae63a8be126982d7c837a2
Author: Gregory Green <[email protected]>
Date: 2017-02-14T20:31:49Z
GEODE-2469 initial changes to support Redis objects
commit 27d7600e85945a7134115630efe378ed43d980f8
Author: Gregory Green <[email protected]>
Date: 2017-02-17T00:26:11Z
GEODE-2469 changes to corrected introduced issue found during JUNIT runs
commit a4ee164ddc944e8eed93c28d2db798c222a21cd4
Author: Gregory Green <[email protected]>
Date: 2017-02-17T00:27:55Z
Merge branch 'develop' into GEODE-2469
commit d5191fb5cd10df1c9c2f34399b849d8bbf8c5bf7
Author: Gregory Green <[email protected]>
Date: 2017-02-18T21:14:02Z
GEODE-2469 add additional junit test coverage
commit 0b3bf689b835628b8573a49e3f0bb2900d07ff1c
Author: Gregory Green <[email protected]>
Date: 2017-02-18T21:14:33Z
GEODE-2469 add additional junit test coverage
commit 1958b1e129ab22be6dbb2d347fb189718fa5f8c4
Author: Gregory Green <[email protected]>
Date: 2017-02-18T21:15:44Z
Merge branch 'develop' into GEODE-2469
commit 628f5093d32a272f7515bdd0953f90e91f559ec7
Author: Gregory Green <[email protected]>
Date: 2017-02-19T02:24:26Z
GEODE-2469 adding licenses to fix RAT issues
----
> Redis adapter Hash key support
> ------------------------------
>
> Key: GEODE-2469
> URL: https://issues.apache.org/jira/browse/GEODE-2469
> Project: Geode
> Issue Type: Sub-task
> Components: redis
> Reporter: Gregory Green
> Assignee: Hitesh Khamesra
>
> The Redis adapter does not appear to handle hash keys correctly.
> The following Example: Redis CLI works.
> localhost:11211> HSET companies name "John Smith"
> Using a HSET <region>:id .. produces an error
> Example:
> localhost:11211> HSET companies:1000 name "John Smith"
> [Server error]
> [fine 2017/02/10 16:04:33.289 EST server1 <Function Execution Processor2>
> tid=0x6a] Region names may only be alphanumeric and may contain hyphens or
> underscores: companies: 1000
> java.lang.IllegalArgumentException: Region names may only be alphanumeric and
> may contain hyphens or underscores: companies: 1000
> at
> org.apache.geode.internal.cache.LocalRegion.validateRegionName(LocalRegion.java:7618)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.createVMRegion(GemFireCacheImpl.java:3201)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.basicCreateRegion(GemFireCacheImpl.java:3181)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.createRegion(GemFireCacheImpl.java:3169)
> at org.apache.geode.cache.RegionFactory.create(RegionFactory.java:762)
> at
> org.apache.geode.management.internal.cli.functions.RegionCreateFunction.createRegion(RegionCreateFunction.java:355)
> at
> org.apache.geode.management.internal.cli.functions.RegionCreateFunction.execute(RegionCreateFunction.java:90)
> at
> org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:333)
> at
> org.apache.geode.internal.cache.execute.AbstractExecution$2.run(AbstractExecution.java:303)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:621)
> at
> org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1067)
> at java.lang.Thread.run(Thread.java:745)
> //Example Spring Data Redis Object sample
> @Data
> @EqualsAndHashCode()
> @RedisHash(value="companies")
> @NoArgsConstructor
> public class Company
> {
> private @Id String id;
> ....
> //Repository
> public interface CompanyRepository extends CrudRepository<Company, String>
> {
> ....
> }
> //When saving using a repository
> repository.save(this.myCompany);
> [Same Server error]
> java.lang.IllegalArgumentException: Region names may only be alphanumeric and
> may contain hyphens or underscores:
> companies:f05405c2-86f2-4aaf-bd0c-6fecd483bf28
> at
> org.apache.geode.internal.cache.LocalRegion.validateRegionName(LocalRegion.java:7618)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.createVMRegion(GemFireCacheImpl.java:3201)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.basicCreateRegion(GemFireCacheImpl.java:3181)
> at
> org.apache.geode.internal.cache.GemFireCacheImpl.createRegion(GemFireCacheImpl.java:3169)
> at org.apache.geode.cache.RegionFactory.create(RegionFactory.java:762)
> at
> org.apache.geode.management.internal.cli.functions.RegionCreateFunction.createRegion(RegionCreateFunction.java:355)
> at
> org.apache.geode.management.internal.cli.functions.RegionCreateFunction.execute(RegionCreateFunction.java:90)
> at
> org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:333)
> at
> org.apache.geode.internal.cache.execute.AbstractExecution$2.run(AbstractExecution.java:303)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:621)
> at
> org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1067)
> at java.lang.Thread.run(Thread.java:745)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)