Class 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 Detail

      • REPOSITORY_ELEMENT_TYPE

        public static final org.pentaho.di.repository.RepositoryObjectType REPOSITORY_ELEMENT_TYPE
    • Constructor Detail

      • PartitionSchema

        public PartitionSchema()
      • PartitionSchema

        public PartitionSchema​(String name,
                               List<String> partitionIDs)
        Parameters:
        name -
        partitionIDs -
      • PartitionSchema

        public PartitionSchema​(Node partitionSchemaNode)
    • Method Detail

      • replaceMeta

        public void replaceMeta​(PartitionSchema partitionSchema)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getName

        public String getName()
        Specified by:
        getName in interface org.pentaho.di.repository.RepositoryElementInterface
        Specified by:
        getName in interface org.pentaho.di.repository.RepositoryObjectInterface
        Specified by:
        getName in interface ResourceHolderInterface
        Specified by:
        getName in interface org.pentaho.di.shared.SharedObjectInterface
        Returns:
        the name
      • setName

        public void setName​(String name)
        Specified by:
        setName in interface org.pentaho.di.repository.RepositoryElementInterface
        Parameters:
        name - the name to set
      • getPartitionIDs

        public List<String> getPartitionIDs()
        Returns:
        the partitionIDs
      • setPartitionIDs

        public void setPartitionIDs​(List<String> partitionIDs)
        Parameters:
        partitionIDs - the partitionIDs to set
      • getXML

        public String getXML()
        Specified by:
        getXML in interface org.pentaho.di.shared.SharedObjectInterface
        Specified by:
        getXML in interface org.pentaho.di.core.xml.XMLInterface
      • isShared

        public boolean isShared()
        Specified by:
        isShared in interface org.pentaho.di.shared.SharedObjectInterface
        Returns:
        the shared
      • setShared

        public void setShared​(boolean shared)
        Specified by:
        setShared in interface org.pentaho.di.shared.SharedObjectInterface
        Parameters:
        shared - the shared to set
      • getObjectId

        public org.pentaho.di.repository.ObjectId getObjectId()
        Specified by:
        getObjectId in interface org.pentaho.di.repository.RepositoryElementInterface
        Specified by:
        getObjectId in interface org.pentaho.di.repository.RepositoryObjectInterface
        Specified by:
        getObjectId in interface ResourceHolderInterface
        Returns:
        the id
      • getDescription

        public String getDescription()
        Specified by:
        getDescription in interface org.pentaho.di.repository.RepositoryElementInterface
        Specified by:
        getDescription in interface ResourceHolderInterface
        Returns:
        The description of the holder of the resource
      • getTypeId

        public String getTypeId()
        Specified by:
        getTypeId in interface ResourceHolderInterface
        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

        public String getNumberOfPartitionsPerSlave()
        Returns:
        the numberOfStepCopiesPerSlave
      • setNumberOfPartitionsPerSlave

        public void setNumberOfPartitionsPerSlave​(String numberOfPartitionsPerSlave)
        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 interface org.pentaho.di.repository.RepositoryElementInterface
      • setRepositoryDirectory

        public void setRepositoryDirectory​(org.pentaho.di.repository.RepositoryDirectoryInterface repositoryDirectory)
        Specified by:
        setRepositoryDirectory in interface org.pentaho.di.repository.RepositoryElementInterface
      • getRepositoryElementType

        public org.pentaho.di.repository.RepositoryObjectType getRepositoryElementType()
        Specified by:
        getRepositoryElementType in interface org.pentaho.di.repository.RepositoryElementInterface
      • setObjectId

        public void setObjectId​(org.pentaho.di.repository.ObjectId id)
        Specified by:
        setObjectId in interface org.pentaho.di.repository.RepositoryElementInterface
      • getObjectRevision

        public org.pentaho.di.repository.ObjectRevision getObjectRevision()
        Specified by:
        getObjectRevision in interface org.pentaho.di.repository.RepositoryElementInterface
      • setObjectRevision

        public void setObjectRevision​(org.pentaho.di.repository.ObjectRevision objectRevision)
        Specified by:
        setObjectRevision in interface org.pentaho.di.repository.RepositoryElementInterface
      • setDescription

        public void setDescription​(String description)
        Specified by:
        setDescription in interface org.pentaho.di.repository.RepositoryElementInterface
      • getChangedDate

        public Date getChangedDate()
        Specified by:
        getChangedDate in interface org.pentaho.di.shared.SharedObjectInterface
        Returns:
        the changedDate
      • setChangedDate

        public void setChangedDate​(Date changedDate)
        Parameters:
        changedDate - the changedDate to set