Пример #1
0
def maprdb_connect():
    """
    Ensures that we connect to DB only once.
    :return: Connection object
    """
    global connection
    if not connection:
        connection = maprdb.connect(mapr_home=os.path.dirname(__file__))
    return connection
Пример #2
0
def open_db():
    print("opening db")
    return (maprdb.connect())
Пример #3
0
def maprdb_get_table(path):
    print("opening table %s" % path)
    connection = maprdb.connect()
    return (connection.get(path))
Пример #4
0
 def test_no_two_jvm(self):
     with self.assertLogs(level=logging.WARN):
         maprdb.connect()  # not raises exception, but warning about inability to start second JVM
Пример #5
0
def open_db():
    print("opening db")
    return (maprdb.connect())
Пример #6
0
def open_db():
    return (maprdb.connect())
Пример #7
0
def open_db():
    logging.debug("opening db")
    return (maprdb.connect())
Пример #8
0
def maprdb_get_table(path):
    print("opening table %s" % path)
    connection = maprdb.connect()
    return (connection.get(path))