@@ -97,7 +97,7 @@ function getBlob(dfg::AbstractDFG, entry::BlobEntry)
9797 end
9898 throw (
9999 KeyError (
100- " could not find $(entry. label) , uuid $(entry. blobId) in any of the listed blobstores:\n $([s-> getKey (s) for (s,v) in stores]) )" ,
100+ " could not find $(entry. label) , uuid $(entry. blobId) in any of the listed blobstores:\n $([s-> getLabel (s) for (s,v) in stores]) )" ,
101101 ),
102102 )
103103end
@@ -177,13 +177,10 @@ end
177177# # FolderStore
178178# #==============================================================================
179179struct FolderStore{T} <: AbstractBlobStore{T}
180- key :: Symbol
180+ label :: Symbol
181181 folder:: String
182182end
183183
184- # TODO rename key to label for consistency
185- getLabel (store:: FolderStore ) = store. key
186-
187184function FolderStore (foldername:: String ; label = :default_folder_store , createfolder = true )
188185 if createfolder && ! isdir (foldername)
189186 @info " Folder '$foldername ' doesn't exist - creating."
@@ -247,12 +244,13 @@ end
247244
248245hasBlob (store:: FolderStore , entry:: BlobEntry ) = hasBlob (store, entry. originId)
249246
247+ listBlobs (store:: FolderStore ) = readdir (store. folder)
250248# #==============================================================================
251249# # InMemoryBlobStore
252250# #==============================================================================
253251
254252struct InMemoryBlobStore{T} <: AbstractBlobStore{T}
255- key :: Symbol
253+ label :: Symbol
256254 blobs:: Dict{UUID, T}
257255end
258256
@@ -295,22 +293,22 @@ listBlobs(store::InMemoryBlobStore) = collect(keys(store.blobs))
295293# #==============================================================================
296294
297295struct LinkStore <: AbstractBlobStore{String}
298- key :: Symbol
296+ label :: Symbol
299297 csvfile:: String
300298 cache:: Dict{UUID, String}
301299
302- function LinkStore (key , csvfile)
300+ function LinkStore (label , csvfile)
303301 if ! isfile (csvfile)
304302 @info " File '$csvfile ' doesn't exist - creating."
305303 # create new folder
306304 open (csvfile, " w" ) do io
307305 return println (io, " blobid,path" )
308306 end
309- return new (key , csvfile, Dict {UUID, String} ())
307+ return new (label , csvfile, Dict {UUID, String} ())
310308 else
311309 file = CSV. File (csvfile)
312310 cache = Dict (UUID .(file. blobid) .=> file. path)
313- return new (key , csvfile, cache)
311+ return new (label , csvfile, cache)
314312 end
315313 end
316314end
373371# # RowBlobStore
374372
375373struct RowBlobStore{T} <: AbstractBlobStore{T}
376- key :: Symbol
374+ label :: Symbol
377375 blobs:: OrderedDict{UUID, RowBlob{T}}
378376end
379377
0 commit comments