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

Support for incr/decr operations #1

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9e739f3
added another merle project to the readme.
joewilliams Mar 19, 2010
8742789
gen_server2 upgrade
May 5, 2010
3294247
Merge branch 'master' of github.com:joewilliams/merle
May 5, 2010
9e60987
added priority queue for gen_server2
May 6, 2010
ab4bccc
s/get/getkey in t02
May 6, 2010
1fc2c4f
better disconnect procedure, thanks zabrane
Jun 28, 2010
60b4251
disconnect should be a cast not call
Jun 28, 2010
d312572
added incr/2, decr/2, addcounter/1, literal/1
Mar 22, 2012
8aeacc7
better addcounter/1, incr/2 and decr/2
Mar 22, 2012
57194fe
Wrapped merle:literal/1 in conditional compilation; documentation
Mar 26, 2012
da6a303
README update
Mar 26, 2012
3c0798a
Adding myself to contributer list in NOTICES
Mar 26, 2012
00538e0
Revert "Adding myself to contributer list in NOTICES"
Mar 26, 2012
03148eb
Revert "Revert "Adding myself to contributer list in NOTICES""
Mar 27, 2012
ab1386e
adding LICENSE.txt to the project
Mar 27, 2012
655f4c0
Trying to rebarify merle
jesse-lauro May 18, 2012
cd05757
Adding a more convenient set method that can skip the creation of arb…
jesse-lauro May 18, 2012
210caa0
Fixed stupid comp error miss
jesse-lauro May 18, 2012
a18939f
Adding ebin to .gitignore
jesse-lauro May 18, 2012
f724f4d
Made addcounter functionality work properly with target version of me…
jesse-lauro May 18, 2012
c2b7b23
Added support for retrieving counter values, or indeed any value stor…
jesse-lauro May 21, 2012
76bb117
Merged changes from pplov fork. Trying to get connection pooling and…
jesse-lauro Jul 10, 2012
d216f70
Debugged issues with merle incr/decr operation
jesse-lauro Jul 10, 2012
e037527
Added support for timeouts to be passed as an arg to the various merl…
jesse-lauro Jul 11, 2012
a5e2d5f
A few changes to the merle parsing of a get response... have to suppo…
jesse-lauro Jul 11, 2012
a4fda86
Fixed issue with using merle with elasticache... have to trim values …
jesse-lauro Jul 17, 2012
e619039
Fixed a bug with socket timeouts
jesse-lauro Jul 17, 2012
48fefff
Added logging for better debugging of memcache errors
jesse-lauro Jul 20, 2012
a9e8ecd
Fixed bug with merle timeouts. When these occur it's best to kill th…
jesse-lauro Jul 24, 2012
6f58759
Ripped out extraneous loggging statement left over from debugging
jesse-lauro Jul 27, 2012
0fc016f
Added a round_robin option for connection pooling
jesse-lauro Aug 15, 2012
73950f4
Fixed dynamic merle compile
jesse-lauro Aug 15, 2012
b011877
Ended race condition with local_pg2 init... debugged round_robin merl…
jesse-lauro Aug 16, 2012
26e8ad8
Splitting writes from reads on ets tables within process group
jesse-lauro Aug 21, 2012
9e96b68
Trying to lock individual merle conns when in use
jesse-lauro Aug 21, 2012
495d231
Small bug fix with how we retrieve pids
jesse-lauro Aug 21, 2012
2ed5898
Small bug fix with how we create use_count records
jesse-lauro Aug 21, 2012
114e463
It helps to actually export the function
jesse-lauro Aug 21, 2012
94fa953
Modified strategy so that merle_watchers are managed by process group…
jesse-lauro Aug 22, 2012
dd9e5bd
Removed extraneous log message
jesse-lauro Aug 22, 2012
b6c2e95
Changed the way we release the merle connection slightly
jesse-lauro Aug 22, 2012
0be553f
Reduced error logging to make less noisy
jesse-lauro Aug 22, 2012
394d186
Changed exit scheme for merle processes.. should now issue exit messa…
jesse-lauro Aug 22, 2012
a0435ab
Reduced error_logger logging when killing memcache connections
jesse-lauro Aug 22, 2012
ccc51f8
Simplified merle_cluster exec, complete with monitoring
jesse-lauro Aug 22, 2012
ba88778
Fixed a bug with merle_watcher monitoring... fixed other shit
jesse-lauro Aug 22, 2012
5a708f4
Tweaked supervision tree for merle project, so that if process pool m…
jesse-lauro Aug 23, 2012
1f7e194
Adding timestamp that tracks time when connections unlock
jesse-lauro Aug 23, 2012
059bab7
Added utility method for retrieving number of available merle connect…
jesse-lauro Aug 23, 2012
ebe815d
Debugged count_available utility method
jesse-lauro Aug 23, 2012
1eae31a
Bug fix to monitoring call
jesse-lauro Aug 23, 2012
83191ce
Adding periodic clean so that we never lose merle connections, even i…
jesse-lauro Aug 24, 2012
43afd58
Adding periodic clean so that we never lose merle connections, even i…
jesse-lauro Aug 24, 2012
f76ea9e
Added proper calculation of now to merle code
jesse-lauro Aug 24, 2012
f382bbe
One more time calc
jesse-lauro Aug 24, 2012
7aec952
Now properly cleaning against proper interval
jesse-lauro Aug 24, 2012
9381814
Added threshold in RR index incrementing
jesse-lauro Aug 24, 2012
0f01024
Shifting the round robin index to include threshold
jesse-lauro Aug 24, 2012
3349a58
Merge pull request #1 from jesse-ad/locked-pgs
jesse-lauro Aug 24, 2012
29ebe6e
Made some changes to the way join initializes state
jesse-lauro Aug 24, 2012
4cf1e33
Trying to fix merle initialization bugs
jesse-lauro Aug 24, 2012
07e19d7
Removing overly verbose error logs from merle
jesse-lauro Nov 27, 2012
3fdbf4d
No longer greedily initializing all connections upon first start. In…
jesse-lauro Jan 2, 2013
0e7459f
Simplified connection pooling logic. Now use status is stored within…
jesse-lauro Jan 3, 2013
f5f6e11
Some bug fixes
jesse-lauro Jan 4, 2013
2e7323f
Returning result along with merle state upon call to merle:exec
jesse-lauro Jan 10, 2013
29c93f7
Fixed a merle code bug
jesse-lauro Jan 10, 2013
2ace37f
Merged old-connection-pooling branch. Now returning merle exec result…
jesse-lauro Jan 10, 2013
592f5d8
Turned down log4erl logging on merle errors
jesse-lauro Jan 11, 2013
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
out
.idea
ebin
*.iml
9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Copyright (c) 2009 Joe Williams
Copyright (c) 2009 Nick Gerakines
Copyright (c) 2010 Zabrane Mikael

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Contributors and Copyright holders:

