Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#40 introduce in-memory store #41

Merged
merged 3 commits into from
Oct 3, 2018
Merged

#40 introduce in-memory store #41

merged 3 commits into from
Oct 3, 2018

Conversation

hleb-albau
Copy link
Contributor

No description provided.

// imms - in-memory storage
func NewLinksHandler(cis CidIndexStorage, ils LinksStorage, ols LinksStorage, imms *InMemoryStorage) sdk.Handler {

getCidIndex := func(ctx sdk.Context, cid Cid) CidNumber {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move function creation to external function


// Load from underlying persistent storage
// Heavy operation
func (s *InMemoryStorage) Load(ctx sdk.Context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be move CyberdPersistentStorages from struct to that function param?

func (cis CidIndexStorage) GetCidsCount(ctx sdk.Context) uint64 {

mainStore := ctx.KVStore(cis.mainStoreKey)
lastIndexAsBytes := mainStore.Get(cidsCount)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lastCidIndex

return nil, nil, err
}

//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to func

@arturalbov arturalbov merged commit efd13b9 into master Oct 3, 2018
@arturalbov arturalbov deleted the in-memory-store branch October 3, 2018 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants