Documentation ¶
Index ¶
- Constants
- Variables
- type Metadata
- type ZkMetadataMapper
- func (self *ZkMetadataMapper) AddBackendToPartition(graphID uuid.UUID, partitionId uuid.UUID, backendID string) ([]string, interface{}, error)
- func (self *ZkMetadataMapper) CreateBackend(backendAddr string) (string, error)
- func (self *ZkMetadataMapper) CreateEdge(graphID uuid.UUID, edgeID uuid.UUID, srcID uuid.UUID) error
- func (self *ZkMetadataMapper) CreateGraph(graphID uuid.UUID, data interface{}) error
- func (self *ZkMetadataMapper) CreatePartition(graphID uuid.UUID, partitionId uuid.UUID) error
- func (self *ZkMetadataMapper) CreateVertex(graphID uuid.UUID, partitionId uuid.UUID, vertexID uuid.UUID) error
- func (self *ZkMetadataMapper) DecrementElementCount(graphID uuid.UUID, partitionId uuid.UUID) error
- func (self *ZkMetadataMapper) DeleteEdge(graphID uuid.UUID, edgeID uuid.UUID) error
- func (self *ZkMetadataMapper) DeleteVertex(graphID uuid.UUID, vertexID uuid.UUID) error
- func (self *ZkMetadataMapper) DeleteVertexInformation(graphID uuid.UUID, vertexID uuid.UUID, key interface{}) error
- func (self *ZkMetadataMapper) FindNewBackendForPartition(graphID uuid.UUID, partitionId uuid.UUID) (string, error)
- func (self *ZkMetadataMapper) GetAllBackends() ([]string, error)
- func (self *ZkMetadataMapper) GetAllPartitions(graphID uuid.UUID) ([]string, error)
- func (self *ZkMetadataMapper) GetBackendInformation(backendID string) (map[string]interface{}, error)
- func (self *ZkMetadataMapper) GetBackendsForPartition(graphID uuid.UUID, partitionId uuid.UUID) ([]string, error)
- func (self *ZkMetadataMapper) GetEdgeInformation(graphID uuid.UUID, edgeID uuid.UUID) (map[string]interface{}, error)
- func (self *ZkMetadataMapper) GetEdgeLocation(graphID uuid.UUID, edgeID uuid.UUID) (*uuid.UUID, []string, error)
- func (self *ZkMetadataMapper) GetGraphs(graphIds *[]uuid.UUID) error
- func (self *ZkMetadataMapper) GetPartitionInformation(graphID uuid.UUID, partitionId uuid.UUID) (map[string]interface{}, error)
- func (self *ZkMetadataMapper) GetVertexInformation(graphID uuid.UUID, vertexID uuid.UUID) (map[string]interface{}, error)
- func (self *ZkMetadataMapper) GetVertexLocation(graphID uuid.UUID, vertexID uuid.UUID) (*uuid.UUID, []string, error)
- func (self *ZkMetadataMapper) GetWatchOnChildren(backendNode string) ([]string, <-chan zk.Event, error)
- func (self *ZkMetadataMapper) IncrementElementCount(graphID uuid.UUID, partitionId uuid.UUID) error
- func (self *ZkMetadataMapper) Initialize() error
- func (self *ZkMetadataMapper) SetEdgeLocation(graphID uuid.UUID, edgeID uuid.UUID, srcID uuid.UUID) error
- func (self *ZkMetadataMapper) SetPartitionInformation(graphID uuid.UUID, partitionId uuid.UUID, data interface{}) error
- func (self *ZkMetadataMapper) SetVertexLocation(graphID uuid.UUID, partitionId uuid.UUID, vertexID uuid.UUID) error
- func (self *ZkMetadataMapper) UpdateEdgeInformation(graphID uuid.UUID, edgeID uuid.UUID, key interface{}, value interface{}) error
- func (self *ZkMetadataMapper) UpdateVertexInformation(graphID uuid.UUID, vertexID uuid.UUID, key interface{}, value interface{}) error
Constants ¶
View Source
const ( DEFAULTVERSION = -1 ROOT = "/" BACKEND = "backends" GRAPH = "graphs" PARTITION = "partitions" VERTEX = "vertices" EDGE = "edges" BACKEND_PREFIX = "back-" EMPTY_DATA = "{}" )
Constants to be used
Variables ¶
View Source
var ZK_TIMEOUT = 5 * time.Second
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata interface { //Intitialize the zookeeper tree Initialize() error //creates a Znode for a graph vertex CreateVertex(graphID uuid.UUID, partitionID uuid.UUID, vertexID uuid.UUID) error //creates a Znode for a graph edge CreateEdge(graphID uuid.UUID, partitionID uuid.UUID, edgeID uuid.UUID) error //creates a Znode for a graph partition CreatePartition(graphID uuid.UUID, partitionID uuid.UUID) error //creates a Znode for a backend CreateBackend(backendAddr string) (string, error) //creates a Znode for a graph CreateGraph(graphID uuid.UUID, data interface{}) error // Gets all graphs in the system GetGraphs(graphsIds *[]uuid.UUID) error //Delete the Znode for a graph vertex DeleteVertex(graphID uuid.UUID, vertexID uuid.UUID) error //Delete the Znode for a graph edge DeleteEdge(graphID uuid.UUID, edgeID uuid.UUID) error //returns the backends that house a particular vertex GetVertexLocation(graphID uuid.UUID, vertexID uuid.UUID) (*uuid.UUID, []string, error) //sets the partition to which a vertex belongs SetVertexLocation(graphID uuid.UUID, partitionID uuid.UUID, vertexID uuid.UUID) error //returns the backend that houses the source vertex of an edge GetEdgeLocation(graphID uuid.UUID, edgeID uuid.UUID) (*uuid.UUID, []string, error) //sets the source vertex of an edge SetEdgeLocation(graphID uuid.UUID, edgeID uuid.UUID, vertexID uuid.UUID) error //returns list of backend IDs GetAllBackends() ([]string, error) //return all backends that house this partition GetBackendsForPartition(graphID uuid.UUID, partitionID uuid.UUID) ([]string, error) //returns backend information GetBackendInformation(backendID string) (map[string]interface{}, error) //returns all partitions of a graph GetAllPartitions(graphID uuid.UUID) ([]string, error) //sets the data at a partition Znode SetPartitionInformation(graphID uuid.UUID, partitionID uuid.UUID, data interface{}) error //returns the data at a partition Znode GetPartitionInformation(graphID uuid.UUID, partitionID uuid.UUID) (map[string]interface{}, error) // updates the data at a vertex Znode UpdateVertexInformation(graphID uuid.UUID, vertexID uuid.UUID, key interface{}, value interface{}) error // returns data at a vertex Znode DeleteVertexInformation(graphID uuid.UUID, vertexID uuid.UUID, key interface{}) error // returns the data at a vertex Znode GetVertexInformation(graphID uuid.UUID, vertexID uuid.UUID) (map[string]interface{}, error) // updates the data at an Edge Znode UpdateEdgeInformation(graphID uuid.UUID, edgeID uuid.UUID, key interface{}, value interface{}) error // returns the data at a vertex Znode GetEdgeInformation(graphID uuid.UUID, edgeID uuid.UUID) (map[string]interface{}, error) //adds a backend to a partition AddBackendToPartition(graphID uuid.UUID, partitionID uuid.UUID, backendID string) ([]string, interface{}, error) //increment count of number of edges/vertices in a partition IncrementElementCount(graphID uuid.UUID, partitionID uuid.UUID) error //decrement count of number of edges/vertices in a partition DecrementElementCount(graphID uuid.UUID, partitionID uuid.UUID) error FindNewBackendForPartition(graphID uuid.UUID, partitionID uuid.UUID) (string, error) }
Metadata : Interface exposing zookeeper functionality
type ZkMetadataMapper ¶
type ZkMetadataMapper struct { Connection *zk.Conn ZkAddrs []string // contains filtered or unexported fields }
func NewZkMetadataMapper ¶
func NewZkMetadataMapper(ZkAddrs []string) *ZkMetadataMapper
func (*ZkMetadataMapper) AddBackendToPartition ¶
func (*ZkMetadataMapper) CreateBackend ¶
func (self *ZkMetadataMapper) CreateBackend(backendAddr string) (string, error)
func (*ZkMetadataMapper) CreateEdge ¶
func (*ZkMetadataMapper) CreateGraph ¶
func (self *ZkMetadataMapper) CreateGraph(graphID uuid.UUID, data interface{}) error
CreateGraph : creates a graph Znode
func (*ZkMetadataMapper) CreatePartition ¶
func (*ZkMetadataMapper) CreateVertex ¶
func (*ZkMetadataMapper) DecrementElementCount ¶
func (*ZkMetadataMapper) DeleteEdge ¶
func (*ZkMetadataMapper) DeleteVertex ¶
func (*ZkMetadataMapper) DeleteVertexInformation ¶
func (*ZkMetadataMapper) FindNewBackendForPartition ¶
func (*ZkMetadataMapper) GetAllBackends ¶
func (self *ZkMetadataMapper) GetAllBackends() ([]string, error)
func (*ZkMetadataMapper) GetAllPartitions ¶
func (self *ZkMetadataMapper) GetAllPartitions(graphID uuid.UUID) ([]string, error)
func (*ZkMetadataMapper) GetBackendInformation ¶
func (self *ZkMetadataMapper) GetBackendInformation(backendID string) (map[string]interface{}, error)
func (*ZkMetadataMapper) GetBackendsForPartition ¶
func (self *ZkMetadataMapper) GetBackendsForPartition(graphID uuid.UUID, partitionId uuid.UUID) ([]string, error)
GetBackendsForPartition : Add backends to Partitions
func (*ZkMetadataMapper) GetEdgeInformation ¶
func (*ZkMetadataMapper) GetEdgeLocation ¶
func (*ZkMetadataMapper) GetGraphs ¶
func (self *ZkMetadataMapper) GetGraphs(graphIds *[]uuid.UUID) error
CreateGraph : Gets all graphs in the systems
func (*ZkMetadataMapper) GetPartitionInformation ¶
func (*ZkMetadataMapper) GetVertexInformation ¶
func (*ZkMetadataMapper) GetVertexLocation ¶
func (*ZkMetadataMapper) GetWatchOnChildren ¶
func (self *ZkMetadataMapper) GetWatchOnChildren(backendNode string) ([]string, <-chan zk.Event, error)
@param : backendNode - full path of node whose children need to be watched @return : list of all alive children,
func (*ZkMetadataMapper) IncrementElementCount ¶
func (*ZkMetadataMapper) Initialize ¶
func (self *ZkMetadataMapper) Initialize() error
func (*ZkMetadataMapper) SetEdgeLocation ¶
func (*ZkMetadataMapper) SetPartitionInformation ¶
func (*ZkMetadataMapper) SetVertexLocation ¶
func (*ZkMetadataMapper) UpdateEdgeInformation ¶
func (*ZkMetadataMapper) UpdateVertexInformation ¶
Click to show internal directories.
Click to hide internal directories.