cache

package
v0.0.0-...-85720d3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cache implements caches for coords, nodes, ways and relations data.

Index

Constants

View Source
const SKIP int64 = -1

Variables

View Source
var (
	NotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type CoordsRefIndex

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

func (*CoordsRefIndex) Add

func (index *CoordsRefIndex) Add(id, ref int64) error

func (*CoordsRefIndex) AddFromWay

func (index *CoordsRefIndex) AddFromWay(way *element.Way)

func (*CoordsRefIndex) Close

func (index *CoordsRefIndex) Close()

func (*CoordsRefIndex) Delete

func (index *CoordsRefIndex) Delete(id int64) error

func (*CoordsRefIndex) DeleteFromWay

func (index *CoordsRefIndex) DeleteFromWay(way *element.Way)

func (*CoordsRefIndex) DeleteRef

func (index *CoordsRefIndex) DeleteRef(id, ref int64) error

func (*CoordsRefIndex) Flush

func (index *CoordsRefIndex) Flush()

func (*CoordsRefIndex) Get

func (index *CoordsRefIndex) Get(id int64) []int64

func (*CoordsRefIndex) SetLinearImport

func (index *CoordsRefIndex) SetLinearImport(val bool)

SetLinearImport optimizes the cache for write operations. Get/Delete operations will panic during linear import.

type DeltaCoordsCache

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

func (*DeltaCoordsCache) CheckCapacity

func (self *DeltaCoordsCache) CheckCapacity()

func (*DeltaCoordsCache) Close

func (self *DeltaCoordsCache) Close()

func (*DeltaCoordsCache) DeleteCoord

func (self *DeltaCoordsCache) DeleteCoord(id int64) error

func (*DeltaCoordsCache) FillWay

func (self *DeltaCoordsCache) FillWay(way *element.Way) error

func (*DeltaCoordsCache) FirstRefIsCached

func (self *DeltaCoordsCache) FirstRefIsCached(refs []int64) bool

func (*DeltaCoordsCache) Flush

func (self *DeltaCoordsCache) Flush()

func (*DeltaCoordsCache) GetCoord

func (self *DeltaCoordsCache) GetCoord(id int64) (*element.Node, error)

func (*DeltaCoordsCache) PutCoords

func (self *DeltaCoordsCache) PutCoords(nodes []element.Node) error

PutCoords puts nodes into cache. nodes need to be sorted by Id.

func (*DeltaCoordsCache) SetLinearImport

func (self *DeltaCoordsCache) SetLinearImport(v bool)

func (*DeltaCoordsCache) SetReadOnly

func (self *DeltaCoordsCache) SetReadOnly(val bool)

type DiffCache

type DiffCache struct {
	Dir    string
	Coords *CoordsRefIndex
	Ways   *WaysRefIndex
	// contains filtered or unexported fields
}

func NewDiffCache

func NewDiffCache(dir string) *DiffCache

func (*DiffCache) Close

func (c *DiffCache) Close()

func (*DiffCache) Exists

func (c *DiffCache) Exists() bool

func (*DiffCache) Flush

func (c *DiffCache) Flush()

func (*DiffCache) Open

func (c *DiffCache) Open() error

func (*DiffCache) Remove

func (c *DiffCache) Remove() error

type InsertedWaysCache

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

func (*InsertedWaysCache) Close

func (c *InsertedWaysCache) Close()

func (*InsertedWaysCache) DeleteMembers

func (p *InsertedWaysCache) DeleteMembers(members []element.Member) error

func (*InsertedWaysCache) IsInserted

func (p *InsertedWaysCache) IsInserted(id int64) (bool, error)

func (*InsertedWaysCache) PutMembers

func (p *InsertedWaysCache) PutMembers(members []element.Member) error

func (*InsertedWaysCache) PutWay

func (p *InsertedWaysCache) PutWay(way *element.Way) error

type NodesCache

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

func (*NodesCache) Close

func (c *NodesCache) Close()

func (*NodesCache) DeleteNode

func (p *NodesCache) DeleteNode(id int64) error

func (*NodesCache) GetNode

func (p *NodesCache) GetNode(id int64) (*element.Node, error)

func (*NodesCache) Iter

func (p *NodesCache) Iter() chan *element.Node

func (*NodesCache) PutNode

func (p *NodesCache) PutNode(node *element.Node) error

func (*NodesCache) PutNodes

func (p *NodesCache) PutNodes(nodes []element.Node) (int, error)

type OSMCache

type OSMCache struct {
	Coords       *DeltaCoordsCache
	Ways         *WaysCache
	Nodes        *NodesCache
	Relations    *RelationsCache
	InsertedWays *InsertedWaysCache
	// contains filtered or unexported fields
}

func NewOSMCache

func NewOSMCache(dir string) *OSMCache

func (*OSMCache) Close

func (c *OSMCache) Close()

func (*OSMCache) Exists

func (c *OSMCache) Exists() bool

func (*OSMCache) Open

func (c *OSMCache) Open() error

func (*OSMCache) Remove

func (c *OSMCache) Remove() error

type RelationsCache

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

func (*RelationsCache) Close

func (c *RelationsCache) Close()

func (*RelationsCache) DeleteRelation

func (p *RelationsCache) DeleteRelation(id int64) error

func (*RelationsCache) GetRelation

func (p *RelationsCache) GetRelation(id int64) (*element.Relation, error)

func (*RelationsCache) Iter

func (p *RelationsCache) Iter() chan *element.Relation

func (*RelationsCache) PutRelation

func (p *RelationsCache) PutRelation(relation *element.Relation) error

func (*RelationsCache) PutRelations

func (p *RelationsCache) PutRelations(rels []element.Relation) error

type WaysCache

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

func (*WaysCache) Close

func (c *WaysCache) Close()

func (*WaysCache) DeleteWay

func (p *WaysCache) DeleteWay(id int64) error

func (*WaysCache) FillMembers

func (self *WaysCache) FillMembers(members []element.Member) error

func (*WaysCache) FirstMemberIsCached

func (self *WaysCache) FirstMemberIsCached(members []element.Member) bool

func (*WaysCache) GetWay

func (p *WaysCache) GetWay(id int64) (*element.Way, error)

func (*WaysCache) Iter

func (p *WaysCache) Iter() chan *element.Way

func (*WaysCache) PutWay

func (p *WaysCache) PutWay(way *element.Way) error

func (*WaysCache) PutWays

func (p *WaysCache) PutWays(ways []element.Way) error

type WaysRefIndex

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

func (*WaysRefIndex) Add

func (index *WaysRefIndex) Add(id, ref int64) error

func (*WaysRefIndex) AddFromMembers

func (index *WaysRefIndex) AddFromMembers(relId int64, members []element.Member)

func (*WaysRefIndex) Close

func (index *WaysRefIndex) Close()

func (*WaysRefIndex) Delete

func (index *WaysRefIndex) Delete(id int64) error

func (*WaysRefIndex) DeleteRef

func (index *WaysRefIndex) DeleteRef(id, ref int64) error

func (*WaysRefIndex) Flush

func (index *WaysRefIndex) Flush()

func (*WaysRefIndex) Get

func (index *WaysRefIndex) Get(id int64) []int64

func (*WaysRefIndex) SetLinearImport

func (index *WaysRefIndex) SetLinearImport(val bool)

SetLinearImport optimizes the cache for write operations. Get/Delete operations will panic during linear import.

Directories

Path Synopsis
Package binary provides functions for (un)marshaling cache data.
Package binary provides functions for (un)marshaling cache data.
Package query provides the query-cache sub command for debugging and testing.
Package query provides the query-cache sub command for debugging and testing.

Jump to

Keyboard shortcuts

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