1
- import Base: ==
2
-
3
1
"""
4
2
$(TYPEDEF)
5
3
GeneralBigDataEntry is a generic multipurpose data entry that creates a unique
6
4
reproducible key using userId_robotId_sessionId_variableId_key.
7
5
"""
8
6
mutable struct GeneralBigDataEntry <: AbstractBigDataEntry
9
7
key:: Symbol
10
- storeKey:: Symbol # Could swap this to string, but using it as an index later, it's better as a symbol I believe.
8
+ storeKey:: Symbol # Could swap this to string, but using it as an index later, so better as a symbol I believe.
11
9
createdTimestamp:: DateTime
12
10
lastUpdatedTimestamp:: DateTime
13
11
mimeType:: String
14
12
end
15
13
16
- # # TODO : Move this
17
- function == (a:: GeneralBigDataEntry , b:: GeneralBigDataEntry )
18
- return a. key == b. key &&
19
- a. storeKey == b. storeKey &&
20
- a. mimeType == b. mimeType &&
21
- Dates. value (a. createdTimestamp - b. createdTimestamp) < 1000 &&
22
- Dates. value (a. lastUpdatedTimestamp - b. lastUpdatedTimestamp) < 1000 # 1 second
23
- end
24
-
25
-
26
- # Clean up and move this.
27
14
"""
28
15
$(SIGNATURES)
29
- Generates a unique key for the entry - userId_robotId_sessionId_variable_key.
16
+ Internal function to generate a unique key for the entry - userId_robotId_sessionId_variable_key.
30
17
Simple symbol.
31
18
"""
32
- function uniqueKey (dfg:: G , v:: V , key:: Symbol ):: Symbol where {G <: AbstractDFG , V <: AbstractDFGVariable }
19
+ function _uniqueKey (dfg:: G , v:: V , key:: Symbol ):: Symbol where {G <: AbstractDFG , V <: AbstractDFGVariable }
33
20
key = join (String .([dfg. userId, dfg. robotId, dfg. sessionId, label (v), String (key)]), " _" )
34
21
return Symbol (key)
35
22
end
36
23
37
- GeneralBigDataEntry (key:: Symbol ,
38
- storeKey:: Symbol ;
24
+ GeneralBigDataEntry (key:: Symbol , storeKey:: Symbol ;
39
25
mimeType:: String = " application/octet-stream" ) =
40
- GeneralBigDataEntry (key, storeKey, now (), now (), mimeType)
26
+ GeneralBigDataEntry (key, storeKey, now (), now (), mimeType)
41
27
42
- function GeneralBigDataEntry (dfg:: G ,
43
- var:: V ,
44
- key:: Symbol ;
28
+ function GeneralBigDataEntry (dfg:: G , var:: V , key:: Symbol ;
45
29
mimeType:: String = " application/octet-stream" ) where {G <: AbstractDFG , V <: AbstractDFGVariable }
46
- return GeneralBigDataEntry (key,
47
- uniqueKey (dfg, var, key),
48
- mimeType= mimeType)
30
+ return GeneralBigDataEntry (key, _uniqueKey (dfg, var, key), mimeType= mimeType)
49
31
end
50
32
51
- # Types <: AbstractBigDataEntry
52
33
"""
53
34
$(TYPEDEF)
54
35
BigDataEntry in MongoDB.
@@ -61,7 +42,6 @@ struct MongodbBigDataEntry <: AbstractBigDataEntry
61
42
# MIMEType::Symbol
62
43
end
63
44
64
-
65
45
"""
66
46
$(TYPEDEF)
67
47
BigDataEntry in a file.
0 commit comments