gemfire-jruby 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gemfire-jruby}
8
- s.version = "0.0.6"
8
+ s.version = "0.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alan McKean"]
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
- # cacheServer.start
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 currently in the GemFire cache. Returns a JRuby Array of JRuby objects.
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
- @region.keys.each do |k| result << Marshal.load(k) end
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemfire-jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan McKean