base
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
/***************************************************************************
|
||||
Cache 생성 작업을 수행하는 Thread class
|
||||
-----------------------------------------
|
||||
begin : 2010/03/13
|
||||
copyright : (C) 2010 Solbox Inc.
|
||||
author : storage dev team
|
||||
email : storage.sd@solbox.com
|
||||
version : 3.3
|
||||
|
||||
CopyRight(C) 2010 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 __CACHE_THREAD_H__
|
||||
#define __CACHE_THREAD_H__
|
||||
|
||||
#include <pthread.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "ProcessStatus.h"
|
||||
#include "CacheData.h"
|
||||
#include "CacheJobList.h"
|
||||
#include "DataQueue.hpp"
|
||||
|
||||
|
||||
// CCacheThread
|
||||
// 전달받은 Content 에 대해 각 FHS 와 통신을 통해 실제 Cache 생성을 수행
|
||||
// - Cache 정보 및 FHS 정보를 SocketControl 을 이용하여 ftsd 로 전송
|
||||
// - 처리 결과 수신 후 CompletQueue 결과 저장처리
|
||||
// 내부적으로 Thread를 사용
|
||||
class CCacheThread
|
||||
{
|
||||
public:
|
||||
|
||||
// 생성자
|
||||
CCacheThread( CProcessStatus* pProcessStatus
|
||||
, CCacheJobList* pJobList
|
||||
, CDataQueue<CCacheData>* pQueueCacheComplete
|
||||
, CCacheData& dataCache );
|
||||
|
||||
~CCacheThread();
|
||||
|
||||
// thread를 생성하여 Cache 생성 작업을 수행.
|
||||
bool Start();
|
||||
|
||||
private:
|
||||
|
||||
// 프로세스 상의 Queue, Thread 상태를 관리하는 CProcessStatus 객체에 대한 포인터
|
||||
// - 생성자를 통해 전달받음
|
||||
CProcessStatus * m_pProcessStatus;
|
||||
|
||||
// Cache 생성 관련 Job List 객체에 대한 포인터
|
||||
// - 생성자를 통해 전달받음
|
||||
CCacheJobList* m_pCacheJob;
|
||||
|
||||
// Cache 생성 완료 저장 Queue 에 대한 포인터
|
||||
// - 생성자를 통해 전달받음
|
||||
CDataQueue<CCacheData>* m_pQueueCacheComplete;
|
||||
|
||||
// Cache 생성 대상 content 정보
|
||||
// - 생성자를 통해 전달받음
|
||||
CCacheData m_dataCache;
|
||||
|
||||
|
||||
// 내부 Thread 에 대한 ID
|
||||
pthread_t m_threadHandle;
|
||||
|
||||
// ftsd 로 부터 정상 처리된 결과 정보를 수신하기 위한 멤버 객체
|
||||
// - success fhs host, hash_name
|
||||
std::map<std::string, std::string> m_mapSuccessFhs;
|
||||
|
||||
// ftsd 로 부터 실패 처리된 결과 정보를 수신하기 위한 멤버 객체
|
||||
// - failed fhs host, error message
|
||||
std::map<std::string, std::string> m_mapFailFhs;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// 스레드 함수
|
||||
static void* threadFunc( void* arg );
|
||||
|
||||
// 실제 Cache 생성 작업을 수행
|
||||
void Execute();
|
||||
|
||||
void DoSuccessProcess();
|
||||
|
||||
};
|
||||
#endif //__CACHE_THREAD_H__
|
||||
Reference in New Issue
Block a user