Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize Annotations Added #3

Closed
wants to merge 53 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7b0c411
attempting to add Memoize ast transformation... not quite working yet.
ctoestreich Dec 30, 2011
39c73bc
attempting to add Memoize ast transformation... not quite working yet.
ctoestreich Dec 31, 2011
993605b
making some progress... just need to solve the issue with getting var…
ctoestreich Jan 12, 2012
f7aff29
making some progress... just need to solve the issue with getting var…
ctoestreich Jan 12, 2012
33a7946
trying a bunch of things to get the variableScope to work....
ctoestreich Jan 12, 2012
d9f6a54
looked at using the VariableScopeVisitor to no avail. still produces…
ctoestreich Jan 13, 2012
bcb18d7
I think it is working finally...
ctoestreich Jan 13, 2012
86ad25c
adding spock and integration specs for testing simple and complex str…
ctoestreich Jan 13, 2012
00c3fe6
adding spock and integration specs for testing simple and complex str…
ctoestreich Jan 13, 2012
bfbaa33
adding ability to use closure or params also added expire to usable p…
ctoestreich Jan 14, 2012
c07d513
appending the method name to the key automatically
ctoestreich Jan 14, 2012
a3b6e51
fixing key generation string
ctoestreich Jan 14, 2012
701cc04
fixing key generation string
ctoestreich Jan 14, 2012
f405e1c
removing the method name from cache key
ctoestreich Jan 17, 2012
4c7acca
moving some folders and adding codenarc and coverage and tests to mai…
ctoestreich Jan 17, 2012
709aaf8
adding AST tests to the mainline code and adding ignore for files in …
ctoestreich Jan 17, 2012
a5c66d5
adding AST tests to the mainline code and adding ignore for files in …
ctoestreich Jan 17, 2012
8282130
missed adding AST when I moved :)
ctoestreich Jan 17, 2012
e035485
still having trouble parsing the gstrings
ctoestreich Jan 17, 2012
59838cc
still having trouble parsing the gstrings
ctoestreich Jan 17, 2012
c9fa260
finally got the gstrings to work and added list and has support. hav…
ctoestreich Jan 18, 2012
cc51b44
added remaining ASTs
ctoestreich Jan 19, 2012
52fe31f
doing a bunch of cleanup and adding detection and auto injection of t…
ctoestreich Jan 23, 2012
882bf9e
starting to update documentation, doing a bunch of cleanup and adding…
ctoestreich Jan 23, 2012
5130aa4
updating documentation
ctoestreich Jan 23, 2012
48358df
updating documentation
ctoestreich Jan 23, 2012
f8fef5a
updating documentation
ctoestreich Jan 23, 2012
6ad5f7c
updating documentation
ctoestreich Jan 23, 2012
fe5eef5
updating documentation
ctoestreich Jan 30, 2012
2f8b498
updating documentation
ctoestreich Jan 30, 2012
00309fc
updating documentation
ctoestreich Jan 30, 2012
a29a3ea
updating documentation
ctoestreich Jan 30, 2012
bf481da
updating documentation
ctoestreich Jan 30, 2012
a0d147c
adding domain and service for test and adding the files in plugin exc…
ctoestreich Jan 30, 2012
159c9a3
codenarc cleanup a bit of the service code
ctoestreich Jan 30, 2012
3de6f9d
codenarc cleanup
ctoestreich Jan 30, 2012
43247ba
codenarc cleanup
ctoestreich Jan 30, 2012
01242f5
codenarc report naming
ctoestreich Jan 30, 2012
a987081
codenarc report naming
ctoestreich Jan 30, 2012
ff9515c
codenarc cleanup
ctoestreich Jan 30, 2012
1e8a928
codenarc cleanup
ctoestreich Jan 30, 2012
405c8b9
fixing build for default project
ctoestreich Jan 30, 2012
50bdef7
fixing build for default project
ctoestreich Jan 30, 2012
4d4f0bf
fixing build for default project
ctoestreich Jan 30, 2012
020deb2
codenarc cleanup
ctoestreich Jan 30, 2012
05c08d9
codenarc cleanup
ctoestreich Jan 30, 2012
649f603
codenarc cleanup
ctoestreich Jan 30, 2012
b23a6e2
codenarc cleanup
ctoestreich Jan 30, 2012
f11c7fa
codenarc cleanup
ctoestreich Jan 30, 2012
32aea5f
codenarc cleanup
ctoestreich Jan 30, 2012
bec3497
codenarc cleanup
ctoestreich Jan 30, 2012
a306006
codenarc cleanup
ctoestreich Jan 30, 2012
46f8625
removal of tomcat/hibernate from application.properties.
ctoestreich Feb 1, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updating documentation
  • Loading branch information
