本文整理汇总了Java中org.pentaho.di.trans.step.StepPartitioningMeta.getPartitionSchema方法的典型用法代码示例。如果您正苦于以下问题:Java StepPartitioningMeta.getPartitionSchema方法的具体用法?Java StepPartitioningMeta.getPartitionSchema怎么用?Java StepPartitioningMeta.getPartitionSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.trans.step.StepPartitioningMeta
的用法示例。
在下文中一共展示了StepPartitioningMeta.getPartitionSchema方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineNrOfStepCopies
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Calculate the number of step copies in a step.<br>
* If a step is not running clustered, it's simply returning getCopies().<br>
* If a step is clustered and not doing any partitioning, it's simply returning getCopies().<br>
* If a step is clustered and partitioned, we need to look in the partitioning map for the specified slave server.<br>
* That is because the number of copies can vary over the slaves. (5 partitions over 3 slaves for example)
*
* @param slaveServer the slave server
* @param referenceStep the reference step
* @return the number of step copies that we run.
*/
private int determineNrOfStepCopies(SlaveServer slaveServer, StepMeta step) {
if (!step.isClustered()) return step.getCopies();
if (!step.isPartitioned()) return step.getCopies();
if (slaveServer.isMaster()) return step.getCopies();
// Partitioned and clustered...
//
StepPartitioningMeta stepPartitioningMeta = step.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
Map<PartitionSchema, List<String>> partitionMap = slaveServerPartitionsMap.get(slaveServer);
List<String> partitionList = partitionMap.get(partitionSchema);
return partitionList.size();
}
示例2: addSlaveCopy
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Create a copy of a step from the original transformation for use in the a slave transformation.
* If the step is partitioned, the partitioning will be changed to "schemaName (slave)"
*
* @param stepMeta The step to copy / clone.
* @return a copy of the specified step for use in a slave transformation.
*/
private StepMeta addSlaveCopy(TransMeta transMeta, StepMeta stepMeta, SlaveServer slaveServer) {
StepMeta copy = (StepMeta) stepMeta.clone();
if (copy.isPartitioned()) {
StepPartitioningMeta stepPartitioningMeta = copy.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
String slavePartitionSchemaName = createSlavePartitionSchemaName(partitionSchema.getName());
PartitionSchema slaveSchema = transMeta.findPartitionSchema(slavePartitionSchemaName);
if (slaveSchema!=null) {
stepPartitioningMeta.setPartitionSchema(slaveSchema);
}
// Always just start a single copy on the slave server...
// Otherwise the confusion w.r.t. to partitioning & re-partitioning would be complete.
//
copy.setCopies(1);
}
// Remove the clustering information on the slave transformation step
// We don't need it anymore, it only confuses.
//
copy.setClusterSchema(null);
transMeta.addStep(copy);
return copy;
}
示例3: isUsingPartitionSchema
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
public boolean isUsingPartitionSchema(PartitionSchema partitionSchema)
{
// Loop over all steps and see if the partition schema is used.
for (int i=0;i<nrSteps();i++)
{
StepPartitioningMeta stepPartitioningMeta = getStep(i).getStepPartitioningMeta();
if (stepPartitioningMeta!=null)
{
PartitionSchema check = stepPartitioningMeta.getPartitionSchema();
if (check!=null && check.equals(partitionSchema))
{
return true;
}
}
}
return false;
}
示例4: determineNrOfStepCopies
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Calculate the number of step copies in a step.<br>
* If a step is not running clustered, it's simply returning getCopies().<br>
* If a step is clustered and not doing any partitioning, it's simply returning getCopies().<br>
* If a step is clustered and partitioned, we need to look in the partitioning map for the specified slave server.<br>
* That is because the number of copies can vary over the slaves. (5 partitions over 3 slaves for example)
*
* @param slaveServer the slave server
* @param referenceStep the reference step
* @return the number of step copies that we run.
*/
private int determineNrOfStepCopies(SlaveServer slaveServer, StepMeta step) {
if (!step.isClustered()) return step.getCopies();
if (!step.isPartitioned()) return step.getCopies();
if (slaveServer.isMaster()) return step.getCopies();
// Partitioned and clustered...
//
StepPartitioningMeta stepPartitioningMeta = step.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
Map<PartitionSchema, List<String>> partitionMap = slaveServerPartitionsMap.get(slaveServer);
List<String> partitionList = partitionMap.get(partitionSchema);
return partitionList.size();
}
示例5: addSlaveCopy
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Create a copy of a step from the original transformation for use in the a slave transformation.
* If the step is partitioned, the partitioning will be changed to "schemaName (slave)"
*
* @param stepMeta The step to copy / clone.
* @return a copy of the specified step for use in a slave transformation.
*/
private StepMeta addSlaveCopy(TransMeta transMeta, StepMeta stepMeta, SlaveServer slaveServer) {
StepMeta copy = (StepMeta) stepMeta.clone();
if (copy.isPartitioned()) {
StepPartitioningMeta stepPartitioningMeta = copy.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
String slavePartitionSchemaName = createSlavePartitionSchemaName(partitionSchema.getName());
PartitionSchema slaveSchema = transMeta.findPartitionSchema(slavePartitionSchemaName);
if (slaveSchema!=null) {
stepPartitioningMeta.setPartitionSchema(slaveSchema);
}
// Always just start a single copy on the slave server...
// Otherwise the confusion w.r.t. to partitioning & re-partitioning would be complete.
//
copy.setCopies(1);
}
// Remove the clustering information on the slave transformation step
// We don't need it anymore, it only confuses.
//
copy.setClusterSchema(null);
transMeta.addStep(copy);
return copy;
}
示例6: isUsingPartitionSchema
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Checks if the transformation is using the specified partition schema.
*
* @param partitionSchema the partition schema
* @return true if the transformation is using the partition schema, false otherwise
*/
public boolean isUsingPartitionSchema(PartitionSchema partitionSchema)
{
// Loop over all steps and see if the partition schema is used.
for (int i=0;i<nrSteps();i++)
{
StepPartitioningMeta stepPartitioningMeta = getStep(i).getStepPartitioningMeta();
if (stepPartitioningMeta!=null)
{
PartitionSchema check = stepPartitioningMeta.getPartitionSchema();
if (check!=null && check.equals(partitionSchema))
{
return true;
}
}
}
return false;
}
示例7: determineNrOfStepCopies
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Calculate the number of step copies in a step.<br>
* If a step is not running clustered, it's simply returning getCopies().<br>
* If a step is clustered and not doing any partitioning, it's simply returning getCopies().<br>
* If a step is clustered and partitioned, we need to look in the partitioning map for the specified slave server.<br>
* That is because the number of copies can vary over the slaves. (5 partitions over 3 slaves for example)
*
* @param slaveServer
* the slave server
* @param step
* the reference step
* @return the number of step copies that we run.
*/
private int determineNrOfStepCopies( SlaveServer slaveServer, StepMeta step ) {
if ( !step.isClustered() ) {
return step.getCopies();
}
if ( !step.isPartitioned() ) {
return step.getCopies();
}
if ( slaveServer.isMaster() ) {
return step.getCopies();
}
// Partitioned and clustered...
//
StepPartitioningMeta stepPartitioningMeta = step.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
Map<PartitionSchema, List<String>> partitionMap = slaveServerPartitionsMap.get( slaveServer );
List<String> partitionList = partitionMap.get( partitionSchema );
return partitionList.size();
}
示例8: addSlaveCopy
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Create a copy of a step from the original transformation for use in the a slave transformation. If the step is
* partitioned, the partitioning will be changed to "schemaName (slave)"
*
* @param stepMeta
* The step to copy / clone.
* @return a copy of the specified step for use in a slave transformation.
*/
private StepMeta addSlaveCopy( TransMeta transMeta, StepMeta stepMeta, SlaveServer slaveServer ) {
StepMeta copy = (StepMeta) stepMeta.clone();
if ( copy.isPartitioned() ) {
StepPartitioningMeta stepPartitioningMeta = copy.getStepPartitioningMeta();
PartitionSchema partitionSchema = stepPartitioningMeta.getPartitionSchema();
String slavePartitionSchemaName = createSlavePartitionSchemaName( partitionSchema.getName() );
PartitionSchema slaveSchema = transMeta.findPartitionSchema( slavePartitionSchemaName );
if ( slaveSchema != null ) {
stepPartitioningMeta.setPartitionSchema( slaveSchema );
}
// Always just start a single copy on the slave server...
// Otherwise the confusion w.r.t. to partitioning & re-partitioning would be complete.
//
copy.setCopies( 1 );
}
// Remove the clustering information on the slave transformation step
// We don't need it anymore, it only confuses.
//
copy.setClusterSchema( null );
transMeta.addStep( copy );
return copy;
}
示例9: isUsingPartitionSchema
import org.pentaho.di.trans.step.StepPartitioningMeta; //导入方法依赖的package包/类
/**
* Checks if the transformation is using the specified partition schema.
*
* @param partitionSchema
* the partition schema
* @return true if the transformation is using the partition schema, false otherwise
*/
public boolean isUsingPartitionSchema( PartitionSchema partitionSchema ) {
// Loop over all steps and see if the partition schema is used.
for ( int i = 0; i < nrSteps(); i++ ) {
StepPartitioningMeta stepPartitioningMeta = getStep( i ).getStepPartitioningMeta();
if ( stepPartitioningMeta != null ) {
PartitionSchema check = stepPartitioningMeta.getPartitionSchema();
if ( check != null && check.equals( partitionSchema ) ) {
return true;
}
}
}
return false;
}