Ejemplo n.º 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
Ejemplo n.º 2
0
def open_db():
    print("opening db")
    return (maprdb.connect())
Ejemplo n.º 3
0
def maprdb_get_table(path):
    print("opening table %s" % path)
    connection = maprdb.connect()
    return (connection.get(path))
Ejemplo n.º 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
Ejemplo n.º 5
0
def open_db():
    print("opening db")
    return (maprdb.connect())
Ejemplo n.º 6
0
def open_db():
    return (maprdb.connect())
Ejemplo n.º 7
0
def open_db():
    logging.debug("opening db")
    return (maprdb.connect())
Ejemplo n.º 8
0
def maprdb_get_table(path):
    print("opening table %s" % path)
    connection = maprdb.connect()
    return (connection.get(path))