def setup():
    schema = {
      'pk': {'convert': str, 'index': None},  # will be indexed anyways
      'ts': {'convert': str, 'index': None},
      'order': {'convert': int, 'index': 1},
      'blarg': {'convert': int, 'index': 1},
      'useless': {'convert': str, 'index': None},
      'mean': {'convert': float, 'index': 1},
      'std': {'convert': float, 'index': 1},
      'vp': {'convert': int, 'index': 1}
    }
    NUMVPS = 5
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    fNames = ['./four_continents_tsdb_vp.dbdb', './four_continents_tsdb_vp_idx.dbdb']
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], schema)
    s = TSDBServer(db, TEST_PORT) # Create a server

    t = ServerThread(s)
    t.daemon = True
    t.start()
    return t
def setup():
    # db = DictDB(basic_schema, 'pk')
    fNames = ['./four_continents_test_repl.dbdb', './four_continents_test_repl_idx.dbdb']
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], basic_schema)
    s = TSDBServer(db) # Create a server
    t = ServerThread(s)
    return t
Example #3
0
def setup():
    schema = {
        'pk': {
            'convert': str,
            'index': None
        },  # will be indexed anyways
        'ts': {
            'convert': str,
            'index': None
        },
        'order': {
            'convert': int,
            'index': 1
        },
        'blarg': {
            'convert': int,
            'index': 1
        },
        'useless': {
            'convert': str,
            'index': None
        },
        'mean': {
            'convert': float,
            'index': 1
        },
        'std': {
            'convert': float,
            'index': 1
        },
        'vp': {
            'convert': int,
            'index': 1
        }
    }
    NUMVPS = 5
    for i in range(NUMVPS):
        schema["d_vp-{}".format(i)] = {'convert': float, 'index': 1}
    fNames = [
        './four_continents_tsdb_vp.dbdb', './four_continents_tsdb_vp_idx.dbdb'
    ]
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], schema)
    s = TSDBServer(db, TEST_PORT)  # Create a server

    t = ServerThread(s)
    t.daemon = True
    t.start()
    return t
def setup():
    # db = DictDB(basic_schema, 'pk')
    fNames = [
        './four_continents_test_repl.dbdb',
        './four_continents_test_repl_idx.dbdb'
    ]
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], basic_schema)
    s = TSDBServer(db)  # Create a server
    t = ServerThread(s)
    return t
def setup():
    empty_schema = {
        'pk': {'convert': lambda x: x, 'index': None},
        'ts': {'convert': lambda x: x, 'index': None},
        'order': {'convert': int, 'index': 1},
        'mean': {'convert':float, 'index':1},
        'std': {'convert':float, 'index':1}
    }
    fNames = ['./four_continents_tsdbs.dbdb', './four_continents_tsdbs_idx.dbdb']
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], empty_schema)
    s = TSDBServer(db, TEST_PORT) # Create a server
    t = ServerThread(s)
    t.daemon = True
    t.start()
    return t
Example #6
0
def setup():
    schema = {
        'pk': {'convert': str, 'index': None},  # will be indexed anyways
        'ts': {'convert': str, 'index': None},
        'order': {'convert': int, 'index': 1},
        'blarg': {'convert': int, 'index': 1},
        'useless': {'convert': str, 'index': None},
        'mean': {'convert': float, 'index': 1},
        'std': {'convert': float, 'index': 1},
        'vp': {'convert': int, 'index': 1}
    }

    fNames = ['./four_continents_tsdb_rest.dbdb', './four_continents_tsdb_rest_idx.dbdb']
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], schema)
    s = TSDBServer(db, port=30000) # Create a server
    t = ServerThread(s)
    t.daemon = True
    t.start()
    return t
Example #7
0
def setup():
    empty_schema = {
        'pk': {
            'convert': lambda x: x,
            'index': None
        },
        'ts': {
            'convert': lambda x: x,
            'index': None
        },
        'order': {
            'convert': int,
            'index': 1
        },
        'mean': {
            'convert': float,
            'index': 1
        },
        'std': {
            'convert': float,
            'index': 1
        }
    }
    fNames = [
        './four_continents_tsdbs.dbdb', './four_continents_tsdbs_idx.dbdb'
    ]
    if os.path.isfile(fNames[0]):
        os.remove(fNames[0])
    if os.path.isfile(fNames[1]):
        os.remove(fNames[1])
    db = connect(fNames[0], fNames[1], empty_schema)
    s = TSDBServer(db, TEST_PORT)  # Create a server
    t = ServerThread(s)
    t.daemon = True
    t.start()
    return t