swarm/storage/localstore: fix typos and update comments

This commit is contained in:
Janos Guljas 2019-01-29 12:10:45 +01:00
parent 85cd349af4
commit 7fa1ba9b05
5 changed files with 8 additions and 8 deletions

View file

@ -37,7 +37,7 @@ on the database.
Getters, Putters and Setters accept different get, put and set modes Getters, Putters and Setters accept different get, put and set modes
to perform different actions. For example, ModeGet has two different to perform different actions. For example, ModeGet has two different
variables ModeGetRequest and ModeGetSync and dwo different Getters variables ModeGetRequest and ModeGetSync and two different Getters
can be constructed with them that are used when the chunk is requested can be constructed with them that are used when the chunk is requested
or when the chunk is synced as this two events are differently changing or when the chunk is synced as this two events are differently changing
the database. the database.

View file

@ -32,7 +32,7 @@ var (
// in range (0,1]. For example, with 0.9 value, // in range (0,1]. For example, with 0.9 value,
// garbage collection will leave 90% of defined capacity // garbage collection will leave 90% of defined capacity
// in database after its run. This prevents frequent // in database after its run. This prevents frequent
// garbage collection runt. // garbage collection runs.
gcTargetRatio = 0.9 gcTargetRatio = 0.9
// gcBatchSize limits the number of chunks in a single // gcBatchSize limits the number of chunks in a single
// leveldb batch on garbage collection. // leveldb batch on garbage collection.

View file

@ -54,7 +54,7 @@ type DB struct {
// schema name of loaded data // schema name of loaded data
schemaName shed.StringField schemaName shed.StringField
// filed that stores number of intems in gc index // field that stores number of intems in gc index
storedGCSize shed.Uint64Field storedGCSize shed.Uint64Field
// retrieval indexes // retrieval indexes

View file

@ -65,7 +65,7 @@ func (g *Getter) Get(addr storage.Address) (chunk storage.Chunk, err error) {
return storage.NewChunk(out.Address, out.Data), nil return storage.NewChunk(out.Address, out.Data), nil
} }
// get returns Item with from the retrieval index // get returns Item from the retrieval index
// and updates other indexes. // and updates other indexes.
func (db *DB) get(mode ModeGet, addr storage.Address) (out shed.Item, err error) { func (db *DB) get(mode ModeGet, addr storage.Address) (out shed.Item, err error) {
item := addressToItem(addr) item := addressToItem(addr)
@ -138,7 +138,7 @@ func (db *DB) updateGC(item shed.Item) (err error) {
return err return err
} }
if item.AccessTimestamp == 0 { if item.AccessTimestamp == 0 {
// chunk is not yes synced // chunk is not yet synced
// do not add it to the gc index // do not add it to the gc index
return nil return nil
} }

View file

@ -27,11 +27,11 @@ type ModePut int
// Putter modes. // Putter modes.
const ( const (
// ModePutRequest: when a chunk is received as a result of retrieve request and delivery, it is put only in // ModePutRequest: when a chunk is received as a result of retrieve request and delivery
ModePutRequest ModePut = iota ModePutRequest ModePut = iota
// ModePutSync: when a chunk is received via syncing in it is put in // ModePutSync: when a chunk is received via syncing
ModePutSync ModePutSync
// ModePutUpload: when a chunk is created by local upload it is put in // ModePutUpload: when a chunk is created by local upload
ModePutUpload ModePutUpload
) )