diff --git a/NEWS.md b/NEWS.md index d983659a..ce999a40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ Listing news on any major breaking changes in DFG. For regular changes, see int - `delete` returns number of nodes deleted and no longer the object that was deleted. - Deprecate `updateVariable!` for `mergeVariable!`, note `merege` returns number of nodes updated/added. - Deprecate `updateFactor!` for `mergeFactor!`, note `merege` returns number of nodes updated/added. +- Rename BlobEntry to Blobentry, see #1123. +- Rename BlobStore to Blobstore, see #1124. # v0.26 - Graph structure plotting now uses GraphMakie.jl instead of GraphPlot.jl. Update by replacing `using GraphPlot` with `using GraphMakie`. diff --git a/docs/src/GraphData.md b/docs/src/GraphData.md index 57f1ddf6..c9bdca09 100644 --- a/docs/src/GraphData.md +++ b/docs/src/GraphData.md @@ -180,10 +180,10 @@ you are working with an in-memory graph, the DFG structure contains the graph it Graphs reside inside a hierarchy made up in the following way: - Agent - Metadata - - BlobEntries + - Blobentries - Graph - Metadata - - BlobEntries + - Blobentries This data can be retrieved with the follow functions: diff --git a/docs/src/blob_ref.md b/docs/src/blob_ref.md index a94510ea..2736b8e9 100644 --- a/docs/src/blob_ref.md +++ b/docs/src/blob_ref.md @@ -1,4 +1,4 @@ -# Blobs and BlobEntries +# Blobs and Blobentries ```@contents Pages = [ diff --git a/src/DataBlobs/entities/BlobEntry.jl b/src/DataBlobs/entities/BlobEntry.jl index 769a704b..6439bff4 100644 --- a/src/DataBlobs/entities/BlobEntry.jl +++ b/src/DataBlobs/entities/BlobEntry.jl @@ -1,31 +1,31 @@ ##============================================================================== -## BlobEntry +## Blobentry ##============================================================================== """ $(TYPEDEF) -A `BlobEntry` is a small about of structured data that holds reference information to find an actual blob. Many `BlobEntry`s +A `Blobentry` is a small about of structured data that holds reference information to find an actual blob. Many `Blobentry`s can exist on different graph nodes spanning Agents and Factor Graphs which can all reference the same `Blob`. Notes: - `blobId`s should be unique within a blobstore and are immutable. """ -Base.@kwdef struct BlobEntry - """ Remotely assigned and globally unique identifier for the `BlobEntry` itself (not the `.blobId`). """ +Base.@kwdef struct Blobentry + """ Remotely assigned and globally unique identifier for the `Blobentry` itself (not the `.blobId`). """ id::Union{UUID, Nothing} = nothing """ Machine friendly and globally unique identifier of the 'Blob', usually assigned from a common point in the system. This can be used to guarantee unique retrieval of the large data blob. """ blobId::Union{UUID, Nothing} = uuid4() #Deprecated in v0.25 TODO remove union, blobId is mandatory """ Machine friendly and locally assigned identifier of the 'Blob'. `.originId`s are mandatory upon first creation at the origin regardless of network access. Separate from `.blobId` since some architectures do not allow edge processes to assign a uuid4 to data store elements. """ originId::Union{UUID, Nothing} = blobId #Deprecated in v0.25 TODO remove union or remove originId completely - """ Human friendly label of the `Blob` and also used as unique identifier per node on which a `BlobEntry` is added. E.g. do "LEFTCAM_1", "LEFTCAM_2", ... of you need to repeat a label on the same variable. """ + """ Human friendly label of the `Blob` and also used as unique identifier per node on which a `Blobentry` is added. E.g. do "LEFTCAM_1", "LEFTCAM_2", ... of you need to repeat a label on the same variable. """ label::Symbol """ A hint about where the `Blob` itself might be stored. Remember that a Blob may be duplicated over multiple blobstores. """ blobstore::Symbol = :default """ A hash value to ensure data consistency which must correspond to the stored hash upon retrieval. Use `bytes2hex(sha256(blob))`. [Legacy: some usage functions allow the check to be skipped if needed.] """ hash::String = ""# Probably https://docs.julialang.org/en/v1/stdlib/SHA - """ Context from which a BlobEntry=>Blob was first created. E.g. agent|graph|varlabel. """ + """ Context from which a Blobentry=>Blob was first created. E.g. agent|graph|varlabel. """ origin::String = "" """ number of bytes in blob as a string""" size::Union{String, Nothing} = "-1" #TODO remove union -> size::String = "-1" @@ -37,16 +37,16 @@ Base.@kwdef struct BlobEntry metadata::String = "e30=" """ When the Blob itself was first created. """ timestamp::ZonedDateTime = now(localzone()) - """ When the BlobEntry was created. """ + """ When the Blobentry was created. """ createdTimestamp::Union{ZonedDateTime, Nothing} = nothing """ Use carefully, but necessary to support advanced usage such as time synchronization over Blob data. """ lastUpdatedTimestamp::Union{ZonedDateTime, Nothing} = nothing - """ Type version of this BlobEntry. TBD.jl consider upgrading to `::VersionNumber`. """ + """ Type version of this Blobentry. TBD.jl consider upgrading to `::VersionNumber`. """ _version::String = string(_getDFGVersion()) end -StructTypes.StructType(::Type{BlobEntry}) = StructTypes.UnorderedStruct() -StructTypes.idproperty(::Type{BlobEntry}) = :id -StructTypes.omitempties(::Type{BlobEntry}) = (:id,) +StructTypes.StructType(::Type{Blobentry}) = StructTypes.UnorderedStruct() +StructTypes.idproperty(::Type{Blobentry}) = :id +StructTypes.omitempties(::Type{Blobentry}) = (:id,) _fixtimezone(cts::NamedTuple) = ZonedDateTime(cts.utc_datetime * "+00") diff --git a/src/DataBlobs/entities/BlobStores.jl b/src/DataBlobs/entities/BlobStores.jl index 3b5e04d2..43622e9b 100644 --- a/src/DataBlobs/entities/BlobStores.jl +++ b/src/DataBlobs/entities/BlobStores.jl @@ -1 +1 @@ -abstract type AbstractBlobStore{T} end +abstract type AbstractBlobstore{T} end diff --git a/src/DataBlobs/services/BlobEntry.jl b/src/DataBlobs/services/BlobEntry.jl index bd261263..a208acca 100644 --- a/src/DataBlobs/services/BlobEntry.jl +++ b/src/DataBlobs/services/BlobEntry.jl @@ -1,16 +1,16 @@ ##============================================================================== -## BlobEntry - compare +## Blobentry - compare ##============================================================================== import Base: == -@generated function ==(x::T, y::T) where {T <: BlobEntry} +@generated function ==(x::T, y::T) where {T <: Blobentry} return mapreduce(n -> :(x.$n == y.$n), (a, b) -> :($a && $b), fieldnames(x)) end ##============================================================================== -## BlobEntry - common +## Blobentry - common ##============================================================================== """ @@ -22,16 +22,16 @@ function buildSourceString(dfg::AbstractDFG, label::Symbol) end ##============================================================================== -## BlobEntry - Defined in src/entities/AbstractDFG.jl +## Blobentry - Defined in src/entities/AbstractDFG.jl ##============================================================================== # Fields to be implemented # label # id -getHash(entry::BlobEntry) = hex2bytes(entry.hash) -getTimestamp(entry::BlobEntry) = entry.timestamp +getHash(entry::Blobentry) = hex2bytes(entry.hash) +getTimestamp(entry::Blobentry) = entry.timestamp -function assertHash(de::BlobEntry, db; hashfunction::Function = sha256) +function assertHash(de::Blobentry, db; hashfunction::Function = sha256) getHash(de) === nothing && @warn "Missing hash?" && return true if hashfunction(db) == getHash(de) return true #or nothing? @@ -40,8 +40,8 @@ function assertHash(de::BlobEntry, db; hashfunction::Function = sha256) end end -function Base.show(io::IO, ::MIME"text/plain", entry::BlobEntry) - println(io, "BlobEntry {") +function Base.show(io::IO, ::MIME"text/plain", entry::Blobentry) + println(io, "Blobentry {") println(io, " id: ", entry.id) println(io, " blobId: ", entry.blobId) println(io, " originId: ", entry.originId) @@ -57,17 +57,17 @@ function Base.show(io::IO, ::MIME"text/plain", entry::BlobEntry) end ##============================================================================== -## BlobEntry - CRUD +## Blobentry - CRUD ##============================================================================== """ $(SIGNATURES) Get data entry -Also see: [`addBlobEntry!`](@ref), [`getBlob`](@ref), [`listBlobEntries`](@ref) +Also see: [`addBlobentry!`](@ref), [`getBlob`](@ref), [`listBlobentries`](@ref) """ -function getBlobEntry(var::AbstractDFGVariable, key::Symbol) - if !hasBlobEntry(var, key) +function getBlobentry(var::AbstractDFGVariable, key::Symbol) + if !hasBlobentry(var, key) throw( KeyError( "No dataEntry label $(key) found in variable $(getLabel(var)). Available keys: $(keys(var.dataDict))", @@ -77,15 +77,15 @@ function getBlobEntry(var::AbstractDFGVariable, key::Symbol) return var.dataDict[key] end -function getBlobEntry(var::VariableDFG, key::Symbol) - if !hasBlobEntry(var, key) +function getBlobentry(var::VariableDFG, key::Symbol) + if !hasBlobentry(var, key) throw(KeyError(key)) end return var.blobEntries[findfirst(x -> x.label == key, var.blobEntries)] end -#TODO maybe rename to getBlobEntryFirst -function getBlobEntry(var::AbstractDFGVariable, blobId::UUID) +#TODO maybe rename to getBlobentryFirst +function getBlobentry(var::AbstractDFGVariable, blobId::UUID) for (k, v) in var.dataDict if blobId in [v.originId, v.blobId] return v @@ -98,9 +98,9 @@ end $(SIGNATURES) Finds and returns the first blob entry that matches the regex. -Also see: [`getBlobEntry`](@ref) +Also see: [`getBlobentry`](@ref) """ -function getBlobEntryFirst(var::AbstractDFGVariable, key::Regex) +function getBlobentryFirst(var::AbstractDFGVariable, key::Regex) for (k, v) in var.dataDict if occursin(key, string(v.label)) return v @@ -113,7 +113,7 @@ function getBlobEntryFirst(var::AbstractDFGVariable, key::Regex) ) end -function getBlobEntryFirst(var::VariableDFG, key::Regex) +function getBlobentryFirst(var::VariableDFG, key::Regex) firstIdx = findfirst(x -> contains(string(x.label), key), var.blobEntries) if isnothing(firstIdx) throw(KeyError("$key")) @@ -121,62 +121,62 @@ function getBlobEntryFirst(var::VariableDFG, key::Regex) return var.blobEntries[firstIdx] end -function getBlobEntryFirst(dfg::AbstractDFG, label::Symbol, key::Regex) - els = listBlobEntries(dfg, label) +function getBlobentryFirst(dfg::AbstractDFG, label::Symbol, key::Regex) + els = listBlobentries(dfg, label) firstIdx = findfirst(contains(key), string.(els)) isnothing(firstIdx) && throw( KeyError( "No blobEntry with label matching regex $(key) found in variable $(label)", ), ) - return getBlobEntry(dfg, label, els[firstIdx]) + return getBlobentry(dfg, label, els[firstIdx]) end # TODO Consider autogenerating all methods of the form: # verbNoun(dfg::VariableCompute, label::Symbol, args...; kwargs...) = verbNoun(getVariable(dfg, label), args...; kwargs...) # with something like: # getvariablemethod = [ -# :getBlobEntryFirst, +# :getBlobentryFirst, # ] # for met in methodstooverload # @eval DistributedFactorGraphs $met(dfg::AbstractDFG, label::Symbol, args...; kwargs...) = $met(getVariable(dfg, label), args...; kwargs...) # end -function getBlobEntry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol, UUID}) - return getBlobEntry(getVariable(dfg, label), key) +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) +# getBlobentry(dfg::AbstractDFG, label::Symbol, key::Symbol) = getBlobentry(getVariable(dfg, label), key) """ $(SIGNATURES) Add Data Entry to a DFG variable Should be extended if DFG variable is not returned by reference. -Also see: [`getBlobEntry`](@ref), [`addBlob!`](@ref), [`mergeBlobEntries!`](@ref) +Also see: [`getBlobentry`](@ref), [`addBlob!`](@ref), [`mergeBlobentries!`](@ref) """ -function addBlobEntry!(var::AbstractDFGVariable, entry::BlobEntry;) +function addBlobentry!(var::AbstractDFGVariable, entry::Blobentry;) # see https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/985 # blobId::Union{UUID,Nothing} = (isnothing(entry.blobId) ? entry.id : entry.blobId), - # blobSize::Int = (hasfield(BlobEntry, :size) ? entry.size : -1) + # blobSize::Int = (hasfield(Blobentry, :size) ? entry.size : -1) haskey(var.dataDict, entry.label) && error("blobEntry $(entry.label) already exists on variable $(getLabel(var))") var.dataDict[entry.label] = entry return entry end -function addBlobEntry!(var::VariableDFG, entry::BlobEntry) +function addBlobentry!(var::VariableDFG, entry::Blobentry) entry.label in getproperty.(var.blobEntries, :label) && error("blobEntry $(entry.label) already exists on variable $(getLabel(var))") push!(var.blobEntries, entry) return entry end -function addBlobEntry!(dfg::AbstractDFG, vLbl::Symbol, entry::BlobEntry;) - return addBlobEntry!(getVariable(dfg, vLbl), entry) +function addBlobentry!(dfg::AbstractDFG, vLbl::Symbol, entry::Blobentry;) + return addBlobentry!(getVariable(dfg, vLbl), entry) end -function addBlobEntries!(dfg::AbstractDFG, vLbl::Symbol, entries::Vector{BlobEntry}) - return addBlobEntry!.(dfg, vLbl, entries) +function addBlobentries!(dfg::AbstractDFG, vLbl::Symbol, entries::Vector{Blobentry}) + return addBlobentry!.(dfg, vLbl, entries) end """ @@ -185,15 +185,15 @@ Update a Blobentry in the factor graph. If the Blobentry does not exist, it will be added. Notes: """ -function mergeBlobentry!(var::AbstractDFGVariable, bde::BlobEntry) +function mergeBlobentry!(var::AbstractDFGVariable, bde::Blobentry) if !haskey(var.dataDict, bde.label) - addBlobEntry!(var, bde) + addBlobentry!(var, bde) else var.dataDict[bde.label] = bde end return 1 end -function mergeBlobentry!(dfg::AbstractDFG, label::Symbol, bde::BlobEntry) +function mergeBlobentry!(dfg::AbstractDFG, label::Symbol, bde::Blobentry) # !isVariable(dfg, label) && return nothing return mergeBlobentry!(getVariable(dfg, label), bde) end @@ -206,13 +206,13 @@ Note this doesn't remove it from any data stores. Notes: - users responsibility to delete data in db before deleting entry """ -function deleteBlobEntry!(var::AbstractDFGVariable, key::Symbol) +function deleteBlobentry!(var::AbstractDFGVariable, key::Symbol) pop!(var.dataDict, key) return 1 end -function deleteBlobEntry!(var::VariableDFG, key::Symbol) - if !hasBlobEntry(var, key) +function deleteBlobentry!(var::VariableDFG, key::Symbol) + if !hasBlobentry(var, key) throw( KeyError( "No dataEntry label $(key) found in variable $(getLabel(var)). Available keys: $(keys(var.dataDict))", @@ -223,19 +223,19 @@ function deleteBlobEntry!(var::VariableDFG, key::Symbol) return 1 end -function deleteBlobEntry!(dfg::AbstractDFG, label::Symbol, key::Symbol) +function deleteBlobentry!(dfg::AbstractDFG, label::Symbol, key::Symbol) #users responsibility to delete data in db before deleting entry # !isVariable(dfg, label) && return nothing - return deleteBlobEntry!(getVariable(dfg, label), key) + return deleteBlobentry!(getVariable(dfg, label), key) end -function deleteBlobEntry!(var::AbstractDFGVariable, entry::BlobEntry) +function deleteBlobentry!(var::AbstractDFGVariable, entry::Blobentry) #users responsibility to delete data in db before deleting entry - return deleteBlobEntry!(var, entry.label) + return deleteBlobentry!(var, entry.label) end ##============================================================================== -## BlobEntry - Helper functions, Lists, etc +## Blobentry - Helper functions, Lists, etc ##============================================================================== """ @@ -243,45 +243,45 @@ end Does a blob entry (element) exist with `blobLabel`. """ -hasBlobEntry(var::AbstractDFGVariable, blobLabel::Symbol) = haskey(var.dataDict, blobLabel) +hasBlobentry(var::AbstractDFGVariable, blobLabel::Symbol) = haskey(var.dataDict, blobLabel) -function hasBlobEntry(var::VariableDFG, label::Symbol) +function hasBlobentry(var::VariableDFG, label::Symbol) return label in getproperty.(var.blobEntries, :label) end """ $(SIGNATURES) -Get blob entries, Vector{BlobEntry} +Get blob entries, Vector{Blobentry} """ -function getBlobEntries(var::AbstractDFGVariable) - #or should we return the iterator, Base.ValueIterator{Dict{Symbol,BlobEntry}}? +function getBlobentries(var::AbstractDFGVariable) + #or should we return the iterator, Base.ValueIterator{Dict{Symbol,Blobentry}}? return collect(values(var.dataDict)) end -function getBlobEntries(var::VariableDFG) +function getBlobentries(var::VariableDFG) return var.blobEntries end -function getBlobEntries(dfg::AbstractDFG, label::Symbol) +function getBlobentries(dfg::AbstractDFG, label::Symbol) # !isVariable(dfg, label) && return nothing - #or should we return the iterator, Base.ValueIterator{Dict{Symbol,BlobEntry}}? - return getBlobEntries(getVariable(dfg, label)) + #or should we return the iterator, Base.ValueIterator{Dict{Symbol,Blobentry}}? + return getBlobentries(getVariable(dfg, label)) end -function getBlobEntries(dfg::AbstractDFG, label::Symbol, regex::Regex) - entries = getBlobEntries(dfg, label) +function getBlobentries(dfg::AbstractDFG, label::Symbol, regex::Regex) + entries = getBlobentries(dfg, label) return filter(entries) do e return occursin(regex, string(e.label)) end end -function getBlobEntries( +function getBlobentries( dfg::AbstractDFG, label::Symbol, skey::Union{Symbol, <:AbstractString}, ) - return getBlobEntries(dfg, label, Regex(string(skey))) + return getBlobentries(dfg, label, Regex(string(skey))) end """ @@ -293,15 +293,15 @@ Notes - Use `dropEmpties=true` to not include empty lists in result. - Use keyword `varList` for which variables to search through. """ -function getBlobEntriesVariables( +function getBlobentriesVariables( dfg::AbstractDFG, bLblPattern::Regex; varList::AbstractVector{Symbol} = sort(listVariables(dfg); lt = natural_lt), dropEmpties::Bool = false, ) - RETLIST = Vector{Vector{BlobEntry}}() + RETLIST = Vector{Vector{Blobentry}}() @showprogress "Get entries matching $bLblPattern" for vl in varList - bes = filter(s -> occursin(bLblPattern, string(s.label)), listBlobEntries(dfg, vl)) + bes = filter(s -> occursin(bLblPattern, string(s.label)), listBlobentries(dfg, vl)) # only push to list if there are entries on this variable (!dropEmpties || 0 < length(bes)) ? nothing : continue push!(RETLIST, bes) @@ -314,17 +314,17 @@ end $(SIGNATURES) List the blob entries associated with a particular variable. """ -function listBlobEntries(var::AbstractDFGVariable) +function listBlobentries(var::AbstractDFGVariable) return collect(keys(var.dataDict)) end -function listBlobEntries(var::VariableDFG) +function listBlobentries(var::VariableDFG) return getproperty.(var.blobEntries, :label) end -function listBlobEntries(dfg::AbstractDFG, label::Symbol) +function listBlobentries(dfg::AbstractDFG, label::Symbol) # !isVariable(dfg, label) && return nothing - return listBlobEntries(getVariable(dfg, label)) + return listBlobentries(getVariable(dfg, label)) end """ @@ -337,7 +337,7 @@ Notes Example ```julia -listBlobEntrySequence(fg, :x0, r"IMG_CENTER", sortDFG) +listBlobentrySequence(fg, :x0, r"IMG_CENTER", sortDFG) 15-element Vector{Symbol}: :IMG_CENTER_21676 :IMG_CENTER_21677 @@ -346,14 +346,14 @@ listBlobEntrySequence(fg, :x0, r"IMG_CENTER", sortDFG) ... ``` """ -function listBlobEntrySequence( +function listBlobentrySequence( dfg::AbstractDFG, lb::Symbol, pattern::Regex, _sort::Function = (x) -> x, ) # - ents_ = listBlobEntries(dfg, lb) + ents_ = listBlobentries(dfg, lb) entReg = map(l -> match(pattern, string(l)), ents_) entMsk = entReg .!== nothing return ents_[findall(entMsk)] |> _sort @@ -365,9 +365,9 @@ end Add a blob entry into the destination variable which already exists in a source variable. -See also: [`addBlobEntry!`](@ref), [`getBlobEntry`](@ref), [`listBlobEntries`](@ref), [`getBlob`](@ref) +See also: [`addBlobentry!`](@ref), [`getBlobentry`](@ref), [`listBlobentries`](@ref), [`getBlob`](@ref) """ -function mergeBlobEntries!( +function mergeBlobentries!( dst::AbstractDFG, dlbl::Symbol, src::AbstractDFG, @@ -377,44 +377,44 @@ function mergeBlobEntries!( # _makevec(s) = [s;] _makevec(s::AbstractVector) = s - des_ = getBlobEntry(src, slbl, bllb) + des_ = getBlobentry(src, slbl, bllb) des = _makevec(des_) # don't add data entries that already exist - dde = listBlobEntries(dst, dlbl) + dde = listBlobentries(dst, dlbl) # HACK, verb list should just return vector of Symbol. NCE36 _getid(s) = s - _getid(s::BlobEntry) = s.id + _getid(s::Blobentry) = s.id uids = _getid.(dde) # (s->s.id).(dde) filter!(s -> !(_getid(s) in uids), des) # add any data entries not already in the destination variable, by uuid - return addBlobEntry!.(dst, dlbl, des) + return addBlobentry!.(dst, dlbl, des) end -function mergeBlobEntries!( +function mergeBlobentries!( dst::AbstractDFG, dlbl::Symbol, src::AbstractDFG, slbl::Symbol, ::Colon = :, ) - des = listBlobEntries(src, slbl) + des = listBlobentries(src, slbl) # don't add data entries that already exist - uids = listBlobEntries(dst, dlbl) + uids = listBlobentries(dst, dlbl) # verb list should just return vector of Symbol. NCE36 filter!(s -> !(s in uids), des) if 0 < length(des) - union(((s -> mergeBlobEntries!(dst, dlbl, src, slbl, s)).(des))...) + union(((s -> mergeBlobentries!(dst, dlbl, src, slbl, s)).(des))...) end end -function mergeBlobEntries!( +function mergeBlobentries!( dest::AbstractDFG, src::AbstractDFG, w...; varList::AbstractVector = listVariables(dest) |> sortDFG, ) @showprogress 1 "merging data entries" for vl in varList - mergeBlobEntries!(dest, vl, src, vl, w...) + mergeBlobentries!(dest, vl, src, vl, w...) end return varList end diff --git a/src/DataBlobs/services/BlobPacking.jl b/src/DataBlobs/services/BlobPacking.jl index 7152bc1b..50fdb786 100644 --- a/src/DataBlobs/services/BlobPacking.jl +++ b/src/DataBlobs/services/BlobPacking.jl @@ -52,8 +52,8 @@ function unpackBlob(::Type{format"JSON"}, blob::Vector{UInt8}) return String(copy(blob)) end -unpackBlob(entry::BlobEntry, blob::Vector{UInt8}) = unpackBlob(entry.mimeType, blob) -unpackBlob(eb::Pair{<:BlobEntry, Vector{UInt8}}) = unpackBlob(eb[1], eb[2]) +unpackBlob(entry::Blobentry, blob::Vector{UInt8}) = unpackBlob(entry.mimeType, blob) +unpackBlob(eb::Pair{<:Blobentry, Vector{UInt8}}) = unpackBlob(eb[1], eb[2]) # 2/ FileIO function packBlob(::Type{T}, data::Any; kwargs...) where {T <: DataFormat} diff --git a/src/DataBlobs/services/BlobStores.jl b/src/DataBlobs/services/BlobStores.jl index 9d73af82..28d8ca1e 100644 --- a/src/DataBlobs/services/BlobStores.jl +++ b/src/DataBlobs/services/BlobStores.jl @@ -6,7 +6,7 @@ Get the data blob for the specified blobstore or dfg. Related -[`getBlobEntry`](@ref) +[`getBlobentry`](@ref) $(METHODLIST) """ @@ -16,7 +16,7 @@ function getBlob end Adds a blob to the blob store or dfg with the given entry. Related -[`addBlobEntry!`](@ref) +[`addBlobentry!`](@ref) $(METHODLIST) """ @@ -38,7 +38,7 @@ function updateBlob! end Delete a blob from the blob store or dfg with the given entry. Related -[`deleteBlobEntry!`](@ref) +[`deleteBlobentry!`](@ref) $(METHODLIST) """ @@ -51,39 +51,39 @@ List all ids in the blob store. function listBlobs end ##============================================================================== -## AbstractBlobStore CRUD Interface +## AbstractBlobstore CRUD Interface ##============================================================================== -function getBlob(store::AbstractBlobStore, ::UUID) +function getBlob(store::AbstractBlobstore, ::UUID) return error("$(typeof(store)) doesn't override 'getBlob'.") end -function addBlob!(store::AbstractBlobStore{T}, ::UUID, ::T) where {T} +function addBlob!(store::AbstractBlobstore{T}, ::UUID, ::T) where {T} return error("$(typeof(store)) doesn't override 'addBlob!'.") end -function updateBlob!(store::AbstractBlobStore{T}, ::UUID, ::T) where {T} +function updateBlob!(store::AbstractBlobstore{T}, ::UUID, ::T) where {T} return error("$(typeof(store)) doesn't override 'updateBlob!'.") end -function deleteBlob!(store::AbstractBlobStore, ::UUID) +function deleteBlob!(store::AbstractBlobstore, ::UUID) return error("$(typeof(store)) doesn't override 'deleteBlob!'.") end -function listBlobs(store::AbstractBlobStore) +function listBlobs(store::AbstractBlobstore) return error("$(typeof(store)) doesn't override 'listBlobs'.") end -function hasBlob(store::AbstractBlobStore, ::UUID) +function hasBlob(store::AbstractBlobstore, ::UUID) return error("$(typeof(store)) doesn't override 'hasBlob'.") end ##============================================================================== -## AbstractBlobStore derived CRUD for Blob +## AbstractBlobstore derived CRUD for Blob ##============================================================================== -function getBlob(dfg::AbstractDFG, entry::BlobEntry) - stores = getBlobStores(dfg) +function getBlob(dfg::AbstractDFG, entry::Blobentry) + stores = getBlobstores(dfg) storekeys = collect(keys(stores)) # first check the saved blobstore and then fall back to the rest fidx = findfirst(==(entry.blobstore), storekeys) @@ -110,45 +110,45 @@ function getBlob(dfg::AbstractDFG, entry::BlobEntry) ) end -function getBlob(store::AbstractBlobStore, entry::BlobEntry) +function getBlob(store::AbstractBlobstore, entry::Blobentry) blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId return getBlob(store, blobId) end #add -function addBlob!(dfg::AbstractDFG, entry::BlobEntry, data) - return addBlob!(getBlobStore(dfg, entry.blobstore), entry, data) +function addBlob!(dfg::AbstractDFG, entry::Blobentry, data) + return addBlob!(getBlobstore(dfg, entry.blobstore), entry, data) end -function addBlob!(store::AbstractBlobStore{T}, entry::BlobEntry, data::T) where {T} +function addBlob!(store::AbstractBlobstore{T}, entry::Blobentry, data::T) where {T} blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId return addBlob!(store, blobId, data) end # also creates an originId as uuid4 -addBlob!(store::AbstractBlobStore, data) = addBlob!(store, uuid4(), data) +addBlob!(store::AbstractBlobstore, data) = addBlob!(store, uuid4(), data) #update -function updateBlob!(dfg::AbstractDFG, entry::BlobEntry, data) - return updateBlob!(getBlobStore(dfg, entry.blobstore), entry.blobId, data) +function updateBlob!(dfg::AbstractDFG, entry::Blobentry, data) + return updateBlob!(getBlobstore(dfg, entry.blobstore), entry.blobId, data) end -function updateBlob!(store::AbstractBlobStore, entry::BlobEntry, data) +function updateBlob!(store::AbstractBlobstore, entry::Blobentry, data) return updateBlob!(store, entry.blobId, data) end #delete -function deleteBlob!(dfg::AbstractDFG, entry::BlobEntry) - return deleteBlob!(getBlobStore(dfg, entry.blobstore), entry) +function deleteBlob!(dfg::AbstractDFG, entry::Blobentry) + return deleteBlob!(getBlobstore(dfg, entry.blobstore), entry) end -function deleteBlob!(store::AbstractBlobStore, entry::BlobEntry) +function deleteBlob!(store::AbstractBlobstore, entry::Blobentry) blobId = isnothing(entry.blobId) ? entry.originId : entry.blobId return deleteBlob!(store, blobId) end #has -function hasBlob(dfg::AbstractDFG, entry::BlobEntry) - return hasBlob(getBlobStore(dfg, entry.blobstore), entry.originId) +function hasBlob(dfg::AbstractDFG, entry::Blobentry) + return hasBlob(getBlobstore(dfg, entry.blobstore), entry.originId) end #TODO @@ -158,7 +158,7 @@ end # Can specify which entries to copy with the `sourceEntries` parameter. # Returns the list of copied entries. # """ -# function copyBlobStore(sourceStore::D1, destStore::D2; sourceEntries=listEntries(sourceStore))::Vector{E} where {T, D1 <: AbstractDataStore{T}, D2 <: AbstractDataStore{T}, E <: BlobEntry} +# function copyBlobstore(sourceStore::D1, destStore::D2; sourceEntries=listEntries(sourceStore))::Vector{E} where {T, D1 <: AbstractDataStore{T}, D2 <: AbstractDataStore{T}, E <: Blobentry} # # Quick check # destEntries = listBlobs(destStore) # typeof(sourceEntries) != typeof(destEntries) && error("Can't copy stores, source has entries of type $(typeof(sourceEntries)), destination has entries of type $(typeof(destEntries)).") @@ -174,7 +174,7 @@ end ##============================================================================== ## FolderStore ##============================================================================== -struct FolderStore{T} <: AbstractBlobStore{T} +struct FolderStore{T} <: AbstractBlobstore{T} label::Symbol folder::String end @@ -241,30 +241,30 @@ function hasBlob(store::FolderStore, blobId::UUID) return isfile(blobfilename) end -hasBlob(store::FolderStore, entry::BlobEntry) = hasBlob(store, entry.originId) +hasBlob(store::FolderStore, entry::Blobentry) = hasBlob(store, entry.originId) listBlobs(store::FolderStore) = readdir(store.folder) ##============================================================================== -## InMemoryBlobStore +## InMemoryBlobstore ##============================================================================== -struct InMemoryBlobStore{T} <: AbstractBlobStore{T} +struct InMemoryBlobstore{T} <: AbstractBlobstore{T} label::Symbol blobs::Dict{UUID, T} end -function InMemoryBlobStore{T}(storeKey::Symbol) where {T} - return InMemoryBlobStore{T}(storeKey, Dict{UUID, T}()) +function InMemoryBlobstore{T}(storeKey::Symbol) where {T} + return InMemoryBlobstore{T}(storeKey, Dict{UUID, T}()) end -function InMemoryBlobStore(storeKey::Symbol = :default_inmemory_store) - return InMemoryBlobStore{Vector{UInt8}}(storeKey) +function InMemoryBlobstore(storeKey::Symbol = :default_inmemory_store) + return InMemoryBlobstore{Vector{UInt8}}(storeKey) end -function getBlob(store::InMemoryBlobStore, blobId::UUID) +function getBlob(store::InMemoryBlobstore, blobId::UUID) return store.blobs[blobId] end -function addBlob!(store::InMemoryBlobStore{T}, blobId::UUID, data::T) where {T} +function addBlob!(store::InMemoryBlobstore{T}, blobId::UUID, data::T) where {T} if haskey(store.blobs, blobId) error("Key '$blobId' blob already exists.") end @@ -272,27 +272,27 @@ function addBlob!(store::InMemoryBlobStore{T}, blobId::UUID, data::T) where {T} return blobId end -function updateBlob!(store::InMemoryBlobStore{T}, blobId::UUID, data::T) where {T} +function updateBlob!(store::InMemoryBlobstore{T}, blobId::UUID, data::T) where {T} if haskey(store.blobs, blobId) @warn "Key '$blobId' doesn't exist." end return store.blobs[blobId] = data end -function deleteBlob!(store::InMemoryBlobStore, blobId::UUID) +function deleteBlob!(store::InMemoryBlobstore, blobId::UUID) pop!(store.blobs, blobId) return 1 end -hasBlob(store::InMemoryBlobStore, blobId::UUID) = haskey(store.blobs, blobId) +hasBlob(store::InMemoryBlobstore, blobId::UUID) = haskey(store.blobs, blobId) -listBlobs(store::InMemoryBlobStore) = collect(keys(store.blobs)) +listBlobs(store::InMemoryBlobstore) = collect(keys(store.blobs)) ##============================================================================== ## LinkStore Link blobId to a existing local folder ##============================================================================== -struct LinkStore <: AbstractBlobStore{String} +struct LinkStore <: AbstractBlobstore{String} label::Symbol csvfile::String cache::Dict{UUID, String} @@ -318,7 +318,7 @@ function getBlob(store::LinkStore, blobId::UUID) return read(fname) end -function addBlob!(store::LinkStore, entry::BlobEntry, linkfile::String) +function addBlob!(store::LinkStore, entry::Blobentry, linkfile::String) return addBlob!(store, entry.originId, nothing, linkfile::String) end @@ -337,11 +337,11 @@ function deleteBlob!(store::LinkStore, args...) return error("deleteDataBlob(::LinkStore) not supported") end -deleteBlob!(store::LinkStore, ::BlobEntry) = deleteBlob!(store) +deleteBlob!(store::LinkStore, ::Blobentry) = deleteBlob!(store) deleteBlob!(store::LinkStore, ::UUID) = deleteBlob!(store) ##============================================================================== -## RowBlobStore Ordered Dict Row Table Blob Store +## RowBlobstore Ordered Dict Row Table Blob Store ##============================================================================== # RowBlob @@ -368,22 +368,22 @@ function Tables.columnnames(row::RowBlob) return (:id, Tables.columnnames(getfield(row, :blob))...) end -## RowBlobStore +## RowBlobstore -struct RowBlobStore{T} <: AbstractBlobStore{T} +struct RowBlobstore{T} <: AbstractBlobstore{T} label::Symbol blobs::OrderedDict{UUID, RowBlob{T}} end -function RowBlobStore{T}(storeKey::Symbol) where {T} - return RowBlobStore{T}(storeKey, OrderedDict{UUID, RowBlob{T}}()) +function RowBlobstore{T}(storeKey::Symbol) where {T} + return RowBlobstore{T}(storeKey, OrderedDict{UUID, RowBlob{T}}()) end -function RowBlobStore(storeKey::Symbol, T::DataType) - return RowBlobStore{T}(storeKey) +function RowBlobstore(storeKey::Symbol, T::DataType) + return RowBlobstore{T}(storeKey) end -function RowBlobStore(storeKey::Symbol, T::DataType, table) - store = RowBlobStore(storeKey, T) +function RowBlobstore(storeKey::Symbol, T::DataType, table) + store = RowBlobstore(storeKey, T) for nt in Tables.namedtupleiterator(table) row = DFG.RowBlob(T, nt) store.blobs[row.id] = row @@ -392,18 +392,18 @@ function RowBlobStore(storeKey::Symbol, T::DataType, table) end # Tables interface -Tables.istable(::Type{RowBlobStore{T}}) where {T} = true -Tables.rowaccess(::Type{RowBlobStore{T}}) where {T} = true -Tables.rows(store::RowBlobStore) = values(store.blobs) +Tables.istable(::Type{RowBlobstore{T}}) where {T} = true +Tables.rowaccess(::Type{RowBlobstore{T}}) where {T} = true +Tables.rows(store::RowBlobstore) = values(store.blobs) #TODO -# Tables.materializer(::Type{RowBlobStore{T}}) where T = Tables.rowtable +# Tables.materializer(::Type{RowBlobstore{T}}) where T = Tables.rowtable ## -function getBlob(store::RowBlobStore, blobId::UUID) +function getBlob(store::RowBlobstore, blobId::UUID) return getfield(store.blobs[blobId], :blob) end -function addBlob!(store::RowBlobStore{T}, blobId::UUID, blob::T) where {T} +function addBlob!(store::RowBlobstore{T}, blobId::UUID, blob::T) where {T} if haskey(store.blobs, blobId) error("Key '$blobId' blob already exists.") end @@ -411,21 +411,21 @@ function addBlob!(store::RowBlobStore{T}, blobId::UUID, blob::T) where {T} return blobId end -function updateBlob!(store::RowBlobStore{T}, blobId::UUID, blob::T) where {T} +function updateBlob!(store::RowBlobstore{T}, blobId::UUID, blob::T) where {T} if haskey(store.blobs, blobId) @warn "Key '$blobId' doesn't exist." end return store.blobs[blobId] = RowBlob(blobId, blob) end -function deleteBlob!(store::RowBlobStore, blobId::UUID) +function deleteBlob!(store::RowBlobstore, blobId::UUID) getfield(pop!(store.blobs, blobId), :blob) return 1 end -hasBlob(store::RowBlobStore, blobId::UUID) = haskey(store.blobs, blobId) +hasBlob(store::RowBlobstore, blobId::UUID) = haskey(store.blobs, blobId) -listBlobs(store::RowBlobStore) = collect(keys(store.blobs)) +listBlobs(store::RowBlobstore) = collect(keys(store.blobs)) # TODO also see about wrapping a table directly ## @@ -434,7 +434,7 @@ if false Tables.columnnames(rb) - tstore = RowBlobStore(:namedtuple, @NamedTuple{a::Vector{Int}, b::Vector{Int}}) + tstore = RowBlobstore(:namedtuple, @NamedTuple{a::Vector{Int}, b::Vector{Int}}) addBlob!(tstore, uuid4(), (a = [1, 2], b = [3, 4])) addBlob!(tstore, uuid4(), (a = [5, 6], b = [7, 8])) @@ -456,7 +456,7 @@ if false b::Float64 end - sstore = RowBlobStore(:struct_Foo, Foo) + sstore = RowBlobstore(:struct_Foo, Foo) addBlob!(sstore, uuid4(), Foo(1, 2)) addBlob!(sstore, uuid4(), Foo(3, 4)) diff --git a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl index a61ce760..7cd6d4e3 100644 --- a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl +++ b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl @@ -7,16 +7,16 @@ """ Get the blob entry and blob for the specified blobstore or dfg retured as a tuple. Related -[`getBlobEntry`](@ref) +[`getBlobentry`](@ref) $(METHODLIST) """ function getData end """ -Add both a BlobEntry and Blob to a distributed factor graph or BlobStore. +Add both a Blobentry and Blob to a distributed factor graph or Blobstore. Related -[`addBlobEntry!`](@ref) +[`addBlobentry!`](@ref) $(METHODLIST) """ @@ -34,15 +34,15 @@ function updateData! end """ Delete a blob entry and blob from the blob store or dfg. Related -[`deleteBlobEntry!`](@ref) +[`deleteBlobentry!`](@ref) $(METHODLIST) """ function deleteData! end -# construction helper from existing BlobEntry for user overriding via kwargs -function BlobEntry( - entry::BlobEntry; +# construction helper from existing Blobentry for user overriding via kwargs +function Blobentry( + entry::Blobentry; id::Union{UUID, Nothing} = entry.id, blobId::Union{UUID, Nothing} = entry.blobId, originId::UUID = entry.originId, @@ -59,7 +59,7 @@ function BlobEntry( lastUpdatedTimestamp = entry.lastUpdatedTimestamp, _version::String = entry._version, ) - return BlobEntry(; + return Blobentry(; id, blobId, originId, @@ -86,8 +86,8 @@ function getData( checkhash::Bool = true, getlast::Bool = true, ) - _getblobentr(g, v, k) = getBlobEntries(g, v, k) - _getblobentr(g, v, k::UUID) = [getBlobEntry(g, v, k);] + _getblobentr(g, v, k) = getBlobentries(g, v, k) + _getblobentr(g, v, k::UUID) = [getBlobentry(g, v, k);] de_ = _getblobentr(dfg, vlabel, key) lbls = (s -> s.label).(de_) idx = sortperm(lbls; rev = getlast) @@ -107,14 +107,14 @@ end # This is the normal one function getData( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, label::Symbol, key::Symbol; hashfunction = sha256, checkhash::Bool = true, getlast::Bool = true, ) - de = getBlobEntry(dfg, label, key) + de = getBlobentry(dfg, label, key) db = getBlob(blobstore, de) checkhash && assertHash(de, db; hashfunction) return de => db @@ -124,30 +124,30 @@ end function addData!( dfg::AbstractDFG, label::Symbol, - entry::BlobEntry, + entry::Blobentry, blob::Vector{UInt8}; hashfunction = sha256, checkhash::Bool = false, ) checkhash && assertHash(entry, blob; hashfunction) blobId = addBlob!(dfg, entry, blob) |> UUID - newEntry = BlobEntry(entry; blobId) #, size=length(blob)) - return addBlobEntry!(dfg, label, newEntry) + newEntry = Blobentry(entry; blobId) #, size=length(blob)) + return addBlobentry!(dfg, label, newEntry) end function addData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, label::Symbol, - entry::BlobEntry, + entry::Blobentry, blob::Vector{UInt8}; hashfunction = sha256, checkhash::Bool = false, ) checkhash && assertHash(entry, blob; hashfunction) blobId = addBlob!(blobstore, entry, blob) |> UUID - newEntry = BlobEntry(entry; blobId) #, size=length(blob)) - return addBlobEntry!(dfg, label, newEntry) + newEntry = Blobentry(entry; blobId) #, size=length(blob)) + return addBlobentry!(dfg, label, newEntry) end function addData!( @@ -161,7 +161,7 @@ function addData!( ) return addData!( dfg, - getBlobStore(dfg, blobstorekey), + getBlobstore(dfg, blobstorekey), vLbl, bLbl, blob, @@ -172,7 +172,7 @@ end function addData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, vLbl::Symbol, bLbl::Symbol, blob::Vector{UInt8}, @@ -186,7 +186,7 @@ function addData!( hashfunction = sha256, ) # - entry = BlobEntry(; + entry = Blobentry(; id, blobId, originId, @@ -205,7 +205,7 @@ end function addData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore{T}, + blobstore::AbstractBlobstore{T}, vLbl::Symbol, blobLabel::Symbol, blob::T, @@ -220,7 +220,7 @@ function addData!( # checkhash && assertHash(entry, blob; hashfunction) blobId = addBlob!(blobstore, blob) - entry = BlobEntry(; + entry = Blobentry(; blobId, originId = blobId, label = blobLabel, @@ -233,14 +233,14 @@ function addData!( metadata, timestamp, ) - addBlobEntry!(dfg, vLbl, entry) + addBlobentry!(dfg, vLbl, entry) return entry => blob end function updateData!( dfg::AbstractDFG, label::Symbol, - entry::BlobEntry, + entry::Blobentry, blob::Vector{UInt8}; hashfunction = sha256, checkhash::Bool = true, @@ -254,15 +254,15 @@ end function updateData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, label::Symbol, - entry::BlobEntry, + entry::Blobentry, blob::Vector{UInt8}; hashfunction = sha256, ) - # Recalculate the hash - NOTE Assuming that this is going to be a BlobEntry. TBD. + # Recalculate the hash - NOTE Assuming that this is going to be a Blobentry. TBD. # order of operations with unknown new blobId not tested - newEntry = BlobEntry( + newEntry = Blobentry( entry; # and kwargs to override new values blobstore = getLabel(blobstore), hash = string(bytes2hex(hashfunction(blob))), @@ -275,29 +275,29 @@ function updateData!( end function deleteData!(dfg::AbstractDFG, vLbl::Symbol, bLbl::Symbol) - de = getBlobEntry(dfg, vLbl, bLbl) - deleteBlobEntry!(dfg, vLbl, bLbl) + de = getBlobentry(dfg, vLbl, bLbl) + deleteBlobentry!(dfg, vLbl, bLbl) deleteBlob!(dfg, de) return 2 end function deleteData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, vLbl::Symbol, - entry::BlobEntry, + entry::Blobentry, ) return deleteData!(dfg, blobstore, vLbl, entry.label) end function deleteData!( dfg::AbstractDFG, - blobstore::AbstractBlobStore, + blobstore::AbstractBlobstore, vLbl::Symbol, bLbl::Symbol, ) - de = getBlobEntry(dfg, vLbl, bLbl) - deleteBlobEntry!(dfg, vLbl, bLbl) + de = getBlobentry(dfg, vLbl, bLbl) + deleteBlobentry!(dfg, vLbl, bLbl) deleteBlob!(blobstore, de) return 2 end diff --git a/src/Deprecated.jl b/src/Deprecated.jl index bf43c331..f6fdbbc6 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -3,12 +3,12 @@ ##================================================================================= @deprecate getNeighborhood(args...; kwargs...) listNeighborhood(args...; kwargs...) -@deprecate addBlob!(store::AbstractBlobStore, blobId::UUID, data, ::String) addBlob!( +@deprecate addBlob!(store::AbstractBlobstore, blobId::UUID, data, ::String) addBlob!( store, blobId, data, ) -@deprecate addBlob!(store::AbstractBlobStore{T}, data::T, ::String) where {T} addBlob!( +@deprecate addBlob!(store::AbstractBlobstore{T}, data::T, ::String) where {T} addBlob!( store, uuid4(), data, @@ -21,6 +21,47 @@ @deprecate updateGraphBlobEntry!(args...) mergeGraphBlobentry!(args...) @deprecate updateAgentBlobEntry!(args...) mergeAgentBlobentry!(args...) +@deprecate getBlobStore(args...) getBlobstore(args...) +@deprecate addBlobStore!(args...) addBlobstore!(args...) +@deprecate updateBlobStore!(args...) updateBlobstore!(args...) +@deprecate deleteBlobStore!(args...) deleteBlobstore!(args...) +@deprecate emptyBlobStore!(args...) emptyBlobstore!(args...) +@deprecate listBlobStores(args...) listBlobstores(args...) + +@deprecate BlobEntry(args...; kwargs...) Blobentry(args...; kwargs...) +@deprecate getGraphBlobEntry(args...; kwargs...) getGraphBlobentry(args...; kwargs...) +@deprecate getGraphBlobEntries(args...; kwargs...) getGraphBlobentries(args...; kwargs...) +@deprecate addGraphBlobEntry!(args...; kwargs...) addGraphBlobentry!(args...; kwargs...) +@deprecate addGraphBlobEntries!(args...; kwargs...) addGraphBlobentries!(args...; kwargs...) +@deprecate mergeGraphBlobEntry!(args...; kwargs...) mergeGraphBlobentry!(args...; kwargs...) +@deprecate deleteGraphBlobEntry!(args...; kwargs...) deleteGraphBlobentry!( + args...; + kwargs..., +) +@deprecate getAgentBlobEntry(args...; kwargs...) getAgentBlobentry(args...; kwargs...) +@deprecate getAgentBlobEntries(args...; kwargs...) getAgentBlobentries(args...; kwargs...) +@deprecate addAgentBlobEntry!(args...; kwargs...) addAgentBlobentry!(args...; kwargs...) +@deprecate addAgentBlobEntries!(args...; kwargs...) addAgentBlobentries!(args...; kwargs...) +@deprecate mergeAgentBlobEntry!(args...; kwargs...) mergeAgentBlobentry!(args...; kwargs...) +@deprecate deleteAgentBlobEntry!(args...; kwargs...) deleteAgentBlobentry!( + args...; + kwargs..., +) +@deprecate listGraphBlobEntries(args...; kwargs...) listGraphBlobentries(args...; kwargs...) +@deprecate listAgentBlobEntries(args...; kwargs...) listAgentBlobentries(args...; kwargs...) +@deprecate hasBlobEntry(args...; kwargs...) hasBlobentry(args...; kwargs...) +@deprecate getBlobEntry(args...; kwargs...) getBlobentry(args...; kwargs...) +@deprecate getBlobEntryFirst(args...; kwargs...) getBlobentryFirst(args...; kwargs...) +@deprecate addBlobEntry!(args...; kwargs...) addBlobentry!(args...; kwargs...) +@deprecate addBlobEntries!(args...; kwargs...) addBlobentries!(args...; kwargs...) +@deprecate mergeBlobEntry!(args...; kwargs...) mergeBlobentry!(args...; kwargs...) +@deprecate deleteBlobEntry!(args...; kwargs...) deleteBlobentry!(args...; kwargs...) +@deprecate listBlobEntrySequence(args...; kwargs...) listBlobentrySequence( + args...; + kwargs..., +) +@deprecate mergeBlobEntries!(args...; kwargs...) mergeBlobentries!(args...; kwargs...) + export updateVariableSolverData! #TODO possibly completely deprecated or not exported until update verb is standardized @@ -190,7 +231,7 @@ export DFGSummary DFGSummary(args) = error("DFGSummary is deprecated") @deprecate getSummary(dfg::AbstractDFG) getSummaryGraph(dfg) -@deprecate getKey(store::AbstractBlobStore) getLabel(store) +@deprecate getKey(store::AbstractBlobstore) getLabel(store) ##------------------------------------------------------------------------------ ## smallData diff --git a/src/DistributedFactorGraphs.jl b/src/DistributedFactorGraphs.jl index eda5775a..92a40252 100644 --- a/src/DistributedFactorGraphs.jl +++ b/src/DistributedFactorGraphs.jl @@ -61,7 +61,7 @@ export DFG ##------------------------------------------------------------------------------ export AbstractDFG export AbstractParams, NoSolverParams -export AbstractBlobStore +export AbstractBlobstore # accessors & crud export getDFGInfo @@ -75,23 +75,23 @@ export getDescription, setGraphMetadata!, getAddHistory -export getGraphBlobEntry, - getGraphBlobEntries, - addGraphBlobEntry!, - addGraphBlobEntries!, +export getGraphBlobentry, + getGraphBlobentries, + addGraphBlobentry!, + addGraphBlobentries!, mergeGraphBlobentry!, - deleteGraphBlobEntry!, - getAgentBlobEntry, - getAgentBlobEntries, - addAgentBlobEntry!, - addAgentBlobEntries!, + deleteGraphBlobentry!, + getAgentBlobentry, + getAgentBlobentries, + addAgentBlobentry!, + addAgentBlobentries!, mergeAgentBlobentry!, - deleteAgentBlobEntry!, - listGraphBlobEntries, - listAgentBlobEntries + deleteAgentBlobentry!, + listGraphBlobentries, + listAgentBlobentries -export getBlobStore, - addBlobStore!, updateBlobStore!, deleteBlobStore!, emptyBlobStore!, listBlobStores +export getBlobstore, + addBlobstore!, updateBlobstore!, deleteBlobstore!, emptyBlobstore!, listBlobstores # TODO Not sure these are needed or should work everywhere, implement in cloud? # NOTE not exporiting these for now. For consistency `get` and `set` might work better. @@ -223,19 +223,19 @@ export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph! # Entry Blob Data ##------------------------------------------------------------------------------ -export hasBlobEntry, - getBlobEntry, - getBlobEntryFirst, - addBlobEntry!, - addBlobEntries!, +export hasBlobentry, + getBlobentry, + getBlobentryFirst, + addBlobentry!, + addBlobentries!, mergeBlobentry!, - deleteBlobEntry!, - listBlobEntrySequence, - mergeBlobEntries! + deleteBlobentry!, + listBlobentrySequence, + mergeBlobentries! export incrDataLabelSuffix -export getBlobEntries -export getBlobEntriesVariables +export getBlobentries +export getBlobentriesVariables # convenience wrappers # aliases export addBlob! @@ -315,12 +315,12 @@ export compare, export printFactor, printVariable, printNode # Data Blobs -export InMemoryBlobStore +export InMemoryBlobstore export FolderStore -export BlobEntry -export getBlob, addBlob!, updateBlob!, deleteBlob!, hasBlob, listBlobEntries +export Blobentry +export getBlob, addBlob!, updateBlob!, deleteBlob!, hasBlob, listBlobentries export listBlobs -export BlobEntry +export Blobentry # export copyStore export getId, getHash, getTimestamp # convenience wrappers diff --git a/src/GraphsDFG/GraphsDFG.jl b/src/GraphsDFG/GraphsDFG.jl index f6ddcb4e..f97d86ec 100644 --- a/src/GraphsDFG/GraphsDFG.jl +++ b/src/GraphsDFG/GraphsDFG.jl @@ -46,12 +46,12 @@ import ...DistributedFactorGraphs: toDot, toDotFile, findShortestPathDijkstra, - getGraphBlobEntry, - getGraphBlobEntries, - addGraphBlobEntry!, - addGraphBlobEntries!, - listGraphBlobEntries, - listAgentBlobEntries, + getGraphBlobentry, + getGraphBlobentries, + addGraphBlobentry!, + addGraphBlobentries!, + listGraphBlobentries, + listAgentBlobentries, getTypeDFGVariables, getTypeDFGFactors diff --git a/src/GraphsDFG/entities/GraphsDFG.jl b/src/GraphsDFG/entities/GraphsDFG.jl index f582bd1e..2f4c58ee 100644 --- a/src/GraphsDFG/entities/GraphsDFG.jl +++ b/src/GraphsDFG/entities/GraphsDFG.jl @@ -20,18 +20,18 @@ mutable struct GraphsDFG{ userData::Union{Nothing, Dict{Symbol, SmallDataTypes}} robotData::Union{Nothing, Dict{Symbol, SmallDataTypes}} sessionData::Union{Nothing, Dict{Symbol, SmallDataTypes}} - userBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} - robotBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} - sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} + userBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} + robotBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} + sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} # --------------------------------- addHistory::Vector{Symbol} #TODO: Discuss more - is this an audit trail? solverParams::T # Solver parameters - blobStores::Dict{Symbol, AbstractBlobStore} + blobStores::Dict{Symbol, AbstractBlobstore} # new structure to replace URS graphLabel::Symbol # graph (session) label graphTags::Vector{Symbol} graphMetadata::Dict{Symbol, SmallDataTypes} # graph (session) metadata - graphBlobEntries::OrderedDict{Symbol, BlobEntry} #graph (session) blob entries + graphBlobEntries::OrderedDict{Symbol, Blobentry} #graph (session) blob entries agent::Agent # (robot) end @@ -94,12 +94,12 @@ function GraphsDFG{T, V, F}( g::FactorGraph{Int, V, F} = FactorGraph{Int, V, F}(); addHistory::Vector{Symbol} = Symbol[], solverParams::T = T(), - blobStores = Dict{Symbol, AbstractBlobStore}(), + blobStores = Dict{Symbol, AbstractBlobstore}(), # factor graph TODO maybe move to FactorGraph or make a new Graph struct to hold these (similar to Agent) graphLabel::Symbol = Symbol("factorgraph_", string(uuid4())[1:6]), graphTags::Vector{Symbol} = Symbol[], graphMetadata = Dict{Symbol, SmallDataTypes}(), - graphBlobEntries = OrderedDict{Symbol, BlobEntry}(), + graphBlobEntries = OrderedDict{Symbol, Blobentry}(), description::String = "", graphDescription::String = description, # agent @@ -107,7 +107,7 @@ function GraphsDFG{T, V, F}( agentDescription::String = "", agentTags::Vector{Symbol} = Symbol[], agentMetadata = Dict{Symbol, SmallDataTypes}(), - agentBlobEntries = OrderedDict{Symbol, BlobEntry}(), + agentBlobEntries = OrderedDict{Symbol, Blobentry}(), agent::Agent = Agent( agentLabel, agentDescription, @@ -123,9 +123,9 @@ function GraphsDFG{T, V, F}( userData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing, robotData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing, sessionData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing, - userBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing, - robotBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing, - sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing, + userBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing, + robotBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing, + sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing, ) where {T <: AbstractParams, V <: AbstractDFGVariable, F <: AbstractDFGFactor} if any([ !isnothing(userLabel), @@ -206,7 +206,7 @@ function GraphsDFG( robotData::Dict{Symbol, SmallDataTypes}, sessionData::Dict{Symbol, SmallDataTypes}, solverParams::AbstractParams, - blobStores = Dict{Symbol, AbstractBlobStore}(), + blobStores = Dict{Symbol, AbstractBlobstore}(), ) #deprecated in v0.25 Base.depwarn( @@ -236,7 +236,7 @@ function GraphsDFG{T, V, F}( robotData::Dict{Symbol, SmallDataTypes}, sessionData::Dict{Symbol, SmallDataTypes}, solverParams::T, - blobStores = Dict{Symbol, AbstractBlobStore}(), + blobStores = Dict{Symbol, AbstractBlobstore}(), ) where {T <: AbstractParams, V <: AbstractDFGVariable, F <: AbstractDFGFactor} #deprecated in v0.25 diff --git a/src/GraphsDFG/services/GraphsDFG.jl b/src/GraphsDFG/services/GraphsDFG.jl index f74e0919..7216b477 100644 --- a/src/GraphsDFG/services/GraphsDFG.jl +++ b/src/GraphsDFG/services/GraphsDFG.jl @@ -511,11 +511,11 @@ function traverseGraphTopologicalSort(fg::GraphsDFG, s::Symbol, fs_tree = bfs_tr end # FG blob entries -function getGraphBlobEntry(fg::GraphsDFG, label::Symbol) +function getGraphBlobentry(fg::GraphsDFG, label::Symbol) return fg.graphBlobEntries[label] end -function getGraphBlobEntries( +function getGraphBlobentries( fg::GraphsDFG, filt::Union{Nothing, String, Base.Fix2} = nothing, ) @@ -529,26 +529,26 @@ function getGraphBlobEntries( return entries end -function listGraphBlobEntries(fg::GraphsDFG) +function listGraphBlobentries(fg::GraphsDFG) return collect(keys(fg.graphBlobEntries)) end -function listAgentBlobEntries(fg::GraphsDFG) +function listAgentBlobentries(fg::GraphsDFG) return collect(keys(fg.agent.blobEntries)) end -function addGraphBlobEntry!(fg::GraphsDFG, entry::BlobEntry) +function addGraphBlobentry!(fg::GraphsDFG, entry::Blobentry) if haskey(fg.graphBlobEntries, entry.label) error( - "BlobEntry '$(entry.label)' already exists in the factor graph's blob entries.", + "Blobentry '$(entry.label)' already exists in the factor graph's blob entries.", ) end push!(fg.graphBlobEntries, entry.label => entry) return entry end -function addGraphBlobEntries!(fg::GraphsDFG, entries::Vector{BlobEntry}) +function addGraphBlobentries!(fg::GraphsDFG, entries::Vector{Blobentry}) return map(entries) do entry - return addGraphBlobEntry!(fg, entry) + return addGraphBlobentry!(fg, entry) end end diff --git a/src/GraphsDFG/services/GraphsDFGSerialization.jl b/src/GraphsDFG/services/GraphsDFGSerialization.jl index 45bdffa3..b229a06b 100644 --- a/src/GraphsDFG/services/GraphsDFGSerialization.jl +++ b/src/GraphsDFG/services/GraphsDFGSerialization.jl @@ -9,9 +9,9 @@ using InteractiveUtils userData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing robotData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing sessionData::Union{Nothing, Dict{Symbol, SmallDataTypes}} = nothing - userBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing - robotBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing - sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} = nothing + userBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing + robotBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing + sessionBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} = nothing # --------------------------------- addHistory::Vector{Symbol} solverParams::T @@ -25,7 +25,7 @@ using InteractiveUtils graphLabel::Union{Nothing, Symbol} graphTags::Union{Nothing, Vector{Symbol}} graphMetadata::Union{Nothing, Dict{Symbol, SmallDataTypes}} - graphBlobEntries::Union{Nothing, OrderedDict{Symbol, BlobEntry}} + graphBlobEntries::Union{Nothing, OrderedDict{Symbol, Blobentry}} agent::Union{Nothing, Agent} end @@ -55,7 +55,7 @@ function packDFGMetadata(fg::GraphsDFG) if store isa FolderStore{Vector{UInt8}} blobStores[getLabel(store)] = store else - @warn "BlobStore $(getLabel(store)) of type $(typeof(store)) is not supported yet and will not be saved" + @warn "Blobstore $(getLabel(store)) of type $(typeof(store)) is not supported yet and will not be saved" end end @@ -73,7 +73,7 @@ function unpackDFGMetadata(packed::PackedGraphsDFG) #FIXME Deprecate remove in DFG v0.24 # setdiff!(commonfields, [:blobStores]) - # blobStores = Dict{Symbol, AbstractBlobStore}() + # blobStores = Dict{Symbol, AbstractBlobstore}() # !isnothing(packed.blobStores) && merge!(blobStores, packed.blobStores) setdiff!(commonfields, [deprecatedDfgFields; :blobStores]) diff --git a/src/entities/Agent.jl b/src/entities/Agent.jl index 0036582d..d304384c 100644 --- a/src/entities/Agent.jl +++ b/src/entities/Agent.jl @@ -3,5 +3,5 @@ description::String = "" tags::Vector{Symbol} = Symbol[] metadata::Dict{Symbol, SmallDataTypes} = Dict{Symbol, SmallDataTypes}() - blobEntries::OrderedDict{Symbol, BlobEntry} = OrderedDict{Symbol, BlobEntry}() + blobEntries::OrderedDict{Symbol, Blobentry} = OrderedDict{Symbol, Blobentry}() end diff --git a/src/entities/DFGFactor.jl b/src/entities/DFGFactor.jl index d23e5bd5..8b4b66f9 100644 --- a/src/entities/DFGFactor.jl +++ b/src/entities/DFGFactor.jl @@ -104,7 +104,7 @@ Base.@kwdef struct FactorDFG <: AbstractDFGFactor data::String metadata::String _version::String = string(_getDFGVersion()) - # blobEntries::Vector{BlobEntry}#TODO should factor have blob entries? + # blobEntries::Vector{Blobentry}#TODO should factor have blob entries? end #TODO type not in DFG FactorDFG, should it be? # _type::String diff --git a/src/entities/DFGVariable.jl b/src/entities/DFGVariable.jl index c6f55c00..54a42405 100644 --- a/src/entities/DFGVariable.jl +++ b/src/entities/DFGVariable.jl @@ -223,7 +223,7 @@ Base.@kwdef struct VariableDFG <: AbstractDFGVariable timestamp::ZonedDateTime = now(tz"UTC") nstime::String = "0" ppes::Vector{MeanMaxPPE} = MeanMaxPPE[] - blobEntries::Vector{BlobEntry} = BlobEntry[] + blobEntries::Vector{Blobentry} = Blobentry[] variableType::String _version::String = string(_getDFGVersion()) metadata::String = "e30=" @@ -311,8 +311,8 @@ Base.@kwdef struct VariableCompute{T <: InferenceVariable, P, N} <: AbstractDFGV Accessors: [`getMetadata`](@ref), [`setMetadata!`](@ref)""" smallData::Dict{Symbol, SmallDataTypes} = Dict{Symbol, SmallDataTypes}() """Dictionary of large data associated with this variable. - Accessors: [`addBlobEntry!`](@ref), [`getBlobEntry`](@ref), [`mergeBlobentry!`](@ref), and [`deleteBlobEntry!`](@ref)""" - dataDict::Dict{Symbol, BlobEntry} = Dict{Symbol, BlobEntry}() + Accessors: [`addBlobentry!`](@ref), [`getBlobentry`](@ref), [`mergeBlobentry!`](@ref), and [`deleteBlobentry!`](@ref)""" + dataDict::Dict{Symbol, Blobentry} = Dict{Symbol, Blobentry}() """Solvable flag for the variable. Accessors: [`getSolvable`](@ref), [`setSolvable!`](@ref)""" solvable::Base.RefValue{Int} = Ref(1) @@ -405,8 +405,8 @@ Base.@kwdef struct VariableSummary <: AbstractDFGVariable Accessor: [`getVariableType`](@ref)""" variableTypeName::Symbol """Dictionary of large data associated with this variable. - Accessors: [`addBlobEntry!`](@ref), [`getBlobEntry`](@ref), [`mergeBlobentry!`](@ref), and [`deleteBlobEntry!`](@ref)""" - dataDict::Dict{Symbol, BlobEntry} + Accessors: [`addBlobentry!`](@ref), [`getBlobentry`](@ref), [`mergeBlobentry!`](@ref), and [`deleteBlobentry!`](@ref)""" + dataDict::Dict{Symbol, Blobentry} end function VariableSummary(id, label, timestamp, tags, ::Nothing, variableTypeName, ::Nothing) @@ -417,7 +417,7 @@ function VariableSummary(id, label, timestamp, tags, ::Nothing, variableTypeName tags, Dict{Symbol, MeanMaxPPE}(), variableTypeName, - Dict{Symbol, BlobEntry}(), + Dict{Symbol, Blobentry}(), ) end diff --git a/src/services/AbstractDFG.jl b/src/services/AbstractDFG.jl index 1c77fbce..2b39a629 100644 --- a/src/services/AbstractDFG.jl +++ b/src/services/AbstractDFG.jl @@ -22,7 +22,7 @@ Base.Broadcast.broadcastable(dfg::AbstractDFG) = Ref(dfg) # - `sessionData::Dict{Symbol, String}` # - `solverParams::T<:AbstractParams` # - `addHistory::Vector{Symbol}` -# - `blobStores::Dict{Symbol, AbstractBlobStore}` +# - `blobStores::Dict{Symbol, AbstractBlobstore}` # AbstractDFG Accessors ##------------------------------------------------------------------------------ @@ -232,50 +232,50 @@ emptyGraphMetadata!(dfg::AbstractDFG) = empty!(dfg.graphMetadata) ## Agent/Graph/Model Blob Entries CRUD ##============================================================================== -function getGraphBlobEntry end -function getGraphBlobEntries end -function addGraphBlobEntry! end -function addGraphBlobEntries! end +function getGraphBlobentry end +function getGraphBlobentries end +function addGraphBlobentry! end +function addGraphBlobentries! end function mergeGraphBlobentry! end -function deleteGraphBlobEntry! end +function deleteGraphBlobentry! end -function getAgentBlobEntry end -function getAgentBlobEntries end -function addAgentBlobEntry! end -function addAgentBlobEntries! end +function getAgentBlobentry end +function getAgentBlobentries end +function addAgentBlobentry! end +function addAgentBlobentries! end function mergeAgentBlobentry! end -function deleteAgentBlobEntry! end +function deleteAgentBlobentry! end -function getModelBlobEntry end -function getModelBlobEntries end -function addModelBlobEntry! end -function addModelBlobEntries! end -function updateModelBlobEntry! end -function deleteModelBlobEntry! end +function getModelBlobentry end +function getModelBlobentries end +function addModelBlobentry! end +function addModelBlobentries! end +function updateModelBlobentry! end +function deleteModelBlobentry! end -function listGraphBlobEntries end -function listAgentBlobEntries end -function listModelBlobEntries end +function listGraphBlobentries end +function listAgentBlobentries end +function listModelBlobentries end ##============================================================================== -## AbstractBlobStore CRUD +## AbstractBlobstore CRUD ##============================================================================== -# AbstractBlobStore should have label or overwrite getLabel +# AbstractBlobstore should have label or overwrite getLabel -getBlobStores(dfg::AbstractDFG) = dfg.blobStores -getBlobStore(dfg::AbstractDFG, key::Symbol) = dfg.blobStores[key] -function addBlobStore!(dfg::AbstractDFG, bs::AbstractBlobStore) +getBlobstores(dfg::AbstractDFG) = dfg.blobStores +getBlobstore(dfg::AbstractDFG, key::Symbol) = dfg.blobStores[key] +function addBlobstore!(dfg::AbstractDFG, bs::AbstractBlobstore) return push!(dfg.blobStores, getLabel(bs) => bs) end -function updateBlobStore!(dfg::AbstractDFG, bs::AbstractBlobStore) +function updateBlobstore!(dfg::AbstractDFG, bs::AbstractBlobstore) return push!(dfg.blobStores, getLabel(bs) => bs) end -function deleteBlobStore!(dfg::AbstractDFG, key::Symbol) +function deleteBlobstore!(dfg::AbstractDFG, key::Symbol) pop!(dfg.blobStores, key) return 1 end -emptyBlobStore!(dfg::AbstractDFG) = empty!(dfg.blobStores) -listBlobStores(dfg::AbstractDFG) = collect(keys(dfg.blobStores)) +emptyBlobstore!(dfg::AbstractDFG) = empty!(dfg.blobStores) +listBlobstores(dfg::AbstractDFG) = collect(keys(dfg.blobStores)) ##============================================================================== ## CRUD Interfaces diff --git a/src/services/CustomPrinting.jl b/src/services/CustomPrinting.jl index 620d2218..793d17dd 100644 --- a/src/services/CustomPrinting.jl +++ b/src/services/CustomPrinting.jl @@ -81,7 +81,7 @@ function printVariable( print(ioc, " :$key ") println(ioc, "<-- .suggested: ", round.(ppe.suggested, digits = 4)) end - println(ioc, " # BlobEntries: (", length(listBlobEntries(vert)), ")") + println(ioc, " # Blobentries: (", length(listBlobentries(vert)), ")") printstyled(ioc, " VariableType: "; color = :blue, bold = true) println(ioc, vari) # println(ioc, "kde max: $(round.(getKDEMax(getBelief(vnd)),digits=4))") diff --git a/src/services/Serialization.jl b/src/services/Serialization.jl index 458e1024..808bd567 100644 --- a/src/services/Serialization.jl +++ b/src/services/Serialization.jl @@ -222,7 +222,7 @@ function unpackVariable(variable::VariableDFG; skipVersionCheck::Bool = false) map(sd -> sd.solveKey, variable.solverData) .=> map(sd -> DFG.unpackVariableNodeData(sd), variable.solverData), ) - dataDict = Dict{Symbol, BlobEntry}( + dataDict = Dict{Symbol, Blobentry}( map(de -> de.label, variable.blobEntries) .=> variable.blobEntries, ) metadata = JSON3.read(base64decode(variable.metadata), Dict{Symbol, DFG.SmallDataTypes}) diff --git a/test/GraphsDFGSummaryTypes.jl b/test/GraphsDFGSummaryTypes.jl index 73c38f1d..d668b83f 100644 --- a/test/GraphsDFGSummaryTypes.jl +++ b/test/GraphsDFGSummaryTypes.jl @@ -11,7 +11,7 @@ function DistributedFactorGraphs.VariableSummary(label::Symbol) Set{Symbol}(), Dict{Symbol, MeanMaxPPE}(), :Pose2, - Dict{Symbol, BlobEntry}(), + Dict{Symbol, Blobentry}(), ) end @@ -26,7 +26,7 @@ function DistributedFactorGraphs.VariableSummary( Set{Symbol}(), Dict{Symbol, MeanMaxPPE}(), Symbol(T), - Dict{Symbol, BlobEntry}(), + Dict{Symbol, Blobentry}(), ) end diff --git a/test/consol_DataEntryBlobTests.jl b/test/consol_DataEntryBlobTests.jl index fe2bf680..f7178594 100644 --- a/test/consol_DataEntryBlobTests.jl +++ b/test/consol_DataEntryBlobTests.jl @@ -45,21 +45,21 @@ dataset2 = rand(UInt8, 1000) # @test ade == ade2 == ade3 # @test adb == adb2 == adb3 -# @test :random in listBlobEntries(dfg, :x2) -# @test length(listBlobEntries(dfg, :x1)) === 0 -# @test length(listBlobEntries(dfg, :x2)) === 1 +# @test :random in listBlobentries(dfg, :x2) +# @test length(listBlobentries(dfg, :x1)) === 0 +# @test length(listBlobentries(dfg, :x2)) === 1 -# mergeBlobEntries!(dfg, :x1, dfg, :x2, :random) +# mergeBlobentries!(dfg, :x1, dfg, :x2, :random) -# @test length(listBlobEntries(dfg, :x1)) === 1 -# @test :random in listBlobEntries(dfg, :x1) -# @test length(listBlobEntries(dfg, :x2)) === 1 +# @test length(listBlobentries(dfg, :x1)) === 1 +# @test :random in listBlobentries(dfg, :x1) +# @test length(listBlobentries(dfg, :x2)) === 1 # deleteBlob!(dfg, :x1, :random) # deleteBlob!(dfg, :x2, :random) -# @test length(listBlobEntries(dfg, :x1)) === 0 -# @test length(listBlobEntries(dfg, :x2)) === 0 +# @test length(listBlobentries(dfg, :x1)) === 0 +# @test length(listBlobentries(dfg, :x2)) === 0 # ##============================================================================== # ## FileDataEntry @@ -88,7 +88,7 @@ dataset2 = rand(UInt8, 1000) # Create a data store and add it to DFG mkpath("/tmp/dfgFolderStore") ds = FolderStore{Vector{UInt8}}(:filestore, "/tmp/dfgFolderStore") -addBlobStore!(dfg, ds) +addBlobstore!(dfg, ds) ade = addData!(dfg, :filestore, :x1, :random, dataset1) _ = addData!(dfg, :filestore, :x1, :another_1, dataset1) @@ -126,12 +126,12 @@ dfs = FolderStore("/tmp/defaultfolderstore") @test dfs isa FolderStore{Vector{UInt8}} ##============================================================================== -## InMemoryBlobStore +## InMemoryBlobstore ##============================================================================== # Create a data store and add it to DFG -ds = InMemoryBlobStore() -addBlobStore!(dfg, ds) +ds = InMemoryBlobstore() +addBlobstore!(dfg, ds) ade = addData!(dfg, :default_inmemory_store, :x1, :random, dataset1) gde, gdb = getData(dfg, :x1, :random) @@ -156,7 +156,7 @@ deleteData!(dfg, :x2, :random) ##============================================================================== ## Unimplemented store ##============================================================================== -struct TestStore{T} <: DFG.AbstractBlobStore{T} end +struct TestStore{T} <: DFG.AbstractBlobstore{T} end store = TestStore{Int}() diff --git a/test/fileDFGTests.jl b/test/fileDFGTests.jl index 1b8593af..7f21d57a 100644 --- a/test/fileDFGTests.jl +++ b/test/fileDFGTests.jl @@ -24,9 +24,9 @@ using UUIDs # Add some data entries map( - v -> addBlobEntry!( + v -> addBlobentry!( v, - BlobEntry(; + Blobentry(; blobId = uuid4(), label = :testing, blobstore = :store, @@ -40,9 +40,9 @@ using UUIDs verts, ) map( - v -> addBlobEntry!( + v -> addBlobentry!( v, - BlobEntry(; + Blobentry(; blobId = uuid4(), label = :testing2, blobstore = :store, @@ -95,7 +95,7 @@ using UUIDs #test user/robot/session metadata #test user/robot/session blob entries - be = BlobEntry(; + be = Blobentry(; blobId = uuid4(), label = :testing2, blobstore = :store, @@ -106,8 +106,8 @@ using UUIDs timestamp = ZonedDateTime(2023, 2, 3, 20, tz"UTC+1"), ) - addGraphBlobEntry!(dfg, be) - #TODO addAgentBlobEntry!(dfg, be) + addGraphBlobentry!(dfg, be) + #TODO addAgentBlobentry!(dfg, be) smallRobotData = Dict{Symbol, SmallDataTypes}(:a => "43", :b => "small_robot") smallSessionData = Dict{Symbol, SmallDataTypes}(:a => "44", :b => "small_session") @@ -144,8 +144,8 @@ using UUIDs # Check data entries for v in ls(dfg) - @test getBlobEntries(getVariable(dfg, v)) == - getBlobEntries(getVariable(retDFG, v)) + @test getBlobentries(getVariable(dfg, v)) == + getBlobentries(getVariable(retDFG, v)) @test issetequal(listPPEs(dfg, v), listPPEs(retDFG, v)) for ppe in listPPEs(dfg, v) @test getPPE(dfg, v, ppe) == getPPE(retDFG, v, ppe) diff --git a/test/iifInterfaceTests.jl b/test/iifInterfaceTests.jl index f1dae890..151f9390 100644 --- a/test/iifInterfaceTests.jl +++ b/test/iifInterfaceTests.jl @@ -220,7 +220,7 @@ end end @testset "Data Entries" begin - de1 = BlobEntry(; + de1 = Blobentry(; originId = uuid4(), label = :key1, blobstore = :test, @@ -230,7 +230,7 @@ end mimeType = "", ) - de2 = BlobEntry(; + de2 = Blobentry(; originId = uuid4(), label = :key2, blobstore = :test, @@ -240,7 +240,7 @@ end mimeType = "", ) - de2_update = BlobEntry(; + de2_update = Blobentry(; originId = uuid4(), label = :key2, blobstore = :test, @@ -252,37 +252,37 @@ end #add v1 = getVariable(dfg, :a) - @test addBlobEntry!(v1, de1) == de1 - @test addBlobEntry!(dfg, :a, de2) == de2 - @test_throws ErrorException addBlobEntry!(v1, de1) - @test de2 in getBlobEntries(v1) + @test addBlobentry!(v1, de1) == de1 + @test addBlobentry!(dfg, :a, de2) == de2 + @test_throws ErrorException addBlobentry!(v1, de1) + @test de2 in getBlobentries(v1) #get - @test deepcopy(de1) == getBlobEntry(v1, :key1) - @test deepcopy(de2) == getBlobEntry(dfg, :a, :key2) - @test_throws KeyError getBlobEntry(v2, :key1) - @test_throws KeyError getBlobEntry(dfg, :b, :key1) + @test deepcopy(de1) == getBlobentry(v1, :key1) + @test deepcopy(de2) == getBlobentry(dfg, :a, :key2) + @test_throws KeyError getBlobentry(v2, :key1) + @test_throws KeyError getBlobentry(dfg, :b, :key1) #update @test mergeBlobentry!(dfg, :a, de2_update) == 1 - @test deepcopy(de2_update) == getBlobEntry(dfg, :a, :key2) + @test deepcopy(de2_update) == getBlobentry(dfg, :a, :key2) @test mergeBlobentry!(dfg, :b, de2_update) == 1 #list - entries = getBlobEntries(dfg, :a) + entries = getBlobentries(dfg, :a) @test length(entries) == 2 @test issetequal(map(e -> e.label, entries), [:key1, :key2]) - @test length(getBlobEntries(dfg, :b)) == 1 + @test length(getBlobentries(dfg, :b)) == 1 - @test issetequal(listBlobEntries(dfg, :a), [:key1, :key2]) - @test listBlobEntries(dfg, :b) == Symbol[:key2] + @test issetequal(listBlobentries(dfg, :a), [:key1, :key2]) + @test listBlobentries(dfg, :b) == Symbol[:key2] #delete - @test deleteBlobEntry!(v1, :key1) == 1 - @test listBlobEntries(v1) == Symbol[:key2] + @test deleteBlobentry!(v1, :key1) == 1 + @test listBlobentries(v1) == Symbol[:key2] #delete from ddfg - @test deleteBlobEntry!(dfg, :a, :key2) == 1 - @test listBlobEntries(v1) == Symbol[] + @test deleteBlobentry!(dfg, :a, :key2) == 1 + @test listBlobentries(v1) == Symbol[] end @testset "Updating Nodes and Estimates" begin diff --git a/test/interfaceTests.jl b/test/interfaceTests.jl index 77954088..7a71643a 100644 --- a/test/interfaceTests.jl +++ b/test/interfaceTests.jl @@ -34,7 +34,7 @@ end end @testset "User, Robot, Session Blob Entries" begin - GraphAgentBlobEntries!(fg1) + GraphAgentBlobentries!(fg1) end # VariableCompute structure construction and accessors @@ -66,10 +66,10 @@ end # for julia v1.6 if DistributedFactorGraphs._getDFGVersion() < v"0.19" @test String(take!(iobuf)) == - "VariableCompute{TestVariableType1}\nid:\nnothing\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict{Symbol, Union{Bool, Float64, Int64, Vector{Bool}, Vector{Float64}, Vector{Int64}, Vector{String}, String}}(:small=>\"data\")\ndataDict:\nDict{Symbol, DistributedFactorGraphs.BlobEntry}()\nsolvable:\n0\n" + "VariableCompute{TestVariableType1}\nid:\nnothing\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict{Symbol, Union{Bool, Float64, Int64, Vector{Bool}, Vector{Float64}, Vector{Int64}, Vector{String}, String}}(:small=>\"data\")\ndataDict:\nDict{Symbol, DistributedFactorGraphs.Blobentry}()\nsolvable:\n0\n" else @test String(take!(iobuf)) == - "VariableCompute{TestVariableType1, Vector{Float64}, 1}\nid:\nnothing\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict{Symbol, Union{Bool, Float64, Int64, Vector{Bool}, Vector{Float64}, Vector{Int64}, Vector{String}, String}}(:small=>\"data\")\ndataDict:\nDict{Symbol, BlobEntry}()\nsolvable:\n0\n" + "VariableCompute{TestVariableType1, Vector{Float64}, 1}\nid:\nnothing\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict{Symbol, Union{Bool, Float64, Int64, Vector{Bool}, Vector{Float64}, Vector{Int64}, Vector{String}, String}}(:small=>\"data\")\ndataDict:\nDict{Symbol, Blobentry}()\nsolvable:\n0\n" end @test printVariable(iobuf, var1; short = true) === nothing diff --git a/test/sandbox.jl b/test/sandbox.jl index 48a01c48..11a45896 100644 --- a/test/sandbox.jl +++ b/test/sandbox.jl @@ -18,7 +18,7 @@ dfg = Neo4jDFG{SolverParams}( Symbol[], SolverParams(); createSessionNodes = false, - blobStores = Dict{Symbol, AbstractBlobStore}(), + blobStores = Dict{Symbol, AbstractBlobstore}(), ) createDfgSessionIfNotExist(dfg) diff --git a/test/testBlocks.jl b/test/testBlocks.jl index a76d2d82..5c9af8c1 100644 --- a/test/testBlocks.jl +++ b/test/testBlocks.jl @@ -253,8 +253,8 @@ function GraphAgentMetadata!(fg::AbstractDFG) end # User, Robot, Session Data Blob Entries -function GraphAgentBlobEntries!(fg::AbstractDFG) - be = BlobEntry(; +function GraphAgentBlobentries!(fg::AbstractDFG) + be = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -274,9 +274,9 @@ function GraphAgentBlobEntries!(fg::AbstractDFG) #TODO # Session Blob Entries - ae = addGraphBlobEntry!(fg, be) + ae = addGraphBlobentry!(fg, be) @test ae == be - ge = getGraphBlobEntry(fg, :key1) + ge = getGraphBlobentry(fg, :key1) @test ge == be #TODO @@ -904,15 +904,15 @@ end function DataEntriesTestBlock!(fg, v2) # "Data Entries" - # getBlobEntry - # addBlobEntry - # updateBlobEntry - # deleteBlobEntry - # getBlobEntries - # listBlobEntries + # getBlobentry + # addBlobentry + # updateBlobentry + # deleteBlobentry + # getBlobentries + # listBlobentries # emptyDataEntries # mergeDataEntries - storeEntry = BlobEntry(; + storeEntry = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -931,7 +931,7 @@ function DataEntriesTestBlock!(fg, v2) # oid = zeros(UInt8,12); oid[12] = 0x01 # de1 = MongodbDataEntry(:key1, uuid4(), NTuple{12,UInt8}(oid), "", now(localzone())) - de1 = BlobEntry(; + de1 = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -946,7 +946,7 @@ function DataEntriesTestBlock!(fg, v2) # oid = zeros(UInt8,12); oid[12] = 0x02 # de2 = MongodbDataEntry(:key2, uuid4(), NTuple{12,UInt8}(oid), "", now(localzone())) - de2 = BlobEntry(; + de2 = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -961,7 +961,7 @@ function DataEntriesTestBlock!(fg, v2) # oid = zeros(UInt8,12); oid[12] = 0x03 # de2_update = MongodbDataEntry(:key2, uuid4(), NTuple{12,UInt8}(oid), "", now(localzone())) - de2_update = BlobEntry(; + de2_update = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -976,52 +976,52 @@ function DataEntriesTestBlock!(fg, v2) #add v1 = getVariable(fg, :a) - @test addBlobEntry!(v1, de1) == de1 - @test addBlobEntry!(fg, :a, de2) == de2 - @test_throws ErrorException addBlobEntry!(v1, de1) - @test de2 in getBlobEntries(v1) + @test addBlobentry!(v1, de1) == de1 + @test addBlobentry!(fg, :a, de2) == de2 + @test_throws ErrorException addBlobentry!(v1, de1) + @test de2 in getBlobentries(v1) #get - @test deepcopy(de1) == getBlobEntry(v1, :key1) - @test deepcopy(de2) == getBlobEntry(fg, :a, :key2) - @test_throws KeyError getBlobEntry(v2, :key1) - @test_throws KeyError getBlobEntry(fg, :b, :key1) + @test deepcopy(de1) == getBlobentry(v1, :key1) + @test deepcopy(de2) == getBlobentry(fg, :a, :key2) + @test_throws KeyError getBlobentry(v2, :key1) + @test_throws KeyError getBlobentry(fg, :b, :key1) #update @test mergeBlobentry!(fg, :a, de2_update) == 1 - @test deepcopy(de2_update) == getBlobEntry(fg, :a, :key2) + @test deepcopy(de2_update) == getBlobentry(fg, :a, :key2) @test mergeBlobentry!(fg, :b, de2_update) == 1 #list - entries = getBlobEntries(fg, :a) + entries = getBlobentries(fg, :a) @test length(entries) == 2 @test issetequal(map(e -> e.label, entries), [:key1, :key2]) - @test length(getBlobEntries(fg, :b)) == 1 + @test length(getBlobentries(fg, :b)) == 1 - @test issetequal(listBlobEntries(fg, :a), [:key1, :key2]) - @test listBlobEntries(fg, :b) == Symbol[:key2] + @test issetequal(listBlobentries(fg, :a), [:key1, :key2]) + @test listBlobentries(fg, :b) == Symbol[:key2] #delete - @test deleteBlobEntry!(v1, de1) == 1 - @test listBlobEntries(v1) == Symbol[:key2] + @test deleteBlobentry!(v1, de1) == 1 + @test listBlobentries(v1) == Symbol[:key2] #delete from dfg - @test deleteBlobEntry!(fg, :a, :key2) == 1 - @test listBlobEntries(v1) == Symbol[] - deleteBlobEntry!(fg, :b, :key2) + @test deleteBlobentry!(fg, :a, :key2) == 1 + @test listBlobentries(v1) == Symbol[] + deleteBlobentry!(fg, :b, :key2) # packed variable data entries pacv = packVariable(v1) - @test addBlobEntry!(pacv, de1) == de1 - @test hasBlobEntry(pacv, :key1) - @test deepcopy(de1) == getBlobEntry(pacv, :key1) - @test getBlobEntries(pacv) == [deepcopy(de1)] - @test issetequal(listBlobEntries(pacv), [:key1]) - # @test deleteBlobEntry!(pacv, de1) == de1 + @test addBlobentry!(pacv, de1) == de1 + @test hasBlobentry(pacv, :key1) + @test deepcopy(de1) == getBlobentry(pacv, :key1) + @test getBlobentries(pacv) == [deepcopy(de1)] + @test issetequal(listBlobentries(pacv), [:key1]) + # @test deleteBlobentry!(pacv, de1) == de1 end function blobsStoresTestBlock!(fg) - de1 = BlobEntry(; + de1 = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -1033,7 +1033,7 @@ function blobsStoresTestBlock!(fg) mimeType = "mimetype1", metadata = "", ) - de2 = BlobEntry(; + de2 = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -1046,7 +1046,7 @@ function blobsStoresTestBlock!(fg) metadata = "", timestamp = ZonedDateTime("2020-08-12T12:00:00.000+00:00"), ) - de2_update = BlobEntry(; + de2_update = Blobentry(; id = uuid4(), blobId = uuid4(), originId = uuid4(), @@ -1067,65 +1067,65 @@ function blobsStoresTestBlock!(fg) #add var1 = getVariable(fg, :a) var2 = getVariable(fg, :b) - @test addBlobEntry!(var1, de1) == de1 + @test addBlobentry!(var1, de1) == de1 mergeVariable!(fg, var1) - @test addBlobEntry!(fg, :a, de2) == de2 - @test_throws ErrorException addBlobEntry!(var1, de1) - @test de2 in getBlobEntries(fg, var1.label) + @test addBlobentry!(fg, :a, de2) == de2 + @test_throws ErrorException addBlobentry!(var1, de1) + @test de2 in getBlobentries(fg, var1.label) #get - @test deepcopy(de1) == getBlobEntry(var1, :label1) - @test deepcopy(de2) == getBlobEntry(fg, :a, :label2) - @test_throws KeyError getBlobEntry(var2, :label1) - @test_throws KeyError getBlobEntry(fg, :b, :label1) + @test deepcopy(de1) == getBlobentry(var1, :label1) + @test deepcopy(de2) == getBlobentry(fg, :a, :label2) + @test_throws KeyError getBlobentry(var2, :label1) + @test_throws KeyError getBlobentry(fg, :b, :label1) #update @test mergeBlobentry!(fg, :a, de2_update) == 1 - @test deepcopy(de2_update) == getBlobEntry(fg, :a, :label2) + @test deepcopy(de2_update) == getBlobentry(fg, :a, :label2) @test mergeBlobentry!(fg, :b, de2_update) == 1 #list - entries = getBlobEntries(fg, :a) + entries = getBlobentries(fg, :a) @test length(entries) == 2 @test issetequal(map(e -> e.label, entries), [:label1, :label2]) - @test length(getBlobEntries(fg, :b)) == 1 + @test length(getBlobentries(fg, :b)) == 1 - @test issetequal(listBlobEntries(fg, :a), [:label1, :label2]) - @test listBlobEntries(fg, :b) == Symbol[:label2] + @test issetequal(listBlobentries(fg, :a), [:label1, :label2]) + @test listBlobentries(fg, :b) == Symbol[:label2] #delete - @test deleteBlobEntry!(fg, var1.label, de1.label) == 1 - @test listBlobEntries(fg, var1.label) == Symbol[:label2] + @test deleteBlobentry!(fg, var1.label, de1.label) == 1 + @test listBlobentries(fg, var1.label) == Symbol[:label2] #delete from dfg - @test deleteBlobEntry!(fg, :a, :label2) == 1 + @test deleteBlobentry!(fg, :a, :label2) == 1 var1 = getVariable(fg, :a) - @test listBlobEntries(var1) == Symbol[] + @test listBlobentries(var1) == Symbol[] # Blobstore functions fs = FolderStore("/tmp/$(string(uuid4())[1:8])") # Adding - addBlobStore!(fg, fs) + addBlobstore!(fg, fs) # Listing - @test listBlobStores(fg) == [fs.label] + @test listBlobstores(fg) == [fs.label] # Getting - @test getBlobStore(fg, fs.label) == fs + @test getBlobstore(fg, fs.label) == fs # Deleting - @test deleteBlobStore!(fg, fs.label) == 1 + @test deleteBlobstore!(fg, fs.label) == 1 # Updating - updateBlobStore!(fg, fs) - @test listBlobStores(fg) == [fs.label] + updateBlobstore!(fg, fs) + @test listBlobstores(fg) == [fs.label] # Emptying - emptyBlobStore!(fg) - @test listBlobStores(fg) == [] + emptyBlobstore!(fg) + @test listBlobstores(fg) == [] # Add it back - addBlobStore!(fg, fs) + addBlobstore!(fg, fs) # Data functions testData = rand(UInt8, 50) # Adding newData = addData!(fg, fs.label, :a, :testing, testData) # convenience wrapper over addBlob! # Listing - @test :testing in listBlobEntries(fg, :a) + @test :testing in listBlobentries(fg, :a) # Getting data = getData(fg, fs, :a, :testing) # convenience wrapper over getBlob @test data[1].hash == newData.hash #[1] @@ -1136,7 +1136,7 @@ function blobsStoresTestBlock!(fg) @test data[1].hash == newData.hash #[1] data = getData(fg, :a, r"testing") # convenience wrapper over getBlob @test data[1].hash == newData.hash #[1] - be = getBlobEntryFirst(fg, :a, r"testing") + be = getBlobentryFirst(fg, :a, r"testing") data = getData(fg, :a, be.originId) # convenience wrapper over getBlob @test data[1].hash == newData.hash #[1] # @test data[2] == newData[2] @@ -1144,7 +1144,7 @@ function blobsStoresTestBlock!(fg) @test updateData!(fg, fs, :a, newData, rand(UInt8, 50)) == 2 @show bllb = DistributedFactorGraphs.incrDataLabelSuffix(fg, :a, :testing) newData2 = addData!(fg, fs.label, :a, bllb, testData) # convenience wrapper over addBlob! - nbe = listBlobEntries(fg, :a) + nbe = listBlobentries(fg, :a) filter!(s -> occursin(r"testing", string(s)), nbe) @test 2 == length(nbe) # TODO: incrSuffix when adding repeat labels, e.g. :testing_1, :testing_2 @@ -1881,9 +1881,9 @@ function FileDFGTestBlock(testDFGAPI; kwargs...) @test getFactor(dfg, fact) == getFactor(retDFG, fact) end - # @test length(getBlobEntries(getVariable(retDFG, :x1))) == 1 - # @test typeof(getBlobEntry(getVariable(retDFG, :x1),:testing)) == GeneralDataEntry - # @test length(getBlobEntries(getVariable(retDFG, :x2))) == 1 - # @test typeof(getBlobEntry(getVariable(retDFG, :x2),:testing2)) == FileDataEntry + # @test length(getBlobentries(getVariable(retDFG, :x1))) == 1 + # @test typeof(getBlobentry(getVariable(retDFG, :x1),:testing)) == GeneralDataEntry + # @test length(getBlobentries(getVariable(retDFG, :x2))) == 1 + # @test typeof(getBlobentry(getVariable(retDFG, :x2),:testing2)) == FileDataEntry end end