base
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
rc_balanced content physical delete thread header
|
||||
-----------------------------------------
|
||||
|
||||
begin : 2019/03/13
|
||||
copyright : (C) 2005 Solbox Inc.
|
||||
author : huibong
|
||||
email : huibong@solbox.com
|
||||
version : 3.5
|
||||
|
||||
CopyRight(C) 2005 Solbox Inc. All Rights reserved.
|
||||
Redistribution and use in source and binary forms, with or with out
|
||||
modification, are not permitted in outside of Solbox Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#ifndef __PHYSICAL_DELETE_THREAD_H__
|
||||
#define __PHYSICAL_DELETE_THREAD_H__
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "RebalanceData.h"
|
||||
#include "DataQueue.hpp"
|
||||
#include "ProcessMonitoringThread.h"
|
||||
|
||||
|
||||
// CPhysicalDeleteThread class
|
||||
// - delete standby queue 에 들어 있는 content 를 pop 하여...
|
||||
// - 각 FHS 의 ftsd 로 unlink 처리 요청을 전송한다.
|
||||
// - 만약 unlink 처리 실패 발생한 경우.. retry queue 에 저장한 후 지정된 시간 이후 재시도 처리한다.
|
||||
class CPhysicalDeleteThread
|
||||
{
|
||||
public:
|
||||
|
||||
// 생성자
|
||||
CPhysicalDeleteThread( CDataQueue<CRebalanceData> * const pQueueDeleteStandby
|
||||
, CProcessMonitoringThread * pMonitoringThread );
|
||||
|
||||
// 소멸자
|
||||
~CPhysicalDeleteThread();
|
||||
|
||||
// Thread 를 생성하여 주기적으로 job 을 처리한다.
|
||||
bool Start( void );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Thread handle
|
||||
pthread_t m_threadHandle;
|
||||
|
||||
// Thread Loop 마다 Sleep Time 정보를 저장하기 위한 변수
|
||||
unsigned int m_uSleep;
|
||||
|
||||
|
||||
// unlink 처리 대상 content 정보를 저장하는 queueDeleteStandby 객체에 대한 포인터
|
||||
CDataQueue<CRebalanceData> * m_pQueueDeleteStandby;
|
||||
|
||||
// unlink 처리 실패시 retry 처리를 수행하기 위한 내부 queue 객체 (외부에서 전달받은 객체가 아닌 내부 멤버객체임)
|
||||
CDataQueue<CRebalanceData> m_queueDeleteRetry;
|
||||
|
||||
|
||||
// CProcessMonitoringThread 객체에 대한 포인터
|
||||
// - delete 작업 통계 정보 업데이트를 위한 객체 포인터, 생성자에서 전달받음
|
||||
CProcessMonitoringThread * m_pMonitoringThread;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Thread loop base function
|
||||
static void * threadFunc( void * arg );
|
||||
|
||||
// 실제 Content Copy 처리를 control 하는 함수
|
||||
void Execute( void );
|
||||
|
||||
|
||||
// Delete queue , Retry queue 에서 삭제 작업을 수행할 content 를 POP 처리하여
|
||||
// 전달받은 참조 인자로 전달한다.
|
||||
// pop 처리할 content 가 없는 경우 false 반환.
|
||||
bool Pop( CRebalanceData &data );
|
||||
|
||||
// 실제 ftsd 와 통신을 통해 인자로 전달받은 content unlink 처리 수행
|
||||
bool Delete( CRebalanceData &data );
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* __PHYSICAL_DELETE_THREAD_H__ */
|
||||
|
||||
Reference in New Issue
Block a user