EDOBE XDOM PMML Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Oprogramowanie programistyczne EDOBE XDOM PMML. TIBCO Spotfire Miner 8.1 Java/C++ Extensibility Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj

Podsumowanie treści

Strona 1

TIBCO Spotfire Miner™ 8.2Java/C++ ExtensibilityNovember 2010TIBCO Software Inc.

Strona 2 - IMPORTANT INFORMATION

10• x-position (if in a worksheet)• y-position (if in a worksheet)• Property values set in the node property dialog

Strona 3 - Technical

11For example, the XML for the Correlations node in the Explorer pane is:<ActivityNode engineClass= "com.insightful.miner.CorrelationsEn

Strona 4 - JAVA/C++ EXTENSIBILITY

12If your new components are implemented entirely using S-PLUS script nodes, and you have no special property dialogs or viewers then the jar file is

Strona 5

13extension.xml FilesIf the file extension.xml exists within an extension subdirectory, it must be an XML file that describes exactly which files comp

Strona 6 - OVERVIEW

14• libraryFile: Value is one or more C++ library files that is loaded when the extension is processed.•imageDirectory: Value is one or more directori

Strona 7 - EXTENSION FILES

15DEVELOPMENT TOOLSYou will need Java and possibly C++ compilers to create new nodes.Java Compiler To compile the Java code, you will need a Java comp

Strona 8 - Extension File

16Optional Tools While the compilers are the only tools strictly required for developing new nodes, we use some additional tools as a standard part of

Strona 9 - Explorer IML

17ARCHITECTURE FEATURESThe architecture for Spotfire Miner has a number of key features that are important for understanding how the application works

Strona 10

18DateDate columns are used to represent dates and times. They are stored as a long representing the number of milliseconds since an origin of Januar

Strona 11

19CreatedA created node has been created and possibly linked to other nodes, but does not have all of its required property values specified. The use

Strona 12 - C++ Library

2IMPORTANT INFORMATIONSOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE T

Strona 13

20INFRASTRUCTURE JAVA CLASSESSome important classes for storing and exchanging information are XTProps for storing property information and XTMetaData

Strona 14

21GRAPHICAL USER INTERFACE CLASSESOverview Spotfire Miner is structured as a client/server application. Each component such as a Read File node has a

Strona 15 - DEVELOPMENT TOOLS

22Constructors The constructor method is typically empty. When the constructor is called, the node properties have not been initialized. Any subclas

Strona 16

23Column Filter GeneratorSome nodes are able to create a Filter Columns node where the columns selected are determined based upon the node’s computati

Strona 17 - ARCHITECTURE FEATURES

24Node Dialog The user has great latitude in how the node’s properties dialog is implemented. In the application each node has its own class extendin

Strona 18

25ENGINE CLASSESOverview For each type of node, there is a class extending EngineNode that is responsible for providing metadata to the activity node

Strona 19

26Output Meta DataThe calculateOutputMetaData() method is called to determine the names and types of the output columns. The pipeline takes care of c

Strona 20 - INFRASTRUCTURE JAVA CLASSES

27An example execute() method is in the section Simple Java Version on page 28.C++ Procs If the computation is to be performed in C++, the CNKProc cla

Strona 21 - Activity Node

28EXAMPLE: COPYING INPUTSThis section presents a simple example of the steps needed to create a new node. We will create a node that simply copies d

Strona 22 - Interfaces

