From 94d4a711febe7739bf8a2296df99d86dc56d9286 Mon Sep 17 00:00:00 2001 From: Johannes Terblanche <6612981+Affie@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:30:18 +0200 Subject: [PATCH] Update BlobEntry (#1095) * Update BlobEntry * update serialization test fileDFGs --- src/DataBlobs/entities/BlobEntry.jl | 14 +++++++------- .../services/HelpersDataWrapEntryBlob.jl | 4 ++-- src/DistributedFactorGraphs.jl | 2 +- src/entities/DFGFactor.jl | 1 + test/data/0_25_0.tar.gz | Bin 0 -> 2117 bytes test/data/0_25_0_meta.tar.gz | Bin 0 -> 2206 bytes test/data/{ => archive}/0_23_0.tar.gz | Bin test/data/{ => archive}/0_23_0_meta.tar.gz | Bin 8 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 test/data/0_25_0.tar.gz create mode 100644 test/data/0_25_0_meta.tar.gz rename test/data/{ => archive}/0_23_0.tar.gz (100%) rename test/data/{ => archive}/0_23_0_meta.tar.gz (100%) diff --git a/src/DataBlobs/entities/BlobEntry.jl b/src/DataBlobs/entities/BlobEntry.jl index 4ab8b60d..aa3af34b 100644 --- a/src/DataBlobs/entities/BlobEntry.jl +++ b/src/DataBlobs/entities/BlobEntry.jl @@ -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'. """ diff --git a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl index 58b323a0..133ac468 100644 --- a/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl +++ b/src/DataBlobs/services/HelpersDataWrapEntryBlob.jl @@ -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, @@ -67,7 +67,7 @@ function BlobEntry( blobstore, hash, origin, - size, + size = string(size), description, mimeType, metadata, diff --git a/src/DistributedFactorGraphs.jl b/src/DistributedFactorGraphs.jl index f483a88d..0a14fdd9 100644 --- a/src/DistributedFactorGraphs.jl +++ b/src/DistributedFactorGraphs.jl @@ -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 diff --git a/src/entities/DFGFactor.jl b/src/entities/DFGFactor.jl index 74777cf2..2d4b0bcd 100644 --- a/src/entities/DFGFactor.jl +++ b/src/entities/DFGFactor.jl @@ -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( diff --git a/test/data/0_25_0.tar.gz b/test/data/0_25_0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..aec2edecd573c9f2214c9a6d32908498a8fb349e GIT binary patch literal 2117 zcmV-L2)g$liwFSVAQoo;1MOPda@#l(&GUYRi?3rUxbmW^c}SehM78myV$VFRol1cO zC^18kT9R_4arxi3L5dP3%cCe>$(I0SnM4x+8x8d7LjW@BcfJ-``f7&>A>=T2ps$ct zuL!#s9iT-zKo~jLeRY6#sZ^83MJaMn<)Q7YcJ7&^8%wGp%;QlRXQ|b-e$T~dP;|Z~ z2k~%}sG&+rQ9U}e#)Zm1ia;e$?463lI4S=C5j@GWAS+iMebO>`R;Z$Y`pwhxI{U@< z9p#0yR^N$ISlyf3SxbxTtnxyjOTSIB;C))=u_{`X?nq~K@5qIeAL63S@~PFmv?dsI zm=OJs>VHiCYA2}hrM@J7r_%SiAtb(s~d@=P>0rkBj}q?2&FDT z)bTiTUG5?G(29#Fo+z1!{=9G!596|u%IsS@7sqLs*Y<|C%6zP<-X0hIkMUnBi3eFG z7cU%-D)pLzx}jx3F20qyQu7L0aCCm$D^*@Jg^EFTw~!X(&_C#Dhl40sC@zX=8ZLJu zuG`}X%yMFNvAzyr^y5*UwTfo_kthc+{IAR5=yf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V%@JBe7lzOtYbz?)Un<^uTPPH3tX%4S|75|i?g7DjE7Yg3c{1%Tl;~|f&8tQ zs^UbIr{nTZAay_}D~ea230d41RpA9ao$u#2_3O%@<;m&Ahu+EW)%h5GGyw*=Ze@FW z=o1jYdtoBT)>)D$J5%{lmgREZowyi^yqY=9DT6F6S41mZv_9^lW%4K+r{yAF<6Y}i z1x%C-l%KzC4K+PnHvOUbJ(-_zgYDb^FZ;oQ&TMpo&$s`2Y|htCE&fj)kN?vJ|7WP; z|773mKZgI4hw*>Tu;KqNg8!3Hg`7xYy9#OE8b-FqII>+A6Nk!3F%%g7zuAtFpoF;* zu`%^A*wH1n9}!_wF9Uw8A{LdT#O>a|2Nx_JCZtF zU^|K^d`EdvWcz^|!c-EBdyL4C82)eg|Fa@KhX23FpK$}T{?DGm`ahkW{~^Ti|9zzP z`A@_D4gZ%Fg(5)um9UXiz*~tI*uLxdb|fRF6lTOn%JBcqcEpZQ4kM8*T&};PsIZ0O zf>|Abk*9IbM~43!{{NhakKz9>@@L#&J2&7jg#NerKYtSZpE?!)r)K?sFR8`PUhX0$N;s3jHgJ;bDO)|-(pEvyvLXcG|0A2t9i$7;8 literal 0 HcmV?d00001 diff --git a/test/data/0_25_0_meta.tar.gz b/test/data/0_25_0_meta.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5ea611824497bfa45591e5a745e91f17e2ee83ea GIT binary patch literal 2206 zcmV;P2x0dhiwFRAAQoo;1MOVvQ`&oA7!4sSYyE$yPWsnmv{nq zf9pbppgqDpEI7r)6+KL-=aLsayiTUtGAS!r04smw=kj~Ia94Y?mfrmLnUpI>=`t#k zah2qmGjQI%|Imx`qBqi&RI-x2N|#lV4V@ilQtIN940Q_K4E0}z(2w#Fv=w=nS8d}F zG=4DzXef1A!pPmG!-jMQ+cX>XEllJLt{nJsI0a$|59LUv>6vMEu4fZ0^UPs{ zHsMlNzSMQr!*n*IzfSY;T~-x|F5!iCs$10ATg!B3wmZ~3C(0RQlQf07pwsT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