Skip to content

Commit 305b200

Browse files
authored
fix comments and old code
1 parent 719cb54 commit 305b200

File tree

1 file changed

+57
-82
lines changed

1 file changed

+57
-82
lines changed

src/DataBlobs/entities/AbstractDataEntries.jl

Lines changed: 57 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ getTimestamp(entry::AbstractDataEntry) = entry.timestamp
1414
##==============================================================================
1515
## BlobStoreEntry
1616
##==============================================================================
17-
export BlobStoreEntry
17+
export BlobEntry
1818

1919
"""
2020
$(TYPEDEF)
@@ -40,97 +40,72 @@ General Data Store Entry.
4040
end
4141

4242
# should be deprecated by v0.21
43+
export BlobStoreEntry
4344
const BlobStoreEntry = BlobEntry
4445

4546
_fixtimezone(cts::NamedTuple) = ZonedDateTime(cts.utc_datetime*"+00")
4647

47-
# # needed for deserialization from JSON during DFG v0.19 transition, see #867
48-
# # TODO this function can likely be removed, since julia automatically tries type conversion on constructors.
49-
# function BlobStoreEntry(;
50-
# id,
51-
# label,
52-
# blobstore,
53-
# hash,
54-
# origin,
55-
# description,
56-
# mimeType,
57-
# timestamp,
58-
# kwargs... # drop excessive fields
59-
# )
60-
# #
61-
# BlobStoreEntry(;
62-
# id=UUID(id),
63-
# label=Symbol(label),
64-
# blobstore=Symbol(blobstore),
65-
# hash,
66-
# origin,
67-
# description,
68-
# mimeType,
69-
# timestamp=_fixtimezone(timestamp),
70-
# )
48+
# # TODO
49+
# """
50+
# $(TYPEDEF)
51+
# Data Entry in MongoDB.
52+
# """
53+
# struct MongodbDataEntry <: AbstractDataEntry
54+
# label::Symbol
55+
# id::UUID
56+
# oid::NTuple{12, UInt8} #mongodb object id - TODO Not needed with id::UUID unique, but perhaps usefull
57+
# hash::String
58+
# createdTimestamp::ZonedDateTime
59+
# # mongodb
60+
# # mongoConfig::MongoConfig
61+
# #maybe other fields such as:
62+
# #flags::Bool ready, valid, locked, permissions
63+
# #MIMEType::String
7164
# end
7265

73-
# TODO
74-
"""
75-
$(TYPEDEF)
76-
Data Entry in MongoDB.
77-
"""
78-
struct MongodbDataEntry <: AbstractDataEntry
79-
label::Symbol
80-
id::UUID
81-
oid::NTuple{12, UInt8} #mongodb object id - TODO Not needed with id::UUID unique, but perhaps usefull
82-
hash::String
83-
createdTimestamp::ZonedDateTime
84-
# mongodb
85-
# mongoConfig::MongoConfig
86-
#maybe other fields such as:
87-
#flags::Bool ready, valid, locked, permissions
88-
#MIMEType::String
89-
end
90-
9166

92-
##==============================================================================
93-
## FileDataEntryBlob Types
94-
##==============================================================================
95-
export FileDataEntry
96-
"""
97-
$(TYPEDEF)
98-
Data Entry in a file.
99-
"""
100-
struct FileDataEntry <: AbstractDataEntry
101-
label::Symbol
102-
id::UUID
103-
folder::String
104-
hash::String #using bytes2hex or perhaps Vector{Uint8}?
105-
createdTimestamp::ZonedDateTime
67+
# ##==============================================================================
68+
# ## FileDataEntryBlob Types
69+
# ##==============================================================================
70+
# export FileDataEntry
71+
# """
72+
# $(TYPEDEF)
73+
# Data Entry in a file.
74+
# """
75+
# struct FileDataEntry <: AbstractDataEntry
76+
# label::Symbol
77+
# id::UUID
78+
# folder::String
79+
# hash::String #using bytes2hex or perhaps Vector{Uint8}?
80+
# createdTimestamp::ZonedDateTime
10681

107-
function FileDataEntry(label, id, folder, hash, timestamp)
108-
if !isdir(folder)
109-
@info "Folder '$folder' doesn't exist - creating."
110-
# create new folder
111-
mkpath(folder)
112-
end
113-
return new(label, id, folder, hash, timestamp)
114-
end
115-
end
82+
# function FileDataEntry(label, id, folder, hash, timestamp)
83+
# if !isdir(folder)
84+
# @info "Folder '$folder' doesn't exist - creating."
85+
# # create new folder
86+
# mkpath(folder)
87+
# end
88+
# return new(label, id, folder, hash, timestamp)
89+
# end
90+
# end
11691

11792

118-
##==============================================================================
119-
## InMemoryDataEntry Types
120-
##==============================================================================
121-
export InMemoryDataEntry
122-
"""
123-
$(TYPEDEF)
124-
Store data temporary in memory.
125-
NOTE: Neither Entry nor Blob will be persisted.
126-
"""
127-
struct InMemoryDataEntry{T} <: AbstractDataEntry
128-
label::Symbol
129-
id::UUID
130-
#hash::String #Is this needed?
131-
createdTimestamp::ZonedDateTime
132-
data::T
133-
end
93+
# ##==============================================================================
94+
# ## InMemoryDataEntry Types
95+
# ##==============================================================================
96+
# export InMemoryDataEntry
97+
# """
98+
# $(TYPEDEF)
99+
# Store data temporary in memory.
100+
# NOTE: Neither Entry nor Blob will be persisted.
101+
# """
102+
# struct InMemoryDataEntry{T} <: AbstractDataEntry
103+
# label::Symbol
104+
# id::UUID
105+
# #hash::String #Is this needed?
106+
# createdTimestamp::ZonedDateTime
107+
# data::T
108+
# end
134109

135110
# getHash(::InMemoryDataEntry) = UInt8[]
136111
assertHash(de::InMemoryDataEntry, db; hashfunction = sha256) = true

0 commit comments

Comments
 (0)