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


Python DBCreator.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None, params = None):
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.create = {}
        self.constraints = {}
        self.create['a_transaction'] = """
SET AUTOCOMMIT = 0; """
        self.create['threadpool'] = """
CREATE TABLE tp_threadpool(
   id                      int(11)      NOT NULL auto_increment,
   event                   varchar(255) NOT NULL,
   component               varchar(255) NOT NULL,
   payload                 text         NOT NULL,
   thread_pool_id          varchar(255) NOT NULL,
   state                 enum('queued','process') default 'queued',
   primary key(id)
   ) ENGINE=InnoDB;
"""
        self.create['threadpool_buffer_in'] = """
CREATE TABLE tp_threadpool_buffer_in(
   id                      int(11)      NOT NULL auto_increment,
   event                   varchar(255) NOT NULL,
   component               varchar(255) NOT NULL,
   payload                 text         NOT NULL,
   thread_pool_id          varchar(255) NOT NULL,
   state                 enum('queued','process') default 'queued',
   primary key(id)
   ) ENGINE=InnoDB;
"""
        self.create['threadpool_buffer_out'] = """
开发者ID:AndresTanasijczuk,项目名称:WMCore,代码行数:32,代码来源:Create.py

示例2: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None):
        """
        _init_

        Call the base class's constructor and add all necessary tables for 
        deletion,
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi
            
        DBCreator.__init__(self, logger, dbi)
        orderedTables = Create.requiredTables[:]
        orderedTables.reverse()
        i = 0
        for tableName in orderedTables:
            i += 1
            prefix = string.zfill(i, 2)
            if tableName.endswith("_seq"):
                 self.create[prefix + tableName] = "DROP SEQUENCE %s" % tableName
            elif tableName.endswith("_trg"):
                self.create[prefix + tableName] = "DROP TRIGGER %s" % tableName
            else:
                self.create[prefix + tableName] = "DROP TABLE %s" % tableName
开发者ID:stuartw,项目名称:WMCore,代码行数:29,代码来源:Destroy.py

示例3: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None, params = None):    
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.create = {}
        self.constraints = {}

        tablespaceTable = ""
        tablespaceIndex = ""

        if params:
            if params.has_key("tablespace_table"):
                tablespaceTable = "TABLESPACE %s" % params["tablespace_table"]
            if params.has_key("tablespace_index"):
                tablespaceIndex = "USING INDEX TABLESPACE %s" % params["tablespace_index"]

        self.create["rc_threshold"] = """
        CREATE TABLE rc_threshold(
            site_id INTEGER NOT NULL,
            sub_type_id INTEGER NOT NULL,
            max_slots INTEGER NOT NULL,
            priority  INTEGER DEFAULT 1) %s""" % tablespaceTable

        self.constraints["rc_threshold_fk1"] = \
          """ALTER TABLE rc_threshold ADD
               (CONSTRAINT rc_threshold_fk1 FOREIGN KEY (site_id) REFERENCES wmbs_location(id) ON DELETE CASCADE)"""

        self.constraints["rc_threshold_fk2"] = \
          """ALTER TABLE rc_threshold ADD
开发者ID:stuartw,项目名称:WMCore,代码行数:30,代码来源:Create.py

示例4: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None):
        """
        _init_

        Call the DBCreator constructor and create the list of required tables.
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi
            
        DBCreator.__init__(self, logger, dbi)

        self.delete['01bl_runjob']    = "DROP TABLE bl_runjob"
        self.delete['02bl_status']    = "DROP TABLE bl_status"


        j = 50
        for i in Create.sequence_tables:
            seqname = '%s_SEQ' % i
            self.create["%s%s" % (j, seqname)] = \
                           "DROP SEQUENCE %s"  % seqname 

        return
开发者ID:stuartw,项目名称:WMCore,代码行数:28,代码来源:Destroy.py

示例5: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None, params = None):
        """
        _init_

        Call the DBCreator constructor and create the list of required tables.
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi

        DBCreator.__init__(self, logger, dbi)

        self.requiredTables = ["01bl_status", "02bl_runjob"]


        self.create['01bl_status'] = \
        """CREATE TABLE bl_status
            (
            id            INT  auto_increment,
            name          VARCHAR(255),
            PRIMARY KEY (id),
            UNIQUE (name)
            )
            ENGINE = InnoDB DEFAULT CHARSET=latin1;
        """

        
        self.create['02bl_runjob'] = \
        """CREATE TABLE bl_runjob
           (
           id            INT   auto_increment,
           wmbs_id       INT,
           grid_id       VARCHAR(255),
           bulk_id       VARCHAR(255),
           status        CHAR(1)   DEFAULT '1',
           sched_status  INT,
           retry_count   INT,
           status_time   INT,
           location      INT,
           user_id       INT,
           PRIMARY KEY (id),
           FOREIGN KEY (wmbs_id) REFERENCES wmbs_job(id) ON DELETE CASCADE,
           FOREIGN KEY (sched_status) REFERENCES bl_status(id),
           FOREIGN KEY (user_id) REFERENCES wmbs_users(id) ON DELETE CASCADE,
           FOREIGN KEY (location) REFERENCES wmbs_location(id) ON DELETE CASCADE,
           UNIQUE (retry_count, wmbs_id)
           )
           ENGINE = InnoDB DEFAULT CHARSET=latin1;
           
        """


        return
开发者ID:stuartw,项目名称:WMCore,代码行数:58,代码来源:Create.py

示例6: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self):
        """
        _init_

        Call the base class's constructor and create all necessary tables,
        constraints and inserts.
        """
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.delete["02managed_feeders"] = "DROP TABLE managed_feeders"
        self.delete["01managed_filesets"] = "DROP TABLE managed_filesets"
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:13,代码来源:Destroy.py

示例7: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self):
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.create = {}
        self.constraints = {}

        self.create['threadpool'] = """      
