use of org.pentaho.di.www.CarteObjectEntry in project pentaho-kettle by pentaho.
the class JobResource method removeJob.
@GET
@Path("/remove/{id : .+}")
public Response removeJob(@PathParam("id") String id) {
Job job = CarteResource.getJob(id);
CarteObjectEntry entry = CarteResource.getCarteObjectEntry(id);
KettleLogStore.discardLines(job.getLogChannelId(), true);
CarteSingleton.getInstance().getJobMap().removeJob(entry);
return Response.ok().build();
}
use of org.pentaho.di.www.CarteObjectEntry in project pentaho-kettle by pentaho.
the class TransformationResource method prepareTransformation.
// change from GET to UPDATE/POST for proper REST method
@GET
@Path("/prepare/{id : .+}")
@Produces({ MediaType.APPLICATION_JSON })
public TransformationStatus prepareTransformation(@PathParam("id") String id) {
Trans trans = CarteResource.getTransformation(id);
try {
CarteObjectEntry entry = CarteResource.getCarteObjectEntry(id);
TransConfiguration transConfiguration = CarteSingleton.getInstance().getTransformationMap().getConfiguration(entry);
TransExecutionConfiguration executionConfiguration = transConfiguration.getTransExecutionConfiguration();
// Set the appropriate logging, variables, arguments, replay date, ...
// etc.
trans.setArguments(executionConfiguration.getArgumentStrings());
trans.setReplayDate(executionConfiguration.getReplayDate());
trans.setSafeModeEnabled(executionConfiguration.isSafeModeEnabled());
trans.setGatheringMetrics(executionConfiguration.isGatheringMetrics());
trans.injectVariables(executionConfiguration.getVariables());
trans.setPreviousResult(executionConfiguration.getPreviousResult());
trans.prepareExecution(null);
} catch (KettleException e) {
e.printStackTrace();
}
return getTransformationStatus(id);
}
use of org.pentaho.di.www.CarteObjectEntry in project pentaho-kettle by pentaho.
the class TransformationResource method getTransformationStatus.
@GET
@Path("/status/{id : .+}")
@Produces({ MediaType.APPLICATION_JSON })
public TransformationStatus getTransformationStatus(@PathParam("id") String id) {
TransformationStatus status = new TransformationStatus();
// find trans
Trans trans = CarteResource.getTransformation(id);
CarteObjectEntry entry = CarteResource.getCarteObjectEntry(id);
status.setId(entry.getId());
status.setName(entry.getName());
status.setStatus(trans.getStatus());
for (int i = 0; i < trans.nrSteps(); i++) {
StepInterface step = trans.getRunThread(i);
if ((step.isRunning()) || step.getStatus() != StepExecutionStatus.STATUS_EMPTY) {
StepStatus stepStatus = new StepStatus(step);
status.addStepStatus(stepStatus);
}
}
return status;
}
use of org.pentaho.di.www.CarteObjectEntry in project pentaho-kettle by pentaho.
the class TransformationResource method removeTransformation.
// change from GET to UPDATE/POST for proper REST method
@GET
@Path("/remove/{id : .+}")
public Response removeTransformation(@PathParam("id") String id) {
Trans trans = CarteResource.getTransformation(id);
CarteObjectEntry entry = CarteResource.getCarteObjectEntry(id);
KettleLogStore.discardLines(trans.getLogChannelId(), true);
CarteSingleton.getInstance().getTransformationMap().removeTransformation(entry);
return Response.ok().build();
}
use of org.pentaho.di.www.CarteObjectEntry in project pentaho-kettle by pentaho.
the class TransformationMapConcurrentTest method setup.
@Before
public void setup() throws Exception {
transformationMap = new TransformationMap();
concurrentAllocateTasks = new ArrayList<>();
concurrentDeallocateTasks = new ArrayList<>();
// adding equal port allocations
for (int i = 1; i <= numberOfSameAllocations; i++) {
concurrentAllocateTasks.add(new ConcurrentAllocate(40000, "host0", "id0", "trans0", "slave0", "source0", "0", "slave-0", "target0", "0"));
}
// no deallocate tasks and !spa.isAllocated() returns true
for (int i = 1; i <= numberOfSameSourceAndTargetSlaveNameAllocations; i++) {
concurrentAllocateTasks.add(new ConcurrentAllocate(40000, "host1", "id" + i, "trans" + i, "slave-1", "source" + i, "" + i, "slave-2", "target" + i, "" + i));
}
// adding different allocations
for (int i = 2; i <= numberOfDifferentAllocations + 1; i++) {
concurrentAllocateTasks.add(new ConcurrentAllocate(40000, "host" + i, "id" + i, "trans" + i, "slave-" + i, "source" + i, "" + i, "slave-" + i, "target" + i, "" + i));
}
// adding allocations which have the same hostname as different ones but diff properties
for (int i = 1; i <= numberOfSameHosts; i++) {
concurrentAllocateTasks.add(new ConcurrentAllocate(40000, "host" + i, "diff", "diff", "diff", "diff", "diff", "diff", "diff", "diff"));
}
for (int i = 0; i < numberOfDeallocateTasks; i++) {
CarteObjectEntry carteObjectEntry = new CarteObjectEntry("trans" + i, "id" + 1);
concurrentDeallocateTasks.add(new ConcurrentDeallocate(i, "host" + i, carteObjectEntry));
}
}
Aggregations