az: remove unused key newing

This commit is contained in:
Minglei Jin 2024-10-16 17:27:32 +08:00
parent b05784f524
commit d81fa80865
5 changed files with 28 additions and 26 deletions

View File

@ -4,7 +4,7 @@ aux_source_directory(. MNODE_ARBGROUP_TEST_SRC)
add_executable(arbgroupTest ${MNODE_ARBGROUP_TEST_SRC})
target_link_libraries(
arbgroupTest
PRIVATE dnode nodes planner gtest qcom
PRIVATE dnode nodes planner gtest qcom tcs
)
add_test(

View File

@ -72,8 +72,6 @@ static int32_t azListBucket(char const *bucketname) {
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
std::string containerName = bucketname;
@ -216,8 +214,7 @@ int32_t azPutObjectFromFileOffset(const char *file, const char *object_name, int
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
std::string accountURL = tsS3Hostname[0];
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
std::string accountURL = tsS3Hostname[0];
accountURL = "https://" + accountURL;
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
@ -278,8 +275,6 @@ int32_t azGetObjectBlockImpl(const char *object_name, int64_t offset, int64_t si
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
accountURL = "https://" + accountURL;
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
@ -353,8 +348,6 @@ void azDeleteObjectsByPrefix(const char *prefix) {
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
std::string containerName = tsS3BucketName;
@ -414,8 +407,6 @@ int32_t azGetObjectToFile(const char *object_name, const char *fileName) {
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
std::string containerName = tsS3BucketName;
@ -450,8 +441,6 @@ int32_t azGetObjectsByPrefix(const char *prefix, const char *path) {
try {
auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);
StorageSharedKeyCredential *pSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);
BlobServiceClient blobServiceClient(accountURL, sharedKeyCredential);
std::string containerName = tsS3BucketName;

View File

@ -12,8 +12,8 @@ if(${BUILD_WITH_ROCKSDB})
if (${BUILD_CONTRIB})
target_link_libraries(
stream
PUBLIC rocksdb tdb
PRIVATE os util transport qcom executor wal index tcs
PUBLIC rocksdb tdb tcs
PRIVATE os util transport qcom executor wal index
)
target_include_directories(
stream
@ -31,14 +31,14 @@ if(${BUILD_WITH_ROCKSDB})
)
target_link_libraries(
stream
PUBLIC rocksdb tdb
PRIVATE os util transport qcom executor wal index tcs
PUBLIC rocksdb tdb tcs
PRIVATE os util transport qcom executor wal index
)
else()
target_link_libraries(
stream
PUBLIC rocksdb tdb
PRIVATE os util transport qcom executor wal index tcs
PUBLIC rocksdb tdb tcs
PRIVATE os util transport qcom executor wal index
)
target_include_directories(
stream
@ -59,4 +59,3 @@ endif(${BUILD_WITH_ROCKSDB})
if(${BUILD_TEST})
ADD_SUBDIRECTORY(test)
endif(${BUILD_TEST})

View File

@ -101,4 +101,4 @@ IF(NOT TD_DARWIN)
NAME backendTest
COMMAND backendTest
)
ENDIF ()
ENDIF ()

View File

@ -4,6 +4,7 @@
#include <queue>
#include "tcs.h"
#include "tcsInt.h"
int32_t tcsInitEnv() {
int32_t code = 0;
@ -19,7 +20,21 @@ int32_t tcsInitEnv() {
tsS3AccessKeySecret[0] = "<access-key-secret/account-key>";
tsS3BucketName = "<bucket/container-name>";
*/
const char *hostname = "endpoint/<account-name>.blob.core.windows.net";
const char *accessKeyId = "<access-key-id/account-name>";
const char *accessKeySecret = "<access-key-secret/account-key>";
const char *bucketName = "<bucket/container-name>";
tstrncpy(&tsS3Hostname[0][0], hostname, TSDB_FQDN_LEN);
tstrncpy(&tsS3AccessKeyId[0][0], accessKeyId, TSDB_FQDN_LEN);
tstrncpy(&tsS3AccessKeySecret[0][0], accessKeySecret, TSDB_FQDN_LEN);
tstrncpy(tsS3BucketName, bucketName, TSDB_FQDN_LEN);
tstrncpy(tsTempDir, "/tmp/", PATH_MAX);
tsS3Enabled = true;
tsS3Ablob = true;
return code;
}
@ -28,11 +43,10 @@ int32_t tcsInitEnv() {
TEST(TcsTest, InterfaceTest) {
int code = 0;
if (!tsS3Enabled) {
(void)fprintf(stderr, "tcs not configured.\n");
return;
}
code = tcsInitEnv();
GTEST_ASSERT_EQ(code, 0);
GTEST_ASSERT_EQ(tsS3Enabled, 1);
GTEST_ASSERT_EQ(tsS3Ablob, 1);
code = tcsInit();
GTEST_ASSERT_EQ(code, 0);