cluster

package
v0.0.0-...-83edfdb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterProxy

func NewClusterProxy(manager *Manager) model.FlowServiceServer

NewClusterProxy creates a proxy service that forwards requests to the appropriate nodes based on the request shard

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages cluster allocation and shard info

func NewManager

func NewManager(settings *Settings, extractor sharding.ShardExtractor) *Manager

NewManager creates a new cluster manager

func (*Manager) GetClient

func (m *Manager) GetClient(flowID string) (model.FlowServiceClient, error)

GetClient returns a GRPC client for the specified graph

func (*Manager) GetClients

func (m *Manager) GetClients() (clients []model.FlowServiceClient, err error)

GetClients returns GRPC clients for all the nodes

func (*Manager) LocalShards

func (m *Manager) LocalShards() (shards []int)

LocalShards returns a slice of the shards associated with this clster member

type Settings

type Settings struct {
	NodeCount  int
	NodeID     int
	NodePrefix string
	NodePort   int
}

Settings holds config for clustering and information about the current node

Source Files

  • cluster.go
  • cluster_proxy.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL