cmd/swarm, swarm: LocalStore storage integration

This commit is contained in:
Janoš Guljaš
2019-04-10 16:50:58 +02:00
committed by Anton Evangelatov
parent c94d582aa7
commit 996755c4a8
62 changed files with 3094 additions and 3676 deletions

View File

@@ -40,9 +40,7 @@ type Item struct {
Data []byte
AccessTimestamp int64
StoreTimestamp int64
// UseMockStore is a pointer to identify
// an unset state of the field in Join function.
UseMockStore *bool
BinID uint64
}
// Merge is a helper method to construct a new
@@ -61,8 +59,8 @@ func (i Item) Merge(i2 Item) (new Item) {
if i.StoreTimestamp == 0 {
i.StoreTimestamp = i2.StoreTimestamp
}
if i.UseMockStore == nil {
i.UseMockStore = i2.UseMockStore
if i.BinID == 0 {
i.BinID = i2.BinID
}
return i
}

View File

@@ -52,7 +52,7 @@ type indexSpec struct {
Name string `json:"name"`
}
// schemaFieldKey retrives the complete LevelDB key for
// schemaFieldKey retrieves the complete LevelDB key for
// a particular field form the schema definition.
func (db *DB) schemaFieldKey(name, fieldType string) (key []byte, err error) {
if name == "" {