Skip to content

Commit 94d4a71

Browse files
authored
Update BlobEntry (#1095)
* Update BlobEntry * update serialization test fileDFGs
1 parent aa122dc commit 94d4a71

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

src/DataBlobs/entities/BlobEntry.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ Base.@kwdef struct BlobEntry
1717
""" Remotely assigned and globally unique identifier for the `BlobEntry` itself (not the `.blobId`). """
1818
id::Union{UUID, Nothing} = nothing
1919
""" 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. """
20-
blobId::Union{UUID, Nothing} = nothing
20+
blobId::Union{UUID, Nothing} = uuid4() #Deprecated in v0.25 TODO remove union, blobId is mandatory
2121
""" 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. """
22-
originId::Union{UUID, Nothing} = nothing
22+
originId::Union{UUID, Nothing} = blobId #Deprecated in v0.25 TODO remove union or remove originId completely
2323
""" 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. """
2424
label::Symbol
2525
""" A hint about where the `Blob` itself might be stored. Remember that a Blob may be duplicated over multiple blobstores. """
26-
blobstore::Symbol
26+
blobstore::Symbol = :default
2727
""" 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.] """
28-
hash::String # Probably https://docs.julialang.org/en/v1/stdlib/SHA
28+
hash::String = ""# Probably https://docs.julialang.org/en/v1/stdlib/SHA
2929
""" Context from which a BlobEntry=>Blob was first created. E.g. user|robot|session|varlabel. """
30-
origin::String
31-
""" number of bytes in blob """
32-
size::Union{Int, Nothing} = nothing
30+
origin::String = ""
31+
""" number of bytes in blob as a string"""
32+
size::Union{String, Nothing} = "" #TODO remove union, use "" as nothing
3333
""" Additional information that can help a different user of the Blob. """
3434
description::String = ""
3535
""" MIME description describing the format of binary data in the `Blob`, e.g. 'image/png' or 'application/json; _type=CameraModel'. """

src/DataBlobs/services/HelpersDataWrapEntryBlob.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function BlobEntry(
4949
label::Symbol = entry.label,
5050
blobstore::Symbol = entry.blobstore,
5151
hash::String = entry.hash,
52-
size::Union{Int, Nothing} = entry.size,
52+
size::Union{String, Int, Nothing} = entry.size,
5353
origin::String = entry.origin,
5454
description::String = entry.description,
5555
mimeType::String = entry.mimeType,
@@ -67,7 +67,7 @@ function BlobEntry(
6767
blobstore,
6868
hash,
6969
origin,
70-
size,
70+
size = string(size),
7171
description,
7272
mimeType,
7373
metadata,

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export DFGNode, AbstractDFGVariable, AbstractDFGFactor
139139
export DFGVariable, DFGVariableSummary, SkeletonDFGVariable, PackedVariable
140140

141141
# Factors
142-
export DFGFactor, DFGFactorSummary, SkeletonDFGFactor, PackedFactor
142+
export DFGFactor, DFGFactorSummary, SkeletonDFGFactor, PackedFactor, Factor
143143

144144
# Common
145145
export getSolvable, setSolvable!, isSolvable

src/entities/DFGFactor.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ function SkeletonDFGFactor(
398398
label::Symbol,
399399
variableOrderSymbols::Vector{Symbol} = Symbol[],
400400
)
401+
@warn "SkeletonDFGFactor(id::Union{UUID, Nothing}...) is deprecated, use SkeletonDFGFactor(label, variableOrderSymbols) instead"
401402
return SkeletonDFGFactor(id, label, Set{Symbol}(), variableOrderSymbols)
402403
end
403404
function SkeletonDFGFactor(

test/data/0_25_0.tar.gz

2.07 KB
Binary file not shown.

test/data/0_25_0_meta.tar.gz

2.15 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)