Merge "Deprecate event trait plugin 'split'"

This commit is contained in:
Jenkins 2015-10-16 00:40:22 +00:00 committed by Gerrit Code Review
commit bcfb09f89d
3 changed files with 16 additions and 9 deletions

View File

@ -15,8 +15,13 @@
import abc
from oslo_log import log
import six
from ceilometer.i18n import _LW
LOG = log.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class TraitPluginBase(object):
@ -102,6 +107,14 @@ class SplitterTraitPlugin(TraitPluginBase):
:param segment: Which segment to return. (int) default 0
:param max_split: Limit number of splits. Default: None (no limit)
"""
LOG.warning(_LW('split plugin is deprecated, '
'add ".`split(%(sep)s, %(segment)d, '
'%(max_split)d)`" to your jsonpath instead') %
dict(sep=separator,
segment=segment,
max_split=(-1 if max_split is None
else max_split)))
self.separator = separator
self.segment = segment
self.max_split = max_split

View File

@ -8,15 +8,9 @@
instance_id:
fields: payload.instance_id
host:
fields: publisher_id
plugin:
name: split
parameters:
segment: 1
max_split: 1
fields: publisher_id.`split(., 1, 1)`
service:
fields: publisher_id
plugin: split
fields: publisher_id.`split(., 0, -1)`
memory_mb:
type: int
fields: payload.memory_mb

View File

@ -5,7 +5,7 @@
retrying!=1.3.0,>=1.2.3 # Apache-2.0
croniter>=0.3.4 # MIT License
eventlet>=0.17.4
jsonpath-rw-ext>=0.1.7
jsonpath-rw-ext>=0.1.9
jsonschema!=2.5.0,<3.0.0,>=2.0.0
kafka-python>=0.9.2 # Apache-2.0
keystonemiddleware>=2.0.0