humboldt 1.0.2-java → 1.0.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37a2d3fc7a3bc35d2da684d3359c9299da39b155
4
- data.tar.gz: abbfab2107a18d0f4fa5e5d6ef9934d2d2d81028
3
+ metadata.gz: ad7d9161131ab93f3ee98a2a22a730bf6af82d9a
4
+ data.tar.gz: ee3f4f283aa281be60b55ecc9b6c169743d87998
5
5
  SHA512:
6
- metadata.gz: 759cd4c0de2cd31a22019b6358fcb36dd26636d40dcc6766b78cd21d68a2f8894382cd7dcc177d996a7fea6506fb2a88d39ebe5b79036c542519cbd5ed82c3e9
7
- data.tar.gz: af8dea70e46df9fa5a8526ebe9d2b7db44c189b61e89c29bbd895d1190a42dbfa1ad92e024be7f9f2eb6dd93a81f2a1f7f9a44a5e50d5293270efae18c94f718
6
+ metadata.gz: 19ccf74a3524748dcea4b24b026f7870a4785d8e6ff18cc661cde2136ab3c955f8f2bd37fb5f4b85b292bbe1961d8464b07f679fc0c3ed263eba8cb5b3fd218b
7
+ data.tar.gz: 93bc3287a0859e02d380d66fb920fc3c48fd02697411c49468da63b86a5b94a381104408667a5cf18915928a3d7ee359e4a836ab9846c5520b30c9292a19b93c
@@ -5,31 +5,6 @@ module Humboldt
5
5
  class Binary
6
6
  HADOOP = ::Hadoop::Io::BytesWritable
7
7
  RUBY = ::String
8
-
9
- attr_reader :hadoop
10
-
11
- def hadoop=(value)
12
- unless value.is_a?(HADOOP)
13
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{HADOOP}"
14
- end
15
- @hadoop = value
16
- end
17
-
18
- def initialize
19
- @hadoop = HADOOP.new
20
- end
21
-
22
- def ruby
23
- String.from_java_bytes(@hadoop.bytes).byteslice(0, @hadoop.length)
24
- end
25
-
26
- def ruby=(value)
27
- unless value.is_a?(RUBY)
28
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{RUBY}"
29
- end
30
-
31
- @hadoop.set(value.to_java_bytes, 0, value.bytesize)
32
- end
33
8
  end
34
9
 
35
10
  begin
@@ -40,13 +15,11 @@ module Humboldt
40
15
  unless value.is_a?(Hash) || value.is_a?(Array)
41
16
  raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected Hash or Array"
42
17
  end
43
- packed = MessagePack.pack(value)
44
- @hadoop.set(packed.to_java_bytes, 0, packed.bytesize)
18
+ super(MessagePack.pack(value))
45
19
  end
46
20
 
47
21
  def ruby
48
- packed = String.from_java_bytes(@hadoop.bytes).byteslice(0, @hadoop.length)
49
- MessagePack.unpack(packed, encoding: Encoding::UTF_8)
22
+ MessagePack.unpack(super(), encoding: Encoding::UTF_8)
50
23
  end
51
24
  end
52
25
  rescue LoadError
@@ -55,35 +28,6 @@ module Humboldt
55
28
  class Text
56
29
  HADOOP = ::Hadoop::Io::Text
57
30
  RUBY = ::String
58
-
59
- attr_reader :hadoop
60
-
61
- def hadoop=(value)
62
- unless value.is_a?(HADOOP)
63
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{HADOOP}"
64
- end
65
- @hadoop = value
66
- end
67
-
68
- def initialize
69
- @hadoop = HADOOP.new
70
- end
71
-
72
- def ruby
73
- String.from_java_bytes(@hadoop.bytes).byteslice(0, @hadoop.length).force_encoding(Encoding::UTF_8)
74
- end
75
-
76
- def ruby=(value)
77
- unless value.is_a?(RUBY)
78
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{RUBY}"
79
- end
80
-
81
- if value.encoding == Encoding::UTF_8
82
- @hadoop.set(value.to_java_bytes, 0, value.bytesize)
83
- else
84
- @hadoop.set(value)
85
- end
86
- end
87
31
  end
88
32
 
89
33
  begin
@@ -94,11 +38,11 @@ module Humboldt
94
38
  unless value.is_a?(Hash) || value.is_a?(Array)