ctoestreich committed Jan 23, 2012
commit 48358df6b8eaa6d643912735f20ac67175e669b1
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ The best definition of Redis that I've heard is that it is a "collection of data

Redis is an [insanely fast][redisfast] key/value store, in some ways similar to [memcached][memcached], but the values it stores aren't just dumb blobs of data. Redis values are data structures like [strings][redisstring], [lists][redislist], [hash maps][redishash], [sets][redisset], and [sorted sets][redissortedset]. Redis also can act as a lightweight pub/sub or message queueing system.


Redis is used in production today by a [number of very popular][redisusing] websites including Craigslist, StackOverflow, GitHub, The Guardian, and Digg.

It's commonly lumped in with other NoSQL technologies and is commonly used as a caching layerhas some similarities to Memcached or Tokyo Tyrant. Because Redis provides network-available data structures, it's very flexible and it's able to solve all kinds of problems. The creator of Redis, Salvatore Sanfilippo, has a nice post on his blog showing [how to take advantage of Redis by just adding it to your stack][addredisstack]. With the Grails Redis plugin, adding Redis to your grails app is very easy.
Expand Down Expand Up @@ -180,15 +179,15 @@ In addition to using the concrete and finite redisService.memoize* methods, as o
The following are available as annotations:

<table width="100%">
<tr><td><b>Annotation</b></td><td><b>Parameters</b></td><td><b>Description</b></td></tr>
<tr><td>@Memoize</td><td>key<br></td><td></td></tr>
<tr><td>@MemoizeDomainObject</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeList</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeHash</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeHashField</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeList</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeSet</td><td>asdf</td><td></td></tr>
<tr><td>@MemoizeScore</td><td>asdf</td><td></td></tr>
<tr><td><b>Annotation</b></td><td><b>Description</b></td></tr>
<tr><td>@Memoize</td><td>Used to memoize methods that return a "string" - redisService.memoize</td></tr>
<tr><td>@MemoizeDomainObject</td><td>Used to memoize methods that return a domain object - redisService.memoizeDomain</td></tr>
<tr><td>@MemoizeDomainList</td><td>Used to memoize methods that return a domain object list - redisService.memoizeDomainList</td></tr>
<tr><td>@MemoizeHash</td><td>Used to memoize methods that return a hash - redisService.memoizeHash</td></tr>
<tr><td>@MemoizeHashField</td>Used to memoize methods that return a hash field - redisService.memoizeHashField<td></td></tr>
<tr><td>@MemoizeList</td><td>Used to memoize methods that return a list - redisService.memoizeList</td></tr>
<tr><td>@MemoizeSet</td><td>Used to memoize methods that return a set - redisService.memoizeSet</td></tr>
<tr><td>@MemoizeScore</td><td>Used to memoize methods that returns a score from a hash - redisService.memoizeScore</td></tr>
</table>

There are integration usage tests written in spock for services at [RedisMemoizeServiceSpec.groovy][redisannotationservicespeccode] and for domains at [RedisMemoizeDomainSpec.groovy][redisannotationdomainspeccode]
Expand Down Expand Up @@ -242,8 +241,6 @@ You can either specify a closure OR a key and expire. When using the closure st
return book.toString()
}



### @MemoizeDomainObject ###

@MemoizeDomainObject(key = "#{title}", clazz = Book.class)
Expand All @@ -261,16 +258,25 @@ You can either specify a closure OR a key and expire. When using the closure st
Book.findAllByTitle(title)
}


### @MemoizeScore ###

@MemoizeScore(key = "#{map.key}", member="foo")
def getAnnotatedScore(Map map) {
return map.foo
}

### @MemoizeList ###


@MemoizeList(key = "#{list[0]}")
def getAnnotatedList(List list) {
return list
}

### @MemoizeHash ###


@MemoizeHash(key = "#{map.foo}")
def getAnnotatedHash(Map map) {
return map
Expand Down