|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.flow.core.AbstractActor
adams.flow.sink.AbstractSink
adams.flow.sink.WekaDatabaseWriter
public class WekaDatabaseWriter
Actor for saving a weka.core.Instances object in a database.
The relation name of the incoming dataset can be used to replace the current filename (path and extension are kept).
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-name <java.lang.String> (property: name) The name of the actor. default: WekaDatabaseWriter
-annotation <adams.core.base.BaseText> (property: annotations) The annotations to attach to this actor. default:
-skip (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is.
-stop-flow-on-error (property: stopFlowOnError) If set to true, the flow gets stopped in case this actor encounters an error; useful for critical actors.
-url <java.lang.String> (property: URL) The JDBC URL of the database to query.
-user <java.lang.String> (property: user) The user for connecting to the database.
-password <adams.core.base.BasePassword> (property: password) The password for the database user.
-table <java.lang.String> (property: tableName) The name of the table to store the data in. default: weka
-auto-key-generation (property: autoKeyGeneration) If set to true, a primary key is automatically generated.
-use-relation-as-table (property: useRelationNameAsTable) If set to true, the relation name is used as table name.
-custom-props <adams.core.io.PlaceholderFile> (property: customPropsFile) Custom properties file to override the default database settings, eg, for accessing a different type of database; ignored if pointing to a directory. default: .
| Field Summary | |
|---|---|
static String |
BACKUP_SAVER
the key for storing the current incremental clusterer in the backup. |
protected boolean |
m_AutoKeyGeneration
whether to automatically generate a primary key. |
protected PlaceholderFile |
m_CustomPropsFile
a custom properties file to use instead of default one. |
protected BasePassword |
m_Password
the password for the user used for connecting. |
protected weka.core.converters.DatabaseSaver |
m_Saver
the database saver. |
protected String |
m_TableName
protected the name of the table to store the data in. |
protected String |
m_URL
the database URL to query. |
protected String |
m_User
the database user to use for connecting. |
protected boolean |
m_UseRelationNameAsTable
whether to use the relation as table name. |
| Fields inherited from class adams.flow.sink.AbstractSink |
|---|
BACKUP_INPUT, m_InputToken |
| Fields inherited from class adams.flow.core.AbstractActor |
|---|
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
WekaDatabaseWriter()
|
|
| Method Summary | |
|---|---|
Class[] |
accepts()
Returns the class that the consumer accepts. |
String |
autoKeyGenerationTipText()
Returns the tip text for this property. |
protected Hashtable<String,Object> |
backupState()
Backs up the current state of the actor before update the variables. |
String |
customPropsFileTipText()
Returns the tip text for this property. |
void |
defineOptions()
Adds options to the internal list of options. |
protected String |
doExecute()
Executes the flow item. |
boolean |
getAutoKeyGeneration()
Returns whether a primary key is automatically generated. |
PlaceholderFile |
getCustomPropsFile()
Returns the custom properties file to use for initializing the database setup instead of WEKA's default one. |
BasePassword |
getPassword()
Returns the database password. |
String |
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI. |
String |
getTableName()
Returns the table name to store the data in. |
String |
getURL()
Returns the query to execute. |
String |
getUser()
Returns the database user. |
boolean |
getUseRelationNameAsTable()
Returns whether to output single Instance objects or just one Instances object. |
String |
globalInfo()
Returns a string describing the object. |
String |
passwordTipText()
Returns the tip text for this property. |
protected void |
pruneBackup()
Removes entries from the backup. |
protected void |
reset()
Resets the actor. |
protected void |
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated. |
void |
setAutoKeyGeneration(boolean value)
Sets whether to automatically generate a primary key. |
void |
setCustomPropsFile(PlaceholderFile value)
Sets the custom properties file to use for initializing the database setup instead of WEKA's default one. |
void |
setPassword(BasePassword value)
Sets the database password. |
void |
setTableName(String value)
Sets the table name to store the data in. |
void |
setURL(String value)
Sets the database URL to query. |
void |
setUser(String value)
Sets the database user. |
void |
setUseRelationNameAsTable(boolean value)
Sets whether to output single Instance objects or just one Instances object. |
String |
tableNameTipText()
Returns the tip text for this property. |
String |
URLTipText()
Returns the tip text for this property. |
String |
useRelationNameAsTableTipText()
Returns the tip text for this property. |
String |
userTipText()
Returns the tip text for this property. |
void |
wrapUp()
Cleans up after the execution has finished. |
| Methods inherited from class adams.flow.sink.AbstractSink |
|---|
input |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BACKUP_SAVER
protected String m_URL
protected String m_User
protected BasePassword m_Password
protected String m_TableName
protected boolean m_AutoKeyGeneration
protected boolean m_UseRelationNameAsTable
protected PlaceholderFile m_CustomPropsFile
protected weka.core.converters.DatabaseSaver m_Saver
| Constructor Detail |
|---|
public WekaDatabaseWriter()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class AbstractOptionHandlerpublic void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractActorprotected void reset()
reset in class AbstractActorpublic String getQuickInfo()
getQuickInfo in interface QuickInfoSupportergetQuickInfo in class AbstractActorprotected void pruneBackup()
pruneBackup in class AbstractActorprotected Hashtable<String,Object> backupState()
backupState in class AbstractSinkprotected void restoreState(Hashtable<String,Object> state)
restoreState in class AbstractSinkstate - the backup of the state to restore frompublic void setURL(String value)
value - the JDBC URLpublic String getURL()
public String URLTipText()
public void setUser(String value)
value - the userpublic String getUser()
public String userTipText()
public void setPassword(BasePassword value)
value - the passwordpublic BasePassword getPassword()
public String passwordTipText()
public void setTableName(String value)
value - the table namepublic String getTableName()
public String tableNameTipText()
public void setAutoKeyGeneration(boolean value)
value - if true then a primary key is generatedpublic boolean getAutoKeyGeneration()
public String autoKeyGenerationTipText()
public void setUseRelationNameAsTable(boolean value)
value - if true then a single Instance objects are outputpublic boolean getUseRelationNameAsTable()
public String useRelationNameAsTableTipText()
public void setCustomPropsFile(PlaceholderFile value)
value - the custom props file, ignored if a directorypublic PlaceholderFile getCustomPropsFile()
public String customPropsFileTipText()
public Class[] accepts()
protected String doExecute()
doExecute in class AbstractActorpublic void wrapUp()
wrapUp in class AbstractSink
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||