Sha256: 6e9e37cf917d5e03f63c884d6bf49cbd89f9f7f609cdb46e1365dc9af686e45f

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#


module Priority
  FATAL = 0
  ERROR = 1
  WARN = 2
  INFO = 3
  DEBUG = 4
  TRACE = 5
  VALUE_MAP = {0 => "FATAL", 1 => "ERROR", 2 => "WARN", 3 => "INFO", 4 => "DEBUG", 5 => "TRACE"}
  VALID_VALUES = Set.new([FATAL, ERROR, WARN, INFO, DEBUG, TRACE]).freeze
end

module EventStatus
  ACK = 0
  COMMITED = 1
  ERR = 2
  VALUE_MAP = {0 => "ACK", 1 => "COMMITED", 2 => "ERR"}
  VALID_VALUES = Set.new([ACK, COMMITED, ERR]).freeze
end

class ThriftFlumeEvent
  include ::Thrift::Struct, ::Thrift::Struct_Union
  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}}
  }

  def struct_fields; FIELDS; end

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

  ::Thrift::Struct.generate_accessors self
end

class RawEvent
  include ::Thrift::Struct, ::Thrift::Struct_Union
  RAW = 1

  FIELDS = {
    RAW => {:type => ::Thrift::Types::STRING, :name => 'raw', :binary => true}
  }

  def struct_fields; FIELDS; end

  def validate
  end

  ::Thrift::Struct.generate_accessors self
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-flume-0.1.1 lib/fluent/plugin/thrift/flume_types.rb
fluent-plugin-flume-0.1.0 lib/fluent/plugin/thrift/flume_types.rb