Package com.nt.udc.flexibleAggregator
Class FlexibleAggregatorFieldProcessor
java.lang.Object
com.nt.udc.ndk.node.DCFieldProcessor
com.nt.udc.ndk.node.NPLFieldProcessor
com.nt.udc.flexibleAggregator.FlexibleAggregatorFieldProcessor
- All Implemented Interfaces:
DataProviderIfc
,DataReceiverIfc
,FileDataProviderIfc
,FileDataReceiverIfc
,StateFreezable
,Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DiscardedStatisticsMonitorIfc
protected FlexibleAggrKeyFactory[]
protected FieldKey
protected FieldKey
protected FieldKey
protected FlexibleNARKey[]
protected static int
protected FlexibleAggrTable[]
protected FlexibleTableFlush[]
protected FlexibleTimerFlush[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Indices into the TimeStamp byte[].Fields inherited from class com.nt.udc.ndk.node.NPLFieldProcessor
currentState, currentTransactionId, fileLevelTransaction, freezeHelper, nplProgram, waitForInputLock
-
Constructor Summary
ConstructorsConstructorDescriptionFlexibleAggregatorFieldProcessor
(Class outputDataType, FlexibleAggregatorNode node, String scratchDir, String fileName, IDCMethodHandler methodHandler) -
Method Summary
Modifier and TypeMethodDescriptionboolean
compareBytes
(DCFieldContainer narA, DCFieldContainer narB, FieldKey attrId) Performs a simple byte comparison on the attribute in the two NARs.This will generate and return a key based on the record.boolean
distributeTrafficVolumesPerDay
(ListField trafficVolumes, NAR destContainer, List uplinkVolumeAttrs, List downlinkVolumeAttrs, ListField unprocessedVolumes, BytesField openingTime) This will distribute the traffic volume uplink and downlink volumes into appropriate daily bins according to the individual times.byte[]
generateOpeningTimeFromTrafficVolume
(List trafficVolumes) Will return the integer day of year corresponding to the first traffic volume.boolean
getAndRemoveNAR
(NAR nar, int index) This will remove the NAR entry from the table.int
getCount
(long tempKey, long tempKey1, long tempKey2, int index) Gets the Countboolean
getNARKeepTimer
(NAR nar, int index) This will remove a NAR but leave its timer.protected void
init()
void
isAllKeyAttributesExists
(NAR nar, int tableNumber) int
populateIndividualTrafficVolume
(Map trafficVolumeMap, DCFieldContainer destContainer, List uplinkVolumeIDs, List downlinkVolumeIDs, BytesField nextOpeningTime, int dayOfYearCheck) Will only populate the traffic volumes if they are for the same day as dayOfYearCheck, unless dayOfYearCheck invalid input: '<' 1.void
printTimer
(NAR nar, int index) To be used in debugging only.void
removeDeactivatedTimer
(int index) This will remove a deactivated timer.boolean
removeNAR
(int index) This will remove a NAR entry from the table without returning the removed entry.boolean
removeNARTimer
(NAR nar, int index) This will remove the timer for a NAR from the timer table.void
reset
(long cleanup) Reset the Countvoid
resetCount
(long tempKey, long tempKey1, long tempKey2, int index) void
setCount
(long tempKey, long tempKey1, long tempKey2, int index) Sets the Countvoid
shutdown()
Performs all steps necessary to gracefully stop this FieldProcessor.void
This will generate a key and store the NAR in the table.void
storeNARReusingTimer
(NAR nar, int index) This will generate a key and store the NAR in the table with an old timer.Methods inherited from class com.nt.udc.ndk.node.NPLFieldProcessor
dataIsAvailable, freezeState, getBulkData, getConfigValue, getData, getExposedFields, getInputFields, getIntConfigValue, getLogger, getMethodHandler, getNPLFileName, getNPLProgram, getOutputFields, getPollForData, getSleepTime, handleProcessingException, handleProcessingException, handleProcessingException, handleRejectOfFile, isBulkProcessing, isDataAvailable, isFileLevelTransaction, isRejected, isRunning, isShutdown, isShutdownOnError, processData, processData, processData, processFileData, processFileData, run, setbulkIOConfig, setBulkProcessing, setDataReceiver, setMultiThreadConfig, setNPLFileName, setPollForData, setProcessingData, setRunning, setShutdown, setShutdownOnError, setSleepTime, setTransactionID, unfreezeState, writeToError, writeToError
Methods inherited from class com.nt.udc.ndk.node.DCFieldProcessor
fileDataIsAvailable, getCurrArchFile, getData, getDataProvider, getDataReceiver, getDiscardedCounter, getFileBulkData, getFileData, getFileDataProvider, getFileDataReceiver, getOutputType, getProcessedArchFile, isEndOfFile, isFileDataAvailable, isStartOfFile, openInputFile, processEndOfFileData, processRejectFile, processStartOfFileData, rejectFile, removeProcessedFile, setDataProvider, setDiscardedCounter, setFileDataProvider, setFileDataReceiver, setOutputType, setProcessedArchFile, signalBatchCompletion, validOIMinorType
-
Field Details
-
NODE_TYPE
protected static int NODE_TYPE -
tableArray
-
keyFactoryArray
-
timerFlushArray
-
tableFlushArray
-
narKeyArray
-
mapChangeTime
-
mapUplinkVolume
-
mapDownlinkVolume
-
discardedCounts
-
TS_YEAR
public static final int TS_YEARIndices into the TimeStamp byte[].- See Also:
-
TS_MONTH
public static final int TS_MONTH- See Also:
-
TS_DAY
public static final int TS_DAY- See Also:
-
TS_HOUR
public static final int TS_HOUR- See Also:
-
TS_MINUTE
public static final int TS_MINUTE- See Also:
-
TS_SECOND
public static final int TS_SECOND- See Also:
-
TS_SIGN
public static final int TS_SIGN- See Also:
-
TS_OFFSET_HOUR
public static final int TS_OFFSET_HOUR- See Also:
-
TS_OFFSET_MINUTE
public static final int TS_OFFSET_MINUTE- See Also:
-
-
Constructor Details
-
FlexibleAggregatorFieldProcessor
public FlexibleAggregatorFieldProcessor(Class outputDataType, FlexibleAggregatorNode node, String scratchDir, String fileName, IDCMethodHandler methodHandler)
-
-
Method Details
-
init
protected void init() -
isAllKeyAttributesExists
-
shutdown
public void shutdown()Description copied from class:NPLFieldProcessor
Performs all steps necessary to gracefully stop this FieldProcessor.- Overrides:
shutdown
in classNPLFieldProcessor
-
createKey
This will generate and return a key based on the record. -
storeNAR
This will generate a key and store the NAR in the table. -
printTimer
To be used in debugging only. Print the time that a NAR will be flushed from the aggregator -
storeNARReusingTimer
This will generate a key and store the NAR in the table with an old timer. -
getNARKeepTimer
This will remove a NAR but leave its timer. -
removeNARTimer
This will remove the timer for a NAR from the timer table. This should be used if the record was removed from the key table, but the timer value was left in the timer table, for example, if getNarSaveTimer was used. -
getAndRemoveNAR
This will remove the NAR entry from the table. -
removeNAR
public boolean removeNAR(int index) This will remove a NAR entry from the table without returning the removed entry. -
setCount
public void setCount(long tempKey, long tempKey1, long tempKey2, int index) Sets the Count -
getCount
public int getCount(long tempKey, long tempKey1, long tempKey2, int index) Gets the Count -
reset
public void reset(long cleanup) Reset the Count -
resetCount
public void resetCount(long tempKey, long tempKey1, long tempKey2, int index) -
removeDeactivatedTimer
public void removeDeactivatedTimer(int index) This will remove a deactivated timer. -
distributeTrafficVolumesPerDay
public boolean distributeTrafficVolumesPerDay(ListField trafficVolumes, NAR destContainer, List uplinkVolumeAttrs, List downlinkVolumeAttrs, ListField unprocessedVolumes, BytesField openingTime) This will distribute the traffic volume uplink and downlink volumes into appropriate daily bins according to the individual times. If the traffic volumes goes past midnight, it will stop and return false. In this case, the volumes already processed for the previous day will be left processed. The list of traffic volumes will also have the processed volumes removed from the list. Only the unprocessed entries will remain. If no day change is detected, true is returned to indicate all traffic volumes have been processed. -
populateIndividualTrafficVolume
public int populateIndividualTrafficVolume(Map trafficVolumeMap, DCFieldContainer destContainer, List uplinkVolumeIDs, List downlinkVolumeIDs, BytesField nextOpeningTime, int dayOfYearCheck) Will only populate the traffic volumes if they are for the same day as dayOfYearCheck, unless dayOfYearCheck invalid input: '<' 1. If the same day, that day of the year will be returned. If a different day, 0 will be returned. If no time is provided in the traffic volume map, -1 is returned. -
generateOpeningTimeFromTrafficVolume
Will return the integer day of year corresponding to the first traffic volume. -
compareBytes
Performs a simple byte comparison on the attribute in the two NARs.
-