本文整理匯總了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$
}
}
示例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);
}
}
示例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$
}
}