Add root path in minio and replace etcd.rootPath in datanode (#8272)

issue: #7905
Signed-off-by: sunby <bingyi.sun@zilliz.com>
pull/8491/head
sunby 2021-09-24 20:50:23 +08:00 committed by GitHub
parent 12fb8290b9
commit 816bac82ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -29,6 +29,7 @@ minio:
secretAccessKey: minioadmin
useSSL: false
bucketName: "a-bucket"
rootPath: files
pulsar:
address: localhost

View File

@ -143,7 +143,7 @@ func (p *ParamTable) initFlushInsertBufferSize() {
func (p *ParamTable) initInsertBinlogRootPath() {
// GOOSE TODO: rootPath change to TenentID
rootPath, err := p.Load("etcd.rootPath")
rootPath, err := p.Load("minio.rootPath")
if err != nil {
panic(err)
}
@ -151,7 +151,7 @@ func (p *ParamTable) initInsertBinlogRootPath() {
}
func (p *ParamTable) initStatsBinlogRootPath() {
rootPath, err := p.Load("etcd.rootPath")
rootPath, err := p.Load("minio.rootPath")
if err != nil {
panic(err)
}

View File

@ -13,6 +13,7 @@ package datanode
import (
"log"
"path"
"testing"
"time"
@ -122,4 +123,15 @@ func TestParamTable(t *testing.T) {
Params.UpdatedTime = time.Now()
log.Println("UpdatedTime: ", Params.UpdatedTime)
})
t.Run("Test InsertBinlogRootPath", func(t *testing.T) {
Params.Init()
assert.Equal(t, path.Join("files", "insert_log"), Params.InsertBinlogRootPath)
})
t.Run("Test StatsBinlogRootPath", func(t *testing.T) {
p := new(ParamTable)
p.Init()
assert.Equal(t, path.Join("files", "stats_log"), Params.StatsBinlogRootPath)
})
}