当前位置: 首页>>代码示例>>Java>>正文


Java StepPartitioningMeta.getPartitionSchema方法代码示例

本文整理汇总了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();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:TransMeta.java

示例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();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:24,代码来源:TransMeta.java

示例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();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:35,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:33,代码来源:TransSplitter.java

示例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;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:TransMeta.java


注:本文中的org.pentaho.di.trans.step.StepPartitioningMeta.getPartitionSchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。