Class ThruNumberAndStringConversion
- java.lang.Object
-
- org.epics.archiverappliance.etl.conversion.ThruNumberAndStringConversion
-
- All Implemented Interfaces:
ConversionFunction
public class ThruNumberAndStringConversion extends Object implements ConversionFunction
Generic class for some standard type conversions. Not all type conversions are supported; some type conversions may be completely (or even worse, incompletely) inaccurate for your use case. Only a few of these have been tested and even those only incompletely. In most cases, you should roll your own conversion function and then apply using the ETLDest interface.- Author:
- mshankar
-
-
Constructor Summary
Constructors Constructor Description ThruNumberAndStringConversion(ArchDBRTypes destDBRType)
-
Method Summary
Modifier and Type Method Description EventStream
convertStream(EventStream srcEventStream, Timestamp streamStartTime, Timestamp streamEndTime)
boolean
shouldConvert(EventStream srcEventStream, Timestamp streamStartTime, Timestamp streamEndTime)
-
-
-
Constructor Detail
-
ThruNumberAndStringConversion
public ThruNumberAndStringConversion(ArchDBRTypes destDBRType)
-
-
Method Detail
-
convertStream
public EventStream convertStream(EventStream srcEventStream, Timestamp streamStartTime, Timestamp streamEndTime) throws IOException
- Specified by:
convertStream
in interfaceConversionFunction
streamStartTime
- . In the appliance, streams are often chunked. streamStartTime and streamEndTime are the boundaries of the chunk being converted.- Returns:
- Throws:
IOException
-
shouldConvert
public boolean shouldConvert(EventStream srcEventStream, Timestamp streamStartTime, Timestamp streamEndTime) throws IOException
- Specified by:
shouldConvert
in interfaceConversionFunction
streamStartTime
- . In the appliance, streams are often chunked. streamStartTime and streamEndTime are the boundaries of the chunk being converted.- Returns:
- Throws:
IOException
- Return true if there are any samples to convert in the source event stream. For example, in the failover merge usecase, one can check to see if the other server has any data during this time period. This provides a useful optimization in that files that no longer need to be converted are left unchanged.
-
-