29/** * Very simple implementation of engine node copying each * input to the corresponding output. Assumes the same * number of inputs as outputs.

Strona 23 - Column Filter

3identification purposes only. This software may be available on multiple operating systems. However, not all operating system platforms for a specifi

Strona 24 - HtmlFrame

30 * is executed. */ public void execute(CNKProcJavaTransform proc) { for (int i=0; i<getNumInputs(); i++) { proc.copyData(i, 0, 0, i,

Strona 25 - ENGINE CLASSES

31CompilationNow that we have our Java code, we need to compile it and place it in a jar file. The specific steps for compiling the code and creating

Strona 26 - CNKProc

32<DisplayInfo labelText="First Copy Columns"defaultLabelText="First Copy Columns"smallIcon="default_small.gif"largeI

Strona 27

33Engine Node The engine node corresponding to a C++ proc differs from the version for the straight Java implementation in a variety of ways:• The cla

Strona 28 - EXAMPLE: COPYING INPUTS

34 /** * Passes the input column name/type information as the * output information. */ public XTMetaData calculateOutputMetaData(int outputNum

Strona 29

35 * DLL */ public void createPeerObject() { createCNKObject("cnkcopy", new String[] { "CNKProcCppSecondCopy", "

Strona 30

36#include "CNKProcCppSecondCopy.h"CNK_DEFINE_ACCESSIBLE_CLASS(CNKProcCppSecondCopy)CNKProcCppSecondCopy::CNKProcCppSecondCopy() : CNKPro

Strona 31

37Now that we have the C++ source and header files, we need to compile the code to create the DLL.CompilationThe programming examples directory contai

Strona 32 - Simple C++

38 numOutputs="2" > <DisplayInfo labelText="Second Copy Columns" defaultLabelText="Second Copy Columns"

Strona 33

39public class ThirdCopyNodeModel extends ActivityNodeModel { /** * Boilerplate constructor. */ public ThirdCopyNodeModel() { } /** * Show t

Strona 34

4Important Information 2Overview 6Extension Files 7Default Extension File Names 8Explorer IML Files 9Java Files 11C++ Library Files 12Image Files 12He

Strona 35

40 } catch (Exception e) { e.printStackTrace(); valid = false; } return valid; } /** * Display the cached input metadata as HTM

Strona 36

41The column selection control is a list box of column names with selection indicating which Columns to Copy. Use the standard Windows selection mech

Strona 37 - numInputs="2"

42 private ThirdCopyDialog() { super(); pack(); setMinimumSize(new Dimension(500,500)); } /** * Restore the list of column names and sel

Strona 38 - Extended Java

43 } } /** * Method called by the dialog to save properties in Model */ public void saveProperties() throws NodeDialog.DialogExcept

Strona 39

44 listModel = new DefaultListModel(); listBox = new JList(); listBox.setModel(listModel); listBox.setSelectionMode( ListSe

Strona 40

45 JOptionPane.INFORMATION_MESSAGE); }}Engine Node The engine node implementation displays a variety of functionality:• Return the metadata fo

Strona 41

46 /** * Empty constructor just uses the super method. */ public ThirdCopyEngineNode() { } /** * Boilerplate for specifying this class provi

Strona 42

47 /** * Store the column names to be referred to when * executing. This shows how to store information for * use in multiple chunks. */ pu

Strona 43

48 // Some error checking if (inColNum < 0) { proc.addError("Column '" + colName + "' n

Strona 44

49 m_columnNames = null; }}XML Description The XML description for this node differs from the previous versions in the engine class name, GUI clas

Strona 45

5Special Interfaces 22Node Dialog 24Viewers 24Engine Classes 25Overview 25General Methods 25Constructors 25Initialization 25Output Meta Data 26CNKProc

Strona 46

50THE TIBCO SPOTFIRE PIPELINEOverview The TIBCO Spotfire Pipeline is a C++ system for accessing and manipulating very large data sets. The core of the

Strona 47

51PipelineA Pipeline object contains a set of bufs and procs. When a pipeline is executed, it repeatedly executes the procs, which read data from and

Strona 48

52FactorThe factor data type is much more complicated. A factor column maintains a list of strings, representing the levels of the factor. When a str

Strona 49

53StringString columns are used for informational columns such as names or addresses that do not represent categories and are not used in computations

Strona 50 - THE TIBCO SPOTFIRE PIPELINE

54enough rows available), but the proc writing to that buf cannot write to it (because the buf doesn't have enough free rows for writing to). In

Strona 51

55Cnkmisc LibraryThe cnkmisc library contains the C++ code for the various C++ procs in Spotfire Miner. This includes components such as linear regre

Strona 52

56These classes, and their publicly-accessible methods, will be described below.All of these classes have similarly-named header files (CNKObj.h, CNKB

Strona 53

57These methods set and get a name associated with the CNK object. The initial value for name is NULL.This is a good opportunity to mention several a

Strona 54

58 severity_warning, severity_error }; void addError(const char* msg); void addWarning(const char* msg); void addInformation(const char* msg)

Strona 55

59only storing messages for the first few rows. The getNumMessagesAtLevel() method returns the number of messages at a specified severity level.CNKOb

Strona 56 - Parent Class

6OVERVIEWSpotfire Miner is written in Java and C++. The graphical user interface and some computational components are in Java. The underlying pipel

Strona 57

60 static int isLevelNumNA(long val); static const char* getStringNA(); static int isStringNA(const char* val); static CNKTimeDate getTime

Strona 58

61 static CNKConverter* getDefaultConverter();These methods support conversions between string and double or time/date values. Such conversions de

Strona 59

62CNKPropertyInfo Information other than the actual data is stored and exchanged using properties. A property is a name/value pair where the name uni

Strona 60

63These methods are similar to getPropAsInt, etc., except that they can interpret the objects representing pointers to CNKBuf and CNKProc objects. Fo

Strona 61

64 if (propInfo->isPropName("seed")) { setSeed(propInfo->getPropAsINT32()); } else if (propInfo->isPropName("total.

Strona 62

65CNKBuf, CNKBufReader, CNKBufWriter: Data BuffersThe three classes CNKBuf, CNKBufReader, and CNKBufWriter together are used to implement a first-in-f

Strona 63

66immediately: it does not support "suspending" a CNKBuf data access method, if the data is not currently available. To handle these limita

Strona 64

67When a CNKMemoryBuf or CNKBackingFileBuf, is passed to one of the CNKProc::setInputBuf or CNKProc::setOutputBuf methods, this actually creates an in

Strona 65 - Data Buffers

68CNKBuf:: void setNumRows(long numRows); void setNumColumns(int cols); long getNumRows(); int getNumColumns();Set/get the number of rows

Strona 66 - Subclasses:

69 column_type_string, column_type_timeDate}; void setColumnType(int colNum, int typeNum); int getColumnType(int colNum); int columnTypeI

Strona 67

7EXTENSION FILESThe Spotfire Miner software is implemented using a large number of Java and C++ object files, image files, etc, stored in various subd

Strona 68 - CNKBufWriter

70integer part of this number is the number of days, and the fractional part represents a fraction of a day, e.g. the hours, minutes, and seconds.CNKB

Strona 69

71The "MaxAutoLevels" property determines the maximum number of levels that will be automatically created. The actual number of levels in a

Strona 70

72CNKBuf will call CNKBufReader::getEOF() to check whether there EOF has been set. CNKBuf::getEOF() gives the same information: it returns true (non-

Strona 71

73To avoid this problem, the CNKBuf must have at least as many rows as the largest possible CNKBufWriter::setRequestRows value plus the largest possib

Strona 72

74single buf reader can access the data sequentially, or read the data in multiple passes or via random access. As different parts of the data are ac

Strona 73 - CNKBackingFileB

75These methods return information about the storage of the data in the backing file. getBackingFileRowBytes returns the number of bytes for each row

Strona 74

76increasing, until releaseRows is called to release some of the read data rows. Therefore, it is safe to save the value returned by getRowsReady, an

Strona 75 - CNKBufReader

77 virtual double getDouble(long rowNum, int columnNum); virtual long getLevelNum(long rowNum, long colNum); virtual const char* getString(lo

Strona 76

78releaseAll() should be called when the reader is no longer interested in reading this data. After calling releaseAll(), no requests will be satisfi

Strona 77

79CNKBufWriter MethodsMost of the methods for CNKBufWriter are similar to those for CNKBufReader. Like the other class, where is no public constructo

Strona 78

8• Possibly a Windows DLL with compiled C++ code.• Possibly help files in a format such as compiled HtmlHelp• Possibly documentation in a format such

Strona 79

80isReady returns true (non-zero) if the CNKBuf is ready to be written to. Normally, this is true if getRowsReady() is greater than or equal to getRe

Strona 80

81With setConvertFactor, if the column is actually a double column, the argument is registered as a factor level for the column (by calling CNKBuf::ma

Strona 81

82 virtual INT64 getChunkPosition();At any time, a CNKBufWriter can write a "chunk" of data rows in a potentially-very-large series of da

Strona 82

83Likewise, the subclass init method should call the CNKProc::init(), as follows:void CNKProcCount::init(){CNKProc::init();...}The destructor ~CNKPro

Strona 83

84After inputs and outputs have been created, they can be accessed with getInputBuf and getOutputBuf (returning the linked CNKBuf objects), and getInp

Strona 84

85At a rough level of detail, the pipeline engine works by repeatedly scanning through all of the CNKProc objects. For each CNKProc, the engine calls

Strona 85

86Each CNKProc contains a field counting the number of times that it has been executed. This field is incremented by the pipeline engine, which calls

Strona 86 - Subclass of

87of a class, this creates and exports a regular C function (with a long, ugly name including the class name) that creates an instance of that class.

Strona 87

881. Request input and output data rows.The execute() method must call CNKBufReader::setRequestRows to request access to its input data, and call CNKB

Strona 88

89If the CNKProc has outputs, the execute() method may set the column names and types of the output CNKBuf objects if they are not set already. This

Strona 89

9In this case, the extension subdirectory is named my_extension, and the extension uses two gif files.Explorer IML FilesAn Explorer IML file is an XML

Strona 90 - Summaries

90Releasing rows and performing these other tasks can often by done by calling CNKProc::executeReleaseRows(long rows), passing the number of rows to r

Strona 91

91After reading a set of input rows, the accumulated max, min, counts, and crosstab values can be extracted from the proc. CNKProcCount:: CNKProcCo

Strona 92

92getCountNA returns the number of NA values read. getCountOK returns the number of non-NA values read.CNKProcCount:: int getColumnNumLevels(int c

Strona 93

93setCrossIndex sets the crosstab level for the crosstab column specified by crossNum. The level for this column is set to levelNum, which is interpr

Strona 94

94These methods set/get the total number of rows to be written by this proc, before the proc sends an EOF to the output buf, and specifies that it is

Strona 95

95CNKProcPrintfThe CNKProcPrintf proc prints information about each block of data. It prints the position of the block in the data, the number of row

Strona 96 - Pipeline Object

96These are the constructor, destructor, and init() methods. The execute() method is run when this CNKProc is executed within a pipeline.CNKProcRando

Strona 97

97 CNKProc* getProc(int i); CNKProc* getProc(const char* name); void addBuf(CNKBuf* buf); void removeBuf(CNKBuf* buf); int getNumBufs()

Strona 98

98 INT64 getLastExecutionCount(); INT64 getTotalExecutionCount();These methods return the number of times that the pipeline has executed a CNKPr

Komentarze do niniejszej Instrukcji

Brak uwag