PageRenderTime 55ms CodeModel.GetById 15ms app.highlight 35ms RepoModel.GetById 2ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/service/src/gen/thrift/gen-rb/hive_service_types.rb

#
Ruby | 67 lines | 48 code | 14 blank | 5 comment | 1 complexity | 46df2aa3bc805e796aad89fe05cbd3d6 MD5 | raw file
 1#
 2# Autogenerated by Thrift
 3#
 4# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 5#
 6
 7require 'fb303_types'
 8require 'hive_metastore_types'
 9require 'queryplan_types'
10
11
12module JobTrackerState
13  INITIALIZING = 1
14  RUNNING = 2
15  VALUE_MAP = {1 => "INITIALIZING", 2 => "RUNNING"}
16  VALID_VALUES = Set.new([INITIALIZING, RUNNING]).freeze
17end
18
19class HiveClusterStatus
20  include ::Thrift::Struct, ::Thrift::Struct_Union
21  TASKTRACKERS = 1
22  MAPTASKS = 2
23  REDUCETASKS = 3
24  MAXMAPTASKS = 4
25  MAXREDUCETASKS = 5
26  STATE = 6
27
28  FIELDS = {
29    TASKTRACKERS => {:type => ::Thrift::Types::I32, :name => 'taskTrackers'},
30    MAPTASKS => {:type => ::Thrift::Types::I32, :name => 'mapTasks'},
31    REDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'reduceTasks'},
32    MAXMAPTASKS => {:type => ::Thrift::Types::I32, :name => 'maxMapTasks'},
33    MAXREDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'maxReduceTasks'},
34    STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => JobTrackerState}
35  }
36
37  def struct_fields; FIELDS; end
38
39  def validate
40    unless @state.nil? || JobTrackerState::VALID_VALUES.include?(@state)
41      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
42    end
43  end
44
45  ::Thrift::Struct.generate_accessors self
46end
47
48class HiveServerException < ::Thrift::Exception
49  include ::Thrift::Struct, ::Thrift::Struct_Union
50  MESSAGE = 1
51  ERRORCODE = 2
52  SQLSTATE = 3
53
54  FIELDS = {
55    MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
56    ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode'},
57    SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'SQLState'}
58  }
59
60  def struct_fields; FIELDS; end
61
62  def validate
63  end
64
65  ::Thrift::Struct.generate_accessors self
66end
67