Class: ThriftFlumeEvent

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/fluent/plugin/thrift/flume_types.rb

Constant Summary collapse

TIMESTAMP =
1
PRIORITY =
2
BODY =
3
NANOS =
4
HOST =
5
FIELDSS =
6
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'},
  FIELDSS => {:type => ::Thrift::Types::MAP, :name => 'fieldss', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING, :binary => true}}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



45
# File 'lib/fluent/plugin/thrift/flume_types.rb', line 45

def struct_fields; FIELDS; end

#validateObject



47
48
49
50
51
# File 'lib/fluent/plugin/thrift/flume_types.rb', line 47

def validate
  unless @priority.nil? || Priority::VALID_VALUES.include?(@priority)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field priority!')
  end
end