shard

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2015 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch(url, commit, branch string, t *testing.T)

func Check

func Check(err error, t *testing.T)

func CheckNoFile

func CheckNoFile(url, name, commit string, t *testing.T)

func CheckResp

func CheckResp(res *http.Response, expected string, t *testing.T)

func Checkfile

func Checkfile(url, name, commit, data string, t *testing.T)

func Commit

func Commit(url, commit, branch string, t *testing.T)

func RunOp

func RunOp(url string, o traffic.Op, t *testing.T)

func RunWorkload

func RunWorkload(url string, w traffic.Workload, t *testing.T)

func SyncFrom

func SyncFrom(dataRepo string, urls []string) error

SyncFrom syncs from the most up to date replica in urls Returns the first error if ALL urls error.

func SyncTo

func SyncTo(dataRepo string, urls []string) error

SyncTo syncs the contents in p to all of the shards in urls Returns the first error if there are multiple

func WriteFile

func WriteFile(url, name, branch, data string, t *testing.T)

Types

type BranchMsg

type BranchMsg struct {
	Name   string `json:"name"`
	TStamp string `json:"tstamp"`
}

type CommitMsg

type CommitMsg struct {
	Name   string `json:"name"`
	TStamp string `json:"tstamp"`
}

type MultiPartPuller

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

func NewMultiPartPuller

func NewMultiPartPuller(r *multipart.Reader) MultiPartPuller

func (MultiPartPuller) Pull

func (m MultiPartPuller) Pull(from string, cb btrfs.Pusher) error

type MultipartReplica

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

func NewMultipartReplica

func NewMultipartReplica(w *multipart.Writer) MultipartReplica

func (MultipartReplica) Push

func (m MultipartReplica) Push(diff io.Reader) error

type Shard

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

func NewShard

func NewShard(dataRepo, compRepo, pipelinePrefix string, shard, modulos uint64) *Shard

func ShardFromArgs

func ShardFromArgs() (*Shard, error)

func (*Shard) BranchHandler

func (s *Shard) BranchHandler(w http.ResponseWriter, r *http.Request)

BranchHandler creates a new branch from commit.

func (*Shard) CommitHandler

func (s *Shard) CommitHandler(w http.ResponseWriter, r *http.Request)

CommitHandler creates a snapshot of outstanding changes.

func (*Shard) EnsureRepos

func (s *Shard) EnsureRepos() error

func (*Shard) FileHandler

func (s *Shard) FileHandler(w http.ResponseWriter, r *http.Request)

FileHandler is the core route for modifying the contents of the fileystem.

func (*Shard) FillRole

func (s *Shard) FillRole(cancel chan struct{}) error

FillRole attempts to find a role in the cluster. Once on is found it prepares the local storage for the role and announces the shard to the rest of the cluster. This function will loop until `cancel` is closed.

func (*Shard) JobHandler

func (s *Shard) JobHandler(w http.ResponseWriter, r *http.Request)

func (*Shard) Peers

func (s *Shard) Peers() ([]string, error)

func (*Shard) PipelineHandler

func (s *Shard) PipelineHandler(w http.ResponseWriter, r *http.Request)

func (*Shard) PullHandler

func (s *Shard) PullHandler(w http.ResponseWriter, r *http.Request)

func (*Shard) RunServer

func (s *Shard) RunServer()

RunServer runs a shard server listening on port 80

func (*Shard) ShardMux

func (s *Shard) ShardMux() *http.ServeMux

ShardMux creates a multiplexer for a Shard writing to the passed in FS.

func (*Shard) SyncFromPeers

func (s *Shard) SyncFromPeers() error

func (*Shard) SyncToPeers

func (s *Shard) SyncToPeers() error

type ShardReplica

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

func NewShardReplica

func NewShardReplica(url string) ShardReplica

func (ShardReplica) Pull

func (r ShardReplica) Pull(from string, cb btrfs.Pusher) error

func (ShardReplica) Push

func (r ShardReplica) Push(diff io.Reader) error

Jump to

Keyboard shortcuts

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