bosrvclient 0.1.7 → 0.1.8

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.
@@ -29,6 +29,23 @@ module Bosrv
29
29
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'star_apply failed: unknown result')
30
30
  end
31
31
 
32
+ def execute(token, stmt, workspace, opts)
33
+ send_execute(token, stmt, workspace, opts)
34
+ return recv_execute()
35
+ end
36
+
37
+ def send_execute(token, stmt, workspace, opts)
38
+ send_message('execute', Execute_args, :token => token, :stmt => stmt, :workspace => workspace, :opts => opts)
39
+ end
40
+
41
+ def recv_execute()
42
+ result = receive_message(Execute_result)
43
+ return result.success unless result.success.nil?
44
+ raise result.err unless result.err.nil?
45
+ raise result.arr unless result.arr.nil?
46
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'execute failed: unknown result')
47
+ end
48
+
32
49
  def sql_execute(token, sql_stmt, workspace, opts)
33
50
  send_sql_execute(token, sql_stmt, workspace, opts)
34
51
  return recv_sql_execute()
@@ -234,6 +251,19 @@ module Bosrv
234
251
  write_result(result, oprot, 'star_apply', seqid)
235
252
  end
236
253
 
254
+ def process_execute(seqid, iprot, oprot)
255
+ args = read_args(iprot, Execute_args)
256
+ result = Execute_result.new()
257
+ begin
258
+ result.success = @handler.execute(args.token, args.stmt, args.workspace, args.opts)
259
+ rescue ::Exc::ServiceError => err
260
+ result.err = err
261
+ rescue ::Exc::AuthError => arr
262
+ result.arr = arr
263
+ end
264
+ write_result(result, oprot, 'execute', seqid)
265
+ end
266
+
237
267
  def process_sql_execute(seqid, iprot, oprot)
238
268
  args = read_args(iprot, Sql_execute_args)
239
269
  result = Sql_execute_result.new()
@@ -427,6 +457,48 @@ module Bosrv
427
457
  ::Thrift::Struct.generate_accessors self
428
458
  end
429
459
 
460
+ class Execute_args
461
+ include ::Thrift::Struct, ::Thrift::Struct_Union
462
+ TOKEN = 1
463
+ STMT = 2
464
+ WORKSPACE = 3
465
+ OPTS = 4
466
+
467
+ FIELDS = {
468
+ TOKEN => {:type => ::Thrift::Types::STRING, :name => 'token'},
469
+ STMT => {:type => ::Thrift::Types::STRING, :name => 'stmt'},
470
+ WORKSPACE => {:type => ::Thrift::Types::STRING, :name => 'workspace'},
471
+ OPTS => {:type => ::Thrift::Types::STRING, :name => 'opts'}
472
+ }
473
+
474
+ def struct_fields; FIELDS; end
475
+
476
+ def validate
477
+ end
478
+
479
+ ::Thrift::Struct.generate_accessors self
480
+ end
481
+
482
+ class Execute_result
483
+ include ::Thrift::Struct, ::Thrift::Struct_Union
484
+ SUCCESS = 0
485
+ ERR = 1
486
+ ARR = 2
487
+
488
+ FIELDS = {
489
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
490
+ ERR => {:type => ::Thrift::Types::STRUCT, :name => 'err', :class => ::Exc::ServiceError},
491
+ ARR => {:type => ::Thrift::Types::STRUCT, :name => 'arr', :class => ::Exc::AuthError}
492
+ }
493
+
494
+ def struct_fields; FIELDS; end
495
+
496
+ def validate
497
+ end
498
+
499
+ ::Thrift::Struct.generate_accessors self
500
+ end
501
+
430
502
  class Sql_execute_args
431
503
  include ::Thrift::Struct, ::Thrift::Struct_Union
432
504
  TOKEN = 1
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosrvclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Jeffrey Jen
@@ -18,33 +19,34 @@ extra_rdoc_files: []
18
19
  files:
19
20
  - lib/bosrvclient.rb
20
21
  - lib/bosrvclient/big_object_service.rb
21
- - lib/bosrvclient/big_object_service_constants.rb
22
- - lib/bosrvclient/big_object_service_types.rb
23
- - lib/bosrvclient/connect.rb
24
22
  - lib/bosrvclient/exception_constants.rb
25
23
  - lib/bosrvclient/exception_types.rb
24
+ - lib/bosrvclient/big_object_service_constants.rb
25
+ - lib/bosrvclient/connect.rb
26
+ - lib/bosrvclient/big_object_service_types.rb
26
27
  homepage: https://bitbucket.org/macrodata/bosrvclient-ruby
27
28
  licenses:
28
29
  - Apache 2.0
29
- metadata: {}
30
30
  post_install_message:
31
31
  rdoc_options: []
32
32
  require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
+ none: false
35
36
  requirements:
36
- - - ">="
37
+ - - ! '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
+ none: false
40
42
  requirements:
41
- - - ">="
43
+ - - ! '>='
42
44
  - !ruby/object:Gem::Version
43
45
  version: '0'
44
46
  requirements: []
45
47
  rubyforge_project:
46
- rubygems_version: 2.2.2
48
+ rubygems_version: 1.8.23
47
49
  signing_key:
48
- specification_version: 4
50
+ specification_version: 3
49
51
  summary: BigObject service client
50
52
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f830fe94c1d3d37bf2b1e8c6ce1867cbec8b6307
4
- data.tar.gz: e02dd8c2cb39e93dd28d828000f5c5250de37699
5
- SHA512:
6
- metadata.gz: 945e41967a1ef5fda505bf0739adbb525002ad0238f4d6900f2a797ec798ec541bd6c0cdf80135737c1366bbd0f1637c1bf7b962ac5a79f657281d1c163186b3
7
- data.tar.gz: 76fe9149d538785041d12b8395257059ef7214348917ab3471028b28b6afabe0706a619f9535a293244c88b74fcc0279d63d56a367627d5816369c79349b662b