@@ -119,6 +119,13 @@ class EngineConnector(HasTraits):
119119 heartbeat = CBytes ()
120120 pending = Set ()
121121
122+ _db_shortcuts = {
123+ 'sqlitedb' : 'IPython.parallel.controller.sqlitedb.SQLiteDB' ,
124+ 'mongodb' : 'IPython.parallel.controller.mongodb.MongoDB' ,
125+ 'dictdb' : 'IPython.parallel.controller.dictdb.DictDB' ,
126+ 'nodb' : 'IPython.parallel.controller.dictdb.NoDB' ,
127+ }
128+
122129class HubFactory (RegistrationFactory ):
123130 """The Configurable for setting up a Hub."""
124131
@@ -181,8 +188,17 @@ def _notifier_port_default(self):
181188
182189 monitor_url = Unicode ('' )
183190
184- db_class = DottedObjectName ('IPython.parallel.controller.dictdb.DictDB' ,
185- config = True , help = """The class to use for the DB backend""" )
191+ db_class = DottedObjectName ('NoDB' ,
192+ config = True , help = """The class to use for the DB backend
193+
194+ Options include:
195+
196+ SQLiteDB: SQLite
197+ MongoDB : use MongoDB
198+ DictDB : in-memory storage (fastest, but be mindful of memory growth of the Hub)
199+ NoDB : disable database altogether (default)
200+
201+ """ )
186202
187203 # not configurable
188204 db = Instance ('IPython.parallel.controller.dictdb.BaseDB' )
@@ -258,9 +274,9 @@ def init_hub(self):
258274 sub = ZMQStream (sub , loop )
259275
260276 # connect the db
261- self . log . info ( 'Hub using DB backend: %r' % (self .db_class .split ()[ - 1 ]) )
262- # cdir = self.config.Global.cluster_dir
263- self .db = import_item (str (self . db_class ))(session = self .session .session ,
277+ db_class = _db_shortcuts . get (self .db_class .lower (), self . db_class )
278+ self . log . info ( 'Hub using DB backend: %r' , ( db_class . split ( '.' )[ - 1 ]))
279+ self .db = import_item (str (db_class ))(session = self .session .session ,
264280 config = self .config , log = self .log )
265281 time .sleep (.25 )
266282 try :
0 commit comments