Skip to content

Commit

Permalink
Update BlobEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
Affie committed Oct 21, 2024
1 parent aa122dc commit 541c9be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/DataBlobs/entities/BlobEntry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ 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} = nothing
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} = nothing
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. """
label::Symbol
""" A hint about where the `Blob` itself might be stored. Remember that a Blob may be duplicated over multiple blobstores. """
blobstore::Symbol
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
hash::String = ""# Probably https://docs.julialang.org/en/v1/stdlib/SHA
""" Context from which a BlobEntry=>Blob was first created. E.g. user|robot|session|varlabel. """
origin::String
""" number of bytes in blob """
size::Union{Int, Nothing} = nothing
origin::String = ""
""" number of bytes in blob as a string"""
size::Union{String, Nothing} = "" #TODO remove union, use "" as nothing
""" Additional information that can help a different user of the Blob. """
description::String = ""
""" MIME description describing the format of binary data in the `Blob`, e.g. 'image/png' or 'application/json; _type=CameraModel'. """
Expand Down
4 changes: 2 additions & 2 deletions src/DataBlobs/services/HelpersDataWrapEntryBlob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function BlobEntry(
label::Symbol = entry.label,
blobstore::Symbol = entry.blobstore,
hash::String = entry.hash,
size::Union{Int, Nothing} = entry.size,
size::Union{String, Int, Nothing} = entry.size,
origin::String = entry.origin,
description::String = entry.description,
mimeType::String = entry.mimeType,
Expand All @@ -67,7 +67,7 @@ function BlobEntry(
blobstore,
hash,
origin,
size,
string(size),
description,
mimeType,
metadata,
Expand Down
2 changes: 1 addition & 1 deletion src/DistributedFactorGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export DFGNode, AbstractDFGVariable, AbstractDFGFactor
export DFGVariable, DFGVariableSummary, SkeletonDFGVariable, PackedVariable

# Factors
export DFGFactor, DFGFactorSummary, SkeletonDFGFactor, PackedFactor
export DFGFactor, DFGFactorSummary, SkeletonDFGFactor, PackedFactor, Factor

# Common
export getSolvable, setSolvable!, isSolvable
Expand Down
1 change: 1 addition & 0 deletions src/entities/DFGFactor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ function SkeletonDFGFactor(
label::Symbol,
variableOrderSymbols::Vector{Symbol} = Symbol[],
)
@warn "SkeletonDFGFactor(id::Union{UUID, Nothing}...) is deprecated, use SkeletonDFGFactor(label, variableOrderSymbols) instead"
return SkeletonDFGFactor(id, label, Set{Symbol}(), variableOrderSymbols)
end
function SkeletonDFGFactor(
Expand Down

0 comments on commit 541c9be

Please sign in to comment.