当前位置: 首页>>代码示例>>Python>>正文


Python DB.__init__方法代码示例

本文整理汇总了Python中DIRAC.Core.Base.DB.DB.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python DB.__init__方法的具体用法?Python DB.__init__怎么用?Python DB.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Core.Base.DB.DB的用法示例。


在下文中一共展示了DB.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self, databaseLocation='DataManagement/FileCatalogDB', maxQueueSize=10 ):
   """ Standard Constructor
   """
   
   # The database location can be specified in System/Database form or in just the Database name
   # in the DataManagement system 
   db = databaseLocation
   if db.find('/') == -1:
     db = 'DataManagement/' + db
   DB.__init__(self,'FileCatalogDB',db,maxQueueSize)
   
   result = self._createTables( self.__tables )
   if not result['OK']:
     gLogger.error( "Failed to create tables", str( self.__tables.keys() ) )
   elif result['Value']:
     gLogger.info( "Tables created: %s" % ','.join( result['Value'] ) )    
   
   self.ugManager = None
   self.seManager = None
   self.securityManager = None
   self.dtree = None
   self.fileManager = None
   self.dmeta = None
   self.fmeta = None
   self.statusDict = {}
开发者ID:graciani,项目名称:DIRAC,代码行数:27,代码来源:FileCatalogDB.py

示例2: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self ):
   DB.__init__( self, 'SandboxMetadataDB', 'WorkloadManagement/SandboxMetadataDB' )
   result = self.__initializeDB()
   if not result[ 'OK' ]:
     raise RuntimeError( "Can't create tables: %s" % result[ 'Message' ] )
   self.__assignedSBGraceDays = 0
   self.__unassignedSBGraceDays = 15
开发者ID:kfox1111,项目名称:DIRAC,代码行数:9,代码来源:SandboxMetadataDB.py

示例3: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
  def __init__( self ):
    """ Standard Constructor
    """
    DB.__init__( self, 'DataIntegrityDB', 'DataManagement/DataIntegrityDB' )

    self.tableName = 'Problematics'
    self.tableDict = { self.tableName: { 'Fields' : { 'FileID': 'INTEGER NOT NULL AUTO_INCREMENT',
                                                      'Prognosis': 'VARCHAR(32) NOT NULL',
                                                      'LFN': 'VARCHAR(255) NOT NULL',
                                                      'PFN': 'VARCHAR(255)',
                                                      'Size': 'BIGINT(20)',
                                                      'SE': 'VARCHAR(32)',
                                                      'GUID': 'VARCHAR(255)',
                                                      'Status': 'VARCHAR(32) DEFAULT "New"',
                                                      'Retries': 'INTEGER DEFAULT 0',
                                                      'InsertDate': 'DATETIME NOT NULL',
                                                      'LastUpdate': 'DATETIME NOT NULL',
                                                      'Source': 'VARCHAR(127) NOT NULL DEFAULT "Unknown"',
                                                    },
                                         'PrimaryKey': 'FileID',
                                         'Indexes': { 'PS': ['Prognosis', 'Status']},
                                         'Engine': 'InnoDB',
                                       }
                      }

    self.fieldList = ['FileID', 'LFN', 'PFN', 'Size', 'SE', 'GUID', 'Prognosis']
开发者ID:DIRACGrid-test,项目名称:DIRAC,代码行数:28,代码来源:DataIntegrityDB.py

示例4: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self ):
   """ Standard Constructor
   """
   DB.__init__( self, 'SystemLoggingDB', 'Framework/SystemLoggingDB', debug = DEBUG )
   result = self._checkTable()
   if not result['OK']:
     gLogger.error( 'Failed to check/create the database tables', result['Message'] )
开发者ID:JanEbbing,项目名称:DIRAC,代码行数:9,代码来源:SystemLoggingDB.py

示例5: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
  def __init__( self, systemInstance = 'Default', maxQueueSize = 10 ):
    """c'tor

    :param self: self reference
    """
    self.getIdLock = threading.Lock()
    DB.__init__( self, "ReqDB", "RequestManagement/ReqDB", maxQueueSize )
