func (f *IndexFile) Compacting() bool {
	f.mu.RLock()
	v := f.compacting
	f.mu.RUnlock()
	return v
}
Compacting returns true if the file is being compacted.
package tsi1
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"sync"
	"github.com/influxdata/influxdb/models"
	"github.com/influxdata/influxdb/pkg/estimator"
	"github.com/influxdata/influxdb/pkg/estimator/hll"
	"github.com/influxdata/influxdb/pkg/mmap"
	"github.com/influxdata/influxdb/tsdb"
)
const IndexFileVersion = 1
const FileSignature = "TSI1"
const (
	IndexFileVersionSize = 2
	IndexFileTrailerSize = IndexFileVersionSize +
		8 + 8 +  
		8 + 8 +  
		8 + 8 +  
		8 + 8 +  
		8 + 8 +  
		0
)
var (
	ErrInvalidIndexFile            = errors.New("invalid index file")
	ErrUnsupportedIndexFileVersion = errors.New("unsupported index file version")
)
type IndexFile struct {
	wg   sync.WaitGroup  
	data []byte
	sfile *tsdb.SeriesFile
	tblks map[string]*TagBlock  
	mblk  MeasurementBlock
	seriesIDSetData          []byte
	tombstoneSeriesIDSetData []byte
	sketch, tSketch estimator.Sketch
	level int
	id    int
	mu         sync.RWMutex
	compacting bool
	path string
}
func NewIndexFile(sfile *tsdb.SeriesFile) *IndexFile {
	return &IndexFile{
		sfile:   sfile,
		sketch:  hll.NewDefaultPlus(),
		tSketch: hll.NewDefaultPlus(),
	}
}
func (f *IndexFile) Open() error {
	defer func() {
		if err := recover(); err != nil {
			err = fmt.Errorf("[Index file: %s] %v", f.path, err)
			panic(err)
		}
	}()
	f.id, f.level = ParseFilename(f.Path())
	data, err := mmap.Map(f.Path(), 0)
	if err != nil {
		return err
	}
	return f.UnmarshalBinary(data)
}
func (f *IndexFile) Close() error {
	f.wg.Wait()
	f.sfile = nil
	f.tblks = nil
	f.mblk = MeasurementBlock{}
	return mmap.Unmap(f.data)
}
func (f *IndexFile) ID() int { return f.id }
func (f *IndexFile) Path() string { return f.path }
func (f *IndexFile) SetPath(path string) { f.path = path }
func (f *IndexFile) Level() int { return f.level }
func (f *IndexFile) Retain() { f.wg.Add(1) }
func (f *IndexFile) Release() { f.wg.Done() }
func (f *IndexFile) Size() int64 { return int64(len(f.data)) }