segmentmap

package
v0.0.0-...-887f819 Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SegmentMap

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

SegmentMap is used for handle a big map slice by slice. It's not thread safe.

func NewSegmentMap

func NewSegmentMap(size int64) (*SegmentMap, error)

NewSegmentMap create a new SegmentMap.

func (*SegmentMap) Get

func (sm *SegmentMap) Get(key []byte) (interface{}, bool)

Get is the same as map[k].

func (*SegmentMap) GetSegment

func (sm *SegmentMap) GetSegment(index int64) (map[string]interface{}, error)

GetSegment gets the map specific by index.

func (*SegmentMap) SegmentCount

func (sm *SegmentMap) SegmentCount() int64

SegmentCount returns how many inner segments.

func (*SegmentMap) Set

func (sm *SegmentMap) Set(key []byte, value interface{}, force bool) bool

Set if key not exists, returns whether already exists.

Jump to

Keyboard shortcuts

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