Click to add text © 2012 IBM Corporation 1 Java Operator API New Functionality InfoSphere Streams Version 3.0 Dan Debrunner and Howard Nasgaard SPL Java.

Slides:



Advertisements
Similar presentations
COMP 121 Week 9: AbstractList and ArrayList. Objectives List common operations and properties of Lists as distinct from Collections Extend the AbstractCollection.
Advertisements

IMS and WebSphere MQ GSE BENELUX IMS User Group Meeting
Click to add text © 2012 IBM Corporation 1 DataExplorerPush Operator InfoSphere Streams Version 3.0 Manasa K Rao Toolkits.
RTC Agile Planning Component
29-Jun-15 JAXB Java Architecture for XML Binding.
© 2011 IBM Corporation Overview on Modeling RESTful Services August, 2011 Manoj Paul, Software Developer, Rational,
Click to add text © 2012 IBM Corporation 1 Streams Toolkit Landscape InfoSphere Streams Version 3.0 Mike Branson Toolkits.
® IBM Software Group © 2012 IBM Corporation OPTIM Data Studio – Jon Sayles, IBM/Rational November, 2012.
Missed Call Notification Unity Connection 11.0
Copyright © IBM Corp., All rights reserved. This presentation is licensed under Creative Commons Att. Nc Nd 2.5 license. OpenDocument Format.
© 2009 IBM Corporation ® IBM Lotus Notes and Domino Product Roadmap April 2009.
IBM ISPF Productivity Tool © 2008 IBM Corporation IBM ISPF Productivity Tool for z/OS V 5.10 More Than Just ISPF.
IBM Software Group ® Jazz Storage Service Thomas.
© 2008 by Matt Flaherty & Mary Ruddy; made available under the EPL v1.0 Security & Identity : From present to future Matt Flaherty, IBM Mary Ruddy, Meristic.
Click to add text © 2012 IBM Corporation 1 Visualization of View Data Susan L. Cline SWS Visualization.
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
© Keren Kalif Advanced Java Topics Written by Keren Kalif, Edited by Liron Blecher.
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
Enhancement Package Innovations Gabe Rodriguez - Halliburton Stefan Kneis – SAP Marco Valencia - SAP.
IBM Software Group ® Process Sequence to call ProcessAdminService from browser Thomas.
Java Class Structure. Class Structure package declaration import statements class declaration class (static) variable declarations* instance variable.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Inbound Logistics (L3) Manage Receipts.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Outbound Logistics (L3) Pick Loads.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Inbound Logistics (L3) Put Away Loads.
© 2015 IBM Corporation Big Data Journey. © 2015 IBM Corporation 2.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Inbound Logistics (L3) Manage Supplier Returns.
Click to add text © 2012 IBM Corporation 1 InfoSphere Streams Streams Console Applications InfoSphere Streams Version 3.0 Warren Acker InfoSphere Streams.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Inbound Logistics (L3) Manage and Disposition Inventory Returns.
Oracle Fusion Applications 11gR1 ( ) Functional Overview (L2) Manage Inbound Logistics (L3) Inspect Material.
® IBM Software Group © 2011 IBM Corporation Innovation for a smarter planet IBM SOA Overview for MITRE “Driving SOA Program Success and Efficiency” April.
Click to add text © 2012 IBM Corporation 1 Streams Console Application Graph Michael Pfeifer Streams Admin Console.
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
INTEL CONFIDENTIAL Intel® Smart Connect Technology Remote Wake with WakeMyPC November 2013 – Revision 1.2 CDI/IBP #:
For Oracle employees and authorized partners only. Do not distribute to third parties. © 2008 Oracle Corporation – Proprietary and Confidential.
Domino iSeries Multi-Versioning © 2002 IBM Corporation | Lotus software © 2002 IBM Corporation Domino Multi-Versioning Mike Gordon – IBM Global Services.
Playback for Epic Ability to turn off default thresholds 1.
© 2013 IBM Corporation IBM UrbanCode Deploy v6.0.1 Support Enablement Training Source Configuration and Database Upgrades Michael Malinowski
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
IBM Software Group ® Jazz Team Build – Part 1 Overview Jonathan.
© 2013 IBM Corporation LDAP Fundamentals & LDAP for CLM Bruce Besch IBM Rational Services.
IBM Innovate 2012 Title Presenter’s Name Presenter’s Title, Organization Presenter’s Address Session Track Number (if applicable)
© 2013 IBM Corporation IBM UrbanCode Deploy v6.0 Support Enablement Training Jenkins plug-in 1 November 2013.
IBM Software Group ® Jazz Process Component —Process Template Management Thomas.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Oracle Proprietary and Confidential. 1.
Slide 1. What's New in NetBeans IDE 7.1 Name Title.
© 2015 IBM Corp. OSD development team 22 October, 2015 BigFix OS Deployment 3.9 Sprint 1 DEMO Oct 22nd, 2015.
Work smarter, keep connected with Lotus Software Jon Crouch | Senior Technical Specialist, Lotus Software Matt Newton | Senior Technical Specialist, Lotus.
David Hatten Developer, UrbanCode 17 October 2013
Gavin Arthurs PE Sr. Technical Specialist – IBM Rational
Deploy Plugins Developer 29 October 2013
Consumer Cloud Monitoring – Beta Sprint Demo
Denny Hatzenbihler InfoSphere Streams - Runtime
Integrating Data With Cognos
Flight Recorder in OpenJDK
Disclaimer The information in this presentation is confidential and proprietary to SAP and may not be disclosed without the permission of SAP. Except for.
IBM Blockchain An Enterprise Deployment of a Distributed Consensus-based Transaction Log Ben Smith & Kostantinos Christidis 1 ©2016 IBM Corporation.
Implementing Listening Producers in IBM Sterling Filegateway
Embedded Software (ESW) Engineering Practices Introduction
Presentation transcript:

