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


Java SlaveServer.isMaster方法代码示例

本文整理汇总了Java中org.pentaho.di.cluster.SlaveServer.isMaster方法的典型用法代码示例。如果您正苦于以下问题:Java SlaveServer.isMaster方法的具体用法?Java SlaveServer.isMaster怎么用?Java SlaveServer.isMaster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.cluster.SlaveServer的用法示例。


在下文中一共展示了SlaveServer.isMaster方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: determineNrOfStepCopies

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的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: determineNrOfStepCopies

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的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

示例3: getSlaveServerNumber

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
private int getSlaveServerNumber(ClusterSchema clusterSchema, SlaveServer slaveServer) throws KettleException {
	int index = 0;
	for (SlaveServer check : clusterSchema.getSlaveServers()) {
		if (!check.isMaster()) {
			if (check.equals(slaveServer)) {
				return index;
			}
    		index++;
		}
	}
	return -1;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:13,代码来源:TransSplitter.java

示例4: getSlaveServerNumber

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
private int getSlaveServerNumber(ClusterSchema clusterSchema, SlaveServer slaveServer) throws KettleException {
  int index = 0;
  for (SlaveServer check : clusterSchema.getSlaveServers()) {
    if (!check.isMaster()) {
      if (check.equals(slaveServer)) {
        return index;
      }
        index++;
    }
  }
  return -1;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:13,代码来源:TransSplitter.java


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