com.rapidminer.operator.io
Class CachedDatabaseExampleSource

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.io.AbstractReader<ExampleSet>
          extended by com.rapidminer.operator.io.AbstractExampleSource
              extended by com.rapidminer.operator.io.CachedDatabaseExampleSource
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class CachedDatabaseExampleSource
extends AbstractExampleSource

This operator reads an ExampleSet from an SQL database. The data is load from a single table which is defined with the table name parameter. Please note that table and column names are often case sensitive. Databases may behave differently here.

The most convenient way of defining the necessary parameters is the configuration wizard. The most important parameters (database URL and user name) will be automatically determined by this wizard and it is also possible to define the special attributes like labels or ids.

In contrast to the DatabaseExampleSource operator, which loads the data into the main memory, this operator keeps the data in the database and performs the data reading in batches. This allows RapidMiner to access data sets of arbitrary sizes without any size restrictions.

Please note the following important restrictions and notes:

Beside the new index column or the mapping table creation no writing actions are performed in the database. Moreover, data sets built on top of a cached database table do not support writing actions at all. Users have to materialize the data, change it, and write it back into a new table of the database (e.g.with the DatabaseExampleSetWriter. If the data set is large, users can employ the operator BatchProcessing for splitting up this data change task.

Author:
Ingo Mierswa

Field Summary
static java.lang.String PARAMETER_RECREATE_INDEX
           
 
Constructor Summary
CachedDatabaseExampleSource(OperatorDescription description)
           
 
Method Summary
 ExampleSet createExampleSet()
          Creates (or reads) the ExampleSet that will be returned by AbstractReader.apply().
protected  DatabaseHandler getConnectedDatabaseHandler()
           
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 void processFinished()
          Called at the end of the process.
 
Methods inherited from class com.rapidminer.operator.io.AbstractExampleSource
read
 
Methods inherited from class com.rapidminer.operator.io.AbstractReader
apply, getInputClasses, getOutputClasses
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, performAdditionalChecks, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_RECREATE_INDEX

public static final java.lang.String PARAMETER_RECREATE_INDEX
See Also:
Constant Field Values
Constructor Detail

CachedDatabaseExampleSource

public CachedDatabaseExampleSource(OperatorDescription description)
Method Detail

createExampleSet

public ExampleSet createExampleSet()
                            throws OperatorException
Description copied from class: AbstractExampleSource
Creates (or reads) the ExampleSet that will be returned by AbstractReader.apply().

Specified by:
createExampleSet in class AbstractExampleSource
Throws:
OperatorException

getConnectedDatabaseHandler

protected DatabaseHandler getConnectedDatabaseHandler()
                                               throws OperatorException,
                                                      java.sql.SQLException
Throws:
OperatorException
java.sql.SQLException

processFinished

public void processFinished()
Description copied from class: Operator
Called at the end of the process. The default implementation does nothing.

Overrides:
processFinished in class Operator

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class Operator


Copyright © 2001-2009 by Rapid-I