Package buildbot :: Package db :: Module connector :: Class DBConnector
[frames] | no frames]

Class DBConnector

source code

util.ComparableMixin --+
                       |
                      DBConnector

Instance Methods
 
__init__(self, spec) source code
 
start(self) source code
 
stop(self)
Call this when you're done with me
source code
 
quoteq(self, query)
Given a query that contains qmark-style placeholders, like:
source code
 
parmlist(self, count)
When passing long lists of values to e.g., an INSERT query, it is tedious to pass long strings of ? placeholders.
source code
 
get_version(self)
Returns None for an empty database, or a number (probably 1) for the database's version
source code
 
runQueryNow(self, *args, **kwargs) source code
 
runInteractionNow(self, interaction, *args, **kwargs) source code
 
get_sync_connection(self) source code
 
notify(*args, **kw)
 
send_notification(self, category, args) source code
 
subscribe_to(self, category, observer) source code
 
runQuery(self, *args, **kwargs) source code
 
runInteraction(self, *args, **kwargs) source code
 
addChangeToDatabase(self, change) source code
 
changeEventGenerator(self, branches=[], categories=[], committers=[], minTime=0) source code
 
getLatestChangeNumberNow(self, branch=None, t=None) source code
 
getChangeNumberedNow(self, changeid, t=None) source code
 
getChangeByNumber(self, changeid) source code
 
getChangesGreaterThan(self, last_changeid, t=None)
Return a Deferred that fires with a list of all Change instances with numbers greater than the given value, sorted by number.
source code
 
getChangeIdsLessThanIdNow(self, new_changeid)
Return a list of all extant change id's less than the given value, sorted by number.
source code
 
removeChangeNow(self, changeid)
Thoroughly remove a change from the database, including all dependent tables
source code
 
getChangesByNumber(self, changeids) source code
 
getSourceStampNumberedNow(self, ssid, t=None) source code
 
get_properties_from_db(self, tablename, idname, id, t=None) source code
 
addSchedulers(self, added) source code
 
scheduler_get_state(self, schedulerid, t) source code
 
scheduler_set_state(self, schedulerid, t, state) source code
 
get_sourcestampid(self, ss, t)
Given a SourceStamp (which may or may not have an ssid), make sure the contents are in the database, and return the ssid.
source code
 
create_buildset(self, ssid, reason, properties, builderNames, t, external_idstring=None) source code
 
scheduler_classify_change(self, schedulerid, number, important, t) source code
 
scheduler_get_classified_changes(self, schedulerid, t) source code
 
scheduler_retire_changes(self, schedulerid, changeids, t) source code
 
scheduler_subscribe_to_buildset(self, schedulerid, bsid, t) source code
 
scheduler_get_subscribed_buildsets(self, schedulerid, t) source code
 
scheduler_unsubscribe_buildset(self, schedulerid, buildsetid, t) source code
 
getBuildRequestWithNumber(self, brid, t=None) source code
 
get_buildername_for_brid(self, brid) source code
 
get_unclaimed_buildrequests(self, buildername, old, master_name, master_incarnation, t, limit=None) source code
 
claim_buildrequests(self, now, master_name, master_incarnation, brids, t=None) source code
 
build_started(self, brid, buildnumber) source code
 
builds_finished(self, bids) source code
 
get_build_info(self, bid) source code
 
get_buildnums_for_brid(self, brid) source code
 
resubmit_buildrequests(self, brids) source code
 
retire_buildrequests(self, brids, results) source code
 
cancel_buildrequests(self, brids) source code
 
get_buildrequestids_for_buildset(self, bsid) source code
 
examine_buildset(self, bsid) source code
 
get_active_buildset_ids(self) source code
 
get_buildset_info(self, bsid) source code
 
get_pending_brids_for_builder(self, buildername) source code
 
has_pending_operations(self) source code
 
setChangeCacheSize(self, max_size) source code
 
__hook_orig_buildbot_db_connector_DBConnector__end_operation__(self, t) source code
 
__hook_orig_buildbot_db_connector_DBConnector_notify__(self, category, *args) source code

Inherited from util.ComparableMixin: __cmp__, __hash__, __providedBy__

Class Variables
  compare_attrs = ['args', 'kwargs']
  synchronized = ['notify', '_end_operation']
  MAX_QUERY_TIMES = 1000
  __hook_post_buildbot_db_connector_DBConnector__end_operation__ = ...
  __hook_post_buildbot_db_connector_DBConnector_notify__ = [<fun...
  __hook_pre_buildbot_db_connector_DBConnector__end_operation__ = ...
  __hook_pre_buildbot_db_connector_DBConnector_notify__ = [<func...

Inherited from util.ComparableMixin: __implemented__, __provides__

Method Details

quoteq(self, query)

source code 

Given a query that contains qmark-style placeholders, like:

INSERT INTO foo (col1, col2) VALUES (?,?)

replace the '?' with '%s' if the backend uses format-style placeholders, like:

INSERT INTO foo (col1, col2) VALUES (%s,%s)

parmlist(self, count)

source code 

When passing long lists of values to e.g., an INSERT query, it is tedious to pass long strings of ? placeholders. This function will create a parenthesis-enclosed list of COUNT placeholders. Note that the placeholders have already had quoteq() applied.

getChangesGreaterThan(self, last_changeid, t=None)

source code 

Return a Deferred that fires with a list of all Change instances with numbers greater than the given value, sorted by number. This is useful for catching up with everything that's happened since you last called this function.

get_sourcestampid(self, ss, t)

source code 

Given a SourceStamp (which may or may not have an ssid), make sure the contents are in the database, and return the ssid. If the SourceStamp originally came from the DB (and thus already has an ssid), just return the ssid. If not, create a new row for it.


Class Variable Details

__hook_post_buildbot_db_connector_DBConnector__end_operation__

Value:
[<function _synchPost at 0x1e862a8>]

__hook_post_buildbot_db_connector_DBConnector_notify__

Value:
[<function _synchPost at 0x1e862a8>]

__hook_pre_buildbot_db_connector_DBConnector__end_operation__

Value:
[<function _synchPre at 0x1e86230>]

__hook_pre_buildbot_db_connector_DBConnector_notify__

Value:
[<function _synchPre at 0x1e86230>]