use of org.pentaho.di.cluster.SlaveServer in project pentaho-kettle by pentaho.
the class Spoon method addSpoonSlave.
public void addSpoonSlave() {
final SlaveServer slaveServer = (SlaveServer) selectionObject;
addSpoonSlave(slaveServer);
}
use of org.pentaho.di.cluster.SlaveServer in project pentaho-kettle by pentaho.
the class Spoon method monitorClusterSchema.
protected void monitorClusterSchema(ClusterSchema clusterSchema) throws KettleException {
for (int i = 0; i < clusterSchema.getSlaveServers().size(); i++) {
SlaveServer slaveServer = clusterSchema.getSlaveServers().get(i);
addSpoonSlave(slaveServer);
}
}
use of org.pentaho.di.cluster.SlaveServer in project pentaho-kettle by pentaho.
the class Spoon method setMenu.
private synchronized void setMenu(Tree tree) {
TreeSelection[] objects = getTreeObjects(tree);
if (objects.length != 1) {
// not yet supported, we can do this later when the OSX bug
return;
// goes away
}
TreeSelection object = objects[0];
selectionObject = object.getSelection();
Object selection = selectionObject;
selectionObjectParent = object.getParent();
// Not clicked on a real object: returns a class
XulMenupopup spoonMenu = null;
if (selection instanceof Class<?>) {
if (selection.equals(TransMeta.class)) {
// New
spoonMenu = (XulMenupopup) menuMap.get("trans-class");
} else if (selection.equals(JobMeta.class)) {
// New
spoonMenu = (XulMenupopup) menuMap.get("job-class");
} else if (selection.equals(TransHopMeta.class)) {
// New
spoonMenu = (XulMenupopup) menuMap.get("trans-hop-class");
} else if (selection.equals(DatabaseMeta.class)) {
spoonMenu = (XulMenupopup) menuMap.get("database-class");
} else if (selection.equals(PartitionSchema.class)) {
// New
spoonMenu = (XulMenupopup) menuMap.get("partition-schema-class");
} else if (selection.equals(ClusterSchema.class)) {
spoonMenu = (XulMenupopup) menuMap.get("cluster-schema-class");
} else if (selection.equals(SlaveServer.class)) {
spoonMenu = (XulMenupopup) menuMap.get("slave-cluster-class");
} else {
spoonMenu = null;
}
} else {
if (selection instanceof TransMeta) {
spoonMenu = (XulMenupopup) menuMap.get("trans-inst");
} else if (selection instanceof JobMeta) {
spoonMenu = (XulMenupopup) menuMap.get("job-inst");
} else if (selection instanceof PluginInterface) {
spoonMenu = (XulMenupopup) menuMap.get("step-plugin");
} else if (selection instanceof DatabaseMeta) {
spoonMenu = (XulMenupopup) menuMap.get("database-inst");
// disable for now if the connection is an SAP ERP type of database...
//
XulMenuitem item = (XulMenuitem) mainSpoonContainer.getDocumentRoot().getElementById("database-inst-explore");
if (item != null) {
final DatabaseMeta databaseMeta = (DatabaseMeta) selection;
item.setDisabled(!databaseMeta.isExplorable());
}
item = (XulMenuitem) mainSpoonContainer.getDocumentRoot().getElementById("database-inst-clear-cache");
if (item != null) {
final DatabaseMeta databaseMeta = (DatabaseMeta) selectionObject;
item.setLabel(BaseMessages.getString(PKG, "Spoon.Menu.Popup.CONNECTIONS.ClearDBCache") + // Clear
databaseMeta.getName());
}
item = (XulMenuitem) mainSpoonContainer.getDocumentRoot().getElementById("database-inst-share");
if (item != null) {
final DatabaseMeta databaseMeta = (DatabaseMeta) selection;
if (databaseMeta.isShared()) {
item.setLabel(BaseMessages.getString(PKG, "Spoon.Menu.Popup.CONNECTIONS.UnShare"));
} else {
item.setLabel(BaseMessages.getString(PKG, "Spoon.Menu.Popup.CONNECTIONS.Share"));
}
}
} else if (selection instanceof StepMeta) {
spoonMenu = (XulMenupopup) menuMap.get("step-inst");
} else if (selection instanceof JobEntryCopy) {
spoonMenu = (XulMenupopup) menuMap.get("job-entry-copy-inst");
} else if (selection instanceof TransHopMeta) {
spoonMenu = (XulMenupopup) menuMap.get("trans-hop-inst");
} else if (selection instanceof PartitionSchema) {
spoonMenu = (XulMenupopup) menuMap.get("partition-schema-inst");
} else if (selection instanceof ClusterSchema) {
spoonMenu = (XulMenupopup) menuMap.get("cluster-schema-inst");
} else if (selection instanceof SlaveServer) {
spoonMenu = (XulMenupopup) menuMap.get("slave-server-inst");
}
}
if (spoonMenu != null) {
ConstUI.displayMenu(spoonMenu, tree);
} else {
tree.setMenu(null);
}
createPopUpMenuExtension();
}
use of org.pentaho.di.cluster.SlaveServer in project pentaho-kettle by pentaho.
the class Spoon method shareObject.
public void shareObject(String id) {
if ("database-inst-share".equals(id)) {
final DatabaseMeta databaseMeta = (DatabaseMeta) selectionObject;
if (databaseMeta.isShared()) {
unShareObject(databaseMeta);
} else {
shareObject(databaseMeta);
}
}
if ("step-inst-share".equals(id)) {
final StepMeta stepMeta = (StepMeta) selectionObject;
shareObject(stepMeta);
}
if ("partition-schema-inst-share".equals(id)) {
final PartitionSchema partitionSchema = (PartitionSchema) selectionObject;
shareObject(partitionSchema);
}
if ("cluster-schema-inst-share".equals(id)) {
final ClusterSchema clusterSchema = (ClusterSchema) selectionObject;
shareObject(clusterSchema);
}
if ("slave-server-inst-share".equals(id)) {
final SlaveServer slaveServer = (SlaveServer) selectionObject;
shareObject(slaveServer);
}
sharedObjectSyncUtil.reloadSharedObjects();
}
use of org.pentaho.di.cluster.SlaveServer in project pentaho-kettle by pentaho.
the class Spoon method refreshSlavesSubtree.
@VisibleForTesting
void refreshSlavesSubtree(TreeItem tiRootName, AbstractMeta meta, GUIResource guiResource) {
TreeItem tiSlaveTitle = createTreeItem(tiRootName, STRING_SLAVES, guiResource.getImageFolder());
List<SlaveServer> servers = meta.getSlaveServers();
servers.sort(new Comparator<SlaveServer>() {
public int compare(SlaveServer s1, SlaveServer s2) {
return String.CASE_INSENSITIVE_ORDER.compare(s1.getName(), s2.getName());
}
});
for (SlaveServer slaveServer : servers) {
if (!filterMatch(slaveServer.getName())) {
continue;
}
TreeItem tiSlave = createTreeItem(tiSlaveTitle, slaveServer.getName(), guiResource.getImageSlaveTree());
if (slaveServer.isShared()) {
tiSlave.setFont(guiResource.getFontBold());
}
}
}
Aggregations