Click to add text © 2012 IBM Corporation 1 Java Operator API New Functionality InfoSphere Streams Version 3.0 Dan Debrunner and Howard Nasgaard SPL Java Operator API

© 2012 IBM Corporation 2 Important Disclaimer THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “ AS IS ”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM ’ S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: CREATING ANY WARRANTY OR REPRESENTATION FROM IBM (OR ITS AFFILIATES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS); OR ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT GOVERNING THE USE OF IBM SOFTWARE. The information on the new product is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information on the new product is for informational purposes only and may not be incorporated into any contract. The information on the new product is not a commitment, promise, or legal obligation to deliver any material, code or functionality. The development, release, and timing of any features or functionality described for our products remains at our sole discretion. THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.

© 2012 IBM Corporation 3 Agenda  SPL Compile Time Checking  SPL Parameter handing ease-of-use  SPL Trace & Log  SPL Types  Tuple Encoding  Platform JMX Integration  Minor Improvements  SPADE API removal warning

© 2012 IBM Corporation 4 SPL Compile Time Checking  Verify Java primitive operator invocation context at SPL compile time and/or runtime  Using Java code –Invocation of annotated static methods of the operator's class at compile public static void checkFileDirectoryExclusive(OperatorContextChecker checker) { checker.checkExcludedParameters("file", "directory"); } –Including super-class methods  Javadoc: com.ibm.streams.operator.OperatorContext.ContextCheck

© 2012 IBM Corporation 5 OperatorContextChecker  Passed into method  Provides –Access to compile time OperatorContext Parameter names (values not available yet) Compile time ports (e.g. no tuple submission) –Get validity/set invalidity of invocation context –Utility methods similar to perl check helper functions in CodeGen.pm public boolean checkDependentParameters(String parameterName, String...dependentParameterNames); public boolean checkRequiredAttributes(StreamingData port, String...attributeNames);  Javadoc: com.ibm.streams.operator.compile.OperatorContextChecker

© 2012 IBM Corporation 6 How to cause SPL Compile Errors  Use OperatorContextChecker utility methods –If context invalid error SPL error automatically raised  Call OperatorContextChecker.setInvalidContext() –Typically with useful error message  Log an error or warn message –Error level causes an SPL compiler error –Warn level causes an SPL compiler warning  Throw an descriptive exception  Flexibility allows the Java primitive to raise multiple errors during compilation

