예제 #1
0
def dropAllBluzelle(url, port, uuid):
    b = pyBluzelle.create_connection(url, port, uuid)

    for key in b.keys():
        b.delete(key)
    print('')
    print('Dropped all records from the uuid')
    print('')
예제 #2
0
def createRecordsFromFile(url, port, uuid, fileLoad):
    b = pyBluzelle.create_connection(url, port, uuid)
    recsCommitted = 0

    print('')
    print('These are the records inserted into the Bluzelle Database')
    print('----------------------------------------------------------------')

    with open(fileLoad) as csvfile:
        reader = csv.reader(csvfile, delimiter=':')
        for row in reader:
            print('[KEY]: {} [VALUE]: {}'.format(row[0], row[1]))
            res = b.create(row[0], row[1])
            if (res is None):
                recsCommitted += 1

    print('')
    print(
        'A total of {} has been successfully loaded into the database'.format(
            recsCommitted))
    print('')
예제 #3
0
def createRecords(url, port, uuid, recNum):
    b = pyBluzelle.create_connection(url, port, uuid)
    recsCommitted = 0

    print('')
    print('These are the records inserted into the Bluzelle Database')
    print('----------------------------------------------------------------')

    recs = RandomUserFactory.create_batch(size=recNum)

    for model in recs:
        key = model.keyRec.encode('utf-8')
        val = model.valRec.encode('utf-8')
        print('[KEY]: ' + model.keyRec + ' [VALUE]: ' + model.valRec)
        res = b.create(key, val)
        if (res is None):
            recsCommitted += 1

    print('')
    print(
        'A total of {} has been successfully loaded into the database'.format(
            recsCommitted))
    print('')
예제 #4
0
import pyBluzelle
b = pyBluzelle.create_connection("testnet.bluzelle.com", 51010,
                                 "137a8403-52ec-43b7-8083-91391d4c5e67")
res = b.has("kk")
print(res)
res = b.create("kk", "1234")
print(res)
res = b.create("gg", "1234")
print(res)
res = b.keys()
print(res)
res = b.read("gg")
print(res)
res = b.has("gg")
print(res)
res = b.delete("gg")
print(res)
res = b.keys()
print(res)
res = b.size()
print(res)
res = b.read("gg")
print(res)
res = b.delete("kk")
print(res)
예제 #5
0
import pyBluzelle
b = pyBluzelle.create_connection("127.0.0.1", 51011, "137a8403-52ec-43b7-8083-91391d4c5e67")
res = b.create("kk","1234")
print(res)
res = b.create("gg","1234")
print(res)
res = b.keys()
print(res)
res = b.read("gg")
print(res)
res = b.has("gg")
print(res)
res = b.delete("gg")
print(res)
res = b.keys()
print(res)
res = b.read("gg")
print(res)
res = b.delete("kk")
print(res)
예제 #6
0
 def setUp(self):
     self.connection = pyBluzelle.create_connection(
         "127.0.0.1", 51011, "137a8403-52ec-43b7-8083-91391d4c5e67")
     self.connection.create('key1', '1234')