MCPcopy Create free account
hub / github.com/brimdata/super / NewVectorWriter

Function NewVectorWriter

db/data/vector.go:75–87  ·  view source on GitHub ↗
(ctx context.Context, engine storage.Engine, path *storage.URI, id ksuid.KSUID)

Source from the content-addressed store, hash-verified

73}
74
75func NewVectorWriter(ctx context.Context, engine storage.Engine, path *storage.URI, id ksuid.KSUID) (*VectorWriter, error) {
76 put, err := engine.Put(ctx, VectorURI(path, id))
77 if err != nil {
78 return nil, err
79 }
80 delete := func() {
81 DeleteVector(context.Background(), engine, path, id)
82 }
83 return &VectorWriter{
84 Serializer: csupio.NewSerializer(bufwriter.New(put)),
85 delete: delete,
86 }, nil
87}
88
89func (w *VectorWriter) Abort() {
90 w.Close()

Callers 2

CreateVectorFunction · 0.85
NewVectorWriterMethod · 0.85

Calls 5

NewSerializerFunction · 0.92
NewFunction · 0.92
VectorURIFunction · 0.85
DeleteVectorFunction · 0.70
PutMethod · 0.65

Tested by

no test coverage detected