Documentation ¶
Index ¶
- Variables
- func AsyncIndexer(idxType string, nid string, colNum int, ctx context.Context)
- func AzureDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
- func DaosDownload(uuid string, nodeInstance *Node) (err error, md5sum string)
- func DbFindDistinct(q bson.M, d string) (results interface{}, err error)
- func FMOpen(filepath string) (f *os.File, err error)
- func GCloudStoreDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
- func HasAttributeField(a string) bool
- func InitReaper()
- func Initialize()
- func IsInMappy(item string, mp mappy) bool
- func LocationsRequest(ctx context.Context)
- func Path2uuid(filepath string) string
- func ReloadFromDisk(path string) (err error)
- func RestoreRequest(ctx context.Context)
- func S3Download(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
- func SetFileFromParts(id string, compress string, numParts int, allowEmpty bool)
- func ShockDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
- func SortByteArray(b []byte) []byte
- func TSMDownload(uuid string, nodeInstance *Node) (err error)
- func Unzip(src string, dest string) ([]string, error)
- type IdxInfo
- type Indexes
- type Location
- type Node
- func CreateNodeUpload(u *user.User, params map[string]string, files file.FormFiles) (node *Node, err error)
- func CreateNodesFromArchive(u *user.User, params map[string]string, files file.FormFiles, archiveId string) (nodes []*Node, err error)
- func Load(id string) (n *Node, err error)
- func New(uuid string) (node *Node)
- func (node *Node) AddLocation(loc Location) (err error)
- func (node *Node) CheckTransit() (locked bool)
- func (node *Node) DBInit()
- func (node *Node) Delete() (deleted bool, err error)
- func (node *Node) DeleteIndex(indextype string) (err error)
- func (node *Node) DeleteLocation(locID string) (err error)
- func (node *Node) DeleteLocations() (err error)
- func (node *Node) DynamicIndex(name string) (idx index.Index, err error)
- func (n *Node) ExpireNodeFiles() (deleted bool, err error)
- func (node *Node) FileExt() string
- func (node *Node) FilePath() string
- func (node *Node) FileReader() (reader file.ReaderAt, err error)
- func (node *Node) GetLocation(locID string) (myLocation Location, err error)
- func (node *Node) GetLocations() (locations []Location)
- func (node *Node) GetRestore() (stat bool)
- func (node *Node) HasFile() bool
- func (node *Node) HasFileLock() bool
- func (node *Node) HasIndex(index string) bool
- func (node *Node) HasIndexLock(name string) bool
- func (node *Node) HasParent() bool
- func (node *Node) IndexFiles() []string
- func (node *Node) IndexPath() string
- func (node *Node) Mkdir() (err error)
- func (node *Node) Path() string
- func (node *Node) Rmdir() (err error)
- func (node *Node) Save() (err error)
- func (node *Node) SetAttributes(attr file.FormFile) (err error)
- func (node *Node) SetAttributesFromString(attributes string) (err error)
- func (node *Node) SetExpiration(expire string) (err error)
- func (node *Node) SetFile(file file.FormFile) (err error)
- func (node *Node) SetFileFromPath(path string, action string) (err error)
- func (node *Node) SetFileFromSubset(subsetIndices file.FormFile) (err error)
- func (node *Node) SetInTransit()
- func (node *Node) SetIndexInfo(indextype string, idxinfo *IdxInfo)
- func (node *Node) SetRestore()
- func (node *Node) ToJson() (s string, err error)
- func (node *Node) UnSetInTransitLocked()
- func (node *Node) UnSetRestore()
- func (node *Node) Update(params map[string]string, files file.FormFiles, hasLock bool) (err error)
- func (node *Node) UpdateDataTags(types string)
- func (node *Node) UpdateLinkages(ltype string, ids string, operation string)
- func (node *Node) UpdateVersion() (err error)
- type NodeReaper
- type Nodes
- type Parent
- type PartsList
- type Subset
- type SubsetNodeIdxInfo
Constants ¶
This section is empty.
Variables ¶
var DocumentMaxByte = 16777216
mongodb has hard limit of 16 MB docuemnt size
var TransitMapMutex = sync.RWMutex{}
TransitMapLock lock write access to the CacheMap
Functions ¶
func AzureDownload ¶
func AzureDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
AzureDownload support for downloading off https://github.com/daos-stack
func DaosDownload ¶
DaosDownload support for downloading off https://github.com/daos-stack
func FMOpen ¶
FMOpen drop in replacement for os.Open that attempts to download files from locations stored in MongoDB
func GCloudStoreDownload ¶
func GCloudStoreDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
GCloudStoreDownload support for downloading off https://github.com/daos-stack
func HasAttributeField ¶
func InitReaper ¶
func InitReaper()
func Initialize ¶
func Initialize()
Initialize creates a copy of the mongodb connection and then uses that connection to create the Nodes collection in mongodb. Then, it ensures that there is a unique index on the id key in this collection, creating the index if necessary.
func LocationsRequest ¶
GET, PUT, DELETE: /node/{nid}/locations/{loc} , for PUT send body: {loc}, specify -H "Content-Type: application/json"
func ReloadFromDisk ¶
func RestoreRequest ¶
GET, PUT, DELETE: /node/{nid}/restore/ , for PUT send body: {loc}, specify -H "Content-Type: application/json"
func S3Download ¶
func S3Download(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
S3Download download a file and its indices from an S3 source
func SetFileFromParts ¶
this runs asynchronously and uses FileLockMgr
func ShockDownload ¶
func ShockDownload(uuid string, nodeInstance *Node, location *conf.LocationConfig) (err error, md5sum string)
ShockDownload download a file from a Shock server
func SortByteArray ¶
func TSMDownload ¶
TSMDownload support for downloading files of an existing IBM Tivoli service
Types ¶
type IdxInfo ¶
type IdxInfo struct { Type string `bson:"index_type" json:"-"` TotalUnits int64 `bson:"total_units" json:"total_units"` AvgUnitSize int64 `bson:"average_unit_size" json:"average_unit_size"` Format string `bson:"format" json:"-"` CreatedOn time.Time `bson:"created_on" json:"created_on"` Locked *locker.LockInfo `bson:"-" json:"locked"` }
type Location ¶
type Location struct { ID string `bson:"id" json:"id"` // name of the location, if present data is verified to exist in said location Stored bool `bson:"stored,omitempty" json:"stored,omitempty"` // RequestedDate *time.Time `bson:"requestedDate,omitempty" json:"requestedDate,omitempty"` // what is the date the data item was send on its way }
Location a data type to represent storage locations (defined in LocationConfig) and status of data in flight
type Node ¶
type Node struct { Id string `bson:"id" json:"id"` Version string `bson:"version" json:"version"` File file.File `bson:"file" json:"file"` Attributes interface{} `bson:"attributes" json:"attributes"` Indexes Indexes `bson:"indexes" json:"indexes"` Acl acl.Acl `bson:"acl" json:"-"` VersionParts map[string]string `bson:"version_parts" json:"version_parts"` Tags []string `bson:"tags" json:"tags"` Revisions []Node `bson:"revisions" json:"-"` Linkages []linkage `bson:"linkage" json:"linkage"` Priority int `bson:"priority" json:"priority"` CreatedOn time.Time `bson:"created_on" json:"created_on"` LastModified time.Time `bson:"last_modified" json:"last_modified"` Expiration time.Time `bson:"expiration" json:"expiration"` // 0 means no expiration of Node Type string `bson:"type" json:"type"` Subset Subset `bson:"subset" json:"-"` Parts *PartsList `bson:"parts" json:"parts"` Locations []Location `bson:"locations" json:"locations"` // see below Restore bool `bson:"restore" json:"restore"` // has a restore request been observed }
func CreateNodeUpload ¶
func CreateNodesFromArchive ¶
func (*Node) CheckTransit ¶
CheckTransit - return true if Node is currently being uploaded to an external Location
func (*Node) DeleteIndex ¶
************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************
DeleteIndex for node
func (*Node) DeleteLocation ¶
DeleteLocation _
func (*Node) DynamicIndex ¶
func (*Node) ExpireNodeFiles ¶
************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************ ************************
ExpireNodeFiles -- remove files in DATA_PATH if present on >= conf.MIN_REPLICA_COUNT external Locations
func (*Node) GetLocation ¶
GetLocation _
func (*Node) GetRestore ¶
GetRestore return true if node has been marked for restoring from external Location
func (*Node) HasFileLock ¶
func (*Node) HasIndexLock ¶
func (*Node) IndexFiles ¶
func (*Node) SetAttributesFromString ¶
func (*Node) SetExpiration ¶
func (*Node) SetFileFromPath ¶
SetFileFromPath _
func (*Node) SetFileFromSubset ¶
func (*Node) SetInTransit ¶
func (node *Node) SetInTransit()
SetInTransit - return true if Node is currently being uploaded to an external Location
func (*Node) SetIndexInfo ¶
func (*Node) SetRestore ¶
func (node *Node) SetRestore()
SetRestore set Restore value to true to mark node for restoring from external Location
func (*Node) UnSetInTransitLocked ¶
func (node *Node) UnSetInTransitLocked()
UnSetInTransitLocked - return true if Node is currently being uploaded to an external Location
func (*Node) UnSetRestore ¶
func (node *Node) UnSetRestore()
UnsetRestore set Restore value to false, node restore has been requested e.g. via TSM client
func (*Node) UpdateDataTags ¶
func (*Node) UpdateLinkages ¶
func (*Node) UpdateVersion ¶
type NodeReaper ¶
type NodeReaper struct{}
var ( Ttl *NodeReaper ExpireRegex = regexp.MustCompile(`^(\d+)(M|H|D)$`) )
func NewNodeReaper ¶
func NewNodeReaper() *NodeReaper
func (*NodeReaper) Handle ¶
func (nr *NodeReaper) Handle()
type Subset ¶
type Subset struct { Parent Parent `bson:"parent" json:"-"` Index SubsetNodeIdxInfo `bson:"index" json:"-"` }
Subset is used to store information about a subset node's parent and its index. A subset node's index defines the subset of the data file that this node represents. A subset node's index is immutable after it is defined.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package contains Node File struct and MultiReaderAt implementation
|
Package contains Node File struct and MultiReaderAt implementation |
format/fasta
Package to read and write FASTA format files
|
Package to read and write FASTA format files |
format/fastq
Package to read and write FASTQ format files
|
Package to read and write FASTQ format files |
format/line
Package to read and index lines of a file
|
Package to read and index lines of a file |
format/multi
Package to read and auto-detect format of fasta & fastq files
|
Package to read and auto-detect format of fasta & fastq files |
format/sam
Package to read and write SAM format files
|
Package to read and write SAM format files |
format/seq
Package contains interfaces for fasta & fastq & and multi packages
|
Package contains interfaces for fasta & fastq & and multi packages |