directoryStaticSet returns the set of static-set schemas that represent the children of n. If the number of children is small (<10000), they're all members of the first (and only) static-set returned. Otherwise they are split and spread on several subsets (i.e. "mergeSets") which are all returned.
()
| 356 | // of the first (and only) static-set returned. Otherwise they are split and spread |
| 357 | // on several subsets (i.e. "mergeSets") which are all returned. |
| 358 | func (n *node) directoryStaticSet() ([]*schema.Blob, error) { |
| 359 | var members []blob.Ref |
| 360 | ss := schema.NewStaticSet() |
| 361 | for _, c := range n.children { |
| 362 | pr, err := c.PutResult() |
| 363 | if err != nil { |
| 364 | return nil, fmt.Errorf("Error populating directory static set for child %q: %v", c.fullPath, err) |
| 365 | } |
| 366 | members = append(members, pr.BlobRef) |
| 367 | } |
| 368 | subsets := ss.SetStaticSetMembers(members) |
| 369 | allSets := []*schema.Blob{ss.Blob()} |
| 370 | allSets = append(allSets, subsets...) |
| 371 | return allSets, nil |
| 372 | } |
| 373 | |
| 374 | func (up *Uploader) uploadNode(ctx context.Context, n *node) (*client.PutResult, error) { |
| 375 | fi := n.fi |
no test coverage detected