Developing lightweight computation at the DSG edge

Commit a1040d34 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[goclidote] Add verbosity to error messages


Signed-off-by: Roger Pueyo Centelles's avatarRoger Pueyo Centelles <rpueyo@ac.upc.edu>
parent bd3e7c52
......@@ -63,7 +63,6 @@ func AntidoteAddItemToSetInBucket(bucketName string, setName string, itemValue s
return false
}
// AntidoteAddItemToSetInMapInBucket save an item to a set in a map in a bucket
func AntidoteAddItemToSetInMapInBucket(bucketName string, mapName string, setName string, itemValue string, DatabaseHost string, DatabasePort int) bool {
client, err := antidoteclient.NewClient(antidoteclient.Host{Name: DatabaseHost, Port: DatabasePort})
......@@ -132,7 +131,7 @@ func AntidoteAddArrayToSetInMapInBucket(bucketName string, mapName string, setNa
// Return true if all values belong now to the set (either they have been added now, or were there already)
anyMissing := false
for _,v := range itemArray {
for _, v := range itemArray {
thisFound := false
for _, w := range setVal {
if v == string(w) {
......@@ -157,7 +156,7 @@ func AntidoteReadRegisterInBucket(bucketName string, registerName string, Databa
defer client.Close()
tx, err := client.StartTransaction()
errCheck(err, ERROR, "[AntidoteReadRegisterInBucket]: Unable to start a transaction using the go client")
errCheck(err, ERROR, fmt.Sprintf("[AntidoteReadRegisterInBucket]: Unable to start a transaction using the go client. bucketName: %s, registerName %s, DatabaseHost %s, DatabasePort %d\n", bucketName, registerName, DatabaseHost, DatabasePort))
bucket := antidoteclient.Bucket{Bucket: []byte(bucketName)}
key := antidoteclient.Key(registerName)
......@@ -175,11 +174,12 @@ func AntidoteReadRegisterInBucket(bucketName string, registerName string, Databa
func AntidoteSetRegisterInBucket(bucketName string, registerName string, itemValue string, DatabaseHost string, DatabasePort int) bool {
client, err := antidoteclient.NewClient(antidoteclient.Host{Name: DatabaseHost, Port: DatabasePort})
errCheck(err, ERROR, "[AntidoteSetRegisterInBucket]: Unable to create a new AntidoteDB go client")
errCheck(err, ERROR, fmt.Sprintf("[AntidoteSetRegisterInBucket]: Unable to create a new AntidoteDB go client. bucketName: %s, registerName %s, itemValue %s, DatabaseHost %s, DatabasePort %d\n", bucketName, registerName, itemValue, DatabaseHost, DatabasePort))
defer client.Close()
tx, err := client.StartTransaction()
errCheck(err, ERROR, "[AntidoteSetRegisterInBucket]: Unable to start a transaction using the go client")
errCheck(err, ERROR, fmt.Sprintf("[AntidoteSetRegisterInBucket]: Unable to start a transaction using the go client. bucketName: %s, registerName %s, itemValue %s, DatabaseHost %s, DatabasePort %d\n", bucketName, registerName, itemValue, DatabaseHost, DatabasePort))
bucket := antidoteclient.Bucket{Bucket: []byte(bucketName)}
key := antidoteclient.Key(registerName)
......@@ -239,11 +239,11 @@ func AntidoteReadItemsFromSetInBucket(bucketName string, setName string, Databas
var items []string
client, err := antidoteclient.NewClient(antidoteclient.Host{Name: DatabaseHost, Port: DatabasePort})
errCheck(err, ERROR, "[AntidoteReadItemsFromSetInBucket]: Unable to create a new AntidoteDB go client")
errCheck(err, ERROR, fmt.Sprintf("[AntidoteReadItemsFromSetInBucket]: Unable to create a new AntidoteDB go client. bucketName %s, setName %s, DatabaseHost %s, DatabasePort %d\n", bucketName, setName, DatabaseHost, DatabasePort))
defer client.Close()
tx, err := client.StartTransaction()
errCheck(err, ERROR, "[AntidoteReadItemsFromSetInBucket]: Unable to start a transaction using the go client")
errCheck(err, ERROR, fmt.Sprintf("[AntidoteReadItemsFromSetInBucket]: Unable to start a transaction using the go client. bucketName: %s, setName: %s, DatabaseHost %s, DatabasePort %d\n", bucketName, setName, DatabaseHost, DatabasePort))
bucket := antidoteclient.Bucket{Bucket: []byte(bucketName)}
key := antidoteclient.Key(setName)
......@@ -325,7 +325,7 @@ func errCheck(e error, level int, message string) {
if e != nil {
switch level {
case FATAL:
glog.Fatalln(message, e)
glog.Infoln(message, e)
case ERROR:
glog.Errorln(message, e)
case WARNING:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment