Skip to content

Commit b8e256a

Browse files
committed
addDataEntry!,
fix #391
1 parent e63d336 commit b8e256a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/BigData/services/AbstractBigDataEntries.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ function addBigDataEntry!(dfg::AbstractDFG, label::Symbol, bde::AbstractBigDataE
3535
return addBigDataEntry!(getVariable(dfg, label), bde)
3636
end
3737

38+
addDataEntry!(x...) = addBigDataEntry!(x...)
39+
40+
"""
41+
$(SIGNATURES)
42+
Add Big Data Entry to distributed factor graph.
43+
Should be extended if DFG variable is not returned by reference.
44+
"""
45+
function addDataEntry!(dfg::AbsstractDFG,
46+
lbl::Symbol,
47+
descr::Symbol,
48+
mimeType::AbstractString,
49+
data::Vector{UInt8} )
50+
#
51+
node = isVariable(dfg, lbl) ? getVariable(dfg, lbl) : getFactor(dfg, lbl)
52+
# Make a big data entry in the graph - use JSON2 to just write this
53+
element = GeneralBigDataEntry(dfg, node, descr, mimeType=mimeType)
54+
# Set it in the store
55+
addBigData!(fec.datastore, element, data)
56+
# Add the entry to the graph
57+
addBigDataEntry!(node, element)
58+
end
59+
3860
"""
3961
$SIGNATURES
4062

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export getNeighborhood, getNeighbors, _getDuplicatedEmptyDFG
165165
export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph!
166166
# Big Data
167167
##------------------------------------------------------------------------------
168-
export addBigDataEntry!, getBigDataEntry, updateBigDataEntry!, deleteBigDataEntry!, getBigDataEntries, getBigDataKeys, hasDataEntry, hasBigDataEntry
168+
export addBigDataEntry!, addDataEntry!, getBigDataEntry, updateBigDataEntry!, deleteBigDataEntry!, getBigDataEntries, getBigDataKeys, hasDataEntry, hasBigDataEntry
169169

170170

171171
##------------------------------------------------------------------------------

0 commit comments

Comments
 (0)