tsdbFile.h 812 字节
Newer Older
H
more  
Hongze Cheng 已提交
1 2 3 4 5 6 7
#if !defined(_TD_TSDB_FILE_H_)
#define _TD_TSDB_FILE_H_

#include "tstring.h"

typedef int32_t file_id_t;

H
Hongze Cheng 已提交
8 9 10 11 12
typedef enum {
  TSDB_FILE_TYPE_HEAD,  // .head file type
  TSDB_FILE_TYPE_DATA,  // .data file type
  TSDB_FILE_TYPE_LAST,  // .last file type
  TSDB_FILE_TYPE_META   // .meta file type
H
more  
Hongze Cheng 已提交
13 14
} TSDB_FILE_TYPE;

H
Hongze Cheng 已提交
15 16 17 18 19 20 21
const char *tsdbFileSuffix[] = {
  ".head",  // TSDB_FILE_TYPE_HEAD
  ".data",  // TSDB_FILE_TYPE_DATA
  ".last",  // TSDB_FILE_TYPE_LAST
  ".meta"   // TSDB_FILE_TYPE_META
};

H
more  
Hongze Cheng 已提交
22 23 24 25 26 27
typedef struct {
  int64_t fileSize;
} SFileInfo;

typedef struct {
  tstring_t fname;
H
more  
Hongze Cheng 已提交
28
  SFileInfo fInfo;
H
more  
Hongze Cheng 已提交
29 30
} SFILE;

H
more  
Hongze Cheng 已提交
31 32 33 34 35 36 37
typedef struct {
  int64_t offset;
  int64_t skey;
  int64_t ekey;
  int16_t numOfBlocks;
} SDataBlock;

H
Hongze Cheng 已提交
38
char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type);
H
more  
Hongze Cheng 已提交
39 40

#endif  // _TD_TSDB_FILE_H_