95
39
  raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected Hash or Array"
96
40
  end
97
- @hadoop.set(JSON.generate(value))
41
+ super(JSON.generate(value))
98
42
  end
99
43
 
100
44
  def ruby
101
- JSON.parse(hadoop.to_s)
45
+ JSON.parse(super())
102
46
  end
103
47
  end
104
48
  end
@@ -106,56 +50,11 @@ module Humboldt
106
50
  class Long
107
51
  HADOOP = ::Hadoop::Io::LongWritable
108
52
  RUBY = ::Integer
109
-
110
- attr_reader :hadoop
111
-
112
- def hadoop=(value)
113
- unless value.is_a?(HADOOP)
114
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{HADOOP}"
115
- end
116
- @hadoop = value
117
- end
118
-
119
- def initialize
120
- @hadoop = HADOOP.new
121
- end
122
-
123
- def ruby
124
- @hadoop.get
125
- end
126
-
127
- def ruby=(value)
128
- unless value.is_a?(Integer)
129
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{RUBY}"
130
- end
131
-
132
- @hadoop.set value
133
- end
134
53
  end
135
54
 
136
55
  class None
137
56
  HADOOP = ::Hadoop::Io::NullWritable
138
57
  RUBY = ::NilClass
139
-
140
- def hadoop
141
- HADOOP.get
142
- end
143
-
144
- def hadoop=(value)
145
- unless value.is_a?(HADOOP)
146
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{HADOOP}"
147
- end
148
- end
149
-
150
- def ruby
151
- nil
152
- end
153
-
154
- def ruby=(value)
155
- unless value.nil?
156
- raise ArgumentError, "Hadoop type mismatch, was #{value.class}, expected #{RUBY}"
157
- end
158
- end
159
58
  end
160
59
 
161
60
  TYPE_CONVERTER_CLASS_CACHE = Hash.new { |h,k| h[k] = const_get(k.to_s.capitalize) }
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Humboldt
4
- VERSION = '1.0.2'.freeze
4
+ VERSION = '1.0.3'.freeze
5
5
  end
data/lib/humboldt.jar CHANGED
Binary file
data/lib/humboldt.rb CHANGED
@@ -4,6 +4,9 @@ require 'fileutils'
4
4
  require 'rubydoop'
5
5
  require 'hadoop'
6
6
 
7
+ $CLASSPATH << File.expand_path('../humboldt.jar', __FILE__)
8
+ Java::Humboldt::HumboldtLibrary.new.load(JRuby.runtime, false)
9
+
7
10
  require 'humboldt/java_lib'
8
11
 
9
12
  require 'ext/hadoop'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humboldt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: java
6
6
  authors:
7
7
  - The Burt Platform Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -66,25 +66,25 @@ executables:
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - lib/humboldt.rb
69
+ - bin/humboldt
70
+ - config/emr-bootstrap/remove_old_jruby.sh
71
+ - config/hadoop-local.xml
70
72
  - lib/ext/hadoop.rb
71
73
  - lib/ext/rubydoop.rb
74
+ - lib/humboldt.jar
75
+ - lib/humboldt.rb
72
76
  - lib/humboldt/cli.rb
73
77
  - lib/humboldt/emr_flow.rb
74
78
  - lib/humboldt/hadoop_status_filter.rb
75
79
  - lib/humboldt/java_lib.rb
76
80
  - lib/humboldt/mapper.rb
81
+ - lib/humboldt/patterns/sum_reducer.rb
77
82
  - lib/humboldt/prefix_grouping.rb
78
83
  - lib/humboldt/processor.rb
79
84
  - lib/humboldt/reducer.rb
80
85
  - lib/humboldt/rspec.rb
81
86
  - lib/humboldt/type_converters.rb
82
87
  - lib/humboldt/version.rb
83
- - lib/humboldt/patterns/sum_reducer.rb
84
- - lib/humboldt.jar
85
- - bin/humboldt
86
- - config/hadoop-local.xml
87
- - config/emr-bootstrap/remove_old_jruby.sh
88
88
  homepage: http://github.com/burtcorp/humboldt
89
89
  licenses:
90
90
  - BSD-3-Clause
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.1.9
108
+ rubygems_version: 2.4.5
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Tools and libraries for simplifying running Rubydoop jobs locally and on AWS Elastic MapReduce