Class: ThriftFlumeEvent

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/flume-logger/flume-ng/flume_types.rb,
lib/flume-logger/flume-og/flume_compatibility_types.rb

Constant Summary collapse

HEADERS =
1
BODY =
3
FIELDS =
{
  TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
  PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority', :enum_class => ::Priority},
  BODY => {:type => ::Thrift::Types::STRING, :name => 'body', :binary => true},
  NANOS => {:type => ::Thrift::Types::I64, :name => 'nanos'},
  HOST => {:type => ::Thrift::Types::STRING, :name => 'host'},
  FIELDS => {:type => ::Thrift::Types::MAP, :name => 'fields', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING, :binary => true}}
}
TIMESTAMP =
1
PRIORITY =
2
NANOS =
4
HOST =
5

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



28
# File 'lib/flume-logger/flume-ng/flume_types.rb', line 28

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


30
31
32
33
# File 'lib/flume-logger/flume-ng/flume_types.rb', line 30

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field headers is unset!') unless @headers
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field body is unset!') unless @body
end