Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Deprecations and add getBlobEntryFirst dispatch #1079

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/DataBlobs/services/BlobEntry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,11 @@ function getBlobEntryFirst(var::Variable, key::Regex)
return var.blobEntries[firstIdx]
end

getBlobEntry(var::AbstractDFGVariable, key::AbstractString) = getBlobEntry(var, Regex(key))
function getBlobEntryFirst(dfg::AbstractDFG, label::Symbol, key::Regex)
return getBlobEntryFirst(getVariable(dfg, label), key)
end

#TODO split betweeen getfirstBlobEntry and getBlobEntry
function getBlobEntry(
dfg::AbstractDFG,
label::Symbol,
key::Union{Symbol, UUID, <:AbstractString, Regex},
)
function getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol, UUID})
return getBlobEntry(getVariable(dfg, label), key)
end
# getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Symbol) = getBlobEntry(getVariable(dfg, label), key)
Expand Down
126 changes: 5 additions & 121 deletions src/Deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,127 +1,11 @@

## ================================================================================
## Remove in v0.24
##=================================================================================
#NOTE free up getNeighbors to return the variables or factors
@deprecate getNeighbors(args...; kwargs...) listNeighbors(args...; kwargs...)

## ================================================================================
## Remove in v0.23
## Remove in v0.25
##=================================================================================

@deprecate BlobEntry(
id,
blobId,
originId::UUID,
label::Symbol,
blobstore::Symbol,
hash::String,
origin::String,
description::String,
mimeType::String,
metadata::String,
timestamp::ZonedDateTime,
_type::String,
_version::String,
) BlobEntry(
id,
blobId,
originId,
label,
blobstore,
hash,
origin,
-1,
description,
mimeType,
metadata,
timestamp,
nothing,
nothing,
_type,
_version,
)

## ================================================================================
## Remove in v0.22
##=================================================================================

@deprecate getBlobEntry(var::AbstractDFGVariable, key::Regex) getBlobEntryFirst(var, key)
@deprecate getBlobEntry(var::AbstractDFGVariable, key::AbstractString) getBlobEntryFirst(var, Regex(key))
Affie marked this conversation as resolved.
Show resolved Hide resolved

## ================================================================================
## Remove in v0.21
## Remove in v0.24
##=================================================================================
@deprecate packFactor(dfg::AbstractDFG, f::DFGFactor) packFactor(f::DFGFactor)

# #TODO check this one
# function addData!(
# ::Type{<:BlobEntry},
# dfg::AbstractDFG,
# vLbl::Symbol,
# bLbl::Symbol,
# blob::AbstractVector{UInt8},
# timestamp=now(localzone());
# id::UUID = uuid4(),
# hashfunction::Function = sha256
# )
# fde = BlobEntry(bLbl, id, timestamp, blob)
# de = addBlobEntry!(dfg, vLbl, fde)
# return de=>blob
# end

"""
$(TYPEDEF)
Abstract parent struct for big data entry.
"""
abstract type AbstractBlobEntry end

# should be deprecated by v0.21

@deprecate BlobStoreEntry(
label::Symbol,
id::UUID,
blobstore::Symbol,
hash::String,
origin::String,
description::String,
mimeType::String,
createdTimestamp::ZonedDateTime,
) BlobEntry(; originId = id, label, blobstore, hash, origin, description, mimeType)

@deprecate hasDataEntry(w...; kw...) hasBlobEntry(w...; kw...)
@deprecate getDataEntry(w...; kw...) getBlobEntry(w...; kw...)
@deprecate getDataEntries(w...; kw...) getBlobEntries(w...; kw...)
@deprecate addDataEntry!(w...; kw...) addBlobEntry!(w...; kw...)
@deprecate updateDataEntry!(w...; kw...) updateBlobEntry!(w...; kw...)
@deprecate deleteDataEntry!(w...; kw...) deleteBlobEntry!(w...; kw...)
@deprecate listDataEntrySequence(w...; kw...) listBlobEntrySequence(w...; kw...)

# @deprecate getData(w...;kw...) getBlob(w...;kw...)
@deprecate getDataBlob(w...; kw...) getBlob(w...; kw...)
@deprecate addDataBlob!(w...; kw...) addBlob!(w...; kw...)
@deprecate updateDataBlob!(w...; kw...) updateBlob!(w...; kw...)
@deprecate deleteDataBlob!(w...; kw...) deleteBlob!(w...; kw...)
@deprecate listDataBlobs(w...; kw...) listBlobs(w...; kw...)

# function updateBlob!(
# dfg::AbstractDFG,
# label::Symbol,
# entry::BlobEntry
# )
# # assertHash(entry, entry.data, hashfunction=hashfunction)
# de = updateBlobEntry!(dfg, label, entry)
# db = getBlob(dfg, entry)
# return de=>db
# end

# function addBlob!(
# dfg::AbstractDFG,
# label::Symbol,
# entry::BlobEntry;
# hashfunction = sha256
# )
# # assertHash(entry, entry.data, hashfunction=hashfunction)
# de = addBlobEntry!(dfg, label, entry)
# db = getBlob(dfg, entry)
# return de=>db
# end
#NOTE free up getNeighbors to return the variables or factors
@deprecate getNeighbors(args...; kwargs...) listNeighbors(args...; kwargs...)
Loading