“a0aaafe9de7008db91f32e50d36ee7d623bf1fa4”上不存在“paddle/fluid/operators/optimizers/adamax_op.h”
提交 d1f7112e 编写于 作者: H hzcheng

more

上级 de06d004
...@@ -88,3 +88,5 @@ SMetaHandle * tsdbCreateMetaHandle (int32_t numOfTables); ...@@ -88,3 +88,5 @@ SMetaHandle * tsdbCreateMetaHandle (int32_t numOfTables);
// Recover the meta handle from the file // Recover the meta handle from the file
SMetaHandle * tsdbOpenMetaHandle(int fd); SMetaHandle * tsdbOpenMetaHandle(int fd);
int32_t tsdbCreateMeterImpl(SMetaHandle *pHandle, STableCfg *pCfg);
#include <stdint.h>
#include <pthread.h> #include <pthread.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "tsdb.h" #include "tsdb.h"
// #include "disk.h" // #include "disk.h"
#include "tsdbMeta.h"
#include "tsdbCache.h" #include "tsdbCache.h"
#include "tsdbMeta.h"
typedef struct STSDBRepo typedef struct STSDBRepo {
{ // TSDB configuration
// TSDB configuration STSDBcfg *pCfg;
STSDBcfg *pCfg;
// The meter meta handle of this TSDB repository // The meter meta handle of this TSDB repository
SMetaHandle *pMetaHandle; SMetaHandle *pMetaHandle;
// The cache Handle // The cache Handle
SCacheHandle *pCacheHandle; SCacheHandle *pCacheHandle;
// Disk tier handle for multi-tier storage // Disk tier handle for multi-tier storage
SDiskTier *pDiskTier; SDiskTier *pDiskTier;
// File Store // File Store
void *pFileStore; void *pFileStore;
pthread_mutext_t tsdbMutex; pthread_mutext_t tsdbMutex;
} STSDBRepo; } STSDBRepo;
...@@ -33,36 +32,104 @@ typedef struct STSDBRepo ...@@ -33,36 +32,104 @@ typedef struct STSDBRepo
// Check the correctness of the TSDB configuration // Check the correctness of the TSDB configuration
static int32_t tsdbCheckCfg(STSDBCfg *pCfg) { static int32_t tsdbCheckCfg(STSDBCfg *pCfg) {
// TODO // TODO
return 0; return 0;
} }
tsdb_repo_t *tsdbCreateRepo(STSDBCfg *pCfg, int32_t *error) { tsdb_repo_t *tsdbCreateRepo(STSDBCfg *pCfg, int32_t *error) {
int32_t err = 0; int32_t err = 0;
err = tsdbCheckCfg(pCfg); err = tsdbCheckCfg(pCfg);
if (err != 0) { if (err != 0) {
// TODO: deal with the error here // TODO: deal with the error here
} }
STSDBRepo *pRepo = (STSDBRepo *) malloc(sizeof(STSDBRepo)); STSDBRepo *pRepo = (STSDBRepo *)malloc(sizeof(STSDBRepo));
if (pRepo == NULL) { if (pRepo == NULL) {
// TODO: deal with error // TODO: deal with error
} return NULL;
}
// TODO: Initailize pMetahandle
pRepo->pMetaHandle = tsdbCreateMetaHandle(pCfg->maxTables); // TODO: Initailize pMetahandle
if (pRepo->pMetaHandle == NULL) { pRepo->pMetaHandle = tsdbCreateMetaHandle(pCfg->maxTables);
// TODO: deal with error if (pRepo->pMetaHandle == NULL) {
free(pRepo); // TODO: deal with error
return NULL; free(pRepo);
} return NULL;
}
// TODO: Initialize cache handle
pRepo->pCacheHandle = tsdbCreateCache(5); // TODO: Initialize cache handle
if (pRepo->pCacheHandle == NULL) { pRepo->pCacheHandle = tsdbCreateCache(5);
// TODO: free the object and return error if (pRepo->pCacheHandle == NULL) {
return NULL; // TODO: free the object and return error
} return NULL;
}
return (tsdb_repo_t *)pRepo;
return (tsdb_repo_t *)pRepo;
}
int32_t tsdbDropRepo(tsdb_repo_t *pRepo, int32_t *error) {
STSDBRepo *pTRepo = (STSDBRepo *)pRepo;
// TODO: Close the metaHandle
// TODO: Close the cache
return 0;
}
tsdb_repo_t *tsdbOpenRepo(char *tsdbDir, int32_t *error) {
STSDBRepo *pRepo = (STSDBRepo *)malloc(sizeof(STSDBRepo));
if (pRepo == NULL) {
return NULL;
}
// TODO: Initialize configuration from the file
{
// TODO: Initialize the pMetaHandle
}
if (pRepo->pMetaHandle == NULL) {
free(pRepo);
return NULL;
}
{
// TODO: initialize the pCacheHandle
}
if (pRepo->pCacheHandle == NULL) {
// TODO: deal with error
return NULL;
}
return (tsdb_repo_t *)pRepo;
}
int32_t tsdbCloseRepo(tsdb_repo_t *pRepo, int32_t *error) {
STSDBRepo *pTRepo = (STSDBRepo *)pRepo;
return 0;
}
int32_t tsdbConfigRepo(STSDBCfg *pCfg, int32_t *error) {
// TODO
}
STSDBRepoInfo *tsdbGetStatus(tsdb_repo_t *pRepo, int32_t *error) {
// TODO
}
int32_t tsdbCreateTable(tsdb_repo_t *pRepo, STableCfg *pCfg, int32_t *error) {
// TODO
}
int32_t tsdbAlterTable(tsdb_repo_t *pRepo, STableCfg *pCfg, int32_t *error) {
// TODO
}
STableInfo *tsdbGetTableInfo(tsdb_repo_t *pRepo, STableId tid, int32_t *error) {
// TODO
}
int32_t tsdbInsertData(tsdb_repo_t *pRepo, STableId tid, char *pData, int32_t *error) {
// TODO
} }
\ No newline at end of file
...@@ -3,27 +3,46 @@ ...@@ -3,27 +3,46 @@
#include "tsdb.h" #include "tsdb.h"
#include "tsdbMeta.h" #include "tsdbMeta.h"
SMetaHandle * tsdbCreateMetaHandle (int32_t numOfTables) { SMetaHandle *tsdbCreateMetaHandle(int32_t numOfTables) {
SMetaHandle * pMetahandle = (SMetaHandle *)malloc(sizeof(SMetaHandle)); SMetaHandle *pMetahandle = (SMetaHandle *)malloc(sizeof(SMetaHandle));
if (pMetahandle == NULL) { if (pMetahandle == NULL) {
return NULL; return NULL;
} }
pMetahandle->numOfTables = 0; pMetahandle->numOfTables = 0;
pMetahandle->numOfSuperTables = 0; pMetahandle->numOfSuperTables = 0;
pMetahandle->pTables = calloc(sizeof(STable *) * numOfTables); pMetahandle->pTables = calloc(sizeof(STable *) * numOfTables);
if (pMetahandle->pTables == NULL) { if (pMetahandle->pTables == NULL) {
free(pMetahandle); free(pMetahandle);
return NULL; return NULL;
} }
// TODO : initialize the map // TODO : initialize the map
// pMetahandle->pNameTableMap = ; // pMetahandle->pNameTableMap = ;
if (pMetahandle->pNameTableMap == NULL) { if (pMetahandle->pNameTableMap == NULL) {
free(pMetahandle->pTables); free(pMetahandle->pTables);
free(pMetahandle); free(pMetahandle);
return NULL; return NULL;
} }
return pMetahandle; return pMetahandle;
}
static int32_t tsdbCheckTableCfg(STableCfg *pCfg) { return 0; }
int32_t tsdbCreateMeterImpl(SMetaHandle *pHandle, STableCfg *pCfg) {
if (tsdbCheckTableCfg(pCfg) < 0) {
return -1;
}
// TODO:
STable *pTable = (STable *)malloc(sizeof(STable));
if (pTable == NULL) {
return -1;
}
pHandle->pTables[pCfg->tableId] = pTable;
// TODO: add name to it
return 0;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册