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


Java Repository.getSlaveIDs方法代码示例

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


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

示例1: readSlaves

import org.pentaho.di.repository.Repository; //导入方法依赖的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: ClusterSchema

import org.pentaho.di.repository.Repository; //导入方法依赖的package包/类
public ClusterSchema(Repository rep, long id_cluster_schema, List<SlaveServer> slaveServers) throws KettleException
{
    this();
    
    setId(id_cluster_schema);
    
    RowMetaAndData row = rep.getClusterSchema(id_cluster_schema);
    
    name = row.getString(Repository.FIELD_CLUSTER_NAME, null); //$NON-NLS-1$
    basePort = row.getString(Repository.FIELD_CLUSTER_BASE_PORT, null); //$NON-NLS-1$
    socketsBufferSize = row.getString(Repository.FIELD_CLUSTER_SOCKETS_BUFFER_SIZE, null); //$NON-NLS-1$
    socketsFlushInterval = row.getString(Repository.FIELD_CLUSTER_SOCKETS_FLUSH_INTERVAL, null); //$NON-NLS-1$
    socketsCompressed = row.getBoolean(Repository.FIELD_CLUSTER_SOCKETS_COMPRESSED, true); //$NON-NLS-1$
    dynamic = row.getBoolean(Repository.FIELD_CLUSTER_DYNAMIC, true); //$NON-NLS-1$
    
    long[] pids = rep.getSlaveIDs(id_cluster_schema);
    for (int i=0;i<pids.length;i++)
    {
        SlaveServer slaveServer = new SlaveServer(rep, pids[i]);
        SlaveServer reference = SlaveServer.findSlaveServer(slaveServers, slaveServer.getName());
        if (reference!=null) 
            this.slaveServers.add(reference);
        else 
            this.slaveServers.add(slaveServer);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:ClusterSchema.java

示例3: readSlaves

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


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