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


Java SlaveServer.shareVariablesWith方法代码示例

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


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

示例1: readSlaves

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
/**
 * Read the slave servers in the repository and add them to this transformation if they are not yet present.
 * @param rep The repository to load from.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readSlaves(Repository rep, boolean overWriteShared) throws KettleException
{
    try
    {
        long dbids[] = rep.getSlaveIDs();
        for (int i = 0; i < dbids.length; i++)
        {
            SlaveServer slaveServer = new SlaveServer(rep, dbids[i]);
            slaveServer.shareVariablesWith(this);
            SlaveServer check = findSlaveServer(slaveServer.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) 
            {
                if (!Const.isEmpty(slaveServer.getName()))
                {
                    addOrReplaceSlaveServer(slaveServer);
                    if (!overWriteShared) slaveServer.setChanged(false);
                }
            }
        }
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadSlaveServersFromRepository"), dbe); //$NON-NLS-1$
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:TransMeta.java

示例2: readSharedObjects

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public SharedObjects readSharedObjects() throws KettleException {
	// Extract the shared steps, connections, etc. using the SharedObjects
	// class
	//
	String soFile = environmentSubstitute(sharedObjectsFile);
	SharedObjects sharedObjects = new SharedObjects(soFile);
	Map<?, SharedObjectInterface> objectsMap = sharedObjects.getObjectsMap();

	// First read the databases...
	// We read databases & slaves first because there might be dependencies
	// that need to be resolved.
	//
	for (SharedObjectInterface object : objectsMap.values()) {
		if (object instanceof DatabaseMeta) {
			DatabaseMeta databaseMeta = (DatabaseMeta) object;
               databaseMeta.shareVariablesWith(this);
			addOrReplaceDatabase(databaseMeta);
		} else if (object instanceof SlaveServer) {
			SlaveServer slaveServer = (SlaveServer) object;
               slaveServer.shareVariablesWith(this);
			addOrReplaceSlaveServer(slaveServer);
		}
	}
	
	return sharedObjects;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:JobMeta.java

示例3: readSlaves

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
/**
 * Read the slave servers in the repository and add them to this transformation if they are not yet present.
 * @param TransMeta The transformation to load into.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readSlaves(TransMeta transMeta, boolean overWriteShared) throws KettleException
{
    try
    {
 	   ObjectId dbids[] = repository.getSlaveIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            SlaveServer slaveServer = repository.loadSlaveServer(dbids[i], null);  // Load last version
            slaveServer.shareVariablesWith(transMeta);
            SlaveServer check = transMeta.findSlaveServer(slaveServer.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) 
            {
                if (!Const.isEmpty(slaveServer.getName()))
                {
             	   transMeta.addOrReplaceSlaveServer(slaveServer);
                    if (!overWriteShared) slaveServer.setChanged(false);
                }
            }
        }
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(BaseMessages.getString(PKG, "TransMeta.Log.UnableToReadSlaveServersFromRepository"), dbe); //$NON-NLS-1$
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例4: readSlaves

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
/**
 * Read the slave servers in the repository and add them to this transformation if they are not yet present.
 * @param rep The repository to load from.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readSlaves(Repository rep, boolean overWriteShared) throws KettleException
{
    try
    {
        long dbids[] = rep.getSlaveIDs();
        for (int i = 0; i < dbids.length; i++)
        {
            SlaveServer slaveServer = new SlaveServer(rep, dbids[i]);
            slaveServer.shareVariablesWith(this);

            SlaveServer check = findSlaveServer(slaveServer.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) 
            {
                if (!Const.isEmpty(slaveServer.getName()))
                {
                    addOrReplaceSlaveServer(slaveServer);
                    if (!overWriteShared) slaveServer.setChanged(false);
                }
            }
        }
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(Messages.getString("JobMeta.Log.UnableToReadSlaveServersFromRepository"), dbe); //$NON-NLS-1$
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:33,代码来源:JobMeta.java

示例5: readSharedObjects

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public SharedObjects readSharedObjects(Repository rep) throws KettleException {
	// Extract the shared steps, connections, etc. using the SharedObjects
	// class
	//
	String soFile = environmentSubstitute(sharedObjectsFile);
	SharedObjects sharedObjects = new SharedObjects(soFile);
	Map<?, SharedObjectInterface> objectsMap = sharedObjects.getObjectsMap();

	// First read the databases...
	// We read databases & slaves first because there might be dependencies
	// that need to be resolved.
	//
	for (SharedObjectInterface object : objectsMap.values()) {
		if (object instanceof DatabaseMeta) {
			DatabaseMeta databaseMeta = (DatabaseMeta) object;
               databaseMeta.shareVariablesWith(this);
			addOrReplaceDatabase(databaseMeta);
		} else if (object instanceof SlaveServer) {
			SlaveServer slaveServer = (SlaveServer) object;
               slaveServer.shareVariablesWith(this);
			addOrReplaceSlaveServer(slaveServer);
		}
	}

	if (rep != null) {
		readDatabases(rep, true);
           readSlaves(rep, true);
	}
	
	return sharedObjects;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:JobMeta.java

示例6: readSlaves

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
/**
 * Read the slave servers in the repository and add them to this transformation if they are not yet present.
 * @param jobMeta The job to put the slave servers in
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readSlaves(JobMeta jobMeta, boolean overWriteShared) throws KettleException
{
    try
    {
        ObjectId dbids[] = repository.getSlaveIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            SlaveServer slaveServer = repository.loadSlaveServer(dbids[i], null);  // Load last version
            slaveServer.shareVariablesWith(jobMeta);

            SlaveServer check = jobMeta.findSlaveServer(slaveServer.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) 
            {
                if (!Const.isEmpty(slaveServer.getName()))
                {
                	jobMeta.addOrReplaceSlaveServer(slaveServer);
                    if (!overWriteShared) slaveServer.setChanged(false);
                }
            }
        }
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(BaseMessages.getString(PKG, "JobMeta.Log.UnableToReadSlaveServersFromRepository"), dbe); //$NON-NLS-1$
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:33,代码来源:KettleDatabaseRepositoryJobDelegate.java

示例7: readSharedObjects

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public SharedObjects readSharedObjects(Repository rep) throws KettleException
{
	if ( rep != null )
	{
        sharedObjectsFile = rep.getTransAttributeString(getId(), 0, "SHARED_FILE");
	}
    
    // Extract the shared steps, connections, etc. using the SharedObjects class
    //
    String soFile = environmentSubstitute(sharedObjectsFile);
    SharedObjects sharedObjects = new SharedObjects(soFile);
    if (sharedObjects.getObjectsMap().isEmpty()) {
    	log.logDetailed(toString(), Messages.getString("TransMeta.Log.EmptySharedObjectsFile", soFile));
    }
    
    // First read the databases...
    // We read databases & slaves first because there might be dependencies that need to be resolved.
    //
    for (SharedObjectInterface object : sharedObjects.getObjectsMap().values())
    {
        if (object instanceof DatabaseMeta)
        {
            DatabaseMeta databaseMeta = (DatabaseMeta) object;
            databaseMeta.shareVariablesWith(this);
            addOrReplaceDatabase(databaseMeta);
        }
        else if (object instanceof SlaveServer)
        {
            SlaveServer slaveServer = (SlaveServer) object;
            slaveServer.shareVariablesWith(this);
            addOrReplaceSlaveServer(slaveServer);
        }
        else if (object instanceof StepMeta)
        {
            StepMeta stepMeta = (StepMeta) object;
            addOrReplaceStep(stepMeta);
        }
        else if (object instanceof PartitionSchema)
        {
            PartitionSchema partitionSchema = (PartitionSchema) object;
            addOrReplacePartitionSchema(partitionSchema);
        }
        else if (object instanceof ClusterSchema)
        {
            ClusterSchema clusterSchema = (ClusterSchema) object;
            clusterSchema.shareVariablesWith(this);
            addOrReplaceClusterSchema(clusterSchema);
        }
    }

    if (rep!=null)
    {
        readDatabases(rep, true);
        readPartitionSchemas(rep, true);
        readSlaves(rep, true);
        readClusters(rep, true);
    }
    
    return sharedObjects;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:61,代码来源:TransMeta.java

示例8: readSharedObjects

import org.pentaho.di.cluster.SlaveServer; //导入方法依赖的package包/类
public SharedObjects readSharedObjects() throws KettleException
{
    // Extract the shared steps, connections, etc. using the SharedObjects class
    //
    String soFile = environmentSubstitute(sharedObjectsFile);
    SharedObjects sharedObjects = new SharedObjects(soFile);
    if (sharedObjects.getObjectsMap().isEmpty()) {
    	log.logDetailed(BaseMessages.getString(PKG, "TransMeta.Log.EmptySharedObjectsFile", soFile));
    }
    
    // First read the databases...
    // We read databases & slaves first because there might be dependencies that need to be resolved.
    //
    for (SharedObjectInterface object : sharedObjects.getObjectsMap().values())
    {
        if (object instanceof DatabaseMeta)
        {
            DatabaseMeta databaseMeta = (DatabaseMeta) object;
            databaseMeta.shareVariablesWith(this);
            addOrReplaceDatabase(databaseMeta);
        }
        else if (object instanceof SlaveServer)
        {
            SlaveServer slaveServer = (SlaveServer) object;
            slaveServer.shareVariablesWith(this);
            addOrReplaceSlaveServer(slaveServer);
        }
        else if (object instanceof StepMeta)
        {
            StepMeta stepMeta = (StepMeta) object;
            addOrReplaceStep(stepMeta);
        }
        else if (object instanceof PartitionSchema)
        {
            PartitionSchema partitionSchema = (PartitionSchema) object;
            addOrReplacePartitionSchema(partitionSchema);
        }
        else if (object instanceof ClusterSchema)
        {
            ClusterSchema clusterSchema = (ClusterSchema) object;
            clusterSchema.shareVariablesWith(this);
            addOrReplaceClusterSchema(clusterSchema);
        }
    }
    
    return sharedObjects;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:48,代码来源:TransMeta.java


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