Package cz.o2.proxima.core.transform
Class RenameTransformation
- java.lang.Object
-
- cz.o2.proxima.core.transform.RenameTransformation
-
- All Implemented Interfaces:
DataOperatorAgnostic
,DataOperatorAware
,ElementWiseTransformation
,Transformation
,java.io.Serializable
@Evolving public class RenameTransformation extends java.lang.Object implements ElementWiseTransformation
A stateless transformation that performs transformation from one attribute to another. ThisTransformation
is used primarily when remapping two attributes one-to-one where only change in name andAttributeDescriptor
occurs. Typical scenario involved replications and proxy attributes where reads and/or writes are routed to different atttributes without changing the payload (note that scheme serializer might change).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.core.transform.ElementWiseTransformation
ElementWiseTransformation.Collector<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RenameTransformation()
RenameTransformation(UnaryFunction<AttributeDescriptor<?>,AttributeDescriptor<?>> descTransform, BiFunction<java.lang.String,AttributeDescriptor<?>,java.lang.String> nameTransform)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
apply(StreamElement input, ElementWiseTransformation.Collector<StreamElement> collector)
Apply the transformation function.protected void
setTransforms(UnaryFunction<AttributeDescriptor<?>,AttributeDescriptor<?>> descTransform, BiFunction<java.lang.String,AttributeDescriptor<?>,java.lang.String> nameTransform)
Update desc and name transforms.void
setup(Repository repo, java.util.Map<java.lang.String,java.lang.Object> cfg)
Setup this transform.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.core.transform.DataOperatorAgnostic
isContextual, isDelegateOf
-
Methods inherited from interface cz.o2.proxima.core.transform.DataOperatorAware
as
-
Methods inherited from interface cz.o2.proxima.core.transform.Transformation
asContextualTransform, asElementWiseTransform
-
-
-
-
Constructor Detail
-
RenameTransformation
protected RenameTransformation()
-
RenameTransformation
public RenameTransformation(UnaryFunction<AttributeDescriptor<?>,AttributeDescriptor<?>> descTransform, BiFunction<java.lang.String,AttributeDescriptor<?>,java.lang.String> nameTransform)
-
-
Method Detail
-
setup
public void setup(Repository repo, java.util.Map<java.lang.String,java.lang.Object> cfg)
Description copied from interface:ElementWiseTransformation
Setup this transform.- Specified by:
setup
in interfaceElementWiseTransformation
- Parameters:
repo
- repositorycfg
- configuration
-
setTransforms
protected void setTransforms(UnaryFunction<AttributeDescriptor<?>,AttributeDescriptor<?>> descTransform, BiFunction<java.lang.String,AttributeDescriptor<?>,java.lang.String> nameTransform)
Update desc and name transforms. This is typically used in response tosetup(Repository, Map)
.- Parameters:
descTransform
- transformationnameTransform
- name transformation
-
apply
public int apply(StreamElement input, ElementWiseTransformation.Collector<StreamElement> collector)
Description copied from interface:ElementWiseTransformation
Apply the transformation function.- Specified by:
apply
in interfaceElementWiseTransformation
- Parameters:
input
- the input stream element to transformcollector
- collector for outputs- Returns:
- how many invocations of collector to expect before the elements should be considered processed
-
-