add doc comments

This commit is contained in:
Matthew Jaffee 2022-05-27 10:57:05 -05:00 committed by Matthew Jaffee
parent a815bba520
commit 9fb68b416c
5 changed files with 10 additions and 0 deletions

4
api.go
View file

@ -1603,6 +1603,10 @@ func (api *API) ImportWithTx(ctx context.Context, qcx *Qcx, req *ImportRequest,
return errors.Wrap(err, "committing")
}
// ImportRoaringShard transactionally imports roaring-encoded data
// across many fields in a single shard. It can both set and clear
// bits and updates caches/bitDepth as appropriate, although only the
// bitmap parts happen truly transactionally.
func (api *API) ImportRoaringShard(ctx context.Context, indexName string, shard uint64, req *ImportRoaringShardRequest) error {
index, err := api.Index(ctx, indexName)
if err != nil {

View file

@ -211,6 +211,8 @@ func OptKeyTranslateBatchSize(v int) BatchOption {
}
}
// OptUseShardTransactionalEndpoint tells the batch to import using
// the newer shard-transactional endpoint.
func OptUseShardTransactionalEndpoint(use bool) BatchOption {
return func(b *Batch) error {
b.useShardTransactionalEndpoint = use

View file

@ -647,6 +647,7 @@ func (c *Client) importData(uri *pnet.URI, path string, data []byte) error {
return nil
}
// ImportRoaringShard imports into the shard-transactional endpoint.
func (c *Client) ImportRoaringShard(index string, shard uint64, request *pilosa.ImportRoaringShardRequest) error {
uris, err := c.getURIsForShard(index, shard)
if err != nil {

View file

@ -349,6 +349,8 @@ type ImportRoaringRequest struct {
UpdateExistence bool
}
// ImportRoaringShardRequest is the request for the shard
// transactional endpoint.
type ImportRoaringShardRequest struct {
// Has this request already been forwarded to all replicas? If
// Remote=false, then the handling server is responsible for

View file

@ -177,6 +177,7 @@ type unionContainerIterator struct {
cur FilterKey
}
// NewUnionContainerIterator unions multiple container iterators to one.
func NewUnionContainerIterator(iters ...ContainerIterator) ContainerIterator {
return &unionContainerIterator{
iters: iters,