Skip to content

Commit 3591188

Browse files
authored
Remove Deprecations and add getBlobEntryFirst dispatch (#1079)
* Remove Deprecations and add getBlobEntryFirst dispatch * Fix deprecate getBlobEntry
1 parent 5a07629 commit 3591188

File tree

6 files changed

+15
-100
lines changed

6 files changed

+15
-100
lines changed

src/DataBlobs/services/BlobEntry.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,11 @@ function getBlobEntryFirst(var::Variable, key::Regex)
126126
return var.blobEntries[firstIdx]
127127
end
128128

129-
getBlobEntry(var::AbstractDFGVariable, key::AbstractString) = getBlobEntry(var, Regex(key))
129+
function getBlobEntryFirst(dfg::AbstractDFG, label::Symbol, key::Regex)
130+
return getBlobEntryFirst(getVariable(dfg, label), key)
131+
end
130132

131-
#TODO split betweeen getfirstBlobEntry and getBlobEntry
132-
function getBlobEntry(
133-
dfg::AbstractDFG,
134-
label::Symbol,
135-
key::Union{Symbol, UUID, <:AbstractString, Regex},
136-
)
133+
function getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol, UUID})
137134
return getBlobEntry(getVariable(dfg, label), key)
138135
end
139136
# getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Symbol) = getBlobEntry(getVariable(dfg, label), key)

src/Deprecated.jl

Lines changed: 8 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11

22
## ================================================================================
3-
## Remove in v0.24
3+
## Deprecated in v0.24
4+
##=================================================================================
5+
@deprecate getBlobEntry(var::AbstractDFGVariable, key::AbstractString) getBlobEntryFirst(var, Regex(key))
6+
7+
## ================================================================================
8+
## Deprecated in v0.23
49
##=================================================================================
510
#NOTE free up getNeighbors to return the variables or factors
611
@deprecate getNeighbors(args...; kwargs...) listNeighbors(args...; kwargs...)
712

