示例#1
0
func (tc *stConstructor_Table) init(t *testing.T, ho *stHarnessOpt) error {
	tc.t = t
	tc.o = &opt.Options{
		BlockSize:            512,
		BlockRestartInterval: 3,
	}
	tc.writer = table.NewWriter(&tc.buf, tc.o)
	return nil
}
示例#2
0
// Creates an empty table and returns table writer.
func (t *tOps) create() (*tWriter, error) {
	file := t.s.getTableFile(t.s.allocFileNum())
	fw, err := file.Create()
	if err != nil {
		return nil, err
	}
	return &tWriter{
		t:    t,
		file: file,
		w:    fw,
		tw:   table.NewWriter(fw, t.s.o),
	}, nil
}