use of org.pentaho.di.cluster.ClusterSchema in project pentaho-kettle by pentaho.
the class ClustersController method refreshClusters.
public void refreshClusters() {
if (repository != null) {
final List<UICluster> tmpList = new ArrayList<UICluster>();
Runnable r = new Runnable() {
public void run() {
try {
ObjectId[] clusterIdList = repository.getClusterIDs(false);
for (ObjectId clusterId : clusterIdList) {
ClusterSchema cluster = repository.loadClusterSchema(clusterId, repository.getSlaveServers(), null);
// Add the cluster schema to the list
tmpList.add(new UICluster(cluster));
}
} catch (KettleException e) {
// convert to runtime exception so it bubbles up through the UI
throw new RuntimeException(e);
}
}
};
doWithBusyIndicator(r);
clusterList.setChildren(tmpList);
}
}
use of org.pentaho.di.cluster.ClusterSchema in project pentaho-kettle by pentaho.
the class RepositoryExplorerDialog method editCluster.
public void editCluster(String clusterName) {
try {
ObjectId id = rep.getClusterID(clusterName);
// Load the last version
ClusterSchema cluster = rep.loadClusterSchema(id, rep.getSlaveServers(), null);
ClusterSchemaDialog dd = new ClusterSchemaDialog(shell, cluster, rep.getSlaveServers());
if (dd.open()) {
rep.insertLogEntry("Updating cluster '" + cluster.getName() + "'");
rep.save(cluster, Const.VERSION_COMMENT_EDIT_VERSION, null);
if (!clusterName.equalsIgnoreCase(cluster.getName())) {
refreshTree();
}
}
} catch (KettleException e) {
// CHECKSTYLE:LineLength:OFF
new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Message") + clusterName + "]", e);
}
}
Aggregations