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


Java SlaveServer.getObjectId方法代码示例

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


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

示例1: delSlaveServer

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public void delSlaveServer(HasSlaveServersInterface hasSlaveServersInterface, SlaveServer slaveServer) throws KettleException
{

	Repository rep = spoon.getRepository();

	if (rep != null && slaveServer.getObjectId() != null)
	{
		// remove the slave server from the repository too...
		rep.deleteSlave(slaveServer.getObjectId());
	}

	int idx = hasSlaveServersInterface.getSlaveServers().indexOf(slaveServer);
	hasSlaveServersInterface.getSlaveServers().remove(idx);
	spoon.refreshTree();

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:17,代码来源:SpoonSlaveDelegate.java

示例2: saveSlaveServer

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public void saveSlaveServer(SlaveServer slaveServer, ObjectId id_transformation, boolean isUsedByTransformation,
    boolean overwrite) throws KettleException {

  if (slaveServer.getObjectId() == null) {
    // See if the slave doesn't exist already (just for safety and PDI-5102
    //
    slaveServer.setObjectId(getSlaveID(slaveServer.getName()));
  }
  
  if (slaveServer.getObjectId() == null) {
    // New Slave Server
    slaveServer.setObjectId(insertSlave(slaveServer));
  } else {
    ObjectId existingSlaveId = slaveServer.getObjectId();
    if (existingSlaveId != null && slaveServer.getObjectId() != null
        && !slaveServer.getObjectId().equals(existingSlaveId)) {
      // A slave with this name already exists
      if (overwrite) {
        // Proceed with save, removing the original version from the repository first
        repository.deleteSlave(existingSlaveId);
        updateSlave(slaveServer);
      } else {
        throw new KettleObjectExistsException("Failed to save object to repository. Object [" + slaveServer.getName()
            + "] already exists.");
      }
    } else {
      // There are no naming collisions (either it is the same object or the name is unique)
      updateSlave(slaveServer);
    }
  }

  // Save the trans-slave relationship too.
  if (id_transformation != null && isUsedByTransformation) {
    repository.insertTransformationSlave(id_transformation, slaveServer.getObjectId());
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:37,代码来源:KettleDatabaseRepositorySlaveServerDelegate.java

示例3: saveClusterSchema

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public void saveClusterSchema(ClusterSchema clusterSchema, String versionComment, ObjectId id_transformation, boolean isUsedByTransformation, boolean overwrite) throws KettleException
{
  ObjectId existingClusterSchemaId = getClusterID(clusterSchema.getName());
  if (existingClusterSchemaId  != null) {
    clusterSchema.setObjectId(existingClusterSchemaId);
  }

  if (clusterSchema.getObjectId() == null)
  {
    // New Slave Server
    clusterSchema.setObjectId(insertCluster(clusterSchema));
  } else {
    
    // If we received a clusterSchemaId and it is different from the cluster schema we are working with...
    if(existingClusterSchemaId != null && !clusterSchema.getObjectId().equals(existingClusterSchemaId)) {
      // A cluster with this name already exists
      if(overwrite) {
        // Proceed with save, removing the original version from the repository first
        repository.deleteClusterSchema(existingClusterSchemaId);
        updateCluster(clusterSchema);
      } else {
        throw new KettleObjectExistsException("Failed to save object to repository. Object [" + clusterSchema.getName() + "] already exists.");
      }
    } else {
      // There are no naming collisions (either it is the same object or the name is unique)
      updateCluster(clusterSchema);
    }
  }
  
  repository.delClusterSlaves(clusterSchema.getObjectId());
  
  // Also save the used slave server references.
  for (int i=0;i<clusterSchema.getSlaveServers().size();i++)
  {
      SlaveServer slaveServer = clusterSchema.getSlaveServers().get(i);
      if (slaveServer.getObjectId()==null) // oops, not yet saved!
      {
      	repository.save(slaveServer, versionComment, null, id_transformation, isUsedByTransformation, overwrite);
      }
      repository.insertClusterSlave(clusterSchema, slaveServer);
  }
  
  // Save a link to the transformation to keep track of the use of this cluster schema
  // Only save it if it's really used by the transformation
  if (isUsedByTransformation)
  {
      repository.insertTransformationCluster(id_transformation, clusterSchema.getObjectId());
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:50,代码来源:KettleDatabaseRepositoryClusterSchemaDelegate.java


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