public class MXAggrDispatcher
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
dailyFlushFeatureEnabled |
protected boolean[] |
dailyFlushFlagArray |
protected java.util.Timer |
dailyFlushTimer |
protected FlexibleAggrKeyFactory[] |
keyFactoryArray |
protected FieldKey |
mapChangeTime |
protected FieldKey |
mapDownlinkVolume |
protected FieldKey |
mapUplinkVolume |
protected FlexibleNARKey[][] |
narKeyArray |
protected FlexibleAggrTable[][] |
tableArray |
protected FlexibleTableFlush[][] |
tableFlushArray |
protected FlexibleTimerFlush[][] |
timerFlushArray |
static int |
TS_DAY |
static int |
TS_HOUR |
static int |
TS_MINUTE |
static int |
TS_MONTH |
static int |
TS_OFFSET_HOUR |
static int |
TS_OFFSET_MINUTE |
static int |
TS_SECOND |
static int |
TS_SIGN |
static int |
TS_YEAR
Indices into the TimeStamp byte[].
|
Constructor and Description |
---|
MXAggrDispatcher(DCNode parent,
MXNarInputProcessor narInput,
DataReceiverIfc narOutput,
java.lang.String nplFile,
int numThreads) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDailyFlush(int fpID)
Called by MXNarInputProcessor.isDataAvailable(), to do Daily Flush processing.
|
boolean |
compareBytes(DCFieldContainer narA,
DCFieldContainer narB,
FieldKey attrId)
Performs a simple byte comparison on the attribute in the two NARs.
|
protected DCFieldProcessor |
createFieldProcessor(MXJavahookHandler hook)
Sets up the general NPLFieldProcesser passing a NAR as the output
class for the Field Processor, and passes the NPL file gained
from the config for parsing instructions for the NPL.
|
void |
createKey(int index,
NAR nar,
int fpID)
This will generate and return a key based on the record.
|
boolean |
distributeTrafficVolumesPerDay(ListField trafficVolumes,
NAR destContainer,
java.util.List uplinkVolumeAttrs,
java.util.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(java.util.List trafficVolumes)
Will return the integer day of year corresponding to the first traffic volume.
|
protected java.lang.String |
generateTableFilename(int th,
int tb) |
boolean |
getAndRemoveNAR(NAR nar,
int index,
int fpID)
This will remove the NAR entry from the table.
|
java.lang.String |
getConfigValue(java.lang.String key) |
int |
getCount(long tempKey,
long tempKey1,
long tempKey2,
int index)
Gets the Count
|
int |
getIntConfigValue(java.lang.String key) |
java.util.ArrayList<FlexibleNARKey> |
getKeys(NAR nar) |
boolean |
getNARKeepTimer(NAR nar,
int index,
int fpID)
This will remove a NAR but leave its timer.
|
long |
getVolumeLimit(java.lang.String volume)
Converts the string representation of value into long
Example: volume is 10KB then returns 10240
|
protected void |
init(int numThreads)
Deprecated.
Use neoInit(). This method has a bug where records may get
trapped in old databases if the number of threads is changed.
|
void |
isAllKeyAttributesExists(NAR nar,
int tableNumber) |
protected void |
neoInit(int numThreads)
New initialization to handle numThreads changes between startup.
|
protected FlexibleAggrTable[][] |
openAndReassignAggrTable(int numThreads,
int numTables,
int compressThreshold)
This method will examine the scratch directory for existing aggrtable files.
|
int |
populateIndividualTrafficVolume(java.util.Map trafficVolumeMap,
DCFieldContainer destContainer,
java.util.List uplinkVolumeIDs,
java.util.List downlinkVolumeIDs,
BytesField nextOpeningTime,
int dayOfYearCheck)
Will only populate the traffic volumes if they are for the same day as dayOfYearCheck,
unless dayOfYearCheck < 1.
|
void |
printTimer(NAR nar,
int index,
int fpID)
To be used in debugging only.
|
java.util.LinkedHashMap |
readHashMapFromFile(java.io.File file)
Reads FlexibleNARTimer objects from the file
|
void |
removeDeactivatedTimer(int index,
int fpID)
This will remove a deactivated timer.
|
boolean |
removeNAR(int index,
int fpID)
This will remove a NAR entry from the table without returning
the removed entry.
|
boolean |
removeNARTimer(NAR nar,
int index,
int fpID)
This will remove the timer for a NAR from the timer table.
|
void |
removeTimer(NAR nar,
int index,
int fpID) |
void |
reset(long cleanup)
Reset the Count
|
void |
resetCount(long tempKey,
long tempKey1,
long tempKey2,
int index) |
void |
resetNarKeys(int fpID) |
void |
setCount(long tempKey,
long tempKey1,
long tempKey2,
int index)
Sets the Count
|
boolean |
setflushTimerActive() |
void |
shutdown() |
protected void |
shutdownFieldProcessorThreads() |
protected void |
startFieldProcessorThreads() |
void |
storeNAR(NAR nar,
int index,
boolean setTimer,
int fpID)
This will generate a key and store the NAR in the table.
|
void |
storeNARReusingTimer(NAR nar,
int index,
int fpID)
This will generate a key and store the NAR in the table with an old timer.
|
protected FlexibleAggrTable[][] tableArray
protected FlexibleAggrKeyFactory[] keyFactoryArray
protected FlexibleTimerFlush[][] timerFlushArray
protected FlexibleTableFlush[][] tableFlushArray
protected FlexibleNARKey[][] narKeyArray
protected boolean[] dailyFlushFlagArray
protected FieldKey mapChangeTime
protected FieldKey mapUplinkVolume
protected FieldKey mapDownlinkVolume
protected boolean dailyFlushFeatureEnabled
protected java.util.Timer dailyFlushTimer
public static final int TS_YEAR
public static final int TS_MONTH
public static final int TS_DAY
public static final int TS_HOUR
public static final int TS_MINUTE
public static final int TS_SECOND
public static final int TS_SIGN
public static final int TS_OFFSET_HOUR
public static final int TS_OFFSET_MINUTE
public MXAggrDispatcher(DCNode parent, MXNarInputProcessor narInput, DataReceiverIfc narOutput, java.lang.String nplFile, int numThreads)
public java.lang.String getConfigValue(java.lang.String key)
public int getIntConfigValue(java.lang.String key)
protected void neoInit(int numThreads)
numThreads
- public java.util.LinkedHashMap readHashMapFromFile(java.io.File file)
file
- to read objects frompublic boolean setflushTimerActive()
public long getVolumeLimit(java.lang.String volume)
volume
- protected FlexibleAggrTable[][] openAndReassignAggrTable(int numThreads, int numTables, int compressThreshold)
numThreads
- numTables
- protected java.lang.String generateTableFilename(int th, int tb)
protected void init(int numThreads)
numThreads
- public void shutdown()
protected void startFieldProcessorThreads()
protected void shutdownFieldProcessorThreads()
protected DCFieldProcessor createFieldProcessor(MXJavahookHandler hook) throws NodeProcessingException
NodeProcessingException
protected void checkDailyFlush(int fpID)
fpID
- public void createKey(int index, NAR nar, int fpID)
public void storeNAR(NAR nar, int index, boolean setTimer, int fpID)
public void printTimer(NAR nar, int index, int fpID)
public void storeNARReusingTimer(NAR nar, int index, int fpID)
public boolean getNARKeepTimer(NAR nar, int index, int fpID)
public boolean removeNARTimer(NAR nar, int index, int fpID)
public void removeTimer(NAR nar, int index, int fpID)
public boolean getAndRemoveNAR(NAR nar, int index, int fpID)
public boolean removeNAR(int index, int fpID)
public void setCount(long tempKey, long tempKey1, long tempKey2, int index)
public int getCount(long tempKey, long tempKey1, long tempKey2, int index)
public void reset(long cleanup)
public void resetCount(long tempKey, long tempKey1, long tempKey2, int index)
public void removeDeactivatedTimer(int index, int fpID)
public boolean distributeTrafficVolumesPerDay(ListField trafficVolumes, NAR destContainer, java.util.List uplinkVolumeAttrs, java.util.List downlinkVolumeAttrs, ListField unprocessedVolumes, BytesField openingTime)
public int populateIndividualTrafficVolume(java.util.Map trafficVolumeMap, DCFieldContainer destContainer, java.util.List uplinkVolumeIDs, java.util.List downlinkVolumeIDs, BytesField nextOpeningTime, int dayOfYearCheck)
public byte[] generateOpeningTimeFromTrafficVolume(java.util.List trafficVolumes)
public boolean compareBytes(DCFieldContainer narA, DCFieldContainer narB, FieldKey attrId)
public void isAllKeyAttributesExists(NAR nar, int tableNumber)
public java.util.ArrayList<FlexibleNARKey> getKeys(NAR nar)
public void resetNarKeys(int fpID)