Search in sources :

Example 1 with TransformationMap

use of org.pentaho.di.www.TransformationMap in project pentaho-metaverse by pentaho.

the class DIRepositoryLocator method getRepository.

/**
 * Returns the DI repository instance to use
 * @return DI repository instance
 * @throws Exception If the repository instance cannot be returned
 */
protected Repository getRepository() throws Exception {
    if (repository == null) {
        TransformationMap transformationMap = CarteSingleton.getInstance().getTransformationMap();
        SlaveServerConfig slaveServerConfig = transformationMap.getSlaveServerConfig();
        repository = slaveServerConfig.getRepository();
    }
    if (repository == null) {
        LOG.error(Messages.getErrorString("ERROR.RepositoryNotFoundInConfiguration"));
    }
    return repository;
}
Also used : TransformationMap(org.pentaho.di.www.TransformationMap) SlaveServerConfig(org.pentaho.di.www.SlaveServerConfig)

Example 2 with TransformationMap

use of org.pentaho.di.www.TransformationMap 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));
    }
}
Also used : TransformationMap(org.pentaho.di.www.TransformationMap) CarteObjectEntry(org.pentaho.di.www.CarteObjectEntry) Before(org.junit.Before)

Aggregations

TransformationMap (org.pentaho.di.www.TransformationMap)2 Before (org.junit.Before)1 CarteObjectEntry (org.pentaho.di.www.CarteObjectEntry)1 SlaveServerConfig (org.pentaho.di.www.SlaveServerConfig)1