© 2012 IBM Corporation 7 Getting SPL Parameter values (Streams Version 2.0) public class MyOp extends AbstractOperator { private int threshold; public void setThreshold(int threshold) { this.threshold = threshold; } public int getThreshold() { return threshold; public void initialize(OperatorContext context) throws Exception { super.initialize(context); setThreshold(Integer.valueOf( context.getParameterValues("threshold").get(0))); } Getting the value of a parameter is awkward: - need to pull value out of List - need to covert to specific type from String Example is just an int, array values are harder List values = context.getParameterValues("rates"); double[] rates = new double[values.size()]; for (int i = 0; i < rates.length; i++) rates[i] = Double.valueOf(values.get(i)); setRates(rates);

© 2012 IBM Corporation 8 SPL Parameters mapped to setters (Streams Version 3.0) Automatically map SPL parameters to the operator's Java bean properties through annotation Javadoc: com.ibm.streams.operator.model.Parameter Setter method for Java bean called automatically before initialize(), with: - automatic conversion (with error checking) - error checking for multiple values into a single value type (e.g. int) - error checking for missing mandatory parameter No code required at initialize() time - Removes boiler plate code A bean property is just a setter method with a standard signature: public void public void setThreshold(int threshold) { this.threshold = threshold; optional=true) public void setRates(double [] rates) { this.rates = rates; }

© 2012 IBM Corporation 9 SPL Trace & Log  Support SPL trace & log enhancements –Integration with: Java platform java.util.logging Apache Log4j –Existing trace Logging api deprecated  Loggers –Root (“”) map to SPL trace facility Thus arbitrary application loggers map to SPL trace – com.ibm.streams.operator.log map to SPL log facility Create a child logger for application messages to SPL log  Javadoc (package): – com.ibm.streams.operator.logging – com.ibm.streams.operator.log4j

© 2012 IBM Corporation 10 Improved Trace/Log functionality  Can use all functionality of standard/log4j logging –Child loggers –Localization (message bundles) –Trace/log to additional locations –Log levels –Multiple logging methods  SPL trace/log aspects supported by associating aspects with named loggers  Constants for SPL trace & log levels supplied –That map to native logger levels

© 2012 IBM Corporation 11 LoggerUseExample (sample) public class LoggerUseExample extends AbstractOperator { private static final String CLASS_NAME = LoggerUseExample.class.getName(); /** Create a Logger} specific to this class that will write * to the SPL trace facility as a child of the root Logger}. */ private final Logger trace = Logger.getLogger(CLASS_NAME); /** Create a Logger} specific to this class that will write * to the SPL log facility as a child of the LoggerNames#LOG_FACILITY} * Logger}. * The Logger} uses a resource bundle.*/ private final Logger log = Logger.getLogger(LoggerNames.LOG_FACILITY + "." + CLASS_NAME, "com.ibm.streams.operator.samples.operators.messages"); /** * Sample uses of log and trace. public void initialize(OperatorContext context) throws Exception { super.initialize(context); // Note setLoggerAspects() must be called after super.initialize(context) // as it requires the context. // Associate the aspects exampleTrace and testTrace with trace // messages from the SPL trace logger setLoggerAspects(trace.getName(), "exampleTrace", "testTrace"); // Associate the aspect exampleLog with messages from the SPL log logger. setLoggerAspects(log.getName(), "exampleLog"); // Example use of trace to dump all parameters. The level uses // the Java Operator API specific class TraceLevel} // that has constants for the SPL log levels. for (String parameterName : context.getParameterNames()) { for (String value : context.getParameterValues(parameterName)) { trace.log(TraceLevel.INFO, "Parameter {0} has value {1}", new Object[] {parameterName, value}); }

© 2012 IBM Corporation 12 SPL enum  enum type supported in stream schemas – com.ibm.streams.operator.Type.MetaType.ENUM  Java mapping –String – exact match to SPL identifier –Java enum State state = tuple.getEnum(State.class, “sensorstate”); –SPL identifiers must match Java enum constants Enum.name()

© 2012 IBM Corporation 13 SPL XML  xml type supported in stream schemas – com.ibm.streams.operator.Type.MetaType.XML  Java mapping – com.ibm.streams.operator.types.XML Integrate with full Java XML support through – javax.xml.transform.stream.StreamSource Indication if value is default SPL value (“empty”) – ValueFactory.newXML() to create values Integrate with full Java XML support through – javax.xml.transform.Source – javax.xml.transform.Transformer  XML processing through standard Java apis –DOM, JAXB, SAX, StAX

© 2012 IBM Corporation 14 Tuple Encoding  Serialize tuples to and from –Java serialization (Streams Version 2.0) –SPL native binary encoding Compatible with C++ NativeByteBuffer  Encode tuples to –JSON (JavaScript Object Notation) Including collections & nested tuples Excluding blob, complex32, complex64  Javadoc (package): – com.ibm.streams.operator.encoding

© 2012 IBM Corporation 15 JMX Integration - Life-cycle Notifications  JMX –Java Management & Monitoring API –Rich set of functionality  MXBeans registered in platform MBeanServer – OperatorContextMXBean, ProcessingElementMXBean –Supports operator life-cycle notifications allPortsReady,shutdown,customMetricCreated –Allows code to be shared across multiple operator classes and manage its own life-cycle –E.g. Jetty webserver started by Operator.initialize() but watches allPortsReady & shutdown notifications to avoid requiring each operator class to code explicit notifications  Javadoc (package): – com.ibm.streams.operator.management

© 2012 IBM Corporation 16 JMX Integration - Metrics  Ability to register a MetricMXBean for operator custom and port metrics  Allows integration of the JMX monitoring functionality provided by Java – javax.management.monitoring  CounterMonitorMBean –Alert when threshold reached  GaugeMonitorMBean –Alerts when high and low threshold crossed

© 2012 IBM Corporation 17 Input Port Queue JMX GaugeMonitorMBean Example T2T1T0 Notification when queue first contains 8 tuples. No further notification until low threshold is crossed Notification when queue drops to 2 tuples after a high threshold notification High threshold Low threshold InputPortMetric.queueSize InputPortMetric.nTuplesQueued Gauge Monitor MBean Metric MXBean Allows an operator to change its behaviour based upon queue state using a hysteresis mechanism

© 2012 IBM Corporation 18 Minor Improvements  OperatorContext –getKind() - Get primitive operator kind  ProcessingElement –Getters for applicationScope, applicationDirectory, optimized, relaunchCount, instanceId  StreamingData –Mapping of operator port to PE port  Tuple,OutputTuple –Better support for nested tuples AsReadOnlyTuple, setTuple, assignTuple

© 2012 IBM Corporation 19 SPADE API Removal WARNING  com.ibm.streams.operator –Streams Version 2.0+ operator API –All new functionality extends this api only  com.ibm.streams.spade –Streams Version 1.x operator API –Deprecated in Streams Version 2.0 Supported in Versions 2.0 & 3.0 –TO BE REMOVED IN NEXT RELEASE Removal warnings added in Streams Version 3.0