本文整理了Java中org.pentaho.di.repository.Repository.readDatabases
方法的一些代码示例,展示了Repository.readDatabases
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.readDatabases
方法的具体详情如下:
包路径:org.pentaho.di.repository.Repository
类名称:Repository
方法名:readDatabases
[英]Read all the databases defined in the repository
[中]读取存储库中定义的所有数据库
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public List<DatabaseMeta> readDatabases() throws KettleException {
return getDelegate().readDatabases();
}
代码示例来源:origin: pentaho/pentaho-kettle
public void collectDatabases() throws KettleException {
List<DatabaseMeta> dbsFromMeta = meta.getDatabases();
names2metas = new HashMap<String, DatabaseMeta>( dbsFromMeta.size() );
for ( DatabaseMeta db : dbsFromMeta ) {
names2metas.put( db.getName(), db );
}
if ( repository != null ) {
List<DatabaseMeta> dbsFromRepo = repository.readDatabases();
for ( DatabaseMeta db : dbsFromRepo ) {
if ( !names2metas.containsKey( db.getName() ) ) {
names2metas.put( db.getName(), db );
}
}
}
dbNames = new ArrayList<String>( names2metas.keySet() );
Collections.sort( dbNames, String.CASE_INSENSITIVE_ORDER );
}
代码示例来源:origin: pentaho/pentaho-kettle
public List<DatabaseMeta> getActiveDatabases() {
Map<String, DatabaseMeta> map = new Hashtable<>();
HasDatabasesInterface hasDatabasesInterface = getActiveHasDatabasesInterface();
if ( hasDatabasesInterface != null ) {
for ( int i = 0; i < hasDatabasesInterface.nrDatabases(); i++ ) {
map.put( hasDatabasesInterface.getDatabase( i ).getName(), hasDatabasesInterface.getDatabase( i ) );
}
}
if ( rep != null ) {
try {
List<DatabaseMeta> repDBs = rep.readDatabases();
for ( DatabaseMeta databaseMeta : repDBs ) {
map.put( databaseMeta.getName(), databaseMeta );
}
} catch ( Exception e ) {
log.logError( "Unexpected error reading databases from the repository: " + e.toString() );
log.logError( Const.getStackTracker( e ) );
}
}
List<DatabaseMeta> databases = new ArrayList<>();
databases.addAll( map.values() );
return databases;
}
代码示例来源:origin: pentaho/pentaho-kettle
List<DatabaseMeta> list = rep.readDatabases();
for ( DatabaseMeta databaseMeta : list ) {
int index = databases.indexOf( databaseMeta );
代码示例来源:origin: pentaho/pentaho-kettle
public void editPartitionSchema( String partitionSchemaName ) {
try {
ObjectId id = rep.getPartitionSchemaID( partitionSchemaName );
PartitionSchema partitionSchema = rep.loadPartitionSchema( id, null ); // Load the last version
PartitionSchemaDialog dd =
new PartitionSchemaDialog( shell, partitionSchema, rep.readDatabases(), variableSpace );
if ( dd.open() ) {
rep.insertLogEntry( "Updating partition schema '" + partitionSchema.getName() + "'" );
rep.save( partitionSchema, Const.VERSION_COMMENT_EDIT_VERSION, null );
if ( !partitionSchemaName.equalsIgnoreCase( partitionSchema.getName() ) ) {
refreshTree();
}
}
} catch ( KettleException e ) {
new ErrorDialog(
shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Message" )
+ partitionSchemaName + "]", e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void newPartitionSchema() {
try {
PartitionSchema partitionSchema = new PartitionSchema();
PartitionSchemaDialog dd =
new PartitionSchemaDialog( shell, partitionSchema, rep.readDatabases(), variableSpace );
if ( dd.open() ) {
// See if this slave server already exists...
ObjectId idPartitionSchema = rep.getPartitionSchemaID( partitionSchema.getName() );
if ( idPartitionSchema == null ) {
rep.insertLogEntry( "Creating new partition schema '" + partitionSchema.getName() + "'" );
rep.save( partitionSchema, Const.VERSION_COMMENT_INITIAL_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Message" ) );
mb.setText( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Title" ) );
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Message" ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
} else {
PartitionSchemaDialog partitionDialog =
new PartitionSchemaDialog( shell, partitionSchema, repository.readDatabases(), variableSpace );
if ( partitionDialog.open() ) {
if ( partitionSchema.getName() != null && !partitionSchema.getName().equals( "" ) ) {
代码示例来源:origin: pentaho/pentaho-kettle
PartitionSchema partition = new PartitionSchema();
PartitionSchemaDialog partitionDialog =
new PartitionSchemaDialog( shell, partition, repository.readDatabases(), variableSpace );
if ( partitionDialog.open() ) {
内容来源于网络,如有侵权,请联系作者删除!