public class AggrCalcFields extends AggregatorModule
config, logger
Constructor and Description |
---|
AggrCalcFields(ConfigIfc config,
LoggerIfc logger)
Creates an object to handle calculated aggregation fields.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeepFields(int[] fields)
Adds more fields that need to be kept at "keep" time.
|
void |
calc_growlist(NAR newRecord,
NAR updatedRecord)
Appends the values of the new record's List field with the
existing list of the updated record.
|
void |
calc_keep(NAR newRecord,
NAR updatedRecord)
Keeps the specified fields from the new record in the updated
record.
|
void |
calc_max(NAR newRecord,
NAR updatedRecord)
Compares the fields in the new record and the updated record, and
keep the greater value in the updated record.
|
void |
calc_strconcat(NAR newRecord,
NAR updatedRecord)
Concatenate the String fields in two records according to the settings of
"strconcat", and store the result in the updated record.
|
void |
calc_sum(NAR newRecord,
NAR updatedRecord)
Sum the fields in two records according to the settings of
"sum", and store the result in the updated record.
|
protected void |
getConfigData()
This method should obtain the necessary information from the
config class, in order to configure the module.
|
boolean |
isSumOverflow(NAR newRecord,
NAR oldRecord)
Determines whether there would be overflow when summing the
fields of the new record into the fields of the old record.
|
int[] |
recordInitFields()
Returns the fields that should be stored in a newly created
record entry.
|
void |
shutdown()
This method should handle shutting down the routines that have been
started by this class.
|
protected void getConfigData()
AggregatorModule
getConfigData
in class AggregatorModule
public int[] recordInitFields()
recordInitFields
in class AggregatorModule
public void addKeepFields(int[] fields)
fields
- Int array of field ID's to keep.public void calc_keep(NAR newRecord, NAR updatedRecord)
newRecord
- incoming recordupdatedRecord
- updated record, from the tablepublic void calc_sum(NAR newRecord, NAR updatedRecord) throws java.lang.ArithmeticException
newRecord
- Record containing the new valuesupdatedRecord
- Record to contain the updated valuesjava.lang.ArithmeticException
public void calc_max(NAR newRecord, NAR updatedRecord)
newRecord
- incoming recordupdatedRecord
- updated record, from the record tablepublic void calc_growlist(NAR newRecord, NAR updatedRecord)
newRecord
- incoming recordupdatedRecord
- updated record, from the record tablepublic void calc_strconcat(NAR newRecord, NAR updatedRecord)
newRecord
- Record containing the new valuesupdatedRecord
- Record to contain the updated valuespublic boolean isSumOverflow(NAR newRecord, NAR oldRecord)
newRecord
- Incoming recordoldRecord
- Record that exists in the tablepublic void shutdown()
AggregatorModule
shutdown
in class AggregatorModule