Esempio n. 1
0
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    db = DictDB(schema, 'pk')
    server = TSDBServer(db)
    server.run()
Esempio n. 2
0
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    db = DictDB(schema, 'pk')
    server = TSDBServer(db)
    server.run()
Esempio n. 3
0
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'type': "float", 'index': 1}
    db = DocDB('pk', schema=schema)
    server = TSDBServer(db)
    server.run()
Esempio n. 4
0
def main(load=False, dbname="db", overwrite=False, threshold = 10, wordlength = 16, tslen = 256, cardinality = 64):
    # we augment the schema by adding columns for 5 vantage points
    #for i in range(NUMVPS):
    #    schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    db = PersistentDB(schema, 'pk',load=load, dbname=dbname, overwrite=overwrite, threshold = threshold, wordlength = wordlength, tslen = tslen, cardinality = cardinality)
    server = TSDBServer(db)
    server.run()
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'type': "float", 'index': 1}
    db = DocDB('pk', schema=schema)
    server = TSDBServer(db)
    server.run()
Esempio n. 6
0
def main():

    # initialize the database
    db = DictDB(schema, 'pk')

    # initialize & run the server
    server = TSDBServer(db)
    server.run()
Esempio n. 7
0
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    # db = DictDB(schema, 'pk')
    db = connect("/tmp/four_continents.dbdb", "/tmp/four_continents_idx.dbdb", schema)
    server = TSDBServer(db, 30000)
    server.run()
def main():
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'type': 'float',  'index': 1}

    db = PersistentDB(schema, pk_field='pk', db_name='testing', ts_length=TS_LENGTH, testing=True)
    server = TSDBServer(db)
    server.run()
    db.delete_database()
Esempio n. 9
0
def main():
    # we augment the schema by adding columns for 5 vantage points
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    # db = DictDB(schema, 'pk')
    db = connect("/tmp/four_continents.dbdb", "/tmp/four_continents_idx.dbdb",
                 schema)
    server = TSDBServer(db, 30000)
    server.run()
Esempio n. 10
0
def main():
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'type': 'float', 'index': 1}

    db = PersistentDB(schema,
                      pk_field='pk',
                      db_name='testing',
                      ts_length=TS_LENGTH,
                      testing=True)
    server = TSDBServer(db)
    server.run()
    db.delete_database()
def main(ts_length, db_name, data_dir):
    '''
    Runs the persistent database server.

    Parameters
    ----------
    ts_length : int
        Length of time series stored in the database
    db_name : str
        Name of the database
    data_dir : str
        Folder location of the database

    Returns
    -------
    Nothing, modifies in-place.
    '''

    # set up directory for db data
    if not os.path.exists(data_dir):
        os.makedirs(data_dir)

    # initialize the database
    db = PersistentDB(schema=schema, pkfield='pk', ts_length=ts_length,
                      db_name=db_name, data_dir=data_dir)

    # initialize & run the server
    server = TSDBServer(db)

    # initialize ayncio event loop
    loop = asyncio.get_event_loop()

    # run database server
    try:
        loop.run_until_complete(server.run())

    # this script is generally called as a sub-process
    # make sure that the database is closed and all data committed
    # if the sub-process is interrupted
    except RuntimeError:
        loop.close()
        db.close()
    except Exception:
        loop.close()
        db.close()
    except KeyboardInterrupt:
        loop.close()
        db.close()
Esempio n. 12
0
def main():
    db = PersistentDB(schema, 'pk', load=False, overwrite=True)
    server = TSDBServer(db)
    server.run()
Esempio n. 13
0
def main():
    db = PersistentDB(schema, 'pk', load=False, overwrite=True)
    server = TSDBServer(db)
    server.run()
Esempio n. 14
0
def main():
    db = DictDB(schema)
    server = TSDBServer(db)
    server.run()