Class: LogStash::Inputs::Gemfire

Inherits:
Threadable show all
Defined in:
lib/logstash/inputs/gemfire.rb

Overview

Push events to a GemFire region.

GemFire is an object database.

To use this plugin you need to add gemfire.jar to your CLASSPATH. Using format=json requires jackson.jar too; use of continuous queries requires antlr.jar.

Note: this plugin has only been tested with GemFire 7.0.

Constant Summary

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes inherited from Base

#params, #threadable

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Threadable

#initialize

Methods inherited from Base

#initialize, #tag

Methods included from Config::Mixin

#config_init, included

Methods inherited from Plugin

#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #terminating?, #to_s

Constructor Details

This class inherits a constructor from LogStash::Inputs::Threadable

Instance Method Details

#registerObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/logstash/inputs/gemfire.rb', line 58

def register
  import com.gemstone.gemfire.cache.AttributesMutator
  import com.gemstone.gemfire.cache.InterestResultPolicy
  import com.gemstone.gemfire.cache.client.ClientCacheFactory
  import com.gemstone.gemfire.cache.client.ClientRegionShortcut
  import com.gemstone.gemfire.cache.query.CqQuery
  import com.gemstone.gemfire.cache.query.CqAttributes
  import com.gemstone.gemfire.cache.query.CqAttributesFactory
  import com.gemstone.gemfire.cache.query.QueryService
  import com.gemstone.gemfire.cache.query.SelectResults
  import com.gemstone.gemfire.pdx.JSONFormatter

  @logger.info("Registering input", :plugin => self)
end

#run(queue) ⇒ Object

def register



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/logstash/inputs/gemfire.rb', line 73

def run(queue)
  return if terminating?
  connect

  @logstash_queue = queue

  if @query
    continuous_query(@query)
  else
    register_interest(@interest_regexp)
  end
end

#teardownObject

def run



86
87
88
89
90
# File 'lib/logstash/inputs/gemfire.rb', line 86

def teardown
  @cache.close if @cache
  @cache = nil
  finished
end