tcs: fix mac stb link issue
This commit is contained in:
parent
af6ff0dd6a
commit
b05784f524
|
@ -49,13 +49,13 @@ static void azDumpCfgByEp(int8_t epIndex) {
|
||||||
"%-24s %s\n"
|
"%-24s %s\n"
|
||||||
"%-24s %s\n"
|
"%-24s %s\n"
|
||||||
"%-24s %s\n"
|
"%-24s %s\n"
|
||||||
// "%-24s %s\n"
|
"%-24s %s\n"
|
||||||
"%-24s %s\n"
|
"%-24s %s\n"
|
||||||
"%-24s %s\n",
|
"%-24s %s\n",
|
||||||
"hostName", tsS3Hostname[epIndex],
|
"hostName", tsS3Hostname[epIndex],
|
||||||
"bucketName", tsS3BucketName,
|
"bucketName", tsS3BucketName,
|
||||||
"protocol", "https only",
|
"protocol", "https only",
|
||||||
//"uristyle", (uriStyleG[epIndex] == S3UriStyleVirtualHost ? "virtualhost" : "path"),
|
"uristyle", "path only",
|
||||||
"accessKey", tsS3AccessKeyId[epIndex],
|
"accessKey", tsS3AccessKeyId[epIndex],
|
||||||
"accessKeySecret", tsS3AccessKeySecret[epIndex]);
|
"accessKeySecret", tsS3AccessKeySecret[epIndex]);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
|
@ -13,7 +13,7 @@ if(${BUILD_WITH_ROCKSDB})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
stream
|
stream
|
||||||
PUBLIC rocksdb tdb
|
PUBLIC rocksdb tdb
|
||||||
PRIVATE os util transport qcom executor wal index
|
PRIVATE os util transport qcom executor wal index tcs
|
||||||
)
|
)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
stream
|
stream
|
||||||
|
@ -32,13 +32,13 @@ if(${BUILD_WITH_ROCKSDB})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
stream
|
stream
|
||||||
PUBLIC rocksdb tdb
|
PUBLIC rocksdb tdb
|
||||||
PRIVATE os util transport qcom executor wal index
|
PRIVATE os util transport qcom executor wal index tcs
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
stream
|
stream
|
||||||
PUBLIC rocksdb tdb
|
PUBLIC rocksdb tdb
|
||||||
PRIVATE os util transport qcom executor wal index
|
PRIVATE os util transport qcom executor wal index tcs
|
||||||
)
|
)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
stream
|
stream
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
aux_source_directory(src TOS_SRC)
|
aux_source_directory(src TCS_SRC)
|
||||||
|
|
||||||
add_library(tcs STATIC ${TOS_SRC})
|
add_library(tcs STATIC ${TCS_SRC})
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
tcs
|
tcs
|
||||||
PUBLIC "${TD_SOURCE_DIR}/include/libs/tcs"
|
PUBLIC "${TD_SOURCE_DIR}/include/libs/tcs"
|
||||||
|
|
|
@ -43,6 +43,7 @@ int32_t tcsInit() {
|
||||||
tcs.GetObjectsByPrefix = s3GetObjectsByPrefix;
|
tcs.GetObjectsByPrefix = s3GetObjectsByPrefix;
|
||||||
tcs.DeleteObjects = s3DeleteObjects;
|
tcs.DeleteObjects = s3DeleteObjects;
|
||||||
tcs.GetObjectToFile = s3GetObjectToFile;
|
tcs.GetObjectToFile = s3GetObjectToFile;
|
||||||
|
|
||||||
} else if (TOS_PROTO_ABLOB == proto) {
|
} else if (TOS_PROTO_ABLOB == proto) {
|
||||||
tcs.Begin = azBegin;
|
tcs.Begin = azBegin;
|
||||||
tcs.End = azEnd;
|
tcs.End = azEnd;
|
||||||
|
@ -74,19 +75,19 @@ int32_t tcsCheckCfg() {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
if (!tsS3Enabled) {
|
if (!tsS3Enabled) {
|
||||||
(void)fprintf(stderr, "s3 not configured.\n");
|
(void)fprintf(stderr, "tcs not configured.\n");
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tcsInit();
|
code = tcsInit();
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
(void)fprintf(stderr, "failed to initialize s3.\n");
|
(void)fprintf(stderr, "failed to initialize tcs.\n");
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tcs.CheckCfg();
|
code = tcs.CheckCfg();
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
(void)fprintf(stderr, "failed to check s3.\n");
|
(void)fprintf(stderr, "failed to check tcs.\n");
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,67 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
|
#include "tcs.h"
|
||||||
|
|
||||||
|
int32_t tcsInitEnv() {
|
||||||
|
int32_t code = 0;
|
||||||
|
|
||||||
|
extern char tsS3Hostname[][TSDB_FQDN_LEN];
|
||||||
|
extern char tsS3AccessKeyId[][TSDB_FQDN_LEN];
|
||||||
|
extern char tsS3AccessKeySecret[][TSDB_FQDN_LEN];
|
||||||
|
extern char tsS3BucketName[TSDB_FQDN_LEN];
|
||||||
|
|
||||||
|
/* TCS parameter format
|
||||||
|
tsS3Hostname[0] = "endpoint/<account-name>.blob.core.windows.net";
|
||||||
|
tsS3AccessKeyId[0] = "<access-key-id/account-name>";
|
||||||
|
tsS3AccessKeySecret[0] = "<access-key-secret/account-key>";
|
||||||
|
tsS3BucketName = "<bucket/container-name>";
|
||||||
|
*/
|
||||||
|
tsS3Enabled = true;
|
||||||
|
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TEST(TcsTest, DISABLE_InterfaceTest) {
|
||||||
|
TEST(TcsTest, InterfaceTest) {
|
||||||
|
int code = 0;
|
||||||
|
|
||||||
|
if (!tsS3Enabled) {
|
||||||
|
(void)fprintf(stderr, "tcs not configured.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
code = tcsInit();
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
code = tcsCheckCfg();
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
/*
|
||||||
|
code = tcsPutObjectFromFileOffset(file, object_name, offset, size);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
code = tcsGetObjectBlock(object_name, offset, size, check, ppBlock);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
tcsDeleteObjectsByPrefix(prefix);
|
||||||
|
// list object to check
|
||||||
|
|
||||||
|
code = tcsPutObjectFromFile2(file, object, withcp);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
code = tcsGetObjectsByPrefix(prefix, path);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
code = tcsDeleteObjects(object_name, nobject);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
code = tcsGetObjectToFile(object_name, fileName);
|
||||||
|
GTEST_ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
// GTEST_ASSERT_NE(pEnv, nullptr);
|
||||||
|
*/
|
||||||
|
|
||||||
|
tcsUninit();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include "walInt.h"
|
#include "walInt.h"
|
||||||
const char* ranStr = "tvapq02tcp";
|
const char* ranStr = "tvapq02tcp";
|
||||||
|
|
Loading…
Reference in New Issue