sequel_impala 1.1.0

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.
Files changed (129) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +50 -0
  3. data/LICENSE +463 -0
  4. data/README.md +45 -0
  5. data/Rakefile +39 -0
  6. data/lib/driver/commons-collections-3.2.1.jar +0 -0
  7. data/lib/driver/commons-configuration-1.10.jar +0 -0
  8. data/lib/driver/commons-logging-1.2.jar +0 -0
  9. data/lib/driver/hadoop-auth-2.9.0.jar +0 -0
  10. data/lib/driver/hadoop-common-2.9.0.jar +0 -0
  11. data/lib/driver/hadoop-core-2.6.0.jar +0 -0
  12. data/lib/driver/hive-exec-1.1.0.jar +0 -0
  13. data/lib/driver/hive-jdbc-1.1.0.jar +0 -0
  14. data/lib/driver/hive-metastore-1.1.0.jar +0 -0
  15. data/lib/driver/hive-service-1.1.0.jar +0 -0
  16. data/lib/driver/httpclient-4.3.jar +0 -0
  17. data/lib/driver/httpcore-4.3.jar +0 -0
  18. data/lib/driver/libfb303-0.9.0.jar +0 -0
  19. data/lib/driver/log4j-1.2.17.jar +0 -0
  20. data/lib/driver/slf4j-api-1.7.5.jar +0 -0
  21. data/lib/driver/stax2-api-3.1.4.jar +0 -0
  22. data/lib/driver/woodstox-core-asl-4.4.1.jar +0 -0
  23. data/lib/impala.rb +55 -0
  24. data/lib/impala/connection.rb +180 -0
  25. data/lib/impala/cursor.rb +200 -0
  26. data/lib/impala/progress_reporter.rb +40 -0
  27. data/lib/impala/protocol.rb +8 -0
  28. data/lib/impala/protocol/beeswax_constants.rb +15 -0
  29. data/lib/impala/protocol/beeswax_service.rb +747 -0
  30. data/lib/impala/protocol/beeswax_types.rb +193 -0
  31. data/lib/impala/protocol/exec_stats_constants.rb +13 -0
  32. data/lib/impala/protocol/exec_stats_types.rb +133 -0
  33. data/lib/impala/protocol/facebook_service.rb +706 -0
  34. data/lib/impala/protocol/fb303_constants.rb +15 -0
  35. data/lib/impala/protocol/fb303_types.rb +25 -0
  36. data/lib/impala/protocol/hive_metastore_constants.rb +53 -0
  37. data/lib/impala/protocol/hive_metastore_types.rb +698 -0
  38. data/lib/impala/protocol/impala_hive_server2_service.rb +137 -0
  39. data/lib/impala/protocol/impala_service.rb +443 -0
  40. data/lib/impala/protocol/impala_service_constants.rb +13 -0
  41. data/lib/impala/protocol/impala_service_types.rb +192 -0
  42. data/lib/impala/protocol/status_constants.rb +13 -0
  43. data/lib/impala/protocol/status_types.rb +46 -0
  44. data/lib/impala/protocol/t_c_l_i_service.rb +1108 -0
  45. data/lib/impala/protocol/t_c_l_i_service_constants.rb +72 -0
  46. data/lib/impala/protocol/t_c_l_i_service_types.rb +1802 -0
  47. data/lib/impala/protocol/thrift_hive_metastore.rb +4707 -0
  48. data/lib/impala/protocol/types_constants.rb +13 -0
  49. data/lib/impala/protocol/types_types.rb +332 -0
  50. data/lib/impala/sasl_transport.rb +117 -0
  51. data/lib/impala/thrift_patch.rb +31 -0
  52. data/lib/impala/version.rb +3 -0
  53. data/lib/jdbc/hive2.rb +52 -0
  54. data/lib/jdbc/impala.rb +50 -0
  55. data/lib/rbhive.rb +8 -0
  56. data/lib/rbhive/connection.rb +150 -0
  57. data/lib/rbhive/explain_result.rb +46 -0
  58. data/lib/rbhive/result_set.rb +37 -0
  59. data/lib/rbhive/schema_definition.rb +86 -0
  60. data/lib/rbhive/t_c_l_i_connection.rb +466 -0
  61. data/lib/rbhive/t_c_l_i_result_set.rb +3 -0
  62. data/lib/rbhive/t_c_l_i_schema_definition.rb +87 -0
  63. data/lib/rbhive/table_schema.rb +122 -0
  64. data/lib/rbhive/version.rb +3 -0
  65. data/lib/sequel/adapters/impala.rb +220 -0
  66. data/lib/sequel/adapters/jdbc/hive2.rb +36 -0
  67. data/lib/sequel/adapters/jdbc/impala.rb +38 -0
  68. data/lib/sequel/adapters/rbhive.rb +177 -0
  69. data/lib/sequel/adapters/shared/impala.rb +808 -0
  70. data/lib/sequel/extensions/csv_to_parquet.rb +166 -0
  71. data/lib/thrift/facebook_service.rb +700 -0
  72. data/lib/thrift/fb303_constants.rb +9 -0
  73. data/lib/thrift/fb303_types.rb +19 -0
  74. data/lib/thrift/hive_metastore_constants.rb +41 -0
  75. data/lib/thrift/hive_metastore_types.rb +630 -0
  76. data/lib/thrift/hive_service_constants.rb +13 -0
  77. data/lib/thrift/hive_service_types.rb +72 -0
  78. data/lib/thrift/queryplan_constants.rb +13 -0
  79. data/lib/thrift/queryplan_types.rb +261 -0
  80. data/lib/thrift/sasl_client_transport.rb +161 -0
  81. data/lib/thrift/serde_constants.rb +92 -0
  82. data/lib/thrift/serde_types.rb +7 -0
  83. data/lib/thrift/t_c_l_i_service.rb +1054 -0
  84. data/lib/thrift/t_c_l_i_service_constants.rb +72 -0
  85. data/lib/thrift/t_c_l_i_service_types.rb +1768 -0
  86. data/lib/thrift/thrift_hive.rb +508 -0
  87. data/lib/thrift/thrift_hive_metastore.rb +3856 -0
  88. data/spec/database_test.rb +56 -0
  89. data/spec/dataset_test.rb +1268 -0
  90. data/spec/files/bad_down_migration/001_create_alt_basic.rb +4 -0
  91. data/spec/files/bad_down_migration/002_create_alt_advanced.rb +4 -0
  92. data/spec/files/bad_timestamped_migrations/1273253849_create_sessions.rb +9 -0
  93. data/spec/files/bad_timestamped_migrations/1273253851_create_nodes.rb +9 -0
  94. data/spec/files/bad_timestamped_migrations/1273253853_3_create_users.rb +3 -0
  95. data/spec/files/bad_up_migration/001_create_alt_basic.rb +4 -0
  96. data/spec/files/bad_up_migration/002_create_alt_advanced.rb +3 -0
  97. data/spec/files/convert_to_timestamp_migrations/001_create_sessions.rb +9 -0
  98. data/spec/files/convert_to_timestamp_migrations/002_create_nodes.rb +9 -0
  99. data/spec/files/convert_to_timestamp_migrations/003_3_create_users.rb +4 -0
  100. data/spec/files/convert_to_timestamp_migrations/1273253850_create_artists.rb +9 -0
  101. data/spec/files/convert_to_timestamp_migrations/1273253852_create_albums.rb +9 -0
  102. data/spec/files/duplicate_timestamped_migrations/1273253849_create_sessions.rb +9 -0
  103. data/spec/files/duplicate_timestamped_migrations/1273253853_create_nodes.rb +9 -0
  104. data/spec/files/duplicate_timestamped_migrations/1273253853_create_users.rb +4 -0
  105. data/spec/files/integer_migrations/001_create_sessions.rb +9 -0
  106. data/spec/files/integer_migrations/002_create_nodes.rb +9 -0
  107. data/spec/files/integer_migrations/003_3_create_users.rb +4 -0
  108. data/spec/files/interleaved_timestamped_migrations/1273253849_create_sessions.rb +9 -0
  109. data/spec/files/interleaved_timestamped_migrations/1273253850_create_artists.rb +9 -0
  110. data/spec/files/interleaved_timestamped_migrations/1273253851_create_nodes.rb +9 -0
  111. data/spec/files/interleaved_timestamped_migrations/1273253852_create_albums.rb +9 -0
  112. data/spec/files/interleaved_timestamped_migrations/1273253853_3_create_users.rb +4 -0
  113. data/spec/files/reversible_migrations/001_reversible.rb +5 -0
  114. data/spec/files/reversible_migrations/002_reversible.rb +5 -0
  115. data/spec/files/reversible_migrations/003_reversible.rb +5 -0
  116. data/spec/files/reversible_migrations/004_reversible.rb +5 -0
  117. data/spec/files/reversible_migrations/005_reversible.rb +10 -0
  118. data/spec/files/timestamped_migrations/1273253849_create_sessions.rb +9 -0
  119. data/spec/files/timestamped_migrations/1273253851_create_nodes.rb +9 -0
  120. data/spec/files/timestamped_migrations/1273253853_3_create_users.rb +4 -0
  121. data/spec/impala_test.rb +290 -0
  122. data/spec/migrator_test.rb +240 -0
  123. data/spec/plugin_test.rb +91 -0
  124. data/spec/prepared_statement_test.rb +327 -0
  125. data/spec/schema_test.rb +356 -0
  126. data/spec/spec_helper.rb +19 -0
  127. data/spec/timezone_test.rb +86 -0
  128. data/spec/type_test.rb +99 -0
  129. metadata +294 -0
