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
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
or when the chunk is synced as this two events are differently changing
the database.

View file

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

View file

@ -54,7 +54,7 @@ type DB struct {
// schema name of loaded data
schemaName shed.StringField
// filed that stores number of intems in gc index
// field that stores number of intems in gc index
storedGCSize shed.Uint64Field
// 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
}
// get returns Item with from the retrieval index
// get returns Item from the retrieval index
// and updates other indexes.
func (db *DB) get(mode ModeGet, addr storage.Address) (out shed.Item, err error) {
item := addressToItem(addr)
@ -138,7 +138,7 @@ func (db *DB) updateGC(item shed.Item) (err error) {
return err
}
if item.AccessTimestamp == 0 {
// chunk is not yes synced
// chunk is not yet synced
// do not add it to the gc index
return nil
}

View file

@ -27,11 +27,11 @@ type ModePut int
// Putter modes.
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
// ModePutSync: when a chunk is received via syncing in it is put in
// ModePutSync: when a chunk is received via syncing
ModePutSync
// ModePutUpload: when a chunk is created by local upload it is put in
// ModePutUpload: when a chunk is created by local upload
ModePutUpload
)