Skip to content

Commit 71f28b5

Browse files
committed
Test fix for BlobStoreEntry
1 parent 309932b commit 71f28b5

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/services/Serialization.jl

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
# For all types that pack their type into their own structure (e.g. PPE)
33
const TYPEKEY = "_type"
44

5+
function _packDataEntry(bde::D) where D <: AbstractBigDataEntry
6+
JSON2.write(bde)
7+
8+
# Custom serialization
9+
using JSON
10+
import JSON.show_json
11+
import JSON.Writer: StructuralContext, JSONContext, show_json
12+
import JSON.Serializations: CommonSerialization, StandardSerialization
13+
JSON.show_json(io::JSONContext, serialization::CommonSerialization, uuid::UUID) = print(io.io, "\"$uuid\"")
14+
15+
516
##==============================================================================
617
## Variable Packing and unpacking
718
##==============================================================================
@@ -18,7 +29,8 @@ function packVariable(dfg::G, v::DFGVariable)::Dict{String, Any} where G <: Abst
1829
props["softtype"] = string(typeof(getSofttype(v)))
1930
# props["bigData"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> JSON2.write(bde), values(v.dataDict))))
2031
# props["bigDataElemType"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> typeof(bde), values(v.dataDict))))
21-
props["dataEntry"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> JSON2.write(bde), values(v.dataDict))))
32+
props["dataEntry"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> JSON.json(bde), values(v.dataDict))))
33+
2234
props["dataEntryType"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> typeof(bde), values(v.dataDict))))
2335
return props
2436
end
@@ -76,7 +88,10 @@ function unpackVariable(dfg::G,
7688
end
7789

7890
for (k,bdeInter) in dataIntermed
79-
fullVal = JSON2.read(bdeInter, getfield(DistributedFactorGraphs, dataElemTypes[k]))
91+
@show label
92+
@show bdeInter
93+
interm = JSON.parse(bdeInter)
94+
Unmarshal.unmarshal(getfield(DistributedFactorGraphs, dataElemTypes[k]), interm)
8095
variable.dataDict[k] = fullVal
8196
end
8297
end

0 commit comments

Comments
 (0)