func (c *core) Load(ctx context.Context, db ycsb.DB, totalCount int64) error {
	return nil
}
Load implements the Workload Load interface.
package workload
import (
	"bytes"
	"context"
	"fmt"
	"math"
	"math/rand"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/magiconair/properties"
	"github.com/pingcap/go-ycsb/pkg/generator"
	"github.com/pingcap/go-ycsb/pkg/measurement"
	"github.com/pingcap/go-ycsb/pkg/prop"
	"github.com/pingcap/go-ycsb/pkg/util"
	"github.com/pingcap/go-ycsb/pkg/ycsb"
)
type contextKey string
const stateKey = contextKey("core")
type coreState struct {
	r *rand.Rand
	fieldNames []string
}
type operationType int64
const (
	read operationType = iota + 1
	update
	insert
	scan
	readModifyWrite
)
type core struct {
	p *properties.Properties
	table      string
	fieldCount int64
	fieldNames []string
	fieldLengthGenerator ycsb.Generator
	readAllFields        bool
	writeAllFields       bool
	dataIntegrity        bool
	keySequence                  ycsb.Generator
	operationChooser             *generator.Discrete
	keyChooser                   ycsb.Generator
	fieldChooser                 ycsb.Generator
	transactionInsertKeySequence *generator.AcknowledgedCounter
	scanLength                   ycsb.Generator
	orderedInserts               bool
	recordCount                  int64
	zeroPadding                  int64
	insertionRetryLimit          int64
	insertionRetryInterval       int64
	valuePool sync.Pool
}
func getFieldLengthGenerator(p *properties.Properties) ycsb.Generator {
	var fieldLengthGenerator ycsb.Generator
	fieldLengthDistribution := p.GetString(prop.FieldLengthDistribution, prop.FieldLengthDistributionDefault)
	fieldLength := p.GetInt64(prop.FieldLength, prop.FieldLengthDefault)
	fieldLengthHistogram := p.GetString(prop.FieldLengthHistogramFile, prop.FieldLengthHistogramFileDefault)
	switch strings.ToLower(fieldLengthDistribution) {
	case "constant":
		fieldLengthGenerator = generator.NewConstant(fieldLength)
	case "uniform":
		fieldLengthGenerator = generator.NewUniform(1, fieldLength)
	case "zipfian":
		fieldLengthGenerator = generator.NewZipfianWithRange(1, fieldLength, generator.ZipfianConstant)
	case "histogram":
		fieldLengthGenerator = generator.NewHistogramFromFile(fieldLengthHistogram)
	default:
		util.Fatalf("unknown field length distribution %s", fieldLengthDistribution)
	}
	return fieldLengthGenerator
}
func createOperationGenerator(p *properties.Properties) *generator.Discrete {
	readProportion := p.GetFloat64(prop.ReadProportion, prop.ReadProportionDefault)
	updateProportion := p.GetFloat64(prop.UpdateProportion, prop.UpdateProportionDefault)
	insertProportion := p.GetFloat64(prop.InsertProportion, prop.InsertProportionDefault)
	scanProportion := p.GetFloat64(prop.ScanProportion, prop.ScanProportionDefault)
	readModifyWriteProportion := p.GetFloat64(prop.ReadModifyWriteProportion, prop.ReadModifyWriteProportionDefault)
	operationChooser := generator.NewDiscrete()
	if readProportion > 0 {
		operationChooser.Add(readProportion, int64(read))
	}
	if updateProportion > 0 {
		operationChooser.Add(updateProportion, int64(update))
	}
	if insertProportion > 0 {
		operationChooser.Add(insertProportion, int64(insert))
	}
	if scanProportion > 0 {
		operationChooser.Add(scanProportion, int64(scan))
	}
	if readModifyWriteProportion > 0 {
		operationChooser.Add(readModifyWriteProportion, int64(readModifyWrite))
	}
	return operationChooser
}
func (c *core) Init(db ycsb.DB) error {
	sqlDB := db.ToSqlDB()
	if sqlDB != nil {
		tableName := c.p.GetString(prop.TableName, prop.TableNameDefault)
		if c.p.GetBool(prop.DropData, prop.DropDataDefault) && !c.p.GetBool(prop.DoTransactions, true) {
			if _, err := sqlDB.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s", tableName)); err != nil {
				return err
			}
		}
		fieldCount := c.p.GetInt64(prop.FieldCount, prop.FieldCountDefault)
		fieldLength := c.p.GetInt64(prop.FieldLength, prop.FieldLengthDefault)
		buf := new(bytes.Buffer)
		s := fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (YCSB_KEY VARCHAR(64) PRIMARY KEY", tableName)
		buf.WriteString(s)
		for i := int64(0); i < fieldCount; i++ {
			buf.WriteString(fmt.Sprintf(", FIELD%d VARCHAR(%d)", i, fieldLength))
		}
		buf.WriteString(");")
		_, err := sqlDB.Exec(buf.String())
		return err
	}
	return nil
}