func (I *Instance) Sync() bool {
	if Gdb.IsSetup() != true {
		return false
	}
	nodeName := etcd.ETC_INST_DIR + "/" + I.Name + "/"
	Gdb.CreateSection(nodeName)
	Gdb.Set(nodeName+"Type", I.Type)
	Gdb.Set(nodeName+"Masters", fmt.Sprintf("%d", I.Masters))
	Gdb.Set(nodeName+"Slaves", fmt.Sprintf("%d", I.Slaves))
	Gdb.Set(nodeName+"Capacity", fmt.Sprintf("%d", I.Capacity))
	Gdb.Set(nodeName+"ExpMasters", fmt.Sprintf("%d", I.ExpMasters))
	Gdb.Set(nodeName+"ExpSlaves", fmt.Sprintf("%d", I.ExpSlaves))
	Gdb.Set(nodeName+"Status", I.Status)
	Gdb.Set(nodeName+"Mname", I.Mname)
	Gdb.Set(nodeName+"DValue", fmt.Sprintf("%d", I.DistributionValue))
	nodeNameSlaves := nodeName + "Snames/"
	Gdb.CreateSection(nodeNameSlaves)
	for _, sname := range I.Snames {
		Gdb.Set(nodeNameSlaves+sname, sname)
	}
	nodeNameProcs := nodeName + "Procs/"
	Gdb.CreateSection(nodeNameProcs)
	return true
}
Sync Writes the entier content of an instance into store, an instance could have many keys to be updated this is a write intensive function should be used carefully, do not call this if you are planning to update only a single attribute of an instance
package types
import (
	"encoding/json"
	"fmt"
	"log"
	"path/filepath"
	"strconv"
	"github.com/mesos/mr-redis/common/store/etcd"
)
type Instance struct {
	Name              string            
	Type              string            
	Capacity          int               
	Masters           int               
	Slaves            int               
	ExpMasters        int               
	ExpSlaves         int               
	Status            string            
	Mname             string            
	Snames            []string          
	Procs             map[string]*Proc  
	DistributionValue int               
}
func NewInstance(Name string, Type string, Masters int, Slaves int, Cap int) *Instance {
	p := &Instance{Name: Name, Type: Type, ExpMasters: Masters, ExpSlaves: Slaves, Capacity: Cap, DistributionValue: 1}
	return p
}
func LoadInstance(Name string) *Instance {
	if Gdb.IsSetup() != true {
		return nil
	}
	nodeName := etcd.ETC_INST_DIR + "/" + Name
	if ok, _ := Gdb.IsKey(nodeName); !ok {
		return nil
	}
	I := &Instance{Name: Name}
	I.Load()
	return I
}
func (I *Instance) Load() bool {
	var err error
	var tmpStr string
	var SnamesKey []string
	if Gdb.IsSetup() != true {
		return false
	}
	nodeName := etcd.ETC_INST_DIR + "/" + I.Name + "/"
	I.Type, err = Gdb.Get(nodeName + "Type")
	tmpStr, err = Gdb.Get(nodeName + "Capacity")
	I.Capacity, err = strconv.Atoi(tmpStr)
	tmpStr, err = Gdb.Get(nodeName + "Masters")
	I.Masters, err = strconv.Atoi(tmpStr)
	tmpStr, err = Gdb.Get(nodeName + "Slaves")
	I.Slaves, err = strconv.Atoi(tmpStr)
	tmpStr, err = Gdb.Get(nodeName + "ExpMasters")
	I.ExpMasters, err = strconv.Atoi(tmpStr)
	tmpStr, err = Gdb.Get(nodeName + "ExpSlaves")
	I.ExpSlaves, err = strconv.Atoi(tmpStr)
	I.Status, err = Gdb.Get(nodeName + "Status")
	I.Mname, err = Gdb.Get(nodeName + "Mname")
	tmpStr, err = Gdb.Get(nodeName + "DValue")
	I.DistributionValue, err = strconv.Atoi(tmpStr)
	nodeNameSlaves := nodeName + "Snames/"
	SnamesKey, err = Gdb.ListSection(nodeNameSlaves, false)
	if err != nil {
		log.Printf("The error value is %v", err)
	}
	for _, snamekey := range SnamesKey {
		_, sname := filepath.Split(snamekey)
		I.Snames = append(I.Snames, sname)
	}
	I.LoadProcs()
	return true
}