From 7fa1ba9b055ec5a16e88f3fa44fc628ec6e8714b Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Tue, 29 Jan 2019 12:10:45 +0100 Subject: [PATCH] swarm/storage/localstore: fix typos and update comments --- swarm/storage/localstore/doc.go | 2 +- swarm/storage/localstore/gc.go | 2 +- swarm/storage/localstore/localstore.go | 2 +- swarm/storage/localstore/mode_get.go | 4 ++-- swarm/storage/localstore/mode_put.go | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/swarm/storage/localstore/doc.go b/swarm/storage/localstore/doc.go index d730fc92ab..98f6fc40aa 100644 --- a/swarm/storage/localstore/doc.go +++ b/swarm/storage/localstore/doc.go @@ -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. diff --git a/swarm/storage/localstore/gc.go b/swarm/storage/localstore/gc.go index a228c8493f..4bf524d28b 100644 --- a/swarm/storage/localstore/gc.go +++ b/swarm/storage/localstore/gc.go @@ -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. diff --git a/swarm/storage/localstore/localstore.go b/swarm/storage/localstore/localstore.go index e0ace5131a..a1908f134a 100644 --- a/swarm/storage/localstore/localstore.go +++ b/swarm/storage/localstore/localstore.go @@ -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 diff --git a/swarm/storage/localstore/mode_get.go b/swarm/storage/localstore/mode_get.go index c4eb21d324..c5905834ce 100644 --- a/swarm/storage/localstore/mode_get.go +++ b/swarm/storage/localstore/mode_get.go @@ -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 } diff --git a/swarm/storage/localstore/mode_put.go b/swarm/storage/localstore/mode_put.go index d232e73cc6..15e2e12412 100644 --- a/swarm/storage/localstore/mode_put.go +++ b/swarm/storage/localstore/mode_put.go @@ -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 )