// createCollection swallows collection-already-exists errors.
483984
func createCollection(raw *mgo.Collection, spec *mgo.CollectionInfo) error {
	err := raw.Create(spec)
	// The lack of error code for this error was reported upstream:
	//     https://jira.mongodb.org/browse/SERVER-6992
	if err == nil || strings.HasSuffix(err.Error(), "already exists") {
		return nil
	}
	return err
}
1112635
func NewMockCollection(ctrl *gomock.Controller) *MockCollection {
	mock := &MockCollection{ctrl: ctrl}
	mock.recorder = &MockCollectionMockRecorder{mock}
	return mock
}
193268
func NewCollection(options CollectionOptions) (
	Collection, error) {
	histograms := make(ghistogram.Histograms)
	histograms["ExecuteBatchBytes"] =
		ghistogram.NewNamedHistogram("ExecuteBatchBytes", 10, 4, 4)
	histograms["ExecuteBatchOpsCount"] =
		ghistogram.NewNamedHistogram("ExecuteBatchOpsCount", 10, 4, 4)
	histograms["ExecuteBatchUsecs"] =
		ghistogram.NewNamedHistogram("ExecuteBatchUsecs", 10, 4, 4)
	histograms["MergerUsecs"] =
		ghistogram.NewNamedHistogram("MergerUsecs", 10, 4, 4)
	histograms["MutationKeyBytes"] =
		ghistogram.NewNamedHistogram("MutationKeyBytes", 10, 4, 4)
	histograms["MutationValBytes"] =
		ghistogram.NewNamedHistogram("MutationValBytes", 10, 4, 4)

	c := &collection{
		options:            &options,
		stopCh:             make(chan struct{}),
		pingMergerCh:       make(chan ping, 10),
		doneMergerCh:       make(chan struct{}),
		donePersisterCh:    make(chan struct{}),
		lowerLevelSnapshot: NewSnapshotWrapper(options.LowerLevelInit, nil),
		stats:              &CollectionStats{},
		histograms:         histograms,
	}

	c.stackDirtyTopCond = sync.NewCond(&c.m)
	c.stackDirtyBaseCond = sync.NewCond(&c.m)

	return c, nil
}
77931
func (c *FakePersistentVolumeClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &corev1.PersistentVolumeClaimList{})
	return err
}
927210
func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions)

	_, err := c.Fake.Invokes(action, &apiextensions.CustomResourceDefinitionList{})
	return err
}
341175
func NewFeatureCollection(features []*Feature) *FeatureCollection {
	if features == nil {
		features = make([]*Feature, 0)
	}
	return &FeatureCollection{Type: FEATURECOLLECTION, Features: features}
}
33144
func (db *DB) create(name string) error {
	if _, exists := db.cols[name]; exists {
		return fmt.Errorf("Collection %s already exists", name)
	} else if err := os.MkdirAll(path.Join(db.path, name), 0700); err != nil {
		return err
	} else if db.cols[name], err = OpenCol(db, name); err != nil {
		return err
	}
	return nil
}
1235218
func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &appsv1.DaemonSetList{})
	return err
}
1127861
func (s *Store) OpenCollection(options StoreOptions,
	persistOptions StorePersistOptions) (Collection, error) {
	return s.openCollection(options, persistOptions)
}
1001850
func (s *OptionSetting) SetIsCollection(v bool) *OptionSetting {
	s.IsCollection = &v
	return s
}
882351
func (c *FakeSecurityContextConstraints) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(securitycontextconstraintsResource, listOptions)

	_, err := c.Fake.Invokes(action, &security.SecurityContextConstraintsList{})
	return err
}
1250172
func (m *Manager) Create(see *See) error {
	see.ID = bson.NewObjectId()
	err := m.collection.Insert(see)
	if mgo.IsDup(err) {
		return db.ErrDuplicate
	}
	return err
}
131404
func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &appsv1.ReplicaSetList{})
	return err
}
766232
func (c *FakeWorkflows) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(workflowsResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &v1alpha1.WorkflowList{})
	return err
}
235647
func (c *FakeAPIServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOptions)

	_, err := c.Fake.Invokes(action, &apiregistration.APIServiceList{})
	return err
}
10535
func (e Embedded) AddCollection(rel Relation, r ResourceCollection) {
	n := e[rel]
	if n == nil {
		//new embed
		e[rel] = r
		return
	}

	if nc, ok := n.([]*Resource); ok {
		e[rel] = append(nc, r...)
		return
	}

	if nr, ok := n.(*Resource); ok {
		e[rel] = append([]*Resource{nr}, r...)
	}

}
1206069
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions)

	_, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{})
	return err
}