
ai.h2o.mojos.runtime.transforms.MojoTransform Maven / Gradle / Ivy
package ai.h2o.mojos.runtime.transforms;
import ai.h2o.mojos.runtime.api.MojoTransformationGroup;
import ai.h2o.mojos.runtime.frame.MojoFrame;
import ai.h2o.mojos.runtime.frame.MojoFrameMeta;
import java.util.Arrays;
/**
* Representation of one transformation operation in the pipeline.
*/
public abstract class MojoTransform {
public final int[] iindices;
public final int[] oindices;
private String id;
private String name;
private MojoTransformationGroup transformationGroup;
public MojoTransform(int[] iindices, int[] oindices) {
assert iindices != null;
assert oindices != null;
this.iindices = iindices;
this.oindices = oindices;
}
/**
* Hierarchical transformer index identification.
*
* To compute the identification, each transformer in the pipeline receives an index based on its physical order, starting from 0.
* This index is formatted with zero-padded 3 digit format, and this forms one component in the hierarchical index.
* Top-level transforms are prefixed with letter T
, indicating the root pipeline as its container.
* Nested transforms (those inside EXEC_OP
contained) use the container's ID as its prefix, followed by underscore, followed by own index.
*
* Examples:
*
* T000
= first transform in the root pipeline
* T005_032
= in the root pipeline's EXEC_OP at position 005, the nested pipeline has this transform at position 032
*
*/
public String getId() {
return id;
}
public void setId(final String id) {
this.id = id;
}
public MojoTransformationGroup getTransformationGroup() {
return transformationGroup;
}
public void setTransformationGroup(final MojoTransformationGroup transformationGroup) {
this.transformationGroup = transformationGroup;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public abstract void transform(MojoFrame frame);
@Override
public String toString() {
return String.format("%s:%s:%s->%s", id, getName(), Arrays.toString(iindices), Arrays.toString(oindices));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy