mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
introduced GetMessageCount
This commit is contained in:
parent
31c4644014
commit
d6a323cfab
@ -137,6 +137,18 @@ abstract class LogStream {
|
||||
* @return integer Error state
|
||||
*/
|
||||
public abstract function Sseek(&$uID, $mode, $numrecs);
|
||||
|
||||
|
||||
/**
|
||||
* If you are interested in how many messages are in the stream, call this method.
|
||||
* But be aware of that some stream can not provide a message count. This is probably
|
||||
* because of performance reason or any other. However, if GetMessageCount return -1
|
||||
* this does not mean that there is no message in the stream, it is just not countable.
|
||||
* If there is no message 0 will be returned.
|
||||
*
|
||||
* @return integer Amount of messages within the stream. -1 means that no count is available.
|
||||
*/
|
||||
public abstract function GetMessageCount();
|
||||
}
|
||||
|
||||
|
||||
|
@ -378,6 +378,17 @@ class LogStreamDisk extends LogStream {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetMessageCount will always return -1 which means
|
||||
* that the message count is not available. We refuse
|
||||
* the request of the message count due to a count would
|
||||
* require to read the whole file which would be a big
|
||||
* pain if the file is e.g. 1 gb.
|
||||
*/
|
||||
public function GetMessageCount() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the direction the stream should read data.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user