@@ -0,0 +1,193 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'hive_metastore_types'
9
+
10
+
11
+ module Impala
12
+ module Protocol
13
+ module Beeswax
14
+ module QueryState
15
+ CREATED = 0
16
+ INITIALIZED = 1
17
+ COMPILED = 2
18
+ RUNNING = 3
19
+ FINISHED = 4
20
+ EXCEPTION = 5
21
+ VALUE_MAP = {0 => "CREATED", 1 => "INITIALIZED", 2 => "COMPILED", 3 => "RUNNING", 4 => "FINISHED", 5 => "EXCEPTION"}
22
+ VALID_VALUES = Set.new([CREATED, INITIALIZED, COMPILED, RUNNING, FINISHED, EXCEPTION]).freeze
23
+ end
24
+
25
+ class Query
26
+ include ::Thrift::Struct, ::Thrift::Struct_Union
27
+ QUERY = 1
28
+ CONFIGURATION = 3
29
+ HADOOP_USER = 4
30
+
31
+ FIELDS = {
32
+ QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'},
33
+ CONFIGURATION => {:type => ::Thrift::Types::LIST, :name => 'configuration', :element => {:type => ::Thrift::Types::STRING}},
34
+ HADOOP_USER => {:type => ::Thrift::Types::STRING, :name => 'hadoop_user'}
35
+ }
36
+
37
+ def struct_fields; FIELDS; end
38
+
39
+ def validate
40
+ end
41
+
42
+ ::Thrift::Struct.generate_accessors self
43
+ end
44
+
45
+ class QueryHandle
46
+ include ::Thrift::Struct, ::Thrift::Struct_Union
47
+ ID = 1
48
+ LOG_CONTEXT = 2
49
+
50
+ FIELDS = {
51
+ ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
52
+ LOG_CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'log_context'}
53
+ }
54
+
55
+ def struct_fields; FIELDS; end
56
+
57
+ def validate
58
+ end
59
+
60
+ ::Thrift::Struct.generate_accessors self
61
+ end
62
+
63
+ class QueryExplanation
64
+ include ::Thrift::Struct, ::Thrift::Struct_Union
65
+ TEXTUAL = 1
66
+
67
+ FIELDS = {
68
+ TEXTUAL => {:type => ::Thrift::Types::STRING, :name => 'textual'}
69
+ }
70
+
71
+ def struct_fields; FIELDS; end
72
+
73
+ def validate
74
+ end
75
+
76
+ ::Thrift::Struct.generate_accessors self
77
+ end
78
+
79
+ class Results
80
+ include ::Thrift::Struct, ::Thrift::Struct_Union
81
+ READY = 1
82
+ COLUMNS = 2
83
+ DATA = 3
84
+ START_ROW = 4
85
+ HAS_MORE = 5
86
+
87
+ FIELDS = {
88
+ READY => {:type => ::Thrift::Types::BOOL, :name => 'ready'},
89
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRING}},
90
+ DATA => {:type => ::Thrift::Types::LIST, :name => 'data', :element => {:type => ::Thrift::Types::STRING}},
91
+ START_ROW => {:type => ::Thrift::Types::I64, :name => 'start_row'},
92
+ HAS_MORE => {:type => ::Thrift::Types::BOOL, :name => 'has_more'}
93
+ }
94
+
95
+ def struct_fields; FIELDS; end
96
+
97
+ def validate
98
+ end
99
+
100
+ ::Thrift::Struct.generate_accessors self
101
+ end
102
+
103
+ # Metadata information about the results.
104
+ # Applicable only for SELECT.
105
+ class ResultsMetadata
106
+ include ::Thrift::Struct, ::Thrift::Struct_Union
107
+ SCHEMA = 1
108
+ TABLE_DIR = 2
109
+ IN_TABLENAME = 3
110
+ DELIM = 4
111
+
112
+ FIELDS = {
113
+ # The schema of the results
114
+ SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => ::Impala::Protocol::HiveMetastore::Schema},
115
+ # The directory containing the results. Not applicable for partition table.
116
+ TABLE_DIR => {:type => ::Thrift::Types::STRING, :name => 'table_dir'},
117
+ # If the results are straight from an existing table, the table name.
118
+ IN_TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'in_tablename'},
119
+ # Field delimiter
120
+ DELIM => {:type => ::Thrift::Types::STRING, :name => 'delim'}
121
+ }
122
+
123
+ def struct_fields; FIELDS; end
124
+
125
+ def validate
126
+ end
127
+
128
+ ::Thrift::Struct.generate_accessors self
129
+ end
130
+
131
+ class BeeswaxException < ::Thrift::Exception
132
+ include ::Thrift::Struct, ::Thrift::Struct_Union
133
+ MESSAGE = 1
134
+ LOG_CONTEXT = 2
135
+ HANDLE = 3
136
+ ERRORCODE = 4
137
+ SQLSTATE = 5
138
+
139
+ FIELDS = {
140
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
141
+ LOG_CONTEXT => {:type => ::Thrift::Types::STRING, :name => 'log_context'},
142
+ HANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'handle', :class => ::Impala::Protocol::Beeswax::QueryHandle},
143
+ ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :default => 0, :optional => true},
144
+ SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'SQLState', :default => %q" ", :optional => true}
145
+ }
146
+
147
+ def struct_fields; FIELDS; end
148
+
149
+ def validate
150
+ end
151
+
152
+ ::Thrift::Struct.generate_accessors self
153
+ end
154
+
155
+ class QueryNotFoundException < ::Thrift::Exception
156
+ include ::Thrift::Struct, ::Thrift::Struct_Union
157
+
158
+ FIELDS = {
159
+
160
+ }
161
+
162
+ def struct_fields; FIELDS; end
163
+
164
+ def validate
165
+ end
166
+
167
+ ::Thrift::Struct.generate_accessors self
168
+ end
169
+
170
+ # Represents a Hadoop-style configuration variable.
171
+ class ConfigVariable
172
+ include ::Thrift::Struct, ::Thrift::Struct_Union
173
+ KEY = 1
174
+ VALUE = 2
175
+ DESCRIPTION = 3
176
+
177
+ FIELDS = {
178
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
179
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
180
+ DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description'}
181
+ }
182
+
183
+ def struct_fields; FIELDS; end
184
+
185
+ def validate
186
+ end
187
+
188
+ ::Thrift::Struct.generate_accessors self
189
+ end
190
+
191
+ end
192
+ end
193
+ end
@@ -0,0 +1,13 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'exec_stats_types'
9
+
10
+ module Impala
11
+ module Protocol
12
+ end
13
+ end
@@ -0,0 +1,133 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'status_types'
9
+ require 'types_types'
10
+
11
+
12
+ module Impala
13
+ module Protocol
14
+ module TExecState
15
+ REGISTERED = 0
16
+ PLANNING = 1
17
+ QUEUED = 2
18
+ RUNNING = 3
19
+ FINISHED = 4
20
+ CANCELLED = 5
21
+ FAILED = 6
22
+ VALUE_MAP = {0 => "REGISTERED", 1 => "PLANNING", 2 => "QUEUED", 3 => "RUNNING", 4 => "FINISHED", 5 => "CANCELLED", 6 => "FAILED"}
23
+ VALID_VALUES = Set.new([REGISTERED, PLANNING, QUEUED, RUNNING, FINISHED, CANCELLED, FAILED]).freeze
24
+ end
25
+
26
+ class TExecStats
27
+ include ::Thrift::Struct, ::Thrift::Struct_Union
28
+ LATENCY_NS = 1
29
+ CPU_TIME_NS = 2
30
+ CARDINALITY = 3
31
+ MEMORY_USED = 4
32
+
33
+ FIELDS = {
34
+ LATENCY_NS => {:type => ::Thrift::Types::I64, :name => 'latency_ns', :optional => true},
35
+ CPU_TIME_NS => {:type => ::Thrift::Types::I64, :name => 'cpu_time_ns', :optional => true},
36
+ CARDINALITY => {:type => ::Thrift::Types::I64, :name => 'cardinality', :optional => true},
37
+ MEMORY_USED => {:type => ::Thrift::Types::I64, :name => 'memory_used', :optional => true}
38
+ }
39
+
40
+ def struct_fields; FIELDS; end
41
+
42
+ def validate
43
+ end
44
+
45
+ ::Thrift::Struct.generate_accessors self
46
+ end
47
+
48
+ class TPlanNodeExecSummary
49
+ include ::Thrift::Struct, ::Thrift::Struct_Union
50
+ NODE_ID = 1
51
+ FRAGMENT_ID = 2
52
+ LABEL = 3
53
+ LABEL_DETAIL = 4
54
+ NUM_CHILDREN = 5
55
+ ESTIMATED_STATS = 6
56
+ EXEC_STATS = 7
57
+ IS_ACTIVE = 8
58
+ IS_BROADCAST = 9
59
+
60
+ FIELDS = {
61
+ NODE_ID => {:type => ::Thrift::Types::I32, :name => 'node_id'},
62
+ FRAGMENT_ID => {:type => ::Thrift::Types::I32, :name => 'fragment_id'},
63
+ LABEL => {:type => ::Thrift::Types::STRING, :name => 'label'},
64
+ LABEL_DETAIL => {:type => ::Thrift::Types::STRING, :name => 'label_detail', :optional => true},
65
+ NUM_CHILDREN => {:type => ::Thrift::Types::I32, :name => 'num_children'},
66
+ ESTIMATED_STATS => {:type => ::Thrift::Types::STRUCT, :name => 'estimated_stats', :class => ::Impala::Protocol::TExecStats, :optional => true},
67
+ EXEC_STATS => {:type => ::Thrift::Types::LIST, :name => 'exec_stats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Impala::Protocol::TExecStats}, :optional => true},
68
+ IS_ACTIVE => {:type => ::Thrift::Types::LIST, :name => 'is_active', :element => {:type => ::Thrift::Types::BOOL}, :optional => true},
69
+ IS_BROADCAST => {:type => ::Thrift::Types::BOOL, :name => 'is_broadcast', :optional => true}
70
+ }
71
+
72
+ def struct_fields; FIELDS; end
73
+
74
+ def validate
75
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field node_id is unset!') unless @node_id
76
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field fragment_id is unset!') unless @fragment_id
77
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field label is unset!') unless @label
78
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field num_children is unset!') unless @num_children
79
+ end
80
+
81
+ ::Thrift::Struct.generate_accessors self
82
+ end
83
+
84
+ class TExecProgress
85
+ include ::Thrift::Struct, ::Thrift::Struct_Union
86
+ TOTAL_SCAN_RANGES = 1
87
+ NUM_COMPLETED_SCAN_RANGES = 2
88
+
89
+ FIELDS = {
90
+ TOTAL_SCAN_RANGES => {:type => ::Thrift::Types::I64, :name => 'total_scan_ranges', :optional => true},
91
+ NUM_COMPLETED_SCAN_RANGES => {:type => ::Thrift::Types::I64, :name => 'num_completed_scan_ranges', :optional => true}
92
+ }
93
+
94
+ def struct_fields; FIELDS; end
95
+
96
+ def validate
97
+ end
98
+
99
+ ::Thrift::Struct.generate_accessors self
100
+ end
101
+
102
+ class TExecSummary
103
+ include ::Thrift::Struct, ::Thrift::Struct_Union
104
+ STATE = 1
105
+ STATUS = 2
106
+ NODES = 3
107
+ EXCH_TO_SENDER_MAP = 4
108
+ ERROR_LOGS = 5
109
+ PROGRESS = 6
110
+
111
+ FIELDS = {
112
+ STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::Impala::Protocol::TExecState},
113
+ STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::Impala::Protocol::TStatus, :optional => true},
114
+ NODES => {:type => ::Thrift::Types::LIST, :name => 'nodes', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Impala::Protocol::TPlanNodeExecSummary}, :optional => true},
115
+ EXCH_TO_SENDER_MAP => {:type => ::Thrift::Types::MAP, :name => 'exch_to_sender_map', :key => {:type => ::Thrift::Types::I32}, :value => {:type => ::Thrift::Types::I32}, :optional => true},
116
+ ERROR_LOGS => {:type => ::Thrift::Types::LIST, :name => 'error_logs', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
117
+ PROGRESS => {:type => ::Thrift::Types::STRUCT, :name => 'progress', :class => ::Impala::Protocol::TExecProgress, :optional => true}
118
+ }
119
+
120
+ def struct_fields; FIELDS; end
121
+
122
+ def validate
123
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field state is unset!') unless @state
124
+ unless @state.nil? || ::Impala::Protocol::TExecState::VALID_VALUES.include?(@state)
125
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
126
+ end
127
+ end
128
+
129
+ ::Thrift::Struct.generate_accessors self
130
+ end
131
+
132
+ end
133
+ end
@@ -0,0 +1,706 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.9.3)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'fb303_types'
9
+
10
+ module Impala
11
+ module Protocol
12
+ module Fb303
13
+ module FacebookService
14
+ class Client
15
+ include ::Thrift::Client
16
+
17
+ def getName()
18
+ send_getName()
19
+ return recv_getName()
20
+ end
21
+
22
+ def send_getName()
23
+ send_message('getName', GetName_args)
24
+ end
25
+
26
+ def recv_getName()
27
+ result = receive_message(GetName_result)
28
+ return result.success unless result.success.nil?
29
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getName failed: unknown result')
30
+ end
31
+
32
+ def getVersion()
33
+ send_getVersion()
34
+ return recv_getVersion()
35
+ end
36
+
37
+ def send_getVersion()
38
+ send_message('getVersion', GetVersion_args)
39
+ end
40
+
41
+ def recv_getVersion()
42
+ result = receive_message(GetVersion_result)
43
+ return result.success unless result.success.nil?
44
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getVersion failed: unknown result')
45
+ end
46
+
47
+ def getStatus()
48
+ send_getStatus()
49
+ return recv_getStatus()
50
+ end
51
+
52
+ def send_getStatus()
53
+ send_message('getStatus', GetStatus_args)
54
+ end
55
+
56
+ def recv_getStatus()
57
+ result = receive_message(GetStatus_result)
58
+ return result.success unless result.success.nil?
59
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getStatus failed: unknown result')
60
+ end
61
+
62
+ def getStatusDetails()
63
+ send_getStatusDetails()
64
+ return recv_getStatusDetails()
65
+ end
66
+
67
+ def send_getStatusDetails()
68
+ send_message('getStatusDetails', GetStatusDetails_args)
69
+ end
70
+
71
+ def recv_getStatusDetails()
72
+ result = receive_message(GetStatusDetails_result)
73
+ return result.success unless result.success.nil?
74
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getStatusDetails failed: unknown result')
75
+ end
76
+
77
+ def getCounters()
78
+ send_getCounters()
79
+ return recv_getCounters()
80
+ end
81
+
82
+ def send_getCounters()
83
+ send_message('getCounters', GetCounters_args)
84
+ end
85
+
86
+ def recv_getCounters()
87
+ result = receive_message(GetCounters_result)
88
+ return result.success unless result.success.nil?
89
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getCounters failed: unknown result')
90
+ end
91
+
92
+ def getCounter(key)
93
+ send_getCounter(key)
94
+ return recv_getCounter()
95
+ end
96
+
97
+ def send_getCounter(key)
98
+ send_message('getCounter', GetCounter_args, :key => key)
99
+ end
100
+
101
+ def recv_getCounter()
102
+ result = receive_message(GetCounter_result)
103
+ return result.success unless result.success.nil?
104
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getCounter failed: unknown result')
105
+ end
106
+
107
+ def setOption(key, value)
108
+ send_setOption(key, value)
109
+ recv_setOption()
110
+ end
111
+
112
+ def send_setOption(key, value)
113
+ send_message('setOption', SetOption_args, :key => key, :value => value)
114
+ end
115
+
116
+ def recv_setOption()
117
+ result = receive_message(SetOption_result)
118
+ return
119
+ end
120
+
121
+ def getOption(key)
122
+ send_getOption(key)
123
+ return recv_getOption()
124
+ end
125
+
126
+ def send_getOption(key)
127
+ send_message('getOption', GetOption_args, :key => key)
128
+ end
129
+
130
+ def recv_getOption()
131
+ result = receive_message(GetOption_result)
132
+ return result.success unless result.success.nil?
133
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getOption failed: unknown result')
134
+ end
135
+
136
+ def getOptions()
137
+ send_getOptions()
138
+ return recv_getOptions()
139
+ end
140
+
141
+ def send_getOptions()
142
+ send_message('getOptions', GetOptions_args)
143
+ end
144
+
145
+ def recv_getOptions()
146
+ result = receive_message(GetOptions_result)
147
+ return result.success unless result.success.nil?
148
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getOptions failed: unknown result')
149
+ end
150
+
151
+ def getCpuProfile(profileDurationInSec)
152
+ send_getCpuProfile(profileDurationInSec)
153
+ return recv_getCpuProfile()
154
+ end
155
+
156
+ def send_getCpuProfile(profileDurationInSec)
157
+ send_message('getCpuProfile', GetCpuProfile_args, :profileDurationInSec => profileDurationInSec)
158
+ end
159
+
160
+ def recv_getCpuProfile()
161
+ result = receive_message(GetCpuProfile_result)
162
+ return result.success unless result.success.nil?
163
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getCpuProfile failed: unknown result')
164
+ end
165
+
166
+ def aliveSince()
167
+ send_aliveSince()
168
+ return recv_aliveSince()
169
+ end
170
+
171
+ def send_aliveSince()
172
+ send_message('aliveSince', AliveSince_args)
173
+ end
174
+
175
+ def recv_aliveSince()
176
+ result = receive_message(AliveSince_result)
177
+ return result.success unless result.success.nil?
178
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'aliveSince failed: unknown result')
179
+ end
180
+
181
+ def reinitialize()
182
+ send_reinitialize()
183
+ end
184
+
185
+ def send_reinitialize()
186
+ send_oneway_message('reinitialize', Reinitialize_args)
187
+ end
188
+ def shutdown()
189
+ send_shutdown()
190
+ end
191
+
192
+ def send_shutdown()
193
+ send_oneway_message('shutdown', Shutdown_args)
194
+ end
195
+ end
196
+
197
+ class Processor
198
+ include ::Thrift::Processor
199
+
200
+ def process_getName(seqid, iprot, oprot)
201
+ args = read_args(iprot, GetName_args)
202
+ result = GetName_result.new()
203
+ result.success = @handler.getName()
204
+ write_result(result, oprot, 'getName', seqid)
205
+ end
206
+
207
+ def process_getVersion(seqid, iprot, oprot)
208
+ args = read_args(iprot, GetVersion_args)
209
+ result = GetVersion_result.new()
210
+ result.success = @handler.getVersion()
211
+ write_result(result, oprot, 'getVersion', seqid)
212
+ end
213
+
214
+ def process_getStatus(seqid, iprot, oprot)
215
+ args = read_args(iprot, GetStatus_args)
216
+ result = GetStatus_result.new()
217
+ result.success = @handler.getStatus()
218
+ write_result(result, oprot, 'getStatus', seqid)
219
+ end
220
+
221
+ def process_getStatusDetails(seqid, iprot, oprot)
222
+ args = read_args(iprot, GetStatusDetails_args)
223
+ result = GetStatusDetails_result.new()
224
+ result.success = @handler.getStatusDetails()
225
+ write_result(result, oprot, 'getStatusDetails', seqid)
226
+ end
227
+
228
+ def process_getCounters(seqid, iprot, oprot)
229
+ args = read_args(iprot, GetCounters_args)
230
+ result = GetCounters_result.new()
231
+ result.success = @handler.getCounters()
232
+ write_result(result, oprot, 'getCounters', seqid)
233
+ end
234
+
235
+ def process_getCounter(seqid, iprot, oprot)
236
+ args = read_args(iprot, GetCounter_args)
237
+ result = GetCounter_result.new()
238
+ result.success = @handler.getCounter(args.key)
239
+ write_result(result, oprot, 'getCounter', seqid)
240
+ end
241
+
242
+ def process_setOption(seqid, iprot, oprot)
243
+ args = read_args(iprot, SetOption_args)
244
+ result = SetOption_result.new()
245
+ @handler.setOption(args.key, args.value)
246
+ write_result(result, oprot, 'setOption', seqid)
247
+ end
248
+
249
+ def process_getOption(seqid, iprot, oprot)
250
+ args = read_args(iprot, GetOption_args)
251
+ result = GetOption_result.new()
252
+ result.success = @handler.getOption(args.key)
253
+ write_result(result, oprot, 'getOption', seqid)
254
+ end
255
+
256
+ def process_getOptions(seqid, iprot, oprot)
257
+ args = read_args(iprot, GetOptions_args)
258
+ result = GetOptions_result.new()
259
+ result.success = @handler.getOptions()
260
+ write_result(result, oprot, 'getOptions', seqid)
261
+ end
262
+
263
+ def process_getCpuProfile(seqid, iprot, oprot)
264
+ args = read_args(iprot, GetCpuProfile_args)
265
+ result = GetCpuProfile_result.new()
266
+ result.success = @handler.getCpuProfile(args.profileDurationInSec)
267
+ write_result(result, oprot, 'getCpuProfile', seqid)
268
+ end
269
+
270
+ def process_aliveSince(seqid, iprot, oprot)
271
+ args = read_args(iprot, AliveSince_args)
272
+ result = AliveSince_result.new()
273
+ result.success = @handler.aliveSince()
274
+ write_result(result, oprot, 'aliveSince', seqid)
275
+ end
276
+
277
+ def process_reinitialize(seqid, iprot, oprot)
278
+ args = read_args(iprot, Reinitialize_args)
279
+ @handler.reinitialize()
280
+ return
281
+ end
282
+
283
+ def process_shutdown(seqid, iprot, oprot)
284
+ args = read_args(iprot, Shutdown_args)
285
+ @handler.shutdown()
286
+ return
287
+ end
288
+
289
+ end
290
+
291
+ # HELPER FUNCTIONS AND STRUCTURES
292
+
293
+ class GetName_args
294
+ include ::Thrift::Struct, ::Thrift::Struct_Union
295
+
296
+ FIELDS = {
297
+
298
+ }
299
+
300
+ def struct_fields; FIELDS; end
301
+
302
+ def validate
303
+ end
304
+
305
+ ::Thrift::Struct.generate_accessors self
306
+ end
307
+
308
+ class GetName_result
309
+ include ::Thrift::Struct, ::Thrift::Struct_Union
310
+ SUCCESS = 0
311
+
312
+ FIELDS = {
313
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
314
+ }
315
+
316
+ def struct_fields; FIELDS; end
317
+
318
+ def validate
319
+ end
320
+
321
+ ::Thrift::Struct.generate_accessors self
322
+ end
323
+
324
+ class GetVersion_args
325
+ include ::Thrift::Struct, ::Thrift::Struct_Union
326
+
327
+ FIELDS = {
328
+
329
+ }
330
+
331
+ def struct_fields; FIELDS; end
332
+
333
+ def validate
334
+ end
335
+
336
+ ::Thrift::Struct.generate_accessors self
337
+ end
338
+
339
+ class GetVersion_result
340
+ include ::Thrift::Struct, ::Thrift::Struct_Union
341
+ SUCCESS = 0
342
+
343
+ FIELDS = {
344
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
345
+ }
346
+
347
+ def struct_fields; FIELDS; end
348
+
349
+ def validate
350
+ end
351
+
352
+ ::Thrift::Struct.generate_accessors self
353
+ end
354
+
355
+ class GetStatus_args
356
+ include ::Thrift::Struct, ::Thrift::Struct_Union
357
+
358
+ FIELDS = {
359
+
360
+ }
361
+
362
+ def struct_fields; FIELDS; end
363
+
364
+ def validate
365
+ end
366
+
367
+ ::Thrift::Struct.generate_accessors self
368
+ end
369
+
370
+ class GetStatus_result
371
+ include ::Thrift::Struct, ::Thrift::Struct_Union
372
+ SUCCESS = 0
373
+
374
+ FIELDS = {
375
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success', :enum_class => ::Impala::Protocol::Fb303::Fb_status}
376
+ }
377
+
378
+ def struct_fields; FIELDS; end
379
+
380
+ def validate
381
+ unless @success.nil? || ::Impala::Protocol::Fb303::Fb_status::VALID_VALUES.include?(@success)
382
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field success!')
383
+ end
384
+ end
385
+
386
+ ::Thrift::Struct.generate_accessors self
387
+ end
388
+
389
+ class GetStatusDetails_args
390
+ include ::Thrift::Struct, ::Thrift::Struct_Union
391
+
392
+ FIELDS = {
393
+
394
+ }
395
+
396
+ def struct_fields; FIELDS; end
397
+
398
+ def validate
399
+ end
400
+
401
+ ::Thrift::Struct.generate_accessors self
402
+ end
403
+
404
+ class GetStatusDetails_result
405
+ include ::Thrift::Struct, ::Thrift::Struct_Union
406
+ SUCCESS = 0
407
+
408
+ FIELDS = {
409
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
410
+ }
411
+
412
+ def struct_fields; FIELDS; end
413
+
414
+ def validate
415
+ end
416
+
417
+ ::Thrift::Struct.generate_accessors self
418
+ end
419
+
420
+ class GetCounters_args
421
+ include ::Thrift::Struct, ::Thrift::Struct_Union
422
+
423
+ FIELDS = {
424
+
425
+ }
426
+
427
+ def struct_fields; FIELDS; end
428
+
429
+ def validate
430
+ end
431
+
432
+ ::Thrift::Struct.generate_accessors self
433
+ end
434
+
435
+ class GetCounters_result
436
+ include ::Thrift::Struct, ::Thrift::Struct_Union
437
+ SUCCESS = 0
438
+
439
+ FIELDS = {
440
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}}
441
+ }
442
+
443
+ def struct_fields; FIELDS; end
444
+
445
+ def validate
446
+ end
447
+
448
+ ::Thrift::Struct.generate_accessors self
449
+ end
450
+
451
+ class GetCounter_args
452
+ include ::Thrift::Struct, ::Thrift::Struct_Union
453
+ KEY = 1
454
+
455
+ FIELDS = {
456
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'}
457
+ }
458
+
459
+ def struct_fields; FIELDS; end
460
+
461
+ def validate
462
+ end
463
+
464
+ ::Thrift::Struct.generate_accessors self
465
+ end
466
+
467
+ class GetCounter_result
468
+ include ::Thrift::Struct, ::Thrift::Struct_Union
469
+ SUCCESS = 0
470
+
471
+ FIELDS = {
472
+ SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}
473
+ }
474
+
475
+ def struct_fields; FIELDS; end
476
+
477
+ def validate
478
+ end
479
+
480
+ ::Thrift::Struct.generate_accessors self
481
+ end
482
+
483
+ class SetOption_args
484
+ include ::Thrift::Struct, ::Thrift::Struct_Union
485
+ KEY = 1
486
+ VALUE = 2
487
+
488
+ FIELDS = {
489
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
490
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'}
491
+ }
492
+
493
+ def struct_fields; FIELDS; end
494
+
495
+ def validate
496
+ end
497
+
498
+ ::Thrift::Struct.generate_accessors self
499
+ end
500
+
501
+ class SetOption_result
502
+ include ::Thrift::Struct, ::Thrift::Struct_Union
503
+
504
+ FIELDS = {
505
+
506
+ }
507
+
508
+ def struct_fields; FIELDS; end
509
+
510
+ def validate
511
+ end
512
+
513
+ ::Thrift::Struct.generate_accessors self
514
+ end
515
+
516
+ class GetOption_args
517
+ include ::Thrift::Struct, ::Thrift::Struct_Union
518
+ KEY = 1
519
+
520
+ FIELDS = {
521
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'}
522
+ }
523
+
524
+ def struct_fields; FIELDS; end
525
+
526
+ def validate
527
+ end
528
+
529
+ ::Thrift::Struct.generate_accessors self
530
+ end
531
+
532
+ class GetOption_result
533
+ include ::Thrift::Struct, ::Thrift::Struct_Union
534
+ SUCCESS = 0
535
+
536
+ FIELDS = {
537
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
538
+ }
539
+
540
+ def struct_fields; FIELDS; end
541
+
542
+ def validate
543
+ end
544
+
545
+ ::Thrift::Struct.generate_accessors self
546
+ end
547
+
548
+ class GetOptions_args
549
+ include ::Thrift::Struct, ::Thrift::Struct_Union
550
+
551
+ FIELDS = {
552
+
553
+ }
554
+
555
+ def struct_fields; FIELDS; end
556
+
557
+ def validate
558
+ end
559
+
560
+ ::Thrift::Struct.generate_accessors self
561
+ end
562
+
563
+ class GetOptions_result
564
+ include ::Thrift::Struct, ::Thrift::Struct_Union
565
+ SUCCESS = 0
566
+
567
+ FIELDS = {
568
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
569
+ }
570
+
571
+ def struct_fields; FIELDS; end
572
+
573
+ def validate
574
+ end
575
+
576
+ ::Thrift::Struct.generate_accessors self
577
+ end
578
+
579
+ class GetCpuProfile_args
580
+ include ::Thrift::Struct, ::Thrift::Struct_Union
581
+ PROFILEDURATIONINSEC = 1
582
+
583
+ FIELDS = {
584
+ PROFILEDURATIONINSEC => {:type => ::Thrift::Types::I32, :name => 'profileDurationInSec'}
585
+ }
586
+
587
+ def struct_fields; FIELDS; end
588
+
589
+ def validate
590
+ end
591
+
592
+ ::Thrift::Struct.generate_accessors self
593
+ end
594
+
595
+ class GetCpuProfile_result
596
+ include ::Thrift::Struct, ::Thrift::Struct_Union
597
+ SUCCESS = 0
598
+
599
+ FIELDS = {
600
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
601
+ }
602
+
603
+ def struct_fields; FIELDS; end
604
+
605
+ def validate
606
+ end
607
+
608
+ ::Thrift::Struct.generate_accessors self
609
+ end
610
+
611
+ class AliveSince_args
612
+ include ::Thrift::Struct, ::Thrift::Struct_Union
613
+
614
+ FIELDS = {
615
+
616
+ }
617
+
618
+ def struct_fields; FIELDS; end
619
+
620
+ def validate
621
+ end
622
+
623
+ ::Thrift::Struct.generate_accessors self
624
+ end
625
+
626
+ class AliveSince_result
627
+ include ::Thrift::Struct, ::Thrift::Struct_Union
628
+ SUCCESS = 0
629
+
630
+ FIELDS = {
631
+ SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}
632
+ }
633
+
634
+ def struct_fields; FIELDS; end
635
+
636
+ def validate
637
+ end
638
+
639
+ ::Thrift::Struct.generate_accessors self
640
+ end
641
+
642
+ class Reinitialize_args
643
+ include ::Thrift::Struct, ::Thrift::Struct_Union
644
+
645
+ FIELDS = {
646
+
647
+ }
648
+
649
+ def struct_fields; FIELDS; end
650
+
651
+ def validate
652
+ end
653
+
654
+ ::Thrift::Struct.generate_accessors self
655
+ end
656
+
657
+ class Reinitialize_result
658
+ include ::Thrift::Struct, ::Thrift::Struct_Union
659
+
660
+ FIELDS = {
661
+
662
+ }
663
+
664
+ def struct_fields; FIELDS; end
665
+
666
+ def validate
667
+ end
668
+
669
+ ::Thrift::Struct.generate_accessors self
670
+ end
671
+
672
+ class Shutdown_args
673
+ include ::Thrift::Struct, ::Thrift::Struct_Union
674
+
675
+ FIELDS = {
676
+
677
+ }
678
+
679
+ def struct_fields; FIELDS; end
680
+
681
+ def validate
682
+ end
683
+
684
+ ::Thrift::Struct.generate_accessors self
685
+ end
686
+
687
+ class Shutdown_result
688
+ include ::Thrift::Struct, ::Thrift::Struct_Union
689
+
690
+ FIELDS = {
691
+
692
+ }
693
+
694
+ def struct_fields; FIELDS; end
695
+
696
+ def validate
697
+ end
698
+
699
+ ::Thrift::Struct.generate_accessors self
700
+ end
701
+
702
+ end
703
+
704
+ end
705
+ end
706
+ end