813
## ================================================================================
9-
## Remove in v0.23
14+
## Deprecated in v0.22
1015
##=================================================================================
11-
1216
@deprecate BlobEntry(
1317
id,
1418
blobId,
@@ -40,88 +44,4 @@
4044
nothing,
4145
_type,
4246
_version,
43-
)
44-
45-
## ================================================================================
46-
## Remove in v0.22
47-
##=================================================================================
48-
49-
@deprecate getBlobEntry(var::AbstractDFGVariable, key::Regex) getBlobEntryFirst(var, key)
50-
51-
## ================================================================================
52-
## Remove in v0.21
53-
##=================================================================================
54-
@deprecate packFactor(dfg::AbstractDFG, f::DFGFactor) packFactor(f::DFGFactor)
55-
56-
# #TODO check this one
57-
# function addData!(
58-
# ::Type{<:BlobEntry},
59-
# dfg::AbstractDFG,
60-
# vLbl::Symbol,
61-
# bLbl::Symbol,
62-
# blob::AbstractVector{UInt8},
63-
# timestamp=now(localzone());
64-
# id::UUID = uuid4(),
65-
# hashfunction::Function = sha256
66-
# )
67-
# fde = BlobEntry(bLbl, id, timestamp, blob)
68-
# de = addBlobEntry!(dfg, vLbl, fde)
69-
# return de=>blob
70-
# end
71-
72-
"""
73-
$(TYPEDEF)
74-
Abstract parent struct for big data entry.
75-
"""
76-
abstract type AbstractBlobEntry end
77-
78-
# should be deprecated by v0.21
79-
80-
@deprecate BlobStoreEntry(
81-
label::Symbol,
82-
id::UUID,
83-
blobstore::Symbol,
84-
hash::String,
85-
origin::String,
86-
description::String,
87-
mimeType::String,
88-
createdTimestamp::ZonedDateTime,
89-
) BlobEntry(; originId = id, label, blobstore, hash, origin, description, mimeType)
90-
91-
@deprecate hasDataEntry(w...; kw...) hasBlobEntry(w...; kw...)
92-
@deprecate getDataEntry(w...; kw...) getBlobEntry(w...; kw...)
93-
@deprecate getDataEntries(w...; kw...) getBlobEntries(w...; kw...)
94-
@deprecate addDataEntry!(w...; kw...) addBlobEntry!(w...; kw...)
95-
@deprecate updateDataEntry!(w...; kw...) updateBlobEntry!(w...; kw...)
96-
@deprecate deleteDataEntry!(w...; kw...) deleteBlobEntry!(w...; kw...)
97-
@deprecate listDataEntrySequence(w...; kw...) listBlobEntrySequence(w...; kw...)
98-
99-
# @deprecate getData(w...;kw...) getBlob(w...;kw...)
100-
@deprecate getDataBlob(w...; kw...) getBlob(w...; kw...)
101-
@deprecate addDataBlob!(w...; kw...) addBlob!(w...; kw...)
102-
@deprecate updateDataBlob!(w...; kw...) updateBlob!(w...; kw...)
103-
@deprecate deleteDataBlob!(w...; kw...) deleteBlob!(w...; kw...)
104-
@deprecate listDataBlobs(w...; kw...) listBlobs(w...; kw...)
105-
106-
# function updateBlob!(
107-
# dfg::AbstractDFG,
108-
# label::Symbol,
109-
# entry::BlobEntry
110-
# )
111-
# # assertHash(entry, entry.data, hashfunction=hashfunction)
112-
# de = updateBlobEntry!(dfg, label, entry)
113-
# db = getBlob(dfg, entry)
114-
# return de=>db
115-
# end
116-
117-
# function addBlob!(
118-
# dfg::AbstractDFG,
119-
# label::Symbol,
120-
# entry::BlobEntry;
121-
# hashfunction = sha256
122-
# )
123-
# # assertHash(entry, entry.data, hashfunction=hashfunction)
124-
# de = addBlobEntry!(dfg, label, entry)
125-
# db = getBlob(dfg, entry)
126-
# return de=>db
127-
# end
47+
)

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,8 @@ export hasBlobEntry,
241241
mergeBlobEntries!
242242
export incrDataLabelSuffix
243243

244-
export getBlobEntries, hasDataEntry, hasDataEntry
244+
export getBlobEntries
245245
export getBlobEntriesVariables
246-
export listDataEntrySequence
247246
# convenience wrappers
248247
# aliases
249248
export addBlob!

src/services/DFGVariable.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ macro defVariable(structname, manifold, point_identity)
107107

108108
DFG.getPointIdentity(::Type{$structname}) = $point_identity
109109

110-
DFG.getVariableType(::typeof($manifold)) = $structname
111110
end,
112111
)
113112
end

test/consol_DataEntryBlobTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ dataset2 = rand(UInt8, 1000)
8686
##==============================================================================
8787

8888
# Create a data store and add it to DFG
89-
mkdir("/tmp/dfgFolderStore")
89+
mkpath("/tmp/dfgFolderStore")
9090
ds = FolderStore{Vector{UInt8}}(:filestore, "/tmp/dfgFolderStore")
9191
addBlobStore!(dfg, ds)
9292

test/testBlocks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ function blobsStoresTestBlock!(fg)
11591159
@test data[1].hash == newData.hash #[1]
11601160
data = getData(fg, :a, r"testing") # convenience wrapper over getBlob
11611161
@test data[1].hash == newData.hash #[1]
1162-
be = getBlobEntry(fg, :a, r"testing")
1162+
be = getBlobEntryFirst(fg, :a, r"testing")
11631163
data = getData(fg, :a, be.originId) # convenience wrapper over getBlob
11641164
@test data[1].hash == newData.hash #[1]
11651165
# @test data[2] == newData[2]

0 commit comments

Comments
 (0)