Documentation ¶
Overview ¶
Package labelsz supports ranking labels by # annotations of each type.
Index ¶
- Constants
- func NewTypeLabelTKey(i IndexType, label uint64) storage.TKey
- func NewTypeSizeLabelTKey(i IndexType, sz uint32, label uint64) storage.TKey
- type Data
- func (d *Data) DescribeTKeyClass(tkc storage.TKeyClass) string
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) GetCountElementType(ctx *datastore.VersionedCtx, label uint64, i IndexType) (uint32, error)
- func (d *Data) GetLabelsByThreshold(ctx *datastore.VersionedCtx, i IndexType, minSize uint32, offset, num int) (LabelSizes, error)
- func (d *Data) GetSyncSubs(synced dvid.Data) (datastore.SyncSubs, error)
- func (d *Data) GetSyncedAnnotation() *annotation.Data
- func (d *Data) GetTopElementType(ctx *datastore.VersionedCtx, n int, i IndexType) (LabelSizes, error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) Help() string
- func (d *Data) InitDataHandlers() error
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) ReloadData(ctx *datastore.VersionedCtx)
- func (d *Data) SendCountsByElementType(w http.ResponseWriter, ctx *datastore.VersionedCtx, labels []uint64, ...) error
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...) (activity map[string]interface{})
- func (d *Data) Shutdown(wg *sync.WaitGroup)
- func (d *Data) SyncPending() bool
- type IndexType
- type LabelSize
- type LabelSizes
- type Properties
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/labelsz" TypeName = "labelsz" )
const (
MaxLabelsReturned = 10000 // Maximum number of labels returned in JSON
)
Variables ¶
This section is empty.
Functions ¶
func NewTypeLabelTKey ¶
NewTypeLabelTKey returns a type-specific key for the (index type, label) tuple.
Types ¶
type Data ¶
type Data struct { *datastore.Data Properties // Keep track of sync operations that could be updating the data. datastore.Updater sync.RWMutex // contains filtered or unexported fields }
Data instance of labelvol, label sparse volumes.
func GetByUUIDName ¶
GetByUUIDName returns a pointer to annotation data given a version (UUID) and data name.
func NewData ¶
func NewData(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (*Data, error)
NewData returns a pointer to labelsz data.
func (*Data) DescribeTKeyClass ¶
DescribeTKeyClass returns a string explanation of what a particular TKeyClass is used for. Implements the datastore.TKeyClassDescriber interface.
func (*Data) GetCountElementType ¶
func (d *Data) GetCountElementType(ctx *datastore.VersionedCtx, label uint64, i IndexType) (uint32, error)
GetCountElementType returns a count of the given ElementType for a given label.
func (*Data) GetLabelsByThreshold ¶
func (d *Data) GetLabelsByThreshold(ctx *datastore.VersionedCtx, i IndexType, minSize uint32, offset, num int) (LabelSizes, error)
GetLabelsByThreshold returns a sorted list of labels that meet the given minSize threshold. We allow a maximum of MaxLabelsReturned returned labels and start with rank "offset".
func (*Data) GetSyncSubs ¶
GetSyncSubs implements the datastore.Syncer interface. Returns a list of subscriptions to the sync data instance that will notify the receiver.
func (*Data) GetSyncedAnnotation ¶
func (d *Data) GetSyncedAnnotation() *annotation.Data
func (*Data) GetTopElementType ¶
func (d *Data) GetTopElementType(ctx *datastore.VersionedCtx, n int, i IndexType) (LabelSizes, error)
GetTopElementType returns a sorted list of the top N labels that have the given ElementType.
func (*Data) InitDataHandlers ¶
InitDataHandlers launches goroutines to handle each labelblk instance's syncs.
func (*Data) MarshalJSON ¶
func (*Data) ReloadData ¶
func (d *Data) ReloadData(ctx *datastore.VersionedCtx)
func (*Data) SendCountsByElementType ¶
func (d *Data) SendCountsByElementType(w http.ResponseWriter, ctx *datastore.VersionedCtx, labels []uint64, idxType IndexType) error
SendCountsByElementType writes the counts for given index type for a list of labels
func (*Data) ServeHTTP ¶
func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, r *http.Request) (activity map[string]interface{})
ServeHTTP handles all incoming HTTP requests for this data.
func (*Data) Shutdown ¶
Shutdown terminates blocks until syncs are done then terminates background goroutines processing data.
func (*Data) SyncPending ¶ added in v0.9.12
SyncPending returns true if any sync messages are in queue
type IndexType ¶
type IndexType uint8
IndexType gives the type of index.
func DecodeTypeLabelTKey ¶
DecodeTypeLabelTKey decodes a type-specific key into a (index type, label) tuple.
func DecodeTypeSizeLabelTKey ¶
DecodeTypeSizeLabelTKey decodes a type-specific key into a (index type, size, label) tuple.
func StringToIndexType ¶
StringToIndexType converts a string to an IndexType
type LabelSize ¶
LabelSize is the count for a given label for some metric like # of PreSyn annotations.
type LabelSizes ¶
type LabelSizes []LabelSize
LabelSizes is a sortable slice of LabelSize
func (LabelSizes) Len ¶
func (s LabelSizes) Len() int
func (LabelSizes) Less ¶
func (s LabelSizes) Less(i, j int) bool
func (LabelSizes) Swap ¶
func (s LabelSizes) Swap(i, j int)
type Properties ¶
type Properties struct { // StaticROI is an optional static ROI specification of the form "<roiname>,<uuid>" // Note that it *cannot* mutate after the labelsz instance is created. StaticROI string }
Properties are additional properties for data beyond those in standard datastore.Data.