Changeset 1189


Ignore:
Timestamp:
06/30/17 16:22:31 (7 years ago)
Author:
ymipsl
Message:

Add new attribute to manage splitting in file name :

  • split_start_offset (duration) : add an offset to the start splitting date in the file name
  • split_end_offset (duration) : add an offset to the end splitting date in the file name
  • split_last_date (date) : the end splitting be replace by split_last_date if greather than.

YM

Location:
XIOS/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/file_attribute.conf

    r1135 r1189  
    1010DECLARE_ATTRIBUTE(CDuration, split_freq) 
    1111DECLARE_ATTRIBUTE(StdString, split_freq_format) 
     12DECLARE_ATTRIBUTE(CDuration, split_start_offset) 
     13DECLARE_ATTRIBUTE(CDuration, split_end_offset) 
     14DECLARE_ATTRIBUTE(string,     split_last_date) 
    1215DECLARE_ATTRIBUTE(bool,      enabled) 
    1316DECLARE_ENUM2(type,          one_file, multiple_file) 
  • XIOS/trunk/src/node/file.cpp

    r1135 r1189  
    400400         if (!split_freq.isEmpty()) 
    401401         { 
    402            CDate splitEnd = lastSplit + split_freq - 1 * Second; 
     402           CDate split_start ; 
     403           CDate splitEnd ; 
     404           if (!split_start_offset.isEmpty()) split_start=lastSplit + split_start_offset ; 
     405           else split_start=lastSplit ; 
     406 
     407           splitEnd = lastSplit + split_freq ; 
     408           if (!split_last_date.isEmpty()) 
     409           { 
     410             CDate splitLastDate=CDate::FromString(split_last_date,*CContext::getCurrent()->getCalendar()) ; 
     411             if( splitLastDate < splitEnd)  splitEnd=splitLastDate ; 
     412           } 
     413             
     414           if (!split_end_offset.isEmpty()) splitEnd = splitEnd + split_end_offset; 
     415           else splitEnd = splitEnd - 1 * Second; 
    403416 
    404417           string splitFormat; 
     
    415428 
    416429           oss << firstPart ; 
    417            if (hasStartDate) oss << lastSplit.getStr(splitFormat) ; 
     430           if (hasStartDate) oss << split_start.getStr(splitFormat) ; 
    418431           oss << middlePart ; 
    419432           if (hasEndDate) oss << splitEnd.getStr(splitFormat); 
     
    421434 
    422435           StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ;  
    423            context->registryOut->setKey(keySuffix+"splitStart", lastSplit); 
     436           context->registryOut->setKey(keySuffix+"splitStart", split_start); 
    424437           context->registryOut->setKey(keySuffix+"splitEnd",   splitEnd); 
    425438         } 
Note: See TracChangeset for help on using the changeset viewer.