MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / Close

Method Close

hintfile.go:456–472  ·  view source on GitHub ↗

Close closes the hint file

()

Source from the content-addressed store, hash-verified

454
455// Close closes the hint file
456func (w *HintFileWriter) Close() error {
457 var err error
458
459 if w.writer != nil {
460 if flushErr := w.writer.Flush(); flushErr != nil {
461 err = flushErr
462 }
463 }
464
465 if w.file != nil {
466 if closeErr := w.file.Close(); closeErr != nil && err == nil {
467 err = closeErr
468 }
469 }
470
471 return err
472}

Callers 7

BenchmarkHintFileWriteFunction · 0.95
BenchmarkHintFileReadFunction · 0.95
TestHintFileWriterReaderFunction · 0.95
TestHintFilePartialReadFunction · 0.95

Calls 2

CloseMethod · 0.65
FlushMethod · 0.45

Tested by 6

BenchmarkHintFileWriteFunction · 0.76
BenchmarkHintFileReadFunction · 0.76
TestHintFileWriterReaderFunction · 0.76
TestHintFilePartialReadFunction · 0.76