ibi Patterns .NET API
Loading...
Searching...
No Matches
NetricsServerInterface.NetricsCompoundReader Class Reference

Read compound records from a set of record sources. More...

Public Member Functions

 NetricsCompoundReader (String parent_tbl_name, NetricsTableRecSrc parent_recs, bool return_orphans)
 Create a compound record reader. This creates a compound record reader. It is created with a single parent table. Child tables must be added using the addChildTable method.
 
void addChildTable (String child_tbl_name, NetricsTableRecSrc child_recs)
 
override NetricsCompoundRecord getNext ()
 
override bool hasNext ()
 Returns true if the source has more records.
 
override void reset ()
 Reset the source to the first record.
 
int getPosition ()
 
Returns
an indicator of the current position in the scan.

 
String getParentTable ()
 
Returns
the parent/primary table name for the compound record. *‍/

 
List< String > getChildTables ()
 
Returns
the list of child table names.

 
abstract NetricsCompoundRecord getNext ()
 Returns the next record.
 
abstract bool hasNext ()
 Returns true if the source has more records.
 
abstract void reset ()
 Reset the source to the first record.
 
bool hasNext ()
 Returns true if the source has more records.
 
NetricsBaseRecord getNext ()
 Returns the next record.
 
void reset ()
 Reset the source to the first record.
 

Detailed Description

Read compound records from a set of record sources.

Objects of this class provide a means of reading in compound records. A compound record is a parent record along with a set of zero or more child records. It may also be an orphan child record. This class builds compound records from a set of record sources. One source represents the parent table, zero or more additional sources represent the child tables. Each source is associated with a table name, all table names must be unique.

To build compound records it is assumed that all sources are sorted by the parent record key. The child record sources are not sorted by their own key, they must be sorted by the parent record key. In this way the sources can be read in parallel and merged.

Constructor & Destructor Documentation

◆ NetricsCompoundReader()

NetricsServerInterface.NetricsCompoundReader.NetricsCompoundReader ( String  parent_tbl_name,
NetricsTableRecSrc  parent_recs,
bool  return_orphans 
)
inline

Create a compound record reader. This creates a compound record reader. It is created with a single parent table. Child tables must be added using the addChildTable method.

Parameters
parent_tbl_nameThe name of the parent table.
parent_recsA record source that provides parent records. The records MUST be provided in sort order of the record keys.
return_orphansIf true, orphan child records are returned as a NetricsCompoundRecord with no children. If false, orphan child records are quietly skipped.
Exceptions
ArgumentExceptionThrown if any argument is null or the parent table name is empty (zero length).
NetricsRecSrcExceptionThrown if there is an error reading the first parent record.

Member Function Documentation

◆ addChildTable()

void NetricsServerInterface.NetricsCompoundReader.addChildTable ( String  child_tbl_name,
NetricsTableRecSrc  child_recs 
)
inline

add a new child table to this compound record reader. This is used to add a child table to this compound record reader. This call should be made before any records are read, but this is not enforced.

Parameters
child_tbl_namethe name of the child table. This must not be the same as the name of the parent table or any existing child table.
child_recsthis is the source of child records. The records returned by this source should be child records. The records must be returned in sort order of the parent key.
Exceptions
ArgumentExceptionif either argument is null, the table name is zero length, the table name is the same as the parent table or an existing child table.
NetricsRecSrcExceptionif there is an error reading the first record.

◆ getNext()

override NetricsCompoundRecord NetricsServerInterface.NetricsCompoundReader.getNext ( )
inlinevirtual

return the next record.

Returns
the next record, null if no more records.
Exceptions
NetricsRecSrcExceptionif there is an error on any of the underlying readers when reading the next record.

Implements NetricsServerInterface.NetricsCompoundRecSrc.

◆ hasNext()

override bool NetricsServerInterface.NetricsCompoundReader.hasNext ( )
inlinevirtual

Returns true if the source has more records.

This may throw an exception if an underlying reader encounters an error.

Implements NetricsServerInterface.NetricsCompoundRecSrc.

◆ reset()

override void NetricsServerInterface.NetricsCompoundReader.reset ( )
inlinevirtual

Reset the source to the first record.

This is only supported if it is supported by all the underlying readers.

Implements NetricsServerInterface.NetricsCompoundRecSrc.