Package invocations :: Package cu19 :: Module cu19 :: Class Cu19
[hide private]

Class Cu19

source code


Prepare release database for a given survey.

Nested Classes [hide private]
    Nested Errors and Exceptions

Inherited from wsatools.DbConnect.CuSession.CuSession: CuError

Instance Methods [hide private]
 
__init__(self, surveyID, release=None, curator='rsc', comment='A descriptive comment', database='WSA', isTrialRun=False, userName='ldservro')
Initialises member data and prepares database connection.
source code
 
_onRun(self)
Verify, freeze, backup and release database for a given survey.
source code
 
_onException(self)
Try a roll-back on exception.
source code
 
_copyOutData(self)
Fills the release database with the correct data.
source code
 
_getDateRangeSQL(self)
Returns the date range selection clause for this survey release.
source code
 
_getDeprecationClause(self)
Returns the deprecation selection clause for this survey release.
source code
 
_copyOutTableData(self, releaseDb)
Copies out release table data into the new release db.
source code
 
_bulkCopyVVVDetTable(self, tableSchema, releaseDb)
Copy VVV detection table by individual monthly table chunks.
source code
 
_joinDetectionTables(self, tableName)
Prepares the necessary query to join the split detection tables to create the given detection table.
source code
 
_sendMail(self)
Sends e-mail notification to ETWS about successful release.
source code
 
_setUserNames(self, servers)
Sets up user name permissions on given list of servers.
source code
 
_splitOutgest(self, releaseDb, table, whereStr='', specialJoin=None, reqDefRow=False, isResumable=True)
Splits the outgest of the given table over several chunks defined by a where clause.
source code

Inherited from wsatools.DbConnect.CuSession.CuSession: __del__, logBrokenFile, run

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from wsatools.DbConnect.CuSession.CuSession: logException

Class Variables [hide private]
  cuNum = 19
Curation task number.
  propPeriodOfGrace = 1
Additional proprietary period-of-grace in months.
  _autoCommit = True
Should this curation task auto-commit database transactions?
  appendDb = False
Append to pre-existing release databases of the same name?
  dateRange = DateRange(begin=<mx.DateTime.DateTime object for '...
Observation date range to release.
  excludeProgs = ()
Tuple of programme acronyms for which detections should not be released.
  fieldIDs = ''
CSV string of field IDs that only their data should be released.
  fromTable = None
Start copy from this table onward.
  insertProgs = ()
Tuple of programme acronyms that only their detections will be copied.
  keepMetadata = False
When inserting programme data, keep existing metadata?
  overwriteDb = False
Overwrite pre-existing release databases of the same name?
  resumeChunkNumber = 1
Resume from this chunk number for VVV detection outgests
  _idxInfo = {}
Parsed index information.
  _isNonSurvey = True
Is release of a non-survey propriety product?
  _objectSchema = []
Parsed database objects schema.
  _releaseDatabase = None
Database object with released database options.
  _releaseServer = None
Server for release database.
  _surveyID = 0
Unique ID of survey to release.
  _tableList = []
Ordered list of tables to copy by table name.
  _tableSchema = {}
Parsed schemas dict referenced by table name.
  _versionNum = 0
Release version number.
  _workSpace = ''
Temporary outgest work space volume.

Inherited from wsatools.DbConnect.CuSession.CuSession: archive, comment, cuEventID, curator, eTypes, isDayStampedLog, onlyNonSurveys, onlySurveys, programme, programmeID, resultsFilePathName, shareFileID, sysc

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, surveyID, release=None, curator='rsc', comment='A descriptive comment', database='WSA', isTrialRun=False, userName='ldservro')
(Constructor)

source code 

Initialises member data and prepares database connection.

Parameters:
  • surveyID (int or str) - The unique identifier for the survey to release, or db name e.g. 1 for UKIDSS, 106 for TRANSIT.
  • release (str) - Optionally override default name of release database.
  • curator (str) - Name of curator.
  • comment (str) - Descriptive comment as to why curation task is being performed.
  • database (str) - Name of the database to connect to.
  • isTrialRun (bool) - If True, do not perform database modifications, just print the SQL statement to the terminal.
  • userName (str) - Optionally override default database username.
Overrides: object.__init__

_onRun(self)

source code 

Verify, freeze, backup and release database for a given survey.

Overrides: wsatools.DbConnect.CuSession.CuSession._onRun

_onException(self)

source code 

Try a roll-back on exception.

Overrides: wsatools.DbConnect.CuSession.CuSession._onException

_copyOutTableData(self, releaseDb)

source code 

Copies out release table data into the new release db. To replicate all necessary load database objects and data that are relevant to that release. Called within the context of the release DB, having first created the release database to receive the replicated data.

Parameters:
  • releaseDb (DbSession) - A connection to the database to be released.

Note: Uses BCP native binary outgests and ingests in preference to the MS SQL Server T-SQL statement SELECT INTO, as performance tests have revealed this to be much faster.

_setUserNames(self, servers)

source code 

Sets up user name permissions on given list of servers.

Parameters:
  • servers (sequence(str)) - List of server names.

_splitOutgest(self, releaseDb, table, whereStr='', specialJoin=None, reqDefRow=False, isResumable=True)

source code 

Splits the outgest of the given table over several chunks defined by a where clause. NB: Try to avoid the iResumable=False option in a production environment as it is not a reliable way to carry out operations.


Class Variable Details [hide private]

propPeriodOfGrace

Additional proprietary period-of-grace in months. This constant defines an additional time interval that is added to the nominal proprietary period of proprietary data such that an allowance is made for the time-lag between ingest (which is the currently assumed start of the proprietary period, as opposed to the date of observation) and release. This period of grace is currently set to one month, since this is of order the time it will take between ingest and release of data.

Value:
1

dateRange

Observation date range to release.

Value:
DateRange(begin=<mx.DateTime.DateTime object for '1753-01-01 00:00:00.\
00' at 3228c00>, end=<mx.DateTime.DateTime object for '9999-12-31 00:0\
0:00.00' at 3228c48>)