CREATE TABLE tp_threadpool(
   id                      integer      PRIMARY KEY AUTOINCREMENT,
   event                   varchar(255) NOT NULL,
   component               varchar(255) NOT NULL,
   payload                 text         NOT NULL,
   thread_pool_id          varchar(255) NOT NULL,
   state                   varchard(20) NOT NULL default 'queued',

   FOREIGN KEY(state) references tp_queued_process_enum(value)
   )
"""
        self.create['threadpool_buffer_in'] = """      
CREATE TABLE tp_threadpool_buffer_in(
   id                      integer      PRIMARY KEY AUTOINCREMENT,
   event                   varchar(255) NOT NULL,
   component               varchar(255) NOT NULL,
   payload                 text         NOT NULL,
   thread_pool_id          varchar(255) NOT NULL,
   state                   varchard(20) NOT NULL default 'queued',

   FOREIGN KEY(state) references tp_queued_process_enum(value)
   )
"""
        self.create['threadpool_buffer_out'] = """      
CREATE TABLE tp_threadpool_buffer_out(
   id                      integer      PRIMARY KEY AUTOINCREMENT,
   event                   varchar(255) NOT NULL,
   component               varchar(255) NOT NULL,
   payload                 text         NOT NULL,
   thread_pool_id          varchar(255) NOT NULL,
   state                   varchard(20) NOT NULL default 'queued',

   FOREIGN KEY(state) references tp_queued_process_enum(value)
   )
"""

        self.create['tp_queued_process_enum'] = """
CREATE TABLE tp_queued_process_enum (
        value varchar(20)       PRIMARY KEY  NOT NULL
        )"""

        self.create['tp_queued_process_enum_insert1'] = """
INSERT INTO tp_queued_process_enum VALUES('queued')
"""
        
        self.create['tp_queued_process_enum_insert2'] = """
开发者ID:stuartw,项目名称:WMCore,代码行数:55,代码来源:Create.py

示例8: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self):
        """
        _init_

        Call the base class's constructor and create all necessary tables,
        constraints and inserts.
        """
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.delete["02wm_managed_workflow_location"] = \
            "DROP TABLE wm_managed_workflow_location"
        self.delete["01wm_managed_workflow"] = "DROP TABLE wm_managed_workflow"
开发者ID:stuartw,项目名称:WMCore,代码行数:14,代码来源:Destroy.py

