webhdfs 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/webhdfs/client_v1.rb +4 -3
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -11,7 +11,8 @@ module WebHDFS
11
11
  OPT_TABLE = {} # internal use only
12
12
 
13
13
  attr_accessor :host, :port, :username, :doas
14
- attr_accessor :open_timeout, :read_timeout
14
+ attr_accessor :open_timeout # default 30s (in ruby net/http)
15
+ attr_accessor :read_timeout # default 60s (in ruby net/http)
15
16
  attr_accessor :httpfs_mode
16
17
 
17
18
  def initialize(host='localhost', port=50070, username=nil, doas=nil)
@@ -228,7 +229,7 @@ module WebHDFS
228
229
  else
229
230
  uri.path
230
231
  end
231
- request(uri.host, uri.port, method, rpath, nil, {}, payload)
232
+ request(uri.host, uri.port, method, rpath, nil, {}, payload, {'Content-Type' => 'application/octet-stream'})
232
233
  else
233
234
  if @httpfs_mode and not payload.nil?
234
235
  request(@host, @port, method, path, op, params, payload, {'Content-Type' => 'application/octet-stream'})
@@ -245,7 +246,7 @@ module WebHDFS
245
246
  # FileNotFoundException 404 Not Found
246
247
  # RumtimeException 500 Internal Server Error
247
248
  def request(host, port, method, path, op=nil, params={}, payload=nil, header=nil)
248
- conn = Net::HTTP.start(host, port)
249
+ conn = Net::HTTP.new(host, port)
249
250
  conn.open_timeout = @open_timeout if @open_timeout
250
251
  conn.read_timeout = @read_timeout if @read_timeout
251
252
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webhdfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-13 00:00:00.000000000 Z
12
+ date: 2012-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake