Package org.pentaho.di.partition
Class PartitionSchema
java.lang.Object
org.pentaho.di.core.changed.ChangedFlag
org.pentaho.di.partition.PartitionSchema
- All Implemented Interfaces:
Cloneable
,ChangedFlagInterface
,org.pentaho.di.core.xml.XMLInterface
,org.pentaho.di.repository.RepositoryElementInterface
,org.pentaho.di.repository.RepositoryObjectInterface
,ResourceHolderInterface
,org.pentaho.di.shared.SharedObjectInterface
public class PartitionSchema
extends ChangedFlag
implements Cloneable, org.pentaho.di.shared.SharedObjectInterface, ResourceHolderInterface, org.pentaho.di.repository.RepositoryElementInterface, org.pentaho.di.core.xml.XMLInterface
A partition schema allow you to partition a step according into a number of partitions that run independendly. It
allows us to "map"
- Author:
- Matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.pentaho.di.repository.RepositoryObjectType
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionSchema
(String name, List<String> partitionIDs) PartitionSchema
(Node partitionSchemaNode) -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
void
expandPartitionsDynamically
(int nrSlaves, org.pentaho.di.core.variables.VariableSpace space) Gets the high-level type of resource holder.getName()
org.pentaho.di.repository.ObjectId
org.pentaho.di.repository.ObjectRevision
org.pentaho.di.repository.RepositoryDirectoryInterface
Not supported for Partition schema, return the root.org.pentaho.di.repository.RepositoryObjectType
getXML()
int
hashCode()
boolean
boolean
isShared()
void
replaceMeta
(PartitionSchema partitionSchema) void
retainPartitionsForSlaveServer
(int slaveCount, int slaveNumber) Slaves don't need ALL the partitions, they just need a few.
So we should only retain those partitions that are of interest to the slave server.
Divide the number of partitions (6) through the number of slaves (2)
That gives you 0, 1, 2, 3, 4, 5
Slave 0 : 0, 2, 4
Slave 1 : 1, 3, 5
--> slaveNumber == partitionNr % slaveCountvoid
setChangedDate
(Date changedDate) void
setDescription
(String description) void
setDynamicallyDefined
(boolean dynamicallyDefined) void
void
setNumberOfPartitionsPerSlave
(String numberOfPartitionsPerSlave) void
setObjectId
(org.pentaho.di.repository.ObjectId id) void
setObjectRevision
(org.pentaho.di.repository.ObjectRevision objectRevision) void
setPartitionIDs
(List<String> partitionIDs) void
setRepositoryDirectory
(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory) void
setShared
(boolean shared) toString()
Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChanged
-
Field Details
-
XML_TAG
- See Also:
-
REPOSITORY_ELEMENT_TYPE
public static final org.pentaho.di.repository.RepositoryObjectType REPOSITORY_ELEMENT_TYPE
-
-
Constructor Details
-
PartitionSchema
public PartitionSchema() -
PartitionSchema
- Parameters:
name
-partitionIDs
-
-
PartitionSchema
-
-
Method Details
-
clone
-
replaceMeta
-
toString
-
equals
-
hashCode
public int hashCode() -
getName
- Specified by:
getName
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Specified by:
getName
in interfaceorg.pentaho.di.repository.RepositoryObjectInterface
- Specified by:
getName
in interfaceResourceHolderInterface
- Specified by:
getName
in interfaceorg.pentaho.di.shared.SharedObjectInterface
- Returns:
- the name
-
setName
- Specified by:
setName
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Parameters:
name
- the name to set
-
getPartitionIDs
- Returns:
- the partitionIDs
-
setPartitionIDs
- Parameters:
partitionIDs
- the partitionIDs to set
-
getXML
- Specified by:
getXML
in interfaceorg.pentaho.di.shared.SharedObjectInterface
- Specified by:
getXML
in interfaceorg.pentaho.di.core.xml.XMLInterface
-
getObjectId
public org.pentaho.di.repository.ObjectId getObjectId()- Specified by:
getObjectId
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Specified by:
getObjectId
in interfaceorg.pentaho.di.repository.RepositoryObjectInterface
- Specified by:
getObjectId
in interfaceResourceHolderInterface
- Returns:
- the id
-
getDescription
- Specified by:
getDescription
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
- Specified by:
getDescription
in interfaceResourceHolderInterface
- Returns:
- The description of the holder of the resource
-
getHolderType
Description copied from interface:ResourceHolderInterface
Gets the high-level type of resource holder.- Specified by:
getHolderType
in interfaceResourceHolderInterface
- Returns:
- JOBENTRY, STEP, etc.
-
getTypeId
- Specified by:
getTypeId
in interfaceResourceHolderInterface
- Returns:
- The Type ID of the resource holder. The Type ID is the system-defined type identifier (like TRANS or SORT).
-
isDynamicallyDefined
public boolean isDynamicallyDefined()- Returns:
- the dynamicallyDefined
-
setDynamicallyDefined
public void setDynamicallyDefined(boolean dynamicallyDefined) - Parameters:
dynamicallyDefined
- the dynamicallyDefined to set
-
getNumberOfPartitionsPerSlave
- Returns:
- the numberOfStepCopiesPerSlave
-
setNumberOfPartitionsPerSlave
- Parameters:
numberOfPartitionsPerSlave
- the number of partitions per slave to set...
-
expandPartitionsDynamically
public void expandPartitionsDynamically(int nrSlaves, org.pentaho.di.core.variables.VariableSpace space) -
retainPartitionsForSlaveServer
public void retainPartitionsForSlaveServer(int slaveCount, int slaveNumber) Slaves don't need ALL the partitions, they just need a few.
So we should only retain those partitions that are of interest to the slave server.
Divide the number of partitions (6) through the number of slaves (2)
That gives you 0, 1, 2, 3, 4, 5
Slave 0 : 0, 2, 4
Slave 1 : 1, 3, 5
--> slaveNumber == partitionNr % slaveCount- Parameters:
slaveCount
-slaveNumber
-
-
getRepositoryDirectory
public org.pentaho.di.repository.RepositoryDirectoryInterface getRepositoryDirectory()Not supported for Partition schema, return the root.- Specified by:
getRepositoryDirectory
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setRepositoryDirectory
public void setRepositoryDirectory(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory) - Specified by:
setRepositoryDirectory
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getRepositoryElementType
public org.pentaho.di.repository.RepositoryObjectType getRepositoryElementType()- Specified by:
getRepositoryElementType
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setObjectId
public void setObjectId(org.pentaho.di.repository.ObjectId id) - Specified by:
setObjectId
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getObjectRevision
public org.pentaho.di.repository.ObjectRevision getObjectRevision()- Specified by:
getObjectRevision
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setObjectRevision
public void setObjectRevision(org.pentaho.di.repository.ObjectRevision objectRevision) - Specified by:
setObjectRevision
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
setDescription
- Specified by:
setDescription
in interfaceorg.pentaho.di.repository.RepositoryElementInterface
-
getChangedDate
- Specified by:
getChangedDate
in interfaceorg.pentaho.di.shared.SharedObjectInterface
- Returns:
- the changedDate
-
setChangedDate
- Parameters:
changedDate
- the changedDate to set
-