示例9: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self,logger=None, dbi=None, params = None):
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)
        self.create = {}
        self.constraints = {}
        self.create['taa'] = """      
SET AUTOCOMMIT = 0; """
        self.create['ta_managed_feeders'] = """
CREATE TABLE `managed_feeders` (
    id           INTEGER      PRIMARY KEY AUTO_INCREMENT,
    feeder_type  VARCHAR(256) NOT NULL,
    feeder_state VARCHAR(256) NOT NULL,
    insert_time  INT(11)      NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
"""
        self.create['ta_managed_filesets'] = """
开发者ID:stuartw,项目名称:WMCore,代码行数:18,代码来源:Create.py

示例10: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None, params = None):
        """
        _init_

        Call the DBCreator constructor and create the list of required tables.
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi

        tablespaceTable = ""
        tablespaceIndex = ""
        if params:
            if "tablespace_table" in params:
                tablespaceTable = "TABLESPACE %s" % params["tablespace_table"]
            if "tablespace_index" in params:
                tablespaceIndex = "USING INDEX TABLESPACE %s" % params["tablespace_index"]

        DBCreator.__init__(self, logger, dbi)

        self.create["01wm_components"] = \
          """CREATE TABLE wm_components (
             id               INTEGER      PRIMARY KEY AUTO_INCREMENT,
             name             VARCHAR(255) NOT NULL,
             pid              INTEGER      NOT NULL,
             update_threshold INTEGER      NOT NULL,
             UNIQUE (name))"""

        self.create["02wm_workers"] = \
          """CREATE TABLE wm_workers (
             component_id  INTEGER NOT NULL,
             name          VARCHAR(255) NOT NULL,
             last_updated  INTEGER      NOT NULL,
             state         VARCHAR(255),
             pid           INTEGER,
             poll_interval INTEGER      NOT NULL,
             last_error    INTEGER,
             cycle_time    DECIMAL(9,4) DEFAULT 0 NOT NULL,
             outcome       VARCHAR(1000),
             error_message VARCHAR(1000),
             UNIQUE (component_id, name))"""

        self.constraints["FK_wm_component_worker"] = \
              """ALTER TABLE wm_workers ADD CONSTRAINT FK_wm_component_worker
开发者ID:amaltaro,项目名称:WMCore,代码行数:49,代码来源:CreateAgentBase.py

示例11: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None, params = None):
        """
        __init__

        """
        myThread = threading.currentThread()
        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi
            
        DBCreator.__init__(self, logger, dbi)
        
        self.delete["01test_tablea"] = "DROP TABLE test_tablea"
        self.delete["02test_tableb"] = "DROP TABLE test_tableb"
        self.delete["03test_tablec"] = "DROP TABLE test_tablec" 
        self.delete["04test_bigcol"] = "DROP TABLE test_bigcol"       

        return
开发者ID:PerilousApricot,项目名称:CRAB2,代码行数:21,代码来源:Destroy.py

示例12: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None):
        """
        _init_

        Call the DBCreator constructor and create the list of required tables.
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi
            
        DBCreator.__init__(self, logger, dbi)

        self.create = {}
        self.delete = {}
        self.delete["03tp_threadpool"]             = "DROP TABLE tp_threadpool"
        self.delete["02tp_threadpool_buffer_in"]   = "DROP TABLE tp_threadpool_buffer_in"
        self.delete["01tp_threadpool_buffer_out"]  = "DROP TABLE tp_threadpool_buffer_out"
开发者ID:stuartw,项目名称:WMCore,代码行数:22,代码来源:Destroy.py

示例13: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger=None, dbi=None, param=None):
        if dbi == None:
            myThread = threading.currentThread()
            dbi = myThread.dbi
            logger = myThread.logger
        DBCreator.__init__(self, logger, dbi)

        self.create = {}
        self.constraints = {}
        #  //
        # // Define create statements for each table
        # //
        #  //
        # tm_id - unique ID which is also the primary key (len 60 chars)
        # tm_user - username (len 30 chars is ENOUGH)
        # tm_workflow - taskName (len 255 chars)
        # tm_group - group which is used inside cert
        # tm_role - role which is used inside cert

        self.create['b_transfers'] = """
开发者ID:emaszs,项目名称:CRABServer,代码行数:22,代码来源:Create.py

示例14: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self, logger = None, dbi = None):
        """
        _init_

        Call the DBCreator constructor and create the list of required tables.
        """
        myThread = threading.currentThread()

        if logger == None:
            logger = myThread.logger
        if dbi == None:
            dbi = myThread.dbi
            
        DBCreator.__init__(self, logger, dbi)

        self.create = {}
        self.delete = {}
        self.delete["rc_threshold"] = "DROP TABLE rc_threshold"

        return
开发者ID:stuartw,项目名称:WMCore,代码行数:22,代码来源:Destroy.py

示例15: __init__

# 需要导入模块: from WMCore.Database.DBCreator import DBCreator [as 别名]
# 或者: from WMCore.Database.DBCreator.DBCreator import __init__ [as 别名]
    def __init__(self):
        """
        _init_

        Call the base class's constructor and create all necessary tables,
        constraints and inserts.
        """
        myThread = threading.currentThread()
        DBCreator.__init__(self, myThread.logger, myThread.dbi)

        self.delete["11dbsbuffer_block"]              = "DROP TABLE dbsbuffer_block"
        self.delete["10dbsbuffer_dataset"]            = "DROP TABLE dbsbuffer_dataset"
        self.delete["09dbsbuffer_algo"]               = "DROP TABLE dbsbuffer_algo"
        self.delete["08dbsbuffer_algo_dataset_assoc"] = "DROP TABLE dbsbuffer_algo_dataset_assoc"
        self.delete["07dbsbuffer_file"]               = "DROP TABLE dbsbuffer_file"
        self.delete["06dbsbuffer_file_parent"]        = "DROP TABLE dbsbuffer_file_parent"
        self.delete["05dbsbuffer_file_runlumi_map"]   = "DROP TABLE dbsbuffer_file_runlumi_map"
        self.delete["04dbsbuffer_location"]           = "DROP TABLE dbsbuffer_location"
        self.delete["03dbsbuffer_file_location"]      = "DROP TABLE dbsbuffer_file_location"
        self.delete["02dbsbuffer_checksum_type"]      = "DROP TABLE dbsbuffer_checksum_type"
        self.delete["01dbsbuffer_file_checksums"]     = "DROP TABLE dbsbuffer_file_checksums"
开发者ID:AndresTanasijczuk,项目名称:WMCore,代码行数:23,代码来源:Destroy.py


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