Cache.h File Reference

#include <pthread.h>
#include "constants.h"
#include "prod_cons.h"
#include "TaskIdList.h"
#include "DataSpaceId.h"
#include "Task.h"
#include "FilterDev.h"
#include "hash.h"

Include dependency graph for Cache.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FinishedTask
struct  Cache

Defines

#define KEY_DSI
#define VAL_VOID
#define KEY_INT
#define VAL_INT

Functions

void initCache ()
void destroyCache ()
void setCreator ()
void cacheSetUseTasks ()
int cacheGetUseTasks ()
void cacheSetForwardTaskMsgs (int forward)
int cacheGetForwardTaskMsgs ()
int cacheCreateTask (int taskId, int *deps, int depSize, char *metadata, int metaSize)
int cacheEndTask (int taskId)
int cachePutData (char *key, void *data, int dataSz)
void * cacheGetData (int taskId, char *key, int *dataSz)
int cacheRemoveData (char *key)
TaskIdListgetFinishedTasks ()
int cacheRecoverTasks (TaskIdList *tasks)
int cacheGetRunningTasks (int *numTasks, int **taskList)
int * cacheGetFinishedTasks (int *numTasks)
void cacheSetCurrentWork (int work)
int cacheGetCurrentWork ()
int cacheSetCurrentTask (int task)
int cacheGetCurrentTask ()
int writeTaskState (FILE *outputFile, Cache *cache)
int readTaskState (FILE *inputFile)
int * cacheGetTaskDeps (int taskId, int *depsSz)
int defaultRecoveryCallback (int newTaskId, int *newTaskDep, int depSize, char *metadata, int metaSize)
int cacheRegisterRecoverCallback (RecoverCallback_t *callback)


Define Documentation

#define KEY_DSI
 

Definition at line 12 of file Cache.h.

#define KEY_INT
 

Definition at line 18 of file Cache.h.

#define VAL_INT
 

Definition at line 19 of file Cache.h.

#define VAL_VOID
 

Definition at line 13 of file Cache.h.


Function Documentation

int cacheCreateTask int  taskId,
int *  deps,
int  depSize,
char *  metadata,
int  metaSize
 

Definition at line 657 of file Cache.c.

References cache, Cache::currentWork, and Cache::tasks.

Referenced by dsCreateTask(), dsReadBuffer(), and dsReadNonBlockingBuffer().

int cacheEndTask int  taskId  ) 
 

Definition at line 743 of file Cache.c.

References cache, cacheRunTask(), Cache::currentTask, Cache::currentWork, _task_::dependsOnMe, E_NO_SUCH_TASK, E_TASK_NOT_RUNNING, _task_::endedTasks, finished, getTaskState(), _task_::myDeps, running, Cache::runningTasks, setTaskState(), DataSpaceId::task, taskIdListAdd(), taskIdListGet(), taskIdListGetSize(), Cache::tasks, Cache::terminatedTasks, and DataSpaceId::work.

Referenced by dsEndTask(), and dsReadBuffer().

Here is the call graph for this function:

int cacheGetCurrentTask  ) 
 

Definition at line 621 of file Cache.c.

References cache, and Cache::currentTask.

Referenced by cacheGetTaskDeps(), dsGetCurrentTask(), dsMCast(), and dsSend().

int cacheGetCurrentWork  ) 
 

Definition at line 629 of file Cache.c.

References cache, and Cache::currentWork.

void* cacheGetData int  taskId,
char *  key,
int *  dataSz
 

Definition at line 266 of file Cache.c.

References cache, Cache::currentTask, Cache::currentWork, finished, getData(), getTaskDataSpace(), getTaskState(), DataSpaceId::task, Cache::tasks, and DataSpaceId::work.

Referenced by dsGetData().

Here is the call graph for this function:

int* cacheGetFinishedTasks int *  numTasks  ) 
 

Definition at line 854 of file Cache.c.

References cache, taskIdListToArray(), and Cache::terminatedTasks.

Referenced by dsGetFinishedTasks().

Here is the call graph for this function:

int cacheGetForwardTaskMsgs  ) 
 

Definition at line 850 of file Cache.c.

References cache, and Cache::forwardTaskMsgs.

Referenced by dsCreateTask(), dsEndTask(), dsReadBuffer(), and dsReadNonBlockingBuffer().

int cacheGetRunningTasks int *  numTasks,
int **  taskList
 

Definition at line 811 of file Cache.c.

References cache, and Cache::runningTasks.

Referenced by dsGetRunningTasks().

