當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。