use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class TransPartitioningTest method prepareStepMetas_cl1_cl2.
/**
* This is a case when we have 2 steps, but partitioned differently
*
* @throws KettlePluginException
*/
private void prepareStepMetas_cl1_cl2() throws KettlePluginException {
StepMeta dummy1 = new StepMeta(ONE, null);
StepMeta dummy2 = new StepMeta(TWO, null);
PartitionSchema schema1 = new PartitionSchema("p1", Arrays.asList(new String[] { PID1, PID2 }));
PartitionSchema schema2 = new PartitionSchema("p2", Arrays.asList(new String[] { PID1, PID2 }));
StepPartitioningMeta partMeta1 = new StepPartitioningMeta("Mirror to all partitions", schema1);
StepPartitioningMeta partMeta2 = new StepPartitioningMeta("Mirror to all partitions", schema2);
partMeta1.setPartitionSchemaName(schema1.getName());
partMeta2.setPartitionSchemaName(schema2.getName());
dummy1.setStepPartitioningMeta(partMeta1);
dummy2.setStepPartitioningMeta(partMeta2);
chain.add(dummy1);
chain.add(dummy2);
for (StepMeta item : chain) {
item.setStepMetaInterface(new DummyTransMeta());
}
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class TransPartitioningTest method prepareStepMetas_cl1_cl1.
/**
* This case simulates when we do have 2 step partitioned with one same partitioner We want to get a 'swim-lanes'
* transformation
*
* @throws KettlePluginException
*/
private void prepareStepMetas_cl1_cl1() throws KettlePluginException {
StepMeta dummy1 = new StepMeta(ONE, null);
StepMeta dummy2 = new StepMeta(TWO, null);
PartitionSchema schema = new PartitionSchema("p1", Arrays.asList(new String[] { PID1, PID2 }));
// for delayed binding StepPartitioning meta does not achieve
// schema name when using in constructor so we have to set it
// explicitly. See equals implementation for StepPartitioningMeta.
StepPartitioningMeta partMeta = new StepPartitioningMeta("Mirror to all partitions", schema);
// that is what I am talking about:
partMeta.setPartitionSchemaName(schema.getName());
dummy1.setStepPartitioningMeta(partMeta);
dummy2.setStepPartitioningMeta(partMeta);
chain.add(dummy1);
chain.add(dummy2);
for (StepMeta item : chain) {
item.setStepMetaInterface(new DummyTransMeta());
}
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class PurRepositoryIT method doesNotChangeFileWhenFailsToRename_partitions.
@Test
public void doesNotChangeFileWhenFailsToRename_partitions() throws Exception {
final PartitionSchema schema1 = new PartitionSchema();
final PartitionSchema schema2 = new PartitionSchema();
try {
testDoesNotChangeFileWhenFailsToRename(schema1, schema2, new Callable<RepositoryElementInterface>() {
@Override
public RepositoryElementInterface call() throws Exception {
return repository.loadPartitionSchema(schema2.getObjectId(), null);
}
});
} finally {
repository.deletePartitionSchema(schema1.getObjectId());
repository.deletePartitionSchema(schema2.getObjectId());
}
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class PurRepository_SharedObjects_IT method partition.
private static PartitionSchema partition() {
PartitionSchema schema = new PartitionSchema();
schema.setName("testPartitionSchema");
return schema;
}
use of org.pentaho.di.partition.PartitionSchema in project pentaho-kettle by pentaho.
the class SlaveStepCopyPartitionDistributionTest method equalsDifferentStepsTest.
@Test
public void equalsDifferentStepsTest() {
SlaveStepCopyPartitionDistribution other = new SlaveStepCopyPartitionDistribution();
List<PartitionSchema> schemas = new ArrayList<>();
schemas.add(new PartitionSchema());
other.setOriginalPartitionSchemas(schemas);
Assert.assertFalse(slaveStep.equals(other));
}
Aggregations