use of org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta in project pdi-dataservice-server-plugin by pentaho.
the class BaseStepValidationTest method before.
@Before
public void before() throws KettleStepException {
stepMetas[0] = stepMeta;
space = new Variables();
checkStepsExtension = new CheckStepsExtension(remarks, space, transMeta, stepMetas, repository, metaStore);
pushDownOptMetas = new ArrayList<PushDownOptimizationMeta>();
when(dataServiceMeta.getPushDownOptimizationMeta()).thenReturn(pushDownOptMetas);
init();
}
use of org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta in project pdi-dataservice-server-plugin by pentaho.
the class BaseStepValidationTest method setupMockedParamGen.
ParameterGeneration setupMockedParamGen(String paramName, String stepName) {
ParameterGeneration pushDownType = mock(ParameterGeneration.class);
when(pushDownType.getParameterName()).thenReturn(paramName);
PushDownOptimizationMeta optMeta = new PushDownOptimizationMeta();
optMeta.setType(pushDownType);
optMeta.setStepName(stepName);
pushDownOptMetas.add(optMeta);
return pushDownType;
}
use of org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta in project pdi-dataservice-server-plugin by pentaho.
the class AutoParameterGenerationService method generateOptimizationList.
private List<PushDownOptimizationMeta> generateOptimizationList(SourceLineageMap sourceLineageMap) {
Map<String, Set<List<StepFieldOperations>>> inputSteps = Multimaps.asMap(sourceLineageMap);
List<PushDownOptimizationMeta> optimizationList = Lists.newArrayListWithExpectedSize(inputSteps.size());
for (Map.Entry<String, Set<List<StepFieldOperations>>> inputStepLineage : inputSteps.entrySet()) {
String inputStep = inputStepLineage.getKey();
Set<List<StepFieldOperations>> lineageSet = inputStepLineage.getValue();
PushDownOptimizationMeta pushDownOptimizationMeta = new PushDownOptimizationMeta();
ParameterGeneration parameterGeneration = serviceProvider.createPushDown();
pushDownOptimizationMeta.setName(MessageFormat.format("Parameter Generator: {0}", inputStep));
pushDownOptimizationMeta.setStepName(inputStep);
pushDownOptimizationMeta.setType(parameterGeneration);
parameterGeneration.setParameterName("DATA_SERVICE_QUERY_" + inputStep.replaceAll("\\s", "_").toUpperCase());
for (List<StepFieldOperations> fieldLineage : lineageSet) {
StepFieldOperations origin = fieldLineage.get(0);
StepFieldOperations last = Iterables.getLast(fieldLineage);
parameterGeneration.createFieldMapping(last.getFieldName(), origin.getFieldName());
}
optimizationList.add(pushDownOptimizationMeta);
}
return optimizationList;
}
use of org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta in project pdi-dataservice-server-plugin by pentaho.
the class ParameterGenerationController method removeParameter.
public void removeParameter() throws XulException {
PushDownOptimizationMeta meta = checkNotNull(model.getSelectedOptimization());
String parameterName = ((ParameterGeneration) meta.getType()).getParameterName();
XulMessageBox messageBox = createMessageBox();
messageBox.setTitle(getString(PKG, "ParameterGenerationController.Delete.Title"));
messageBox.setMessage(getString(PKG, "ParameterGenerationController.Delete.Message", parameterName));
messageBox.setIcon(SWT.ICON_QUESTION);
messageBox.setButtons(new Object[] { SWT.YES, SWT.NO });
if (messageBox.open() == SWT.YES) {
model.setSelectedParameter(null);
model.remove(meta);
}
}
use of org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta in project pdi-dataservice-server-plugin by pentaho.
the class ParameterGenerationModel method setSelectedStep.
public void setSelectedStep(String stepName) {
PushDownOptimizationMeta meta = getSelectedOptimization();
if (meta != null) {
String previous = meta.getStepName();
meta.setStepName(stepName);
firePropertyChange("selectedStep", previous, stepName);
}
}
Aggregations