* Copyright 2009, Joe Williams <[email protected]>
* Copyright 2009, Nick Gerakines <[email protected]>
* Copyright 2010, Zabrane Mikael <[email protected]>
* Copyright 2012, Jeremy D. Acord <[email protected]>m
30 changes: 26 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ This code is available as Open Source Software under the MIT license.


Features:
* Support for stats, version, getkey, getskey, delete, set, add, replace, cas, flushall, verbosity
* Support for stats, version, getkey, getskey, delete, set, add, replace, cas, flushall, verbosity, incr and decr (with specially set "counter" keys)

Notes:
* Uses term_to_binary and binary_to_term to serialize/deserialize Erlang terms before sending/receiving them. This allows for native Erlang terms to be returned from memcached but doesn't play well using other languages after setting values with merle or using merle to get values set by other languages.
* getkey and getskey currently don't work on keys initialized with addcounter/1. The binary data you get back won't be a serialized erlang integer, and so the implicity binary_to_term done by getkey and getskey provokes disaster.

Merle Based Projects:

http://github.com/cstar/merle/tree/master
http://github.com/issuu/merle/tree/master
http://github.com/0lvin/merle/tree/master
http://github.com/cstar/merle
http://github.com/issuu/merle
http://github.com/0lvin/merle
http://github.com/ppolv/merle

Usage:

Expand Down Expand Up @@ -103,3 +105,23 @@ ok
"STAT evictions 0","STAT bytes_read 216",
"STAT bytes_written 468","STAT limit_maxbytes 67108864",
"STAT threads 1","END"]

> merle:addcounter("my_counter").
ok
> merle:incr("my_counter",0).
{ok,0}
> merle:incr("my_counter",12).
{ok,12}
> merle:addcounter("my_counter").
ok
> merle:incr("my_counter",12).
{ok,24}
> merle:decr("my_counter",30).
{ok,0}
> merle:incr("nonexistent_counter",0).
not_found
> merle:delete("my_counter").
ok
> merle:delete("my_counter").
not_found

Binary file added rebar
Binary file not shown.
Loading