2023-08-04 05:31:00 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can use, redistribute, and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3
|
|
|
|
|
* or later ("AGPL"), as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _TD_VND_COS_H_
|
|
|
|
|
#define _TD_VND_COS_H_
|
|
|
|
|
|
2023-11-02 12:13:29 +00:00
|
|
|
#include "os.h"
|
2023-08-04 05:31:00 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-09-15 08:19:21 +00:00
|
|
|
#define S3_BLOCK_CACHE
|
|
|
|
|
|
2023-11-02 12:13:29 +00:00
|
|
|
extern int8_t tsS3StreamEnabled;
|
2023-09-15 08:19:21 +00:00
|
|
|
extern int8_t tsS3Enabled;
|
|
|
|
|
extern int32_t tsS3BlockSize;
|
|
|
|
|
extern int32_t tsS3BlockCacheSize;
|
2023-11-02 02:10:03 +00:00
|
|
|
extern int32_t tsS3PageCacheSize;
|
2023-10-30 06:58:22 +00:00
|
|
|
extern int32_t tsS3UploadDelaySec;
|
2023-08-04 05:31:00 +00:00
|
|
|
|
|
|
|
|
int32_t s3Init();
|
|
|
|
|
void s3CleanUp();
|
2024-04-08 02:33:02 +00:00
|
|
|
int32_t s3CheckCfg();
|
2023-08-15 07:14:34 +00:00
|
|
|
int32_t s3PutObjectFromFile(const char *file, const char *object);
|
2023-11-30 09:20:21 +00:00
|
|
|
int32_t s3PutObjectFromFile2(const char *file, const char *object, int8_t withcp);
|
2024-04-08 02:33:02 +00:00
|
|
|
int32_t s3PutObjectFromFileOffset(const char *file, const char *object_name, int64_t offset, int64_t size);
|
2023-08-18 08:38:26 +00:00
|
|
|
void s3DeleteObjectsByPrefix(const char *prefix);
|
2024-04-08 02:33:02 +00:00
|
|
|
int32_t s3DeleteObjects(const char *object_name[], int nobject);
|
2023-08-04 07:37:52 +00:00
|
|
|
bool s3Exists(const char *object_name);
|
2023-08-04 08:35:35 +00:00
|
|
|
bool s3Get(const char *object_name, const char *path);
|
2023-11-09 01:32:13 +00:00
|
|
|
int32_t s3GetObjectBlock(const char *object_name, int64_t offset, int64_t size, bool check, uint8_t **ppBlock);
|
2023-11-09 06:06:15 +00:00
|
|
|
int32_t s3GetObjectsByPrefix(const char *prefix, const char *path);
|
2023-08-07 07:59:37 +00:00
|
|
|
void s3EvictCache(const char *path, long object_size);
|
2023-08-04 08:35:35 +00:00
|
|
|
long s3Size(const char *object_name);
|
2024-04-28 01:50:21 +00:00
|
|
|
int32_t s3GetObjectToFile(const char *object_name, const char *fileName);
|
2023-08-07 07:59:37 +00:00
|
|
|
|
2024-04-08 02:33:02 +00:00
|
|
|
#define S3_DATA_CHUNK_PAGES (256 * 1024 * 1024)
|
|
|
|
|
|
2023-08-04 05:31:00 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /*_TD_VND_COS_H_*/
|