开发者ID:IgorPelevanyuk,项目名称:DIRAC,代码行数:9,代码来源:RequestDB.py

示例6: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self, systemInstance = 'Default', maxQueueSize = 10 ):
   DB.__init__( self, 'StorageManagementDB', 'StorageManagement/StorageManagementDB', maxQueueSize )
   self.lock = threading.Lock()
   self.TASKPARAMS = ['TaskID', 'Status', 'Source', 'SubmitTime', 'LastUpdate', 'CompleteTime', 'CallBackMethod', 'SourceTaskID']
   self.REPLICAPARAMS = ['ReplicaID', 'Type', 'Status', 'SE', 'LFN', 'PFN', 'Size', 'FileChecksum', 'GUID', 'SubmitTime', 'LastUpdate', 'Reason', 'Links']
   self.STAGEPARAMS = ['ReplicaID', 'StageStatus', 'RequestID', 'StageRequestSubmitTime', 'StageRequestCompletedTime', 'PinLength', 'PinExpiryTime']
   self.STATES = ['Failed', 'New', 'Waiting', 'Offline', 'StageSubmitted', 'Staged']
开发者ID:caitriana,项目名称:DIRAC,代码行数:9,代码来源:StorageManagementDB.py

示例7: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self, maxQueueSize = 10 ):
   DB.__init__( self, 'SandboxMetadataDB', 'WorkloadManagement/SandboxMetadataDB', maxQueueSize )
   result = self.__initializeDB()
   if not result[ 'OK' ]:
     raise Exception( "Can't create tables: %s" % result[ 'Message' ])
   self.__assignedSBGraceDays = 0
   self.__unassignedSBGraceDays = 15
开发者ID:KrzysztofCiba,项目名称:DIRAC,代码行数:9,代码来源:SandboxMetadataDB.py

示例8: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self, maxQueueSize = 10 ):
   """ 
   """
   self.ops = Operations()
   self.dbname = 'OverlayDB'
   self.logger = gLogger.getSubLogger('OverlayDB')
   DB.__init__( self, self.dbname, 'Overlay/OverlayDB', maxQueueSize  )
   self._createTables( { "OverlayData" : { 'Fields' : { 'Site' : "VARCHAR(256) UNIQUE NOT NULL",
                                                         'NumberOfJobs' : "INTEGER DEFAULT 0"
                                                      },
                                            'PrimaryKey' : 'Site',
                                            'Indexes': {'Index':['Site']}
                                          }
                       }
                     )
   limits = self.ops.getValue("/Overlay/MaxConcurrentRunning", 200)
   self.limits = {}
   self.limits["default"] = limits
   res = self.ops.getSections("/Overlay/Sites/")
   sites = []
   if res['OK']:
     sites = res['Value']
   for tempsite in sites:
     res = self.ops.getValue("/Overlay/Sites/%s/MaxConcurrentRunning" % tempsite, 200)
     self.limits[tempsite] = res
   self.logger.info("Using the following restrictions : %s" % self.limits)
开发者ID:LCDgit,项目名称:ILCDIRAC,代码行数:28,代码来源:OverlayDB.py

示例9: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__(self, maxQueueSize=10):
     """ 
 """
     # self.ops = Operations()
     self.dbname = "GlastAdditionalInfoDB"
     self.logger = gLogger.getSubLogger("GlastAdditionalInfoDB")
     DB.__init__(self, self.dbname, "ResourceStatus/GlastAdditionalInfoDB", maxQueueSize)
     self.fields = ["CEName", "Status", "Software_Tag"]
     self._createTables(
         {
             "SoftwareTags_has_Sites": {
                 "Fields": {
                     "idRelation": "INT NOT NULL AUTO_INCREMENT",
                     "CEName": "VARCHAR(45) NOT NULL",
                     "Status": "ENUM('New','Installing','Valid','Bad','Removed') DEFAULT 'New'",
                     "Software_Tag": "VARCHAR(255) NOT NULL",
                     "LastUpdateTime": "DATETIME",
                 },
                 "PrimaryKey": ["idRelation"],
                 "Indexes": {"Index": ["idRelation", "Software_Tag", "CEName", "Status"]},
             }
         }
     )
     self.vo = getVO("glast.org")
     ##tags statuses:
     self.tag_statuses = ["New", "Installing", "Valid", "Bad", "Removed"]
