func (c ConfigDataNode) Merge(n ctree.Node) ctree.Node {
	cd := n.(*ConfigDataNode)
	t := cd.Table()
	for k, v := range t {
		c.AddItem(k, v)
	}
	return c
}
Merges a ConfigDataNode on top of this one (overwriting items where it occurs).
package cdata
import (
	"bytes"
	"encoding/gob"
	"encoding/json"
	"fmt"
	"sync"
	"github.com/intelsdi-x/snap/core/ctypes"
	"github.com/intelsdi-x/snap/pkg/ctree"
)
type ConfigDataNode struct {
	mutex *sync.Mutex
	table map[string]ctypes.ConfigValue
}
func (c *ConfigDataNode) GobEncode() ([]byte, error) {
	w := new(bytes.Buffer)
	encoder := gob.NewEncoder(w)
	if err := encoder.Encode(&c.table); err != nil {
		return nil, err
	}
	return w.Bytes(), nil
}
func (c *ConfigDataNode) GobDecode(buf []byte) error {
	r := bytes.NewBuffer(buf)
	c.mutex = new(sync.Mutex)
	decoder := gob.NewDecoder(r)
	return decoder.Decode(&c.table)
}
func (c *ConfigDataNode) MarshalJSON() ([]byte, error) {
	return json.Marshal(c.table)
}
func (c *ConfigDataNode) UnmarshalJSON(data []byte) error {
	t := map[string]interface{}{}
	c.table = map[string]ctypes.ConfigValue{}
	dec := json.NewDecoder(bytes.NewReader(data))
	dec.UseNumber()
	if err := dec.Decode(&t); err != nil {
		return err
	}
	for k, i := range t {
		switch t := i.(type) {
		case string:
			c.table[k] = ctypes.ConfigValueStr{Value: t}
		case bool:
			c.table[k] = ctypes.ConfigValueBool{Value: t}
		case json.Number:
			if v, err := t.Int64(); err == nil {
				c.table[k] = ctypes.ConfigValueInt{Value: int(v)}
				continue
			}
			if v, err := t.Float64(); err == nil {
				c.table[k] = ctypes.ConfigValueFloat{Value: v}
				continue
			}
		default:
			return fmt.Errorf("Error Unmarshalling JSON ConfigDataNode. Key: %v Type: %v is unsupported.", k, t)
		}
	}
	c.mutex = new(sync.Mutex)
	return nil
}
func NewNode() *ConfigDataNode {
	return &ConfigDataNode{
		mutex: new(sync.Mutex),
		table: make(map[string]ctypes.ConfigValue),
	}
}
func FromTable(table map[string]ctypes.ConfigValue) *ConfigDataNode {
	return &ConfigDataNode{
		mutex: new(sync.Mutex),
		table: table,
	}
}
func (c *ConfigDataNode) Table() map[string]ctypes.ConfigValue {
	c.mutex.Lock()
	defer c.mutex.Unlock()
	return c.table
}
func (c *ConfigDataNode) AddItem(k string, v ctypes.ConfigValue) {
	if k == "" {
		return
	}
	c.mutex.Lock()
	defer c.mutex.Unlock()
	c.table[k] = v
}