4343- Coordinating Node
4444
4545.. uml::
46-
46+
4747 @startuml images/06_uc.png
4848 actor "Coordinating Node" as CN
4949 actor "Member Node" as MN
6161involved in this use case.
6262
6363
64- Preconditions
64+ Preconditions
6565~~~~~~~~~~~~~
6666
6767- CN and MN operational
@@ -78,7 +78,7 @@ Triggers
7878Post Conditions
7979~~~~~~~~~~~~~~~
8080
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
8282 are also present on the CN
8383
8484- Update to the search index is triggered (Use Case 43)
@@ -93,7 +93,7 @@ Implementation Overview
9393 autonumber "[0] "
9494 participant MN <<Member Node>>
9595 participant CN <<Coordinating Node>>
96-
96+
9797 CN -> MN: listObjects( timePeriod )
9898 activate CN
9999 MN -> CN: objectList
@@ -134,8 +134,8 @@ Implementation Overview
134134 deactivate CN
135135 @enduml
136136
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
139139period.
140140
141141
@@ -145,7 +145,7 @@ period.
145145 autonumber "[0] "
146146 participant MN <<Member Node>>
147147 participant CN <<Coordinating Node>>
148-
148+
149149 MN -> CN: synchronize(PID)
150150 activate CN
151151 CN -> CN: queue PID for synchronization
@@ -184,33 +184,21 @@ period.
184184 deactivate CN
185185 @enduml
186186
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.
190190
191191
192192Implementation Details
193193~~~~~~~~~~~~~~~~~~~~~~
194194
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.
207195
196+ .. uml::
208197
209- ..
210198 @startuml images/06_seq.png
211199 skinparam notebordercolor #AAAAAA
212200 skinparam notefontcolor #222222
213-
201+
214202 participant "Repl Task Queue" as cn_repl << Cluster >>
215203 participant "Replication" as cn_replication << CN >>
216204 participant "Index Task Queue" as cn_index << Cluster >>
@@ -225,36 +213,36 @@ retrieve the system metadata for the object from the CN.
225213 'm_crud -> c_notify: notify(session, PID, OBJECT_CREATED)
226214 'c_notify -> cn_queue: addTask(SyncTask, node, PID)
227215 'note right
228- ' notification triggered by successful
216+ ' notification triggered by successful
229217 ' create operation on MN.
230218 'end note
231219
232220 'm_rep -> c_notify: setReplicationStatus(token, PID, COMPLETE)
233221 'c_notify -> cn_queue: addTask(SyncTask, node, PID)
234222 'note right
235- ' notification triggered by completed
223+ ' notification triggered by completed
236224 ' replication operation on MN.
237225 'end note
238-
226+
239227 group populateSynchronizationQueue
240228 cn_sync -> cn_nodes: lock(node_id)
241229 activate cn_sync #D74F57
242230 note right
243- Start of synchronization
231+ Start of synchronization
244232 process triggered by quartz
245233 end note
246234 activate cn_nodes #D74F57
247235 cn_nodes --> cn_sync: OK
248236 cn_sync -> cn_nodes: getLastUpdateTime(node_id)
249237 activate cn_nodes #D74F57
250238 note right
251- The Node Map is a hash of
239+ The Node Map is a hash of
252240 (node_id, Node), use Hazelcast query
253241 Map.values() passing in SqlPredicate
254242 end note
255243 cn_nodes --> cn_sync: startTime
256244 deactivate cn_nodes
257-
245+
258246 cn_sync -> mn_read: listObjects(session, startTime, ...)
259247 activate mn_read #D74F57
260248 cn_sync <-- mn_read: ObjectList
@@ -264,28 +252,28 @@ retrieve the system metadata for the object from the CN.
264252 note right
265253 Each SyncTask implements Callable
266254 and will be submitted to the
267- ExecutorService to be executed
255+ ExecutorService to be executed
268256 on a CN
269257 end note
270-
258+
271259 cn_sync -> cn_queue: offer(taskid, SyncTask)
272260 activate cn_queue #D74F57
273261 cn_queue --> cn_sync: OK
274262 deactivate cn_queue
275263 end
276264 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
281269 process.
282270 end note
283271 cn_sync -> cn_nodes: setLastUpdateTime(node_id, startTime)
284272 activate cn_nodes #D74F57
285273 cn_nodes --> cn_sync: OK
286274 deactivate cn_nodes
287275
288- cn_sync -> cn_nodes: unlock(node_id)
276+ cn_sync -> cn_nodes: unlock(node_id)
289277 deactivate cn_sync
290278 deactivate cn_nodes
291279 end
@@ -296,11 +284,11 @@ retrieve the system metadata for the object from the CN.
296284 Synchronization implements EntryListener,
297285 monitors the Sync Queue for changes.
298286 end note
299- activate cn_sync #D74F57
287+ activate cn_sync #D74F57
300288 cn_sync -> cn_queue: poll(timeout)
301289 activate cn_queue #D74F57
302290 note right
303- Only one CN will win the poll and
291+ Only one CN will win the poll and
304292 process the SyncTask
305293 end note
306294 cn_queue --> cn_sync: SyncTask
@@ -315,7 +303,7 @@ retrieve the system metadata for the object from the CN.
315303 mn_read -> cn_sync: object
316304 cn_sync -> cn_sync: work
317305 note right
318- Check for new object,
306+ Check for new object,
319307 updates to properties
320308 end note
321309 end
@@ -325,14 +313,14 @@ retrieve the system metadata for the object from the CN.
325313 activate cn_indexer #D74F57
326314 note left
327315 Indexer implements EntryListener,
328- monitors the System Metadata Map
316+ monitors the System Metadata Map
329317 for inserts, updates, deletes.
330318 end note
331319 cn_indexer -> cn_indexer: createTask(PID)
332320 note left
333321 Each IndexTask implements Callable
334322 and will be submitted to the
335- ExecutorService to be executed
323+ ExecutorService to be executed
336324 on the local CN
337325 end note
338326 cn_indexer -> cn_index: offer(taskid, IndexTask)
@@ -346,14 +334,14 @@ retrieve the system metadata for the object from the CN.
346334 activate cn_replication #D74F57
347335 note left
348336 Indexer implements EntryListener,
349- monitors the System Metadata Map
337+ monitors the System Metadata Map
350338 for inserts, updates, deletes.
351339 end note
352340 cn_replication -> cn_replication: createTask(PID)
353341 note left
354342 Each ReplTask implements Callable
355343 and will be submitted to the
356- ExecutorService to be executed
344+ ExecutorService to be executed
357345 on the a CN
358346 end note
359347 cn_replication -> cn_repl: offer(taskid, ReplTask)
@@ -363,8 +351,12 @@ retrieve the system metadata for the object from the CN.
363351 deactivate cn_sync
364352 @enduml
365353
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::
366359
367- ..
368360 @startuml images/06_act.png
369361 (*) --> [processObject()] if "CNRead.getSystemMetadata(PID)" then
370362 if "Duplicate Object?" then
@@ -373,7 +365,7 @@ retrieve the system metadata for the object from the CN.
373365 --> "Store System Metadata"
374366 --> "Notify watchers\nIndex, Replication"
375367 --> (*)
376- else
368+ else
377369 -->[No] "Error: Duplicate Identifier"
378370 --> "Notify MN"
379371 --> (*)
@@ -398,14 +390,20 @@ retrieve the system metadata for the object from the CN.
398390 @enduml
399391
400392
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+
401399Implementation
402400~~~~~~~~~~~~~~
403401
404402The Member Node synchronization process will operate in an asynchronous
405403manner, 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:
407405
408- 1. scheduled calls to :func:`MNRead.listObjects`
406+ 1. scheduled calls to :func:`MNRead.listObjects`
409407
4104082. through a new notification API that is called by a Member Node after a
411409 successful create operation.
@@ -492,7 +490,7 @@ Populating the harvest task queue pseudo code::
492490 if (taskQueue.length < MIN_TASKS)
493491 {
494492 MemberNodeState = getNextMemberNode();
495-
493+
496494 // This could be executed in a different thread, which would
497495 // enable multiple MNs to be polled at a tme if necessary
498496 int numNewEntries = loadMNTasks(taskQueue, mnState);
0 commit comments