Fixed left out name changes Fixed health stats event not being published to CEP Fixed incrementing event number of the events published to the thrift receiver
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7f8ef63f Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7f8ef63f Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7f8ef63f Branch: refs/heads/master Commit: 7f8ef63f985bbaae4e7fc80f4873fbb4f2e0393b Parents: cd97e69 Author: Chamila de Alwis <[email protected]> Authored: Wed Oct 22 19:40:54 2014 +0530 Committer: Chamila de Alwis <[email protected]> Committed: Wed Oct 22 19:40:54 2014 +0530 ---------------------------------------------------------------------- tools/python_cartridgeagent/cartridgeagent/agent.conf | 4 ++-- .../modules/artifactmgt/git/gitrepository.py | 5 +---- .../cartridgeagent/modules/databridge/agent.py | 2 ++ .../cartridgeagent/modules/databridge/thrift/publisher.py | 10 +++++----- .../cartridgeagent/modules/util/cartridgeagentutils.py | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/7f8ef63f/tools/python_cartridgeagent/cartridgeagent/agent.conf ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/agent.conf b/tools/python_cartridgeagent/cartridgeagent/agent.conf index 5c087e9..dff3cd7 100644 --- a/tools/python_cartridgeagent/cartridgeagent/agent.conf +++ b/tools/python_cartridgeagent/cartridgeagent/agent.conf @@ -23,8 +23,8 @@ thrift.receiver.ip =CEP-IP thrift.receiver.port =CEP-PORT thrift.server.admin.username =CEP-ADMIN-USERNAME thrift.server.admin.password =CEP-ADMIN-PASSWORD -param.file.path =/mnt/cartridge-agent/payload/launch-params -extensions.dir =/mnt/cartridge-agent/extensions +param.file.path =/mnt/cartridgeagent/payload/launch-params +extensions.dir =/mnt/cartridgeagent/extensions cep.stats.publisher.enabled =ENABLE_HEALTH_PUBLISHER lb.private.ip =LB_PRIVATE_IP lb.public.ip =LB_PUBLIC_IP http://git-wip-us.apache.org/repos/asf/stratos/blob/7f8ef63f/tools/python_cartridgeagent/cartridgeagent/modules/artifactmgt/git/gitrepository.py ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/modules/artifactmgt/git/gitrepository.py b/tools/python_cartridgeagent/cartridgeagent/modules/artifactmgt/git/gitrepository.py index 98a8a44..d710d9b 100644 --- a/tools/python_cartridgeagent/cartridgeagent/modules/artifactmgt/git/gitrepository.py +++ b/tools/python_cartridgeagent/cartridgeagent/modules/artifactmgt/git/gitrepository.py @@ -15,9 +15,6 @@ # specific language governing permissions and limitations # under the License. -from ...util.asyncscheduledtask import AsyncScheduledTask -from gittle import Gittle -from git import * class GitRepository: """ @@ -48,4 +45,4 @@ class GitRepository: self.commit_enabled = False """ :type : bool """ self.scheduled_update_task = None - """:type : AsyncScheduledTask """ \ No newline at end of file + """:type : ScheduledExecutor """ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/7f8ef63f/tools/python_cartridgeagent/cartridgeagent/modules/databridge/agent.py ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/modules/databridge/agent.py b/tools/python_cartridgeagent/cartridgeagent/modules/databridge/agent.py index 1859d8a..d67be89 100644 --- a/tools/python_cartridgeagent/cartridgeagent/modules/databridge/agent.py +++ b/tools/python_cartridgeagent/cartridgeagent/modules/databridge/agent.py @@ -155,6 +155,8 @@ class ThriftPublisher: :return: void """ event_bundler = EventBundle() + event_bundler.addStringAttribute(self.stream_id) + event_bundler.addLongAttribute(time.time() * 1000) ThriftPublisher.assign_attributes(event.metaData, event_bundler) ThriftPublisher.assign_attributes(event.correlationData, event_bundler) ThriftPublisher.assign_attributes(event.payloadData, event_bundler) http://git-wip-us.apache.org/repos/asf/stratos/blob/7f8ef63f/tools/python_cartridgeagent/cartridgeagent/modules/databridge/thrift/publisher.py ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/modules/databridge/thrift/publisher.py b/tools/python_cartridgeagent/cartridgeagent/modules/databridge/thrift/publisher.py index 325b05d..dfe4aa2 100644 --- a/tools/python_cartridgeagent/cartridgeagent/modules/databridge/thrift/publisher.py +++ b/tools/python_cartridgeagent/cartridgeagent/modules/databridge/thrift/publisher.py @@ -42,6 +42,8 @@ class Publisher: self.sessionId = None self.streamId = None + self.event_num = 0 + def connect(self, username, password): # Create a client to use the protocol encoder Publisher.client = ThriftSecureEventTransmissionService.Client(self.protocol) @@ -57,12 +59,10 @@ class Publisher: def publish(self, event): # Build thrift event bundle - #event = EventBundle() event.setSessionId(self.sessionId) - event.setEventNum(0) - event.addStringAttribute(self.streamId) - event.addLongAttribute(time.time() * 1000) - #event.addStringAttribute(msg) + event.setEventNum(self.event_num) + self.event_num += 1 + # Publish Publisher.client.publish(event.getEventBundle()) http://git-wip-us.apache.org/repos/asf/stratos/blob/7f8ef63f/tools/python_cartridgeagent/cartridgeagent/modules/util/cartridgeagentutils.py ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/modules/util/cartridgeagentutils.py b/tools/python_cartridgeagent/cartridgeagent/modules/util/cartridgeagentutils.py index 6ae89b1..583cae2 100644 --- a/tools/python_cartridgeagent/cartridgeagent/modules/util/cartridgeagentutils.py +++ b/tools/python_cartridgeagent/cartridgeagent/modules/util/cartridgeagentutils.py @@ -164,5 +164,5 @@ def get_working_dir(): :return: Base working dir path :rtype : str """ - #"/path/to/cartridge-agent/modules/util/".split("modules") returns ["/path/to/cartridge-agent/", "/util"] + #"/path/to/cartridgeagent/modules/util/".split("modules") returns ["/path/to/cartridgeagent/", "/util"] return os.path.abspath(os.path.dirname(__file__)).split("modules")[0] \ No newline at end of file
