gemfire-jruby 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gemfire-jruby.gemspec +1 -1
- data/lib/gemfire-jruby.rb +11 -4
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/gemfire-jruby.gemspec
CHANGED
data/lib/gemfire-jruby.rb
CHANGED
@@ -31,6 +31,7 @@ module ActiveSupport
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def initialize(role, options)
|
34
|
+
@role = role
|
34
35
|
# fill the GemFire properties from the options
|
35
36
|
check_required_options(role, options)
|
36
37
|
# join the distributed system
|
@@ -47,7 +48,7 @@ module ActiveSupport
|
|
47
48
|
# it's a server
|
48
49
|
cacheServer = @cache.addCacheServer
|
49
50
|
cacheServer.setPort(options['cacheserver-port'])
|
50
|
-
|
51
|
+
cacheServer.start
|
51
52
|
regionAttributes = get_server_attributes(options)
|
52
53
|
end
|
53
54
|
@region = @cache.createRegion(options['region-name'], regionAttributes)
|
@@ -79,10 +80,16 @@ module ActiveSupport
|
|
79
80
|
logger.error("GemfireCache Error (#{e}): #{e.message}")
|
80
81
|
end
|
81
82
|
|
82
|
-
# Fetch all of the keys
|
83
|
-
def keys
|
83
|
+
# Fetch all of the keys. Optional argument controls whether the keys come from the server orReturns a JRuby Array of JRuby objects.
|
84
|
+
def keys(onServer=true)
|
85
|
+
keySet = nil
|
84
86
|
result = []
|
85
|
-
|
87
|
+
if (onServer && @role == 'client') then
|
88
|
+
keySet = @region.keySetOnServer
|
89
|
+
else
|
90
|
+
keySet = @region.keys
|
91
|
+
end
|
92
|
+
keySet.each do |k| result << Marshal.load(k) end
|
86
93
|
result
|
87
94
|
end
|
88
95
|
|