A special type of database session, where you wish to bulk outgest
data from the database to a file. This class ensures the connection has
the correct permissions and is designed to work around the delays in the
appearance of the data on the NFS mounted load server share directory. If
the schema for tables that data will be outgested from is supplied, then
upon initialisation this class verifies that the schemas of the database
tables are up-to-date. Otherwise, the class will query the database
schema directly, which is slower.
|
__init__(self,
dbCon,
tag=' CuID000000 ' ,
honourTrialRun=False)
Makes connection to the requested database. |
source code
|
|
|
getFilePath(self,
fileID)
Returns the location of a file that outgest with this fileID. |
source code
|
|
str (or int)
|
outgestQuery(self,
query,
fileID='
' ,
filePath='
' ,
createDtdFile=False,
isCsv=False,
redirectStdOut=False)
Bulk outgest the results from an SQL query to a file in the catalogue
server share directory. |
source code
|
|
|
_getDataTypes(self,
query)
Returns ordered list of data types returned by the given query,
either via examining the schema, if available, or by direct database
table query. |
source code
|
|
bool
|
|
|
_transferFile(self,
filePathName,
filePath)
Transfers given file from the share path to the given path on the
curation server. |
source code
|
|
|
_waitForNFS(self,
filePathName,
query)
Wait until the file on the NFS share is ready to be accessed. |
source code
|
|
Inherited from DbSession :
__del__ ,
__str__ ,
addColumn ,
addIndex ,
alterColumn ,
checkConstraints ,
checkSchema ,
commitTransaction ,
copyIntoTable ,
copyTable ,
createObjects ,
createStatistics ,
createTable ,
createUser ,
delete ,
deleteRows ,
dropColumn ,
dropObjects ,
dropTable ,
enableDirtyRead ,
existsTable ,
freeProcCache ,
getBestVolume ,
goOffline ,
grantAccess ,
insertData ,
query ,
queryAllowsNulls ,
queryAttrMax ,
queryColumnNames ,
queryDataTypes ,
queryEntriesExist ,
queryNumRows ,
queryRowSize ,
renameTable ,
rollbackTransaction ,
runOnServer ,
sharePath ,
shrinkTempDb ,
tablePath ,
testSharePath ,
truncate ,
uncPath ,
update ,
updateEntries ,
updateStatistics
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|
|
fileTag = ' CuID000000 '
Tag to append to outgest files so they can be cleaned-up later.
|
|
sampleRate = 2
Delay in seconds between testing file size on NFS mounted share.
|
|
tempViewName = ' OutgestTempView51591neferefre '
Name of temporary outgest view that's created if the SQL statement is
too long for the BCP statement.
|
|
timeOut = 600
Time in seconds before assuming outgest to NFS has failed.
|
|
_isBcpDeadlocked = False
BCP outgest is currently deadlocked?
|
Inherited from DbSession :
database ,
isLoadDb ,
isRealRun ,
isTrialRun ,
server ,
sysc ,
userName
|