Ejemplo n.º 1
0
#ret = py_hypertable.__table_exist(table_name)
#print "Does table we just created exist?"
#print ret

ret = py_hypertable.delete_row(table_name, key)
print "Deleting the key %s"%key
print ret

ret = py_hypertable.get_entity(table_name, key, columns)
print "Trying to get deleted key:"
print ret
print "doing a put with key %s"%key
print py_hypertable.put_entity("hello", "1", ["a","b","c"], ["1","2","3"])
print "doing a get table" 
print py_hypertable.get_table("hello", ["a","b","c"])
py_hypertable.put_entity("hello", "2", ["a","b","c"], ["4","5","6"])
print "doing get table:"
print py_hypertable.get_table("hello", ["a","b","c"])
py_hypertable.put_entity("hello", "3", ["a","b","c"], ["1","2","3"])
py_hypertable.get_table("hello", ["a","b","c"])

print "TRYING TO REPLACE KEY 3"
py_hypertable.put_entity("hello", "3", ["a","b","c"], ["1","2","3"])
py_hypertable.get_table("hello", ["a","b","c"])
py_hypertable.get_row_count("hello")
ret = py_hypertable.delete_row("hello", "1")
ret = py_hypertable.delete_row("hello", "2")
ret = py_hypertable.delete_row("hello", "3")
py_hypertable.get_table("hello", ["a","b","c"])
print "Deleting table:"
Ejemplo n.º 2
0
table = "test_"+ GenPasswd2(10) 
print "creating table " + table + " result and adding 2 rows:"
print py_hypertable.put_entity(table, "1", ["c1","c2", "c3"], ["a1","b2","c3"])
print py_hypertable.put_entity(table, "2", ["c1","c2", "c3"], ["d4","e5","f6"])
print "does this newly table exist:"
print py_hypertable.__table_exist(table)

print "doing a get entity for row key 1:"
print py_hypertable.get_entity(table, "1", ["c1", "c2", "c3"])
print "doing a get entity for row key 2:"
print py_hypertable.get_entity(table, "2", ["c1", "c2", "c3"])
print "how many rows are in this table?"
print py_hypertable.get_row_count(table)
print "getting entire table:"
print py_hypertable.get_table(table, ["c1","c2","c3"])

print "what happens when trying to do a get on a table that doesnt exist:"
print py_hypertable.get_entity("qwerty", "1", ["a","b","c"])

print "query that table"
print py_hypertable.__query_table(table)

print "delete row from table ",table
print py_hypertable.delete_row(table, "1")

print "Doing a get on that which was deleted"
print py_hypertable.get_entity(table, "1", ["c1", "c2", "c3"])
print "query the table"
print py_hypertable.__query_table(table)
print "doing a get entity:"
#ret = py_hypertable.__table_exist(table_name)
#print "Does table we just created exist?"
#print ret

ret = py_hypertable.delete_row(table_name, key)
print "Deleting the key %s" % key
print ret

ret = py_hypertable.get_entity(table_name, key, columns)
print "Trying to get deleted key:"
print ret
print "doing a put with key %s" % key
print py_hypertable.put_entity("hello", "1", ["a", "b", "c"], ["1", "2", "3"])
print "doing a get table"
print py_hypertable.get_table("hello", ["a", "b", "c"])
py_hypertable.put_entity("hello", "2", ["a", "b", "c"], ["4", "5", "6"])
print "doing get table:"
print py_hypertable.get_table("hello", ["a", "b", "c"])
py_hypertable.put_entity("hello", "3", ["a", "b", "c"], ["1", "2", "3"])
py_hypertable.get_table("hello", ["a", "b", "c"])

print "TRYING TO REPLACE KEY 3"
py_hypertable.put_entity("hello", "3", ["a", "b", "c"], ["1", "2", "3"])
py_hypertable.get_table("hello", ["a", "b", "c"])
py_hypertable.get_row_count("hello")
ret = py_hypertable.delete_row("hello", "1")
ret = py_hypertable.delete_row("hello", "2")
ret = py_hypertable.delete_row("hello", "3")
py_hypertable.get_table("hello", ["a", "b", "c"])
print "Deleting table:"
Ejemplo n.º 4
0
print "creating table " + table + " result and adding 2 rows:"
print py_hypertable.put_entity(table, "1", ["c1", "c2", "c3"],
                               ["a1", "b2", "c3"])
print py_hypertable.put_entity(table, "2", ["c1", "c2", "c3"],
                               ["d4", "e5", "f6"])
print "does this newly table exist:"
print py_hypertable.__table_exist(table)

print "doing a get entity for row key 1:"
print py_hypertable.get_entity(table, "1", ["c1", "c2", "c3"])
print "doing a get entity for row key 2:"
print py_hypertable.get_entity(table, "2", ["c1", "c2", "c3"])
print "how many rows are in this table?"
print py_hypertable.get_row_count(table)
print "getting entire table:"
print py_hypertable.get_table(table, ["c1", "c2", "c3"])

print "what happens when trying to do a get on a table that doesnt exist:"
print py_hypertable.get_entity("qwerty", "1", ["a", "b", "c"])

print "query that table"
print py_hypertable.__query_table(table)

print "delete row from table ", table
print py_hypertable.delete_row(table, "1")

print "Doing a get on that which was deleted"
print py_hypertable.get_entity(table, "1", ["c1", "c2", "c3"])
print "query the table"
print py_hypertable.__query_table(table)
print "doing a get entity:"