use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class PartitionSettingsTest method defaultSelectedSchemaIndexIsFoundBySchemaName.
@Test
public void defaultSelectedSchemaIndexIsFoundBySchemaName() throws Exception {
PartitionSchema schema = new PartitionSchema("qwerty", Collections.<String>emptyList());
StepPartitioningMeta meta = mock(StepPartitioningMeta.class);
when(meta.getPartitionSchema()).thenReturn(schema);
when(stepMeta.getStepPartitioningMeta()).thenReturn(meta);
List<String> schemas = Arrays.asList("1", plugin.getName(), "2");
when(partitionSchemasProvider.getPartitionSchemasNames(any(TransMeta.class))).thenReturn(schemas);
assertEquals(1, settings.getDefaultSelectedSchemaIndex());
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class PartitionSettingsTest method metaIsUpdated.
@Test
public void metaIsUpdated() {
PartitionSchema schema = new PartitionSchema("1", Collections.<String>emptyList());
StepPartitioningMeta meta = mock(StepPartitioningMeta.class);
when(stepMeta.getStepPartitioningMeta()).thenReturn(meta);
settings.updateSchema(schema);
verify(meta).setPartitionSchema(schema);
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class PartitionSettingsTest method metaIsNotUpdatedWithNameless.
@Test
public void metaIsNotUpdatedWithNameless() {
PartitionSchema schema = new PartitionSchema(null, Collections.<String>emptyList());
StepPartitioningMeta meta = mock(StepPartitioningMeta.class);
when(stepMeta.getStepPartitioningMeta()).thenReturn(meta);
settings.updateSchema(null);
verify(meta, never()).setPartitionSchema(any(PartitionSchema.class));
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class Spoon method doubleClickedInTree.
/**
* Reaction to double click
*/
private void doubleClickedInTree(Tree tree, boolean shift) {
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];
final Object selection = object.getSelection();
final Object parent = object.getParent();
if (selection instanceof Class<?>) {
if (selection.equals(TransMeta.class)) {
newTransFile();
}
if (selection.equals(JobMeta.class)) {
newJobFile();
}
if (selection.equals(TransHopMeta.class)) {
newHop((TransMeta) parent);
}
if (selection.equals(DatabaseMeta.class)) {
delegates.db.newConnection();
}
if (selection.equals(PartitionSchema.class)) {
newPartitioningSchema((TransMeta) parent);
}
if (selection.equals(ClusterSchema.class)) {
newClusteringSchema((TransMeta) parent);
}
if (selection.equals(SlaveServer.class)) {
newSlaveServer((HasSlaveServersInterface) parent);
}
} else {
if (selection instanceof TransMeta) {
TransGraph.editProperties((TransMeta) selection, this, rep, true);
}
if (selection instanceof JobMeta) {
JobGraph.editProperties((JobMeta) selection, this, rep, true);
}
if (selection instanceof PluginInterface) {
PluginInterface plugin = (PluginInterface) selection;
if (plugin.getPluginType().equals(StepPluginType.class)) {
TransGraph transGraph = getActiveTransGraph();
if (transGraph != null) {
transGraph.addStepToChain(plugin, shift);
}
}
if (plugin.getPluginType().equals(JobEntryPluginType.class)) {
JobGraph jobGraph = getActiveJobGraph();
if (jobGraph != null) {
jobGraph.addJobEntryToChain(object.getItemText(), shift);
}
}
}
if (selection instanceof DatabaseMeta) {
DatabaseMeta database = (DatabaseMeta) selection;
delegates.db.editConnection(database);
}
if (selection instanceof StepMeta) {
StepMeta step = (StepMeta) selection;
delegates.steps.editStep((TransMeta) parent, step);
sharedObjectSyncUtil.synchronizeSteps(step);
}
if (selection instanceof JobEntryCopy) {
editJobEntry((JobMeta) parent, (JobEntryCopy) selection);
}
if (selection instanceof TransHopMeta) {
editHop((TransMeta) parent, (TransHopMeta) selection);
}
if (selection instanceof PartitionSchema) {
editPartitionSchema((TransMeta) parent, (PartitionSchema) selection);
}
if (selection instanceof ClusterSchema) {
delegates.clusters.editClusterSchema((TransMeta) parent, (ClusterSchema) selection);
}
if (selection instanceof SlaveServer) {
editSlaveServer((SlaveServer) selection);
}
editSelectionTreeExtension(selection);
}
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class Spoon method editPartitionSchema.
public void editPartitionSchema() {
final TransMeta transMeta = (TransMeta) selectionObjectParent;
final PartitionSchema partitionSchema = (PartitionSchema) selectionObject;
editPartitionSchema(transMeta, partitionSchema);
}
Aggregations