Class: Impala::Protocol::TCounter

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/impala/protocol/runtime_profile_types.rb

Constant Summary collapse

NAME =
1
TYPE =
2
VALUE =
3
FIELDS =
{
NAME => { :type => ::Thrift::Types::STRING, :name => 'name' },
TYPE => { :type => ::Thrift::Types::I32, :name => 'type', :enum_class => Impala::Protocol::TCounterType },
VALUE => { :type => ::Thrift::Types::I64, :name => 'value' }
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



33
# File 'lib/impala/protocol/runtime_profile_types.rb', line 33

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


35
36
37
38
39
40
41
42
# File 'lib/impala/protocol/runtime_profile_types.rb', line 35

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
  unless @type.nil? || Impala::Protocol::TCounterType::VALID_VALUES.include?(@type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
  end
end