int* cacheGetTaskDeps int  taskId,
int *  depsSz
 

Todo:
Define access verifications for this function

Definition at line 334 of file Cache.c.

References cache, cacheGetCurrentTask(), Cache::currentWork, getTaskMyDeps(), DataSpaceId::task, taskIdListGet(), taskIdListGetSize(), Cache::tasks, and DataSpaceId::work.

Referenced by dsGetTaskDeps().

Here is the call graph for this function:

int cacheGetUseTasks  ) 
 

Definition at line 842 of file Cache.c.

References cache, and Cache::useTasks.

int cachePutData char *  key,
void *  data,
int  dataSz
 

Definition at line 234 of file Cache.c.

References cache, createDataSpace(), createTask(), Cache::currentTask, Cache::currentWork, E_NO_SUCH_TASK, getTaskDataSpace(), INITIAL_CAPACITY, putData(), DataSpaceId::task, Cache::tasks, and DataSpaceId::work.

Referenced by dsPutData().

Here is the call graph for this function:

int cacheRecoverTasks TaskIdList tasks  ) 
 

Todo:
make cache capable of saving/recovering multiple works
Todo:
test: mother inserted, then child child insered then mother
Todo:
verify if mother points to the real child

Definition at line 400 of file Cache.c.

References cache, Cache::currentWork, destroyTask(), E_COULD_NOT_RECOVER_TASK, finished, Cache::finishedTasksDir, _task_::id, _task_::mother, readTask(), setTaskState(), DataSpaceId::task, TASK_DIRNAME_SIZE, TASK_FILENAME_SIZE, taskAddChild(), taskIdListAdd(), taskIdListGet(), taskIdListGetSize(), taskIdListSortAscendig(), Cache::tasks, taskTakeChildren(), Cache::terminatedTasks, and DataSpaceId::work.

Here is the call graph for this function:

int cacheRegisterRecoverCallback RecoverCallback_t callback  ) 
 

Definition at line 833 of file Cache.c.

References cache, and Cache::recoverCallback.

Referenced by dsRegisterRecoverCallback().

int cacheRemoveData char *  key  ) 
 

Definition at line 308 of file Cache.c.

References cache, Cache::currentTask, Cache::currentWork, getTaskDataSpace(), removeData(), DataSpaceId::task, Cache::tasks, and DataSpaceId::work.

Referenced by dsRemoveData().

Here is the call graph for this function:

int cacheSetCurrentTask int  task  ) 
 

Definition at line 602 of file Cache.c.

References cache, Cache::currentTask, Cache::currentWork, E_NO_SUCH_TASK, E_TASK_NOT_RUNNING, getTaskState(), running, DataSpaceId::task, Cache::tasks, and DataSpaceId::work.

Referenced by dsSetCurrentTask().

Here is the call graph for this function:

void cacheSetCurrentWork int  work  ) 
 

Definition at line 625 of file Cache.c.

References cache, and Cache::currentWork.

void cacheSetForwardTaskMsgs int  forward  ) 
 

Definition at line 846 of file Cache.c.

References cache, and Cache::forwardTaskMsgs.

void cacheSetUseTasks  ) 
 

Definition at line 838 of file Cache.c.

References cache, and Cache::useTasks.

Referenced by dsUseTasks().

int defaultRecoveryCallback int  newTaskId,
int *  newTaskDep,
int  depSize,
char *  metadata,
int  metaSize
 

Definition at line 828 of file Cache.c.

References dsCreateTask().

Referenced by initCacheStruct().

Here is the call graph for this function:

void destroyCache  ) 
 

Definition at line 212 of file Cache.c.

References cache, destroy_prod_cons(), Cache::finishedTasksDir, put(), Cache::runningTasks, FinishedTask::task, Cache::taskBuffer, FinishedTask::taskId, taskIdListDestroy(), Cache::tasks, Cache::terminatedTasks, FinishedTask::workId, and Cache::writeThreadDescriptor.

Here is the call graph for this function:

TaskIdList* getFinishedTasks  ) 
 

Definition at line 373 of file Cache.c.

References cache, Cache::finishedTasksDir, taskIdListAdd(), and taskIdListCreate().

Here is the call graph for this function:

void initCache  ) 
 

int readTaskState FILE *  inputFile  ) 
 

void setCreator  ) 
 

Definition at line 598 of file Cache.c.

References cache, and Cache::IAmTaskCreator.

int writeTaskState FILE *  outputFile,
Cache cache
 


Generated on Tue Jan 17 19:19:28 2006 for Void by  doxygen 1.4.6