Skip to content

Commit d7dc45d

Browse files
Removed deprecated code from V2 (#693)
1 parent e082d30 commit d7dc45d

21 files changed

+9
-523
lines changed

v2/arangodb/client_database.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ import (
2525
)
2626

2727
type ClientDatabase interface {
28-
// Deprecated: use GetDatabase instead
29-
//
30-
// Database opens a connection to an existing database.
31-
// If no database with given name exists, an NotFoundError is returned.
32-
Database(ctx context.Context, name string) (Database, error)
33-
3428
// GetDatabase opens a connection to an existing database.
3529
// If no database with given name exists, an NotFoundError is returned.
3630
GetDatabase(ctx context.Context, name string, options *GetDatabaseOptions) (Database, error)

v2/arangodb/collection.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ type Collection interface {
4545
// Properties fetches extended information about the collection.
4646
Properties(ctx context.Context) (CollectionProperties, error)
4747

48-
// Deprecated: use 'SetPropertiesV2' instead
49-
//
50-
// SetProperties allows modifying collection parameters
51-
SetProperties(ctx context.Context, options SetCollectionPropertiesOptions) error
52-
5348
// SetProperties allows modifying collection parameters
5449
SetPropertiesV2(ctx context.Context, options SetCollectionPropertiesOptionsV2) error
5550

v2/arangodb/collection_impl.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,6 @@ func (c collection) Properties(ctx context.Context) (CollectionProperties, error
139139
}
140140
}
141141

142-
func (c collection) SetProperties(ctx context.Context, options SetCollectionPropertiesOptions) error {
143-
urlEndpoint := c.url("collection", "properties")
144-
145-
var response struct {
146-
shared.ResponseStruct `json:",inline"`
147-
}
148-
149-
resp, err := connection.CallPut(ctx, c.connection(), urlEndpoint, &response, options, c.withModifiers()...)
150-
if err != nil {
151-
return errors.WithStack(err)
152-
}
153-
154-
switch code := resp.Code(); code {
155-
case http.StatusOK:
156-
return nil
157-
default:
158-
return response.AsArangoErrorWithCode(code)
159-
}
160-
}
161-
162142
func (c collection) SetPropertiesV2(ctx context.Context, options SetCollectionPropertiesOptionsV2) error {
163143
urlEndpoint := c.url("collection", "properties")
164144

v2/arangodb/collection_indexes.go

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ type CollectionIndexes interface {
5959
// fields The index is returned, together with a boolean indicating if the index was newly created (true) or pre-existing (false).
6060
EnsureTTLIndex(ctx context.Context, fields []string, expireAfter int, options *CreateTTLIndexOptions) (IndexResponse, bool, error)
6161

62-
// EnsureZKDIndex
63-
// The previously experimental `zkd` index is now stable and has been renamed to `mdi`.
64-
// Existing indexes keep the `zkd` type. The HTTP API still allows the old name to create new indexes that behave
65-
// exactly like `mdi` indexes but this is discouraged. The `zkd` alias may get removed in a future version.
66-
//
67-
// Deprecated: since 3.12 version use EnsureMKDIndex instead.
68-
EnsureZKDIndex(ctx context.Context, fields []string, options *CreateZKDIndexOptions) (IndexResponse, bool, error)
69-
7062
// EnsureMDIIndex creates a multidimensional index for the collection, if it does not already exist.
7163
// The index is returned, together with a boolean indicating if the index was newly created (true) or pre-existing (false).
7264
// Available in ArangoDB 3.12 and later.
@@ -114,12 +106,6 @@ const (
114106
// Documents which are expired are eventually removed by a background thread.
115107
TTLIndexType = IndexType("ttl")
116108

117-
// ZKDIndexType == multi-dimensional index. The zkd index type is an experimental index for indexing two- or higher dimensional data such as time ranges,
118-
// for efficient intersection of multiple range queries.
119-
//
120-
// Deprecated: since 3.12 version use MDIIndexType instead.
121-
ZKDIndexType = IndexType("zkd")
122-
123109
// MDIIndexType is multidimensional index for indexing two- or higher dimensional data such as time ranges,
124110
// for efficient intersection of multiple range queries.
125111
// Available in ArangoDB 3.12 and later.
@@ -132,26 +118,6 @@ const (
132118

133119
// InvertedIndexType can be used to speed up a broad range of AQL queries, from simple to complex, including full-text search
134120
InvertedIndexType = IndexType("inverted")
135-
136-
// FullTextIndex
137-
//
138-
// Deprecated: since 3.10 version. Use ArangoSearch view instead.
139-
// It is ued just for the read compatibility with older versions.
140-
FullTextIndex = IndexType("fulltext")
141-
142-
// HashIndex are an aliases for the persistent index type and should no longer be used to create new indexes.
143-
// The aliases will be removed in a future version.
144-
// It is ued just for the read compatibility with older versions.
145-
//
146-
// Deprecated: use PersistentIndexType instead
147-
HashIndex = IndexType("hash")
148-
149-
// SkipListIndex are an aliases for the persistent index type and should no longer be used to create new indexes.
150-
// The aliases will be removed in a future version.
151-
// It is ued just for the read compatibility with older versions.
152-
//
153-
// Deprecated: use PersistentIndexType instead
154-
SkipListIndex = IndexType("skiplist")
155121
)
156122

157123
// IndexResponse is the response from the Index list method
@@ -302,29 +268,10 @@ type CreateTTLIndexOptions struct {
302268
InBackground *bool `json:"inBackground,omitempty"`
303269
}
304270

305-
// ZKDFieldType
306-
//
307-
// Deprecated: use MDIFieldType instead
308-
type ZKDFieldType string
309-
310-
// ZKDDoubleFieldType
311-
//
312-
// Deprecated: use MDIDoubleFieldType instead
313-
const ZKDDoubleFieldType ZKDFieldType = "double"
314-
315271
type MDIFieldType string
316272

317273
const MDIDoubleFieldType MDIFieldType = "double"
318274

319-
// CreateZKDIndexOptions provides specific options for creating a ZKD index
320-
type CreateZKDIndexOptions struct {
321-
// Name optional user defined name used for hints in AQL queries
322-
Name string `json:"name,omitempty"`
323-
324-
// FieldValueTypes is required and the only allowed value is "double". Future extensions of the index will allow other types.
325-
FieldValueTypes ZKDFieldType `json:"fieldValueTypes,required"`
326-
}
327-
328275
// CreateMDIIndexOptions provides specific options for creating a MKD index
329276
type CreateMDIIndexOptions struct {
330277
// Name optional user defined name used for hints in AQL queries

v2/arangodb/collection_indexes_impl.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,6 @@ func (c *collectionIndexes) EnsureTTLIndex(ctx context.Context, fields []string,
159159
return newIndexResponse(&result), created, err
160160
}
161161

162-
func (c *collectionIndexes) EnsureZKDIndex(ctx context.Context, fields []string, options *CreateZKDIndexOptions) (IndexResponse, bool, error) {
163-
reqData := struct {
164-
Type IndexType `json:"type"`
165-
Fields []string `json:"fields"`
166-
*CreateZKDIndexOptions
167-
}{
168-
Type: ZKDIndexType,
169-
Fields: fields,
170-
CreateZKDIndexOptions: options,
171-
}
172-
173-
result := responseIndex{}
174-
created, err := c.ensureIndex(ctx, &reqData, &result)
175-
return newIndexResponse(&result), created, err
176-
}
177-
178162
func (c *collectionIndexes) EnsureMDIIndex(ctx context.Context, fields []string, options *CreateMDIIndexOptions) (IndexResponse, bool, error) {
179163
reqData := struct {
180164
Type IndexType `json:"type"`

v2/arangodb/collection_opts.go

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ type CollectionExtendedInfo struct {
7575
AllowUserKeys bool `json:"allowUserKeys,omitempty"`
7676
} `json:"keyOptions,omitempty"`
7777

78-
// Deprecated: use 'WriteConcern' instead.
79-
MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
80-
8178
// NumberOfShards is the number of shards of the collection.
8279
// Only available in cluster setup.
8380
NumberOfShards int `json:"numberOfShards,omitempty"`
@@ -125,34 +122,9 @@ type CollectionExtendedInfo struct {
125122
type CollectionProperties struct {
126123
CollectionExtendedInfo
127124

128-
// The number of buckets into which indexes using a hash table are split. The default is 16 and this number has to be a power
129-
// of 2 and less than or equal to 1024. For very large collections one should increase this to avoid long pauses when the hash
130-
// table has to be initially built or resized, since buckets are resized individually and can be initially built in parallel.
131-
// For example, 64 might be a sensible value for a collection with 100 000 000 documents.
132-
// Currently, only the edge index respects this value, but other index types might follow in future ArangoDB versions.
133-
// Changes are applied when the collection is loaded the next time.
134-
//
135-
// Deprecated: since 3.7 version. It is related only to MMFiles.
136-
IndexBuckets int `json:"indexBuckets,omitempty"`
137-
138-
// DoCompact specifies whether or not the collection will be compacted.
139-
//
140-
// Deprecated: since 3.7 version. It is related only to MMFiles.
141-
DoCompact bool `json:"doCompact,omitempty"`
142-
143125
// JournalSize is the maximal size setting for journals / datafiles in bytes.
144126
JournalSize int64 `json:"journalSize,omitempty"`
145127

146-
// If true then the collection data is kept in-memory only and not made persistent.
147-
// Unloading the collection will cause the collection data to be discarded. Stopping or re-starting the server will also
148-
// cause full loss of data in the collection. Setting this option will make the resulting collection be slightly faster
149-
// than regular collections because ArangoDB does not enforce any synchronization to disk and does not calculate any
150-
// CRC checksums for datafiles (as there are no datafiles). This option should therefore be used for cache-type collections only,
151-
// and not for data that cannot be re-created otherwise. (The default is false)
152-
//
153-
// Deprecated: since 3.7 version. It is related only to MMFiles.
154-
IsVolatile bool `json:"isVolatile,omitempty"`
155-
156128
// SmartJoinAttribute
157129
// See documentation for SmartJoins.
158130
// This requires ArangoDB Enterprise Edition.
@@ -184,37 +156,7 @@ func (p *CollectionProperties) IsSatellite() bool {
184156
return p.ReplicationFactor == ReplicationFactorSatellite
185157
}
186158

187-
// Deprecated: use 'SetCollectionPropertiesOptionsV2' instead
188-
//
189159
// SetCollectionPropertiesOptions contains data for Collection.SetProperties.
190-
type SetCollectionPropertiesOptions struct {
191-
// If true then creating or changing a document will wait until the data has been synchronized to disk.
192-
WaitForSync *bool `json:"waitForSync,omitempty"`
193-
194-
// The maximal size of a journal or datafile in bytes. The value must be at least 1048576 (1 MB). Note that when changing the journalSize value, it will only have an effect for additional journals or datafiles that are created. Already existing journals or datafiles will not be affected.
195-
JournalSize int64 `json:"journalSize,omitempty"`
196-
197-
// ReplicationFactor contains how many copies of each shard are kept on different DBServers.
198-
// Only available in cluster setup.
199-
ReplicationFactor ReplicationFactor `json:"replicationFactor,omitempty"`
200-
201-
// Deprecated: use 'WriteConcern' instead
202-
MinReplicationFactor int `json:"minReplicationFactor,omitempty"`
203-
204-
// WriteConcern contains how many copies must be available before a collection can be written.
205-
// Available from 3.6 arangod version.
206-
WriteConcern int `json:"writeConcern,omitempty"`
207-
208-
// CacheEnabled set cacheEnabled option in collection properties
209-
CacheEnabled *bool `json:"cacheEnabled,omitempty"`
210-
211-
// Schema for collection validation
212-
Schema *CollectionSchemaOptions `json:"schema,omitempty"`
213-
214-
// ComputedValues let configure collections to generate document attributes when documents are created or modified, using an AQL expression
215-
ComputedValues []ComputedValue `json:"computedValues,omitempty"`
216-
}
217-
218160
type SetCollectionPropertiesOptionsV2 struct {
219161
// If true then creating or changing a document will wait until the data has been synchronized to disk.
220162
WaitForSync *bool `json:"waitForSync,omitempty"`
@@ -226,9 +168,6 @@ type SetCollectionPropertiesOptionsV2 struct {
226168
// Only available in cluster setup.
227169
ReplicationFactor *ReplicationFactor `json:"replicationFactor,omitempty"`
228170

229-
// Deprecated: use 'WriteConcern' instead
230-
MinReplicationFactor *int `json:"minReplicationFactor,omitempty"`
231-
232171
// WriteConcern contains how many copies must be available before a collection can be written.
233172
// Available from 3.6 arangod version.
234173
WriteConcern *int `json:"writeConcern,omitempty"`

v2/arangodb/database_analyzer.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ import (
2525
)
2626

2727
type DatabaseAnalyzer interface {
28-
// Deprecated: Use EnsureCreatedAnalyzer instead
29-
//
30-
// EnsureAnalyzer ensures that the given analyzer exists. If it does not exist, it is created.
31-
// The function returns whether the analyzer already existed or not.
32-
EnsureAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (bool, Analyzer, error)
33-
3428
// EnsureCreatedAnalyzer creates an Analyzer for the database, if it does not already exist.
3529
// It returns the Analyser object together with a boolean indicating if the Analyzer was newly created (true) or pre-existing (false).
3630
EnsureCreatedAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (Analyzer, bool, error)

v2/arangodb/database_analyzer_impl.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,6 @@ type databaseAnalyzer struct {
4444
db *database
4545
}
4646

47-
// Deprecated: Use EnsureCreatedAnalyzer instead
48-
func (d databaseAnalyzer) EnsureAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (bool, Analyzer, error) {
49-
urlEndpoint := d.db.url("_api", "analyzer")
50-
51-
var response struct {
52-
shared.ResponseStruct `json:",inline"`
53-
AnalyzerDefinition
54-
}
55-
resp, err := connection.CallPost(ctx, d.db.connection(), urlEndpoint, &response, analyzer)
56-
if err != nil {
57-
return false, nil, errors.WithStack(err)
58-
}
59-
60-
switch code := resp.Code(); code {
61-
case http.StatusCreated, http.StatusOK:
62-
return code == http.StatusOK, newAnalyzer(d.db, response.AnalyzerDefinition), nil
63-
default:
64-
return false, nil, response.AsArangoErrorWithCode(code)
65-
}
66-
}
67-
6847
// EnsureCreatedAnalyzer creates an Analyzer for the database, if it does not already exist.
6948
// It returns the Analyser object together with a boolean indicating if the Analyzer was newly created (true) or pre-existing (false).
7049
func (d databaseAnalyzer) EnsureCreatedAnalyzer(ctx context.Context, analyzer *AnalyzerDefinition) (Analyzer, bool, error) {

v2/arangodb/database_collection.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ import (
2525
)
2626

2727
type DatabaseCollection interface {
28-
// Deprecated: use GetCollection instead
29-
//
30-
// Collection opens a connection to an existing collection within the database.
31-
// If no collection with given name exists, an NotFoundError is returned.
32-
Collection(ctx context.Context, name string) (Collection, error)
33-
3428
// GetCollection opens a connection to an existing collection within the database.
3529
// If no collection with given name exists, an NotFoundError is returned.
3630
GetCollection(ctx context.Context, name string, options *GetCollectionOptions) (Collection, error)
@@ -41,22 +35,10 @@ type DatabaseCollection interface {
4135
// Collections returns a list of all collections in the database.
4236
Collections(ctx context.Context) ([]Collection, error)
4337

44-
// Deprecated: use CreateCollectionV2 instead
45-
//
46-
// CreateCollection creates a new collection with given name and options, and opens a connection to it.
47-
// If a collection with given name already exists within the database, a DuplicateError is returned.
48-
CreateCollection(ctx context.Context, name string, props *CreateCollectionProperties) (Collection, error)
49-
5038
// CreateCollection creates a new collection with given name and options, and opens a connection to it.
5139
// If a collection with given name already exists within the database, a DuplicateError is returned.
5240
CreateCollectionV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2) (Collection, error)
5341

54-
// Deprecated: use CreateCollectionWithOptionsV2 instead
55-
//
56-
// CreateCollectionWithOptions creates a new collection with given name and options, and opens a connection to it.
57-
// If a collection with given name already exists within the database, a DuplicateError is returned.
58-
CreateCollectionWithOptions(ctx context.Context, name string, props *CreateCollectionProperties, options *CreateCollectionOptions) (Collection, error)
59-
6042
// CreateCollectionWithOptions creates a new collection with given name and options, and opens a connection to it.
6143
// If a collection with given name already exists within the database, a DuplicateError is returned.
6244
CreateCollectionWithOptionsV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2, options *CreateCollectionOptions) (Collection, error)

v2/arangodb/database_collection_impl.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ type databaseCollection struct {
4343
db *database
4444
}
4545

46-
func (d databaseCollection) Collection(ctx context.Context, name string) (Collection, error) {
47-
return d.GetCollection(ctx, name, nil)
48-
}
49-
5046
func (d databaseCollection) GetCollection(ctx context.Context, name string, options *GetCollectionOptions) (Collection, error) {
5147
col := newCollection(d.db, name)
5248

@@ -113,47 +109,10 @@ func (d databaseCollection) Collections(ctx context.Context) ([]Collection, erro
113109
}
114110
}
115111

116-
// Deprecated: use CreateCollectionV2 instead
117-
//
118-
// CreateCollectionWithOptions
119-
func (d databaseCollection) CreateCollection(ctx context.Context, name string, props *CreateCollectionProperties) (Collection, error) {
120-
return d.CreateCollectionWithOptions(ctx, name, props, nil)
121-
}
122-
123112
func (d databaseCollection) CreateCollectionV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2) (Collection, error) {
124113
return d.CreateCollectionWithOptionsV2(ctx, name, props, nil)
125114
}
126115

127-
// Deprecated: use CreateCollectionWithOptionsV2 instead
128-
//
129-
// CreateCollectionWithOptions
130-
func (d databaseCollection) CreateCollectionWithOptions(ctx context.Context, name string, props *CreateCollectionProperties, options *CreateCollectionOptions) (Collection, error) {
131-
props.Init()
132-
133-
urlEndpoint := d.db.url("_api", "collection")
134-
reqData := struct {
135-
Name string `json:"name"`
136-
*CreateCollectionProperties
137-
}{
138-
Name: name,
139-
CreateCollectionProperties: props,
140-
}
141-
142-
var respData shared.ResponseStruct
143-
144-
resp, err := connection.CallPost(ctx, d.db.connection(), urlEndpoint, &respData, &reqData, append(d.db.modifiers, options.modifyRequest)...)
145-
if err != nil {
146-
return nil, errors.WithStack(err)
147-
}
148-
149-
switch code := resp.Code(); code {
150-
case http.StatusOK:
151-
return newCollection(d.db, name), nil
152-
default:
153-
return nil, respData.AsArangoErrorWithCode(code)
154-
}
155-
}
156-
157116
func (d databaseCollection) CreateCollectionWithOptionsV2(ctx context.Context, name string, props *CreateCollectionPropertiesV2, options *CreateCollectionOptions) (Collection, error) {
158117
props.Init()
159118

0 commit comments

Comments
 (0)