43
43
- Coordinating Node
44
44
45
45
.. uml::
46
-
46
+
47
47
@startuml images/06_uc.png
48
48
actor "Coordinating Node" as CN
49
49
actor "Member Node" as MN
61
61
involved in this use case.
62
62
63
63
64
- Preconditions
64
+ Preconditions
65
65
~~~~~~~~~~~~~
66
66
67
67
- CN and MN operational
@@ -78,7 +78,7 @@ Triggers
78
78
Post Conditions
79
79
~~~~~~~~~~~~~~~
80
80
81
- - All System Metadata, science metadata, and resoruce map documents from a MN
81
+ - All System Metadata, science metadata, and resoruce map documents from a MN
82
82
are also present on the CN
83
83
84
84
- Update to the search index is triggered (Use Case 43)
@@ -93,7 +93,7 @@ Implementation Overview
93
93
autonumber "[0] "
94
94
participant MN <<Member Node>>
95
95
participant CN <<Coordinating Node>>
96
-
96
+
97
97
CN -> MN: listObjects( timePeriod )
98
98
activate CN
99
99
MN -> CN: objectList
@@ -134,8 +134,8 @@ Implementation Overview
134
134
deactivate CN
135
135
@enduml
136
136
137
- **Figure 2.** Overview of synchronization process using a polling process to
138
- periodically request information about objects that have changed within a time
137
+ **Figure 2.** Overview of synchronization process using a polling process to
138
+ periodically request information about objects that have changed within a time
139
139
period.
140
140
141
141
@@ -145,7 +145,7 @@ period.
145
145
autonumber "[0] "
146
146
participant MN <<Member Node>>
147
147
participant CN <<Coordinating Node>>
148
-
148
+
149
149
MN -> CN: synchronize(PID)
150
150
activate CN
151
151
CN -> CN: queue PID for synchronization
@@ -184,33 +184,21 @@ period.
184
184
deactivate CN
185
185
@enduml
186
186
187
- **Figure 3.** Overview of synchronization process with an external request to
188
- synchronize an object rather than relying on periodic polling. Note this is a
189
- Version 2.x feature.
187
+ **Figure 3.** Overview of synchronization process with an external request to
188
+ synchronize an object rather than relying on periodic polling. Note this is a
189
+ Version 2.x feature.
190
190
191
191
192
192
Implementation Details
193
193
~~~~~~~~~~~~~~~~~~~~~~
194
194
195
- .. TODO:: 2015-09-17 Review for currentness
196
-
197
- .. image:: images/06_seq.png
198
-
199
- *Figure 4.* Sequence diagram for use case 06. Synchronize content between
200
- Member and Coordinating Node. Detail for the *processObject()* step provided
201
- in the activity diagram below.
202
-
203
- .. image:: images/06_act.png
204
-
205
- *Figure 5.* Activity diagram indicating the execution flow after attempting to
206
- retrieve the system metadata for the object from the CN.
207
195
196
+ .. uml::
208
197
209
- ..
210
198
@startuml images/06_seq.png
211
199
skinparam notebordercolor #AAAAAA
212
200
skinparam notefontcolor #222222
213
-
201
+
214
202
participant "Repl Task Queue" as cn_repl << Cluster >>
215
203
participant "Replication" as cn_replication << CN >>
216
204
participant "Index Task Queue" as cn_index << Cluster >>
@@ -225,36 +213,36 @@ retrieve the system metadata for the object from the CN.
225
213
'm_crud -> c_notify: notify(session, PID, OBJECT_CREATED)
226
214
'c_notify -> cn_queue: addTask(SyncTask, node, PID)
227
215
'note right
228
- ' notification triggered by successful
216
+ ' notification triggered by successful
229
217
' create operation on MN.
230
218
'end note
231
219
232
220
'm_rep -> c_notify: setReplicationStatus(token, PID, COMPLETE)
233
221
'c_notify -> cn_queue: addTask(SyncTask, node, PID)
234
222
'note right
235
- ' notification triggered by completed
223
+ ' notification triggered by completed
236
224
' replication operation on MN.
237
225
'end note
238
-
226
+
239
227
group populateSynchronizationQueue
240
228
cn_sync -> cn_nodes: lock(node_id)
241
229
activate cn_sync #D74F57
242
230
note right
243
- Start of synchronization
231
+ Start of synchronization
244
232
process triggered by quartz
245
233
end note
246
234
activate cn_nodes #D74F57
247
235
cn_nodes --> cn_sync: OK
248
236
cn_sync -> cn_nodes: getLastUpdateTime(node_id)
249
237
activate cn_nodes #D74F57
250
238
note right
251
- The Node Map is a hash of
239
+ The Node Map is a hash of
252
240
(node_id, Node), use Hazelcast query
253
241
Map.values() passing in SqlPredicate
254
242
end note
255
243
cn_nodes --> cn_sync: startTime
256
244
deactivate cn_nodes
257
-
245
+
258
246
cn_sync -> mn_read: listObjects(session, startTime, ...)
259
247
activate mn_read #D74F57
260
248
cn_sync <-- mn_read: ObjectList
@@ -264,28 +252,28 @@ retrieve the system metadata for the object from the CN.
264
252
note right
265
253
Each SyncTask implements Callable
266
254
and will be submitted to the
267
- ExecutorService to be executed
255
+ ExecutorService to be executed
268
256
on a CN
269
257
end note
270
-
258
+
271
259
cn_sync -> cn_queue: offer(taskid, SyncTask)
272
260
activate cn_queue #D74F57
273
261
cn_queue --> cn_sync: OK
274
262
deactivate cn_queue
275
263
end
276
264
note right
277
- adding SyncTasks should fail if PID is already
278
- in the list and the PID is NOT locked. This enables
279
- very recent updates to a PID to occur and be
280
- correctly managed by the overall synchronization
265
+ adding SyncTasks should fail if PID is already
266
+ in the list and the PID is NOT locked. This enables
267
+ very recent updates to a PID to occur and be
268
+ correctly managed by the overall synchronization
281
269
process.
282
270
end note
283
271
cn_sync -> cn_nodes: setLastUpdateTime(node_id, startTime)
284
272
activate cn_nodes #D74F57
285
273
cn_nodes --> cn_sync: OK
286
274
deactivate cn_nodes
287
275
288
- cn_sync -> cn_nodes: unlock(node_id)
276
+ cn_sync -> cn_nodes: unlock(node_id)
289
277
deactivate cn_sync
290
278
deactivate cn_nodes
291
279
end
@@ -296,11 +284,11 @@ retrieve the system metadata for the object from the CN.
296
284
Synchronization implements EntryListener,
297
285
monitors the Sync Queue for changes.
298
286
end note
299
- activate cn_sync #D74F57
287
+ activate cn_sync #D74F57
300
288
cn_sync -> cn_queue: poll(timeout)
301
289
activate cn_queue #D74F57
302
290
note right
303
- Only one CN will win the poll and
291
+ Only one CN will win the poll and
304
292
process the SyncTask
305
293
end note
306
294
cn_queue --> cn_sync: SyncTask
@@ -315,7 +303,7 @@ retrieve the system metadata for the object from the CN.
315
303
mn_read -> cn_sync: object
316
304
cn_sync -> cn_sync: work
317
305
note right
318
- Check for new object,
306
+ Check for new object,
319
307
updates to properties
320
308
end note
321
309
end
@@ -325,14 +313,14 @@ retrieve the system metadata for the object from the CN.
325
313
activate cn_indexer #D74F57
326
314
note left
327
315
Indexer implements EntryListener,
328
- monitors the System Metadata Map
316
+ monitors the System Metadata Map
329
317
for inserts, updates, deletes.
330
318
end note
331
319
cn_indexer -> cn_indexer: createTask(PID)
332
320
note left
333
321
Each IndexTask implements Callable
334
322
and will be submitted to the
335
- ExecutorService to be executed
323
+ ExecutorService to be executed
336
324
on the local CN
337
325
end note
338
326
cn_indexer -> cn_index: offer(taskid, IndexTask)
@@ -346,14 +334,14 @@ retrieve the system metadata for the object from the CN.
346
334
activate cn_replication #D74F57
347
335
note left
348
336
Indexer implements EntryListener,
349
- monitors the System Metadata Map
337
+ monitors the System Metadata Map
350
338
for inserts, updates, deletes.
351
339
end note
352
340
cn_replication -> cn_replication: createTask(PID)
353
341
note left
354
342
Each ReplTask implements Callable
355
343
and will be submitted to the
356
- ExecutorService to be executed
344
+ ExecutorService to be executed
357
345
on the a CN
358
346
end note
359
347
cn_replication -> cn_repl: offer(taskid, ReplTask)
@@ -363,8 +351,12 @@ retrieve the system metadata for the object from the CN.
363
351
deactivate cn_sync
364
352
@enduml
365
353
354
+ *Figure 4.* Sequence diagram for use case 06. Synchronize content between
355
+ Member and Coordinating Node. Detail for the *processObject()* step provided
356
+ in the activity diagram below.
357
+
358
+ .. uml::
366
359
367
- ..
368
360
@startuml images/06_act.png
369
361
(*) --> [processObject()] if "CNRead.getSystemMetadata(PID)" then
370
362
if "Duplicate Object?" then
@@ -373,7 +365,7 @@ retrieve the system metadata for the object from the CN.
373
365
--> "Store System Metadata"
374
366
--> "Notify watchers\nIndex, Replication"
375
367
--> (*)
376
- else
368
+ else
377
369
-->[No] "Error: Duplicate Identifier"
378
370
--> "Notify MN"
379
371
--> (*)
@@ -398,14 +390,20 @@ retrieve the system metadata for the object from the CN.
398
390
@enduml
399
391
400
392
393
+ *Figure 5.* Activity diagram indicating the execution flow after attempting to
394
+ retrieve the system metadata for the object from the CN.
395
+
396
+
397
+
398
+
401
399
Implementation
402
400
~~~~~~~~~~~~~~
403
401
404
402
The Member Node synchronization process will operate in an asynchronous
405
403
manner, with a task queue on the CN service containing a list of objects that
406
- need to be added to the coordinating node populated through two mechanisms:
404
+ need to be added to the coordinating node populated through two mechanisms:
407
405
408
- 1. scheduled calls to :func:`MNRead.listObjects`
406
+ 1. scheduled calls to :func:`MNRead.listObjects`
409
407
410
408
2. through a new notification API that is called by a Member Node after a
411
409
successful create operation.
@@ -492,7 +490,7 @@ Populating the harvest task queue pseudo code::
492
490
if (taskQueue.length < MIN_TASKS)
493
491
{
494
492
MemberNodeState = getNextMemberNode();
495
-
493
+
496
494
// This could be executed in a different thread, which would
497
495
// enable multiple MNs to be polled at a tme if necessary
498
496
int numNewEntries = loadMNTasks(taskQueue, mnState);
0 commit comments