Drizzled Public API Documentation

compactor_ms.h
00001 /* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
00002  *
00003  * PrimeBase Media Stream for MySQL
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00018  *
00019  * Original author: Paul McCullagh
00020  * Continued development: Barry Leslie
00021  *
00022  * 2007-07-10
00023  *
00024  * H&G2JCtL
00025  *
00026  * Temporary BLOB log.
00027  *
00028  * Temporary BLOBs are BLOBs that are to be deleted after an certain
00029  * expiry time.
00030  *
00031  * Temporary BLOBs are referenced by the temporary log.
00032  *
00033  * The compactor thread also handles the rebuilding of the BLOB alias index.
00034  *
00035  */
00036 
00037 #pragma once
00038 #ifndef __COMPACTOR_MS_H__
00039 #define __COMPACTOR_MS_H__
00040 
00041 #include "cslib/CSDefs.h"
00042 #include "cslib/CSFile.h"
00043 
00044 class MSDatabase;
00045 
00046 class MSCompactorThread : public CSDaemon {
00047 public:
00048   MSCompactorThread(time_t wait_time, MSDatabase *db);
00049   virtual ~MSCompactorThread(){} // Do nothing here because 'self' will no longer be valid, use completeWork().
00050 
00051   void close();
00052 
00053   virtual bool doWork();
00054 
00055   virtual void *completeWork();
00056 
00057 private:
00058   MSDatabase      *iCompactorDatabase;
00059 
00060   char        iCompactBuffer[MS_COMPACTOR_BUFFER_SIZE];
00061 
00062 };
00063 
00064 #endif