def new_space(request, session, graph_spaces): name = "EmptyGraph_" + space_generator() space_desc = SpaceDesc( name=name, partition_num=9, replica_factor=1, vid_type="FIXED_STRING(30)", charset="utf8", collate="utf8_bin", ) create_space(space_desc, session) graph_spaces["space_desc"] = space_desc graph_spaces["drop_space"] = True
def new_space(options, session, graph_spaces): lines = csv.reader(io.StringIO(options), delimiter="|") opts = {line[1].strip(): line[2].strip() for line in lines} name = "EmptyGraph_" + space_generator() space_desc = SpaceDesc( name=name, partition_num=int(opts.get("partition_num", 7)), replica_factor=int(opts.get("replica_factor", 1)), vid_type=opts.get("vid_type", "FIXED_STRING(30)"), charset=opts.get("charset", "utf8"), collate=opts.get("collate", "utf8_bin"), ) create_space(space_desc, session) graph_spaces["space_desc"] = space_desc graph_spaces["drop_space"] = True