Sha256: 0abffc400346f83c26166c2cc4c13872b55c4bc263e1c44b4b886b3db78af869

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

#
# Autogenerated by Thrift Compiler (0.8.0)
#
# 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
  FIELDS = 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'},
    FIELDS => {:type => ::Thrift::Types::MAP, :name => 'fields', :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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
floom-0.0.1 lib/thrift/flume_types.rb