Changes between Version 1 and Version 2 of ew2mseed


Ignore:
Timestamp:
02/26/12 15:54:39 (8 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ew2mseed

    v1 v2  
    6363Running more than a single copy of ew2mseed for for the same SCNL/Location/file structure is prohibited.  Despite we implemented a locking mechanism preventing more then one copy of ew2mseed to operate over a particular ew2mseed.d.x file, there is no automatic way to prevent two ew2mseed  with different ew2mseed.d.x configuration files to write to the same   /NET/STN/STN.NET.LOC.CHAN.YEAR.JDAY. 
    6464 
    65 === Using ew2mseed with multiple WaveServers === 
     65=== Using ew2mseed with multiple !WaveServers === 
    6666 
    67 1. Here we walk a reader through the steps of the ew2mseed program from the standpoint of multiple WaveServers usage. Multiple WaveServers are set in the configuration file as key word WaveServer followed by the IP:Port, where IP address can also be human readable computer name which will be resolved by gethostbyname() system call. 
     671. Here we walk a reader through the steps of the ew2mseed program from the standpoint of multiple !WaveServers usage. Multiple !WaveServers are set in the configuration file as key word WaveServer followed by the IP:Port, where IP address can also be human readable computer name which will be resolved by gethostbyname() system call. 
    6868{{{ 
    6969# frame relay..  
     
    7474WaveServer 136.177.31.10 16022 
    7575}}} 
    76 2. All available WaveServers are first registered in the configuration structure of ew2mseed.  If we follow the example configuration above, in particular, there will be created a WaveServer linked list containing 3 WaveServers. 
     762. All available !WaveServers are first registered in the configuration structure of ew2mseed.  If we follow the example configuration above, in particular, there will be created a WaveServer linked list containing 3 WaveServers. 
    7777 
    78 3.  ew2mseed calls a function  int processWsAppendMenu (RINGS *rn, WS_MENU_QUEUE_REC *menu) , which uses EW library function wsAppendMenu() in a loop for each WaveServer. wsAppendMenu() can either append a current WaveServer menu or return an error indicating that the connection to the WaveServer is not available. The main task of processWsAppendMenu () is to fill up the WaveServers structure WS_MENU_QUEUE_REC *menu. This structure is later used for getting data snippets. As long as at least a single WaveServer is available, the WS_MENU_QUEUE_REC *menu structure is not NULL and function processWsAppendMenu () returns the number of available WaveServers from the list. If no WaveServers are available, processWsAppendMenu () does not return. In this case it idles for 20 seconds and attempt to connect to WaveServers again. An operator can examine the log file and kill the instance of '''ew2mseed''' manually if he/she realizes that the WaveServers declared in the configuration will not be available. 
     783.  ew2mseed calls a function  int processWsAppendMenu (RINGS *rn, WS_MENU_QUEUE_REC *menu) , which uses EW library function wsAppendMenu() in a loop for each WaveServer. wsAppendMenu() can either append a current WaveServer menu or return an error indicating that the connection to the WaveServer is not available. The main task of processWsAppendMenu () is to fill up the WaveServers structure WS_MENU_QUEUE_REC *menu. This structure is later used for getting data snippets. As long as at least a single WaveServer is available, the WS_MENU_QUEUE_REC *menu structure is not NULL and function processWsAppendMenu () returns the number of available WaveServers from the list. If no WaveServers are available, processWsAppendMenu () does not return. In this case it idles for 20 seconds and attempt to connect to WaveServers again. An operator can examine the log file and kill the instance of '''ew2mseed''' manually if he/she realizes that the !WaveServers declared in the configuration will not be available. 
    7979 
    80 4. Let us suppose that we passed the stage (3) and found out that, for example, two out of three WaveServers declared in the configuration file are running and their data are available.  We now search through every available WaveServer and create a list of available PSCNLs. If no PSCNLs is available, the program quits. 
     804. Let us suppose that we passed the stage (3) and found out that, for example, two out of three !WaveServers declared in the configuration file are running and their data are available.  We now search through every available WaveServer and create a list of available PSCNLs. If no PSCNLs is available, the program quits. 
    8181 
    82 5. If we are here, it means that more than 0 WaveServers provide more than zero PSCNLs.  In other words we entered the main loop of ew2mseed. In the main loop, the core call is to int wsGetTraceBin (TRACE_REQ* getThis, WS_MENU_QUEUE_REC* menu_queue,  int timeout).  wsGetTraceBin() is a library function from WaveClient library and it is declared as being able to extract data from multiple waveServers. Here is an extract from wsGetTraceBin() documentation: 
     825. If we are here, it means that more than 0 !WaveServers provide more than zero PSCNLs.  In other words we entered the main loop of ew2mseed. In the main loop, the core call is to int wsGetTraceBin (TRACE_REQ* getThis, WS_MENU_QUEUE_REC* menu_queue,  int timeout).  wsGetTraceBin() is a library function from WaveClient library and it is declared as being able to extract data from multiple waveServers. Here is an extract from wsGetTraceBin() documentation: 
    8383{{{ 
    8484                 Retrieves the piece of raw trace data specified in the  
     
    9090                 in the menu queue will be tried. (http://www.cnss.org/EWAB/libsrc.html) 
    9191}}} 
    92 6. Once in while (when ew2mseed read all data until the endTime of the tank for a particular PSCNL),  ew2mseed calls a function int updateMenu (RINGS *rn, WS_MENU_QUEUE_REC *menu_queue), which updates local copies of menus of WaveServers and includes/excludes from the WaveServer's linked list those WaveServers which  became available/unavailable. 
     926. Once in while (when ew2mseed read all data until the endTime of the tank for a particular PSCNL),  ew2mseed calls a function int updateMenu (RINGS *rn, WS_MENU_QUEUE_REC *menu_queue), which updates local copies of menus of !WaveServers and includes/excludes from the WaveServer's linked list those !WaveServers which  became available/unavailable. 
    9393 
    9494=== Catch-up algorithm (new in version 02-Apr-2002) ===