Package uk.ac.ed.epcc.safe.accounting

This package handles the accounting records.

See: Description

Package uk.ac.ed.epcc.safe.accounting Description

This package handles the accounting records.

The aim of these classes is to support general accounting and report generation with a variety of deployment and accounting models.

The key item here is an accounting record. This contains a combination of different kinds of data:

This naturally leads us towards having implementation classes for different providers of factual information and augmenting them (by extension or composition) with the local policy. In practice some of the derived information needs to be stored and cannot just be generated on the fly from the factual data. Charging data needs to reflect the actual charge made in case charging parameters are changed. Also any derived quantities that will be used for record selection may need to be recorded with the record for performance reasons. In some cases raw data from different data sources needs to be combined. For example to add a log of which executables are running to the basic information in a batch accounting log.

There are different types of resource quantity we need to consider:

Where the period covered by a usage record is defined a mapping exists between Point and Cumulative properties. Point properties can be integrated (or representative values multiplied by the period length) to give a corresponding Cumulative property. Cumulative properties can be divided by the period length to give an indicative rate. The correct mapping of Point and Cumulative properties onto a reporting period tends to be different depending on the property in question but many common mappings can be performed by OverlapHandler.

The lowest common denominator of accounting record is something like:

However this could represent many different things depending on the system. E.g.

Many accounting operations require that some subset of the accounting records is selected. Usually by date-range and some record properties and a chart or table produced of one of the Extrinsic properties often divided into classes based on additional job properties. For example a table of CPU-time grouped by project.

We need to abstract out these different concepts to allow common code that can cope with the different quantities and properties supported by different accounting schemes. In addition we sometimes want to support aggregate reports over multiple types of accounting scheme. In which case we need a combining object that implements the same basic interface but only exposes those quantities and properties that are common to all the underlying schemes.

In order to support multiple accounting schemes at the same time we need a UsageManager class to present a unified view of the tables from the different schemes.

Standard accounting only uses the functionality of UsageRecord. Accounting data is queried via the UsageProducer interface. UsageManager has to implement this interface. The Factory classes for the various sub-classes of UsageRecord also need to present a standard interface for the UsageManager to use. This is also UsageProducer interface.

Because we wish to support aggregate operations over multiple tables we introduce an additional level of data abstraction over that used by Repository/Record. Instead of identifying quantities by their database field name we use PropertyTags. These are translated into objects from uk.ac.epcc.model.data.expr by the underlying classes. This allows properties to be represented by different field names in different tables. Properties can also be used to reference complex expressions PropExpressions involving multiple table fields.