Class: ThriftSourceProtocol::Client

Inherits:
Object
  • Object
show all
Includes:
Thrift::Client
Defined in:
lib/flume-logger/flume-ng/thrift_source_protocol.rb

Instance Method Summary collapse

Instance Method Details

#append(event) ⇒ Object



14
15
16
17
# File 'lib/flume-logger/flume-ng/thrift_source_protocol.rb', line 14

def append(event)
  send_append(event)
  return recv_append()
end

#appendBatch(events) ⇒ Object



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

def appendBatch(events)
  send_appendBatch(events)
  return recv_appendBatch()
end

#recv_appendObject

Raises:

  • (::Thrift::ApplicationException)


23
24
25
26
27
# File 'lib/flume-logger/flume-ng/thrift_source_protocol.rb', line 23

def recv_append()
  result = receive_message(Append_result)
  return result.success unless result.success.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'append failed: unknown result')
end

#recv_appendBatchObject

Raises:

  • (::Thrift::ApplicationException)


38
39
40
41
42
# File 'lib/flume-logger/flume-ng/thrift_source_protocol.rb', line 38

def recv_appendBatch()
  result = receive_message(AppendBatch_result)
  return result.success unless result.success.nil?
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'appendBatch failed: unknown result')
end

#send_append(event) ⇒ Object



19
20
21
# File 'lib/flume-logger/flume-ng/thrift_source_protocol.rb', line 19

def send_append(event)
  send_message('append', Append_args, :event => event)
end

#send_appendBatch(events) ⇒ Object



34
35
36
# File 'lib/flume-logger/flume-ng/thrift_source_protocol.rb', line 34

def send_appendBatch(events)
  send_message('appendBatch', AppendBatch_args, :events => events)
end