Skip to content

Commit

Permalink
Merge pull request #143 from IBMStreams/develop
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
markheger authored Jun 17, 2019
2 parents 24cea6a + a65ef5b commit 686ac6b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.README.md.html

.DS_Store
/**/.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ public void handleNotification(Notification notification, Object handback) {
* Register existing jobs.
*/
BigInteger jobId = (BigInteger)notification.getUserData();


String jobName = addValidJob(jobId);

if (null != _operatorConfiguration.get_tupleContainerJobStatusSource()) {
final Tuple tuple = _operatorConfiguration.get_tupleContainerJobStatusSource().getTuple(notification, handback, _domainId, _instanceId, jobId, null, null, null, null, null);
final Tuple tuple = _operatorConfiguration.get_tupleContainerJobStatusSource().getTuple(notification, handback, _domainId, _instanceId, jobId, jobName, null, null, null, null);
_operatorConfiguration.get_tupleContainerJobStatusSource().submit(tuple);
}

addValidJob(jobId);
}

if (isInfoEnabled) {
_trace.info("received JOB_ADDED notification: jobId=" + jobId);
}
Expand All @@ -139,8 +140,10 @@ else if (notification.getType().equals(Notifications.JOB_REMOVED)) {
BigInteger jobId = (BigInteger)notification.getUserData();
if (_jobHandlers.containsKey(jobId)) {

String jobName = _jobHandlers.get(jobId).getJobName();

if (null != _operatorConfiguration.get_tupleContainerJobStatusSource()) {
final Tuple tuple = _operatorConfiguration.get_tupleContainerJobStatusSource().getTuple(notification, handback, _domainId, _instanceId, jobId, null, null, null, null, null);
final Tuple tuple = _operatorConfiguration.get_tupleContainerJobStatusSource().getTuple(notification, handback, _domainId, _instanceId, jobId, jobName, null, null, null, null);
_operatorConfiguration.get_tupleContainerJobStatusSource().submit(tuple);
}

Expand All @@ -162,7 +165,7 @@ else if (isInfoEnabled) {
}
}

protected void addValidJob(BigInteger jobId) {
protected String addValidJob(BigInteger jobId) {
boolean isDebugEnabled = _trace.isDebugEnabled();
if (isDebugEnabled) {
_trace.debug("--> addValidJob(" + jobId + ")");
Expand All @@ -189,6 +192,7 @@ protected void addValidJob(BigInteger jobId) {
if (isDebugEnabled) {
_trace.debug("<-- addValidJob(" + jobId + ")");
}
return jobName;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,8 @@ public void close() throws Exception {
_peHandlers.clear();
}

public String getJobName() {
return _jobName;
}

}
2 changes: 1 addition & 1 deletion com.ibm.streamsx.monitoring/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ For example, launch the MetricsIngestService from command line using relative pa
streamsx-runner --service-name $STREAMING_ANALYTICS_SERVICE_NAME --main-composite com.ibm.streamsx.monitoring.metrics.services::MetricsIngestService --toolkits com.ibm.streamsx.monitoring --trace info
]]></info:description>
<info:version>2.0.0</info:version>
<info:version>2.0.1</info:version>
<info:requiredProductVersion>4.1.0.0</info:requiredProductVersion>
</info:identity>
<info:dependencies/>
Expand Down
17 changes: 17 additions & 0 deletions samples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Licensed Materials - Property of IBM
# Monitoring Toolkit for IBM Streams
# (c) Copyright IBM Corp. 2019
# All rights reserved.

DIRS := $(shell for x in *; do if [ -d $$x ]; then echo -n "$$x "; fi; done)
$(info Samples to build: $(DIRS))
$(info )

.PHONY: all clean

all:
for x in $(DIRS); do echo -e "\n######## make sample $$x ########"; cd $$x; make all; cd -; done

clean:
for x in $(DIRS); do cd $$x; make clean; cd -; done

0 comments on commit 686ac6b

Please sign in to comment.