changelog

package
v0.0.0-...-7bde1eb Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(device, token string, endRec int64) error

Clear is a convenience function to enable clearing a changelog without first creating a Handle.

Types

type Follower

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

Follower is a Lustre Changelog follower. It provides a work-around for the broken CHANGELOG_FLAG_FOLLOW functionality in liblustreapi. If that is ever fixed, then it should be possible to just call NextRecord() in a blocking loop directly on the handle.

func CreateFollower

func CreateFollower(device string, startRec int64) *Follower

CreateFollower takes a MDT name and returns a Follower-wrapped Handle

func FollowHandle

func FollowHandle(h Handle, startRec int64) *Follower

FollowHandle takes a Handle and wraps it with a Follower object.

func (*Follower) Close

func (f *Follower) Close()

Close signals that the Follower should close the wrapped Handle and stop processing records.

func (*Follower) Follow

func (f *Follower) Follow()

Follow opens the wrapped Handle at the first available index.

func (*Follower) FollowFrom

func (f *Follower) FollowFrom(startRec int64)

FollowFrom opens the wrapped Handle at the specified index.

func (*Follower) NextRecord

func (f *Follower) NextRecord() (Record, error)

NextRecord blocks until the next record is available or an error was encountered by the follower goroutine.

type Handle

type Handle interface {
	Open(bool) error
	OpenAt(int64, bool) error
	Close() error
	NextRecord() (Record, error)
	Clear(string, int64) error
	String() string
}

Handle represents an interface to a Lustre Changelog

func CreateHandle

func CreateHandle(device string) Handle

CreateHandle returns a Handle for accessing Changelog records on a given MDT.

type Record

type Record interface {
	Index() int64
	Name() string
	Type() string
	TypeCode() uint
	Time() time.Time
	TargetFid() *lustre.Fid
	ParentFid() *lustre.Fid
	SourceName() string
	SourceFid() *lustre.Fid
	SourceParentFid() *lustre.Fid
	IsRename() bool
	IsLastRename() (bool, bool)
	IsLastUnlink() (bool, bool)
	JobID() string
	String() string
}

Record represents a Lustre Changelog record

type RecordIterator

type RecordIterator interface {
	NextRecord() (Record, error)
}

RecordIterator iterates over Records

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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