@@ -47,9 +47,8 @@ type Journal struct {
47
47
outChan chan * libs.FluentMsg
48
48
commitChan chan * libs.FluentMsg
49
49
50
- baseJournalDir string
51
- jjLock * sync.Mutex
52
- tag2JMap , // map[string]*journal.Journal
50
+ jjLock * sync.Mutex
51
+ tag2JMap , // map[string]*journal.Journal
53
52
tag2JJInchanMap , // map[string]chan *libs.FluentMsg
54
53
tag2JJCommitChanMap , // map[string]chan *libs.FluentMsg
55
54
tag2IDsCounter ,
@@ -133,10 +132,10 @@ func (j *Journal) CloseTag(tag string) error {
133
132
134
133
// initLegacyJJ process existed legacy data and ids
135
134
func (j * Journal ) initLegacyJJ (ctx context.Context ) {
136
- files , err := ioutil .ReadDir (j .baseJournalDir )
135
+ files , err := ioutil .ReadDir (j .BufDirPath )
137
136
if err != nil {
138
137
utils .Logger .Error ("try to read dir of journal" ,
139
- zap .String ("directory" , j .baseJournalDir ),
138
+ zap .String ("directory" , j .BufDirPath ),
140
139
zap .Error (err ))
141
140
return
142
141
}
@@ -282,12 +281,11 @@ func (j *Journal) createJournalRunner(ctx context.Context, tag string) {
282
281
283
282
utils .Logger .Info ("create new journal.Journal" , zap .String ("tag" , tag ))
284
283
jj , err := journal .NewJournal (
285
- journal .WithBufDirPath (j .BufDirPath ),
284
+ journal .WithBufDirPath (filepath . Join ( j .BufDirPath , tag ) ),
286
285
journal .WithBufSizeByte (j .BufSizeBytes ),
287
286
journal .WithIsCompress (j .IsCompress ),
288
287
journal .WithCommitIDTTL (j .CommittedIDTTL ),
289
288
journal .WithIsAggresiveGC (false ),
290
- journal .WithBufDirPath (filepath .Join (j .baseJournalDir , tag )),
291
289
)
292
290
if err != nil {
293
291
utils .Logger .Panic ("new journal" , zap .Error (err ))
0 commit comments