Search in sources :

Example 51 with ClusterSchema

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);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) UICluster(org.pentaho.di.ui.repository.repositoryexplorer.model.UICluster) ObjectId(org.pentaho.di.repository.ObjectId) ArrayList(java.util.ArrayList) ClusterSchema(org.pentaho.di.cluster.ClusterSchema)

Example 52 with ClusterSchema

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);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) ObjectId(org.pentaho.di.repository.ObjectId) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) ClusterSchema(org.pentaho.di.cluster.ClusterSchema) ClusterSchemaDialog(org.pentaho.di.ui.cluster.dialog.ClusterSchemaDialog)

Aggregations

ClusterSchema (org.pentaho.di.cluster.ClusterSchema)52 SlaveServer (org.pentaho.di.cluster.SlaveServer)23 KettleException (org.pentaho.di.core.exception.KettleException)19 PartitionSchema (org.pentaho.di.partition.PartitionSchema)19 TransMeta (org.pentaho.di.trans.TransMeta)16 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)15 StepMeta (org.pentaho.di.trans.step.StepMeta)15 ObjectId (org.pentaho.di.repository.ObjectId)11 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)7 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)7 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)7 NotePadMeta (org.pentaho.di.core.NotePadMeta)6 TransHopMeta (org.pentaho.di.trans.TransHopMeta)6 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)5 Point (org.pentaho.di.core.gui.Point)5 ClusterSchemaDialog (org.pentaho.di.ui.cluster.dialog.ClusterSchemaDialog)5 List (java.util.List)4 MessageBox (org.eclipse.swt.widgets.MessageBox)4 JobMeta (org.pentaho.di.job.JobMeta)4