|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Partitioner
Defines methods needed for partitioner plugins. The main responsibilities are:
The following interface method also falls into the area of maintaining settings:
This method is called when a step containing partitioning configuration is duplicated in Spoon. It needs to return a deep copy of this partitioner object. It is essential that the implementing class creates proper deep copies if the configuration is stored in modifiable objects, such as lists or custom helper objects. The copy is created by first calling super.clone(), and deep-copying any fields the partitioner may have declared.
public Partitioner getInstance()
This method is required to return a new instance of the partitioner class, with the plugin id and plugin description inherited from the instance this function is called on.
This method is called by PDI whenever the plugin needs to serialize its settings to XML. It is called when saving a transformation in Spoon. The method returns an XML string, containing the serialized settings. The string contains a series of XML tags, typically one tag per setting. The helper class org.pentaho.di.core.xml.XMLHandler is typically used to construct the XML string.
This method is called by PDI whenever a plugin needs to read its settings from XML. The XML node containing the plugin’s settings is passed in as an argument. Again, the helper class org.pentaho.di.core.xml.XMLHandler is typically used to conveniently read the settings from the XML node.
This method is called by PDI whenever a plugin needs to save its settings to a PDI repository. The repository object passed in as the first argument provides a convenient set of methods for serializing settings. The transformation id and step id passed in should be used as identifiers when calling the repository serialization methods.
This method is called by PDI whenever a plugin needs to read its configuration from a PDI repository. The step id given in the arguments should be used as the identifier when using the repositories serialization methods.
public String getDialogClassName()
This method is called with the row structure and the actual row as arguments. It must return the partition this row will be sent to. The total number of partitions is available in the inherited field nrPartitions, and the return value must be between 0 and nrPartitions-1.
Method Summary | |
---|---|
Partitioner |
clone()
Clone. |
String |
getDescription()
Gets the description. |
String |
getDialogClassName()
Gets the dialog class name. |
String |
getId()
Gets the id. |
Partitioner |
getInstance()
Gets the single instance of Partitioner. |
int |
getPartition(RowMetaInterface rowMeta,
Object[] r)
Gets the partition. |
String |
getXML()
Gets the xml. |
void |
loadRep(Repository rep,
ObjectId id_step)
Load rep. |
void |
loadXML(Node partitioningMethodNode)
Load xml. |
void |
saveRep(Repository rep,
ObjectId id_transformation,
ObjectId id_step)
Saves partitioning properties in the repository for the given step. |
void |
setDescription(String description)
Sets the description. |
void |
setId(String id)
Sets the id. |
void |
setMeta(StepPartitioningMeta meta)
Sets the meta. |
Method Detail |
---|
Partitioner getInstance()
int getPartition(RowMetaInterface rowMeta, Object[] r) throws KettleException
rowMeta
- the row metar
- the r
KettleException
- the kettle exceptionvoid setMeta(StepPartitioningMeta meta)
meta
- the new metaString getId()
String getDescription()
void setId(String id)
id
- the new idvoid setDescription(String description)
description
- the new descriptionString getDialogClassName()
Partitioner clone()
String getXML()
void loadXML(Node partitioningMethodNode) throws KettleXMLException
partitioningMethodNode
- the partitioning method node
KettleXMLException
- the kettle xml exceptionvoid saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
rep
- the repository to save inid_transformation
- the ID of the transformationid_step
- the ID of the step
KettleDatabaseException
- In case anything goes wrong
KettleException
void loadRep(Repository rep, ObjectId id_step) throws KettleException
rep
- the repid_step
- the id_step
KettleException
- the kettle exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |