#include <autoexpire.h>
Definition at line 35 of file autoexpire.h.
Public Member Functions | |
| AutoExpire (QMap< int, EncoderLink * > *encoderList) | |
| Creates AutoExpire class, starting the thread. | |
| AutoExpire (void) | |
| Creates AutoExpire class. | |
| ~AutoExpire () | |
| AutoExpire destructor stops auto delete thread if it is running. | |
| void | CalcParams (void) |
| Calcualtes how much space needs to be cleared, and how often. | |
| void | PrintExpireList (QString expHost="ALL") |
| Prints a summary of the files that can be deleted. | |
| size_t | GetDesiredSpace (int fsID) const |
| void | GetAllExpiring (QStringList &strList) |
| Gets the full list of programs that can expire in expiration order. | |
| void | GetAllExpiring (pginfolist_t &list) |
| Gets the full list of programs that can expire in expiration order. | |
Static Public Member Functions | |
| static void | Update (int encoder, int fsID, bool immediately) |
| This is used to update the global AutoExpire instance "expirer". | |
| static void | Update (bool immediately) |
Public Attributes | |
| QMap< int, EncoderLink * > * | encoderList |
Protected Member Functions | |
| void | RunExpirer (void) |
| This contains the main loop for the auto expire process. | |
Static Protected Member Functions | |
| static void * | ExpirerThread (void *param) |
| This calls RunExpirer() from within a new pthread. | |
Private Member Functions | |
| void | Init (void) |
| Inits member vars. | |
| void | ExpireLiveTV (int type) |
| This expires LiveTV programs. | |
| void | ExpireOldDeleted (void) |
| This expires deleted programs older than DeletedMaxAge. | |
| void | ExpireRecordings (void) |
| This expires normal recordings. | |
| void | ExpireEpisodesOverMax (void) |
| This deletes programs exceeding the maximum number of episodes of that program desired. | |
| void | FillExpireList (pginfolist_t &expireList) |
| Uses the "AutoExpireMethod" setting in the database to fill the list of files that are deletable. | |
| void | FillDBOrdered (pginfolist_t &expireList, int expMethod) |
| Creates a list of programs to delete using the database to order list. | |
| void | SendDeleteMessages (pginfolist_t &deleteList) |
| This sends delete message to main event thread. | |
| void | ClearExpireList (pginfolist_t &expireList, bool deleteProg=true) |
| Clears expireList, freeing any ProgramInfo's if necessary. | |
| void | Sleep (int sleepTime) |
| Sleeps for sleepTime minutes; unless the expire thread is told to quit, then stops sleeping within 5 seconds. | |
| void | UpdateDontExpireSet (void) |
| bool | IsInDontExpireSet (QString chanid, QDateTime starttime) |
| bool | IsInExpireList (pginfolist_t &expireList, QString chanid, QDateTime starttime) |
Private Attributes | |
| set< QString > | dont_expire_set |
| pthread_t | expire_thread |
| uint | desired_freq |
| bool | expire_thread_running |
| QMap< int, uint64_t > | desired_space |
| QMap< int, int > | used_encoders |
| QMutex | instance_lock |
| QWaitCondition | instance_cond |
| bool | update_pending |
| pthread_t | update_thread |
Friends | |
| void * | SpawnUpdateThread (void *param) |
| AutoExpire::AutoExpire | ( | QMap< int, EncoderLink * > * | tvList | ) |
Creates AutoExpire class, starting the thread.
| tvList | EncoderLink list of all recorders |
Definition at line 58 of file autoexpire.cpp.
| AutoExpire::AutoExpire | ( | void | ) |
| AutoExpire::~AutoExpire | ( | ) |
AutoExpire destructor stops auto delete thread if it is running.
Definition at line 91 of file autoexpire.cpp.
| void AutoExpire::CalcParams | ( | void | ) |
Calcualtes how much space needs to be cleared, and how often.
Definition at line 124 of file autoexpire.cpp.
Referenced by RunExpirer(), SpawnUpdateThread(), and Update().
| void AutoExpire::PrintExpireList | ( | QString | expHost = "ALL" |
) |
Prints a summary of the files that can be deleted.
Definition at line 760 of file autoexpire.cpp.
Referenced by main().
| size_t AutoExpire::GetDesiredSpace | ( | int | fsID | ) | const |
| void AutoExpire::GetAllExpiring | ( | QStringList & | strList | ) |
Gets the full list of programs that can expire in expiration order.
Definition at line 799 of file autoexpire.cpp.
Referenced by MythXML::GetExpiring(), and MainServer::HandleGetExpiringRecordings().
| void AutoExpire::GetAllExpiring | ( | pginfolist_t & | list | ) |
Gets the full list of programs that can expire in expiration order.
Definition at line 824 of file autoexpire.cpp.
| void AutoExpire::Update | ( | int | encoder, | |
| int | fsID, | |||
| bool | immediately | |||
| ) | [static] |
This is used to update the global AutoExpire instance "expirer".
| encoder | This recorder starts a recording now | |
| fsID | file system ID of the writing directory | |
| immediately | If true CalcParams() is called directly. If false, a thread is spawned to call CalcParams(), this is for use in the MainServer event thread where calling CalcParams() directly would deadlock the event thread. |
Definition at line 1043 of file autoexpire.cpp.
Referenced by MainServer::autoexpireUpdate(), Scheduler::GetNextLiveTVDir(), MainServer::MainServer(), Scheduler::RunScheduler(), and Update().
| static void AutoExpire::Update | ( | bool | immediately | ) | [inline, static] |
Definition at line 51 of file autoexpire.h.
| void AutoExpire::RunExpirer | ( | void | ) | [protected] |
This contains the main loop for the auto expire process.
Responsible for cleanup of old LiveTV programs as well as deleting as many expireable recordings as necessary to maintain enough free space on all directories in MythTV Storage Groups. The thread deletes short LiveTV programs every 2 minutes and long LiveTV and regular programs as needed every "desired_freq" minutes.
Definition at line 262 of file autoexpire.cpp.
Referenced by ExpirerThread().
| void * AutoExpire::ExpirerThread | ( | void * | param | ) | [static, protected] |
This calls RunExpirer() from within a new pthread.
Definition at line 605 of file autoexpire.cpp.
Referenced by AutoExpire().
| void AutoExpire::Init | ( | void | ) | [private] |
| void AutoExpire::ExpireLiveTV | ( | int | type | ) | [private] |
This expires LiveTV programs.
Definition at line 331 of file autoexpire.cpp.
Referenced by RunExpirer().
| void AutoExpire::ExpireOldDeleted | ( | void | ) | [private] |
This expires deleted programs older than DeletedMaxAge.
Definition at line 344 of file autoexpire.cpp.
Referenced by RunExpirer().
| void AutoExpire::ExpireRecordings | ( | void | ) | [private] |
This expires normal recordings.
Definition at line 358 of file autoexpire.cpp.
Referenced by RunExpirer().
| void AutoExpire::ExpireEpisodesOverMax | ( | void | ) | [private] |
This deletes programs exceeding the maximum number of episodes of that program desired.
Excludes recordings in the LiveTV Recording Group.
Definition at line 618 of file autoexpire.cpp.
Referenced by RunExpirer().
| void AutoExpire::FillExpireList | ( | pginfolist_t & | expireList | ) | [private] |
Uses the "AutoExpireMethod" setting in the database to fill the list of files that are deletable.
Definition at line 738 of file autoexpire.cpp.
Referenced by ExpireRecordings(), and PrintExpireList().
| void AutoExpire::FillDBOrdered | ( | pginfolist_t & | expireList, | |
| int | expMethod | |||
| ) | [private] |
Creates a list of programs to delete using the database to order list.
Definition at line 866 of file autoexpire.cpp.
Referenced by ExpireLiveTV(), ExpireOldDeleted(), FillExpireList(), and GetAllExpiring().
| void AutoExpire::SendDeleteMessages | ( | pginfolist_t & | deleteList | ) | [private] |
This sends delete message to main event thread.
Definition at line 563 of file autoexpire.cpp.
Referenced by ExpireLiveTV(), ExpireOldDeleted(), and ExpireRecordings().
| void AutoExpire::ClearExpireList | ( | pginfolist_t & | expireList, | |
| bool | deleteProg = true | |||
| ) | [private] |
Clears expireList, freeing any ProgramInfo's if necessary.
Definition at line 847 of file autoexpire.cpp.
Referenced by ExpireLiveTV(), ExpireOldDeleted(), ExpireRecordings(), FillExpireList(), GetAllExpiring(), and PrintExpireList().
| void AutoExpire::Sleep | ( | int | sleepTime | ) | [private] |
Sleeps for sleepTime minutes; unless the expire thread is told to quit, then stops sleeping within 5 seconds.
Definition at line 317 of file autoexpire.cpp.
Referenced by RunExpirer().
| void AutoExpire::UpdateDontExpireSet | ( | void | ) | [private] |
| bool AutoExpire::IsInDontExpireSet | ( | QString | chanid, | |
| QDateTime | starttime | |||
| ) | [private] |
Definition at line 1123 of file autoexpire.cpp.
Referenced by ExpireEpisodesOverMax(), and FillDBOrdered().
| bool AutoExpire::IsInExpireList | ( | pginfolist_t & | expireList, | |
| QString | chanid, | |||
| QDateTime | starttime | |||
| ) | [private] |
| void* SpawnUpdateThread | ( | void * | param | ) | [friend] |
| QMap<int, EncoderLink *>* AutoExpire::encoderList |
Definition at line 53 of file autoexpire.h.
Referenced by AutoExpire(), CalcParams(), and ExpireRecordings().
set<QString> AutoExpire::dont_expire_set [private] |
Definition at line 79 of file autoexpire.h.
Referenced by IsInDontExpireSet(), and UpdateDontExpireSet().
pthread_t AutoExpire::expire_thread [private] |
uint AutoExpire::desired_freq [private] |
bool AutoExpire::expire_thread_running [private] |
Definition at line 82 of file autoexpire.h.
Referenced by AutoExpire(), RunExpirer(), Sleep(), and ~AutoExpire().
QMap<int, uint64_t> AutoExpire::desired_space [private] |
Definition at line 84 of file autoexpire.h.
Referenced by CalcParams(), ExpireRecordings(), and GetDesiredSpace().
QMap<int, int> AutoExpire::used_encoders [private] |
QMutex AutoExpire::instance_lock [private] |
Definition at line 87 of file autoexpire.h.
Referenced by CalcParams(), GetAllExpiring(), RunExpirer(), SpawnUpdateThread(), Update(), and ~AutoExpire().
QWaitCondition AutoExpire::instance_cond [private] |
Definition at line 88 of file autoexpire.h.
Referenced by SpawnUpdateThread(), Update(), and ~AutoExpire().
bool AutoExpire::update_pending [private] |
Definition at line 91 of file autoexpire.h.
Referenced by Init(), SpawnUpdateThread(), Update(), and ~AutoExpire().
pthread_t AutoExpire::update_thread [private] |
1.5.5