开发者ID:sposs,项目名称:GlastDIRAC,代码行数:28,代码来源:GlastAdditionalInfoDB.py

示例10: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
  def __init__( self, maxQueueSize = 10 ):
    """ c'tor

    :param self: self reference
    :param int maxQueueSize: query queue size
    """
    DB.__init__( self, "DataLoggingDB", "DataManagement/DataLoggingDB", maxQueueSize )
    self.gLogger = gLogger
开发者ID:sbel,项目名称:bes3-jinr,代码行数:10,代码来源:DataLoggingDB.py

示例11: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
  def __init__( self, maxQueueSize = 10 ):
    DB.__init__( self, 'VirtualMachineDB', 'WorkloadManagement/VirtualMachineDB', maxQueueSize )
    if not self._MySQL__initialized:
      raise Exception( 'Can not connect to VirtualMachineDB, exiting...' )

    result = self.__initializeDB()
    if not result[ 'OK' ]:
      raise Exception( "Can't create tables: %s" % result[ 'Message' ] )
开发者ID:acasajus,项目名称:VMDIRAC,代码行数:10,代码来源:VirtualMachineDB.py

示例12: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self, systemInstance = 'Default', maxQueueSize = 10 ):
   """ c'tor
   
   :param self: self reference
   :param str systemInstance: ??? 
   :param int maxQueueSize: queue size    
   """
   DB.__init__( self, 'RequestDB', 'RequestManagement/RequestDB', maxQueueSize )
   self.getIdLock = threading.Lock()
开发者ID:sbel,项目名称:bes3-jinr,代码行数:11,代码来源:RequestDBMySQL.py

示例13: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__(self):
     """ Constructor
 """
     self.__permValues = ["USER", "GROUP", "VO", "ALL"]
     self.__permAttrs = ["ReadAccess", "PublishAccess"]
     DB.__init__(self, "UserProfileDB", "Framework/UserProfileDB", 10)
     retVal = self.__initializeDB()
     if not retVal["OK"]:
         raise Exception("Can't create tables: %s" % retVal["Message"])
开发者ID:kfox1111,项目名称:DIRAC,代码行数:11,代码来源:UserProfileDB.py

示例14: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
 def __init__( self ):
   """ Constructor
   """
   self.__permValues = [ 'USER', 'GROUP', 'VO', 'ALL' ]
   self.__permAttrs = [ 'ReadAccess', 'PublishAccess' ]
   DB.__init__(self, 'UserProfileDB', 'Framework/UserProfileDB')
   retVal = self.__initializeDB()
   if not retVal[ 'OK' ]:
     raise Exception( "Can't create tables: %s" % retVal[ 'Message' ] )
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:11,代码来源:UserProfileDB.py

示例15: __init__

# 需要导入模块: from DIRAC.Core.Base.DB import DB [as 别名]
# 或者: from DIRAC.Core.Base.DB.DB import __init__ [as 别名]
  def __init__( self, maxQueueSize = 10 ):

    DB.__init__( self, 'BigDataDB', 'WorkloadManagement/BigDataDB', maxQueueSize )
    if not self._MySQL__initialized:
      raise Exception( 'Can not connect to BigDataDB, exiting...' )

    result = self.__initializeDB()
    if not result[ 'OK' ]:
      raise Exception( 'Can\'t create tables: %s' % result[ 'Message' ] )
开发者ID:vfalbor,项目名称:BigDataDIRAC,代码行数:11,代码来源:BigDataDB.py


注:本文中的DIRAC.Core.Base.DB.DB.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。