LFUDA changes #47

Closed
nikooo777 wants to merge 12 commits from improvements into master
6 changed files with 267 additions and 2 deletions
Showing only changes of commit bc54601dde - Show all commits

3
go.mod
View file

@ -5,6 +5,7 @@ replace github.com/btcsuite/btcd => github.com/lbryio/lbrycrd.go v0.0.0-20200203
require ( require (
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
github.com/aws/aws-sdk-go v1.16.11 github.com/aws/aws-sdk-go v1.16.11
github.com/bparli/lfuda-go v0.3.0
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew v1.1.1
@ -25,7 +26,7 @@ require (
github.com/lbryio/lbry.go v1.1.2 // indirect github.com/lbryio/lbry.go v1.1.2 // indirect
github.com/lbryio/lbry.go/v2 v2.6.1-0.20200901175808-73382bb02128 github.com/lbryio/lbry.go/v2 v2.6.1-0.20200901175808-73382bb02128
github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec
github.com/lucas-clemente/quic-go v0.19.1 github.com/lucas-clemente/quic-go v0.19.2
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6 github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6
github.com/prometheus/client_golang v0.9.2 github.com/prometheus/client_golang v0.9.2
github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus v1.4.2

4
go.sum
View file

@ -25,6 +25,8 @@ github.com/aws/aws-sdk-go v1.16.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bparli/lfuda-go v0.3.0 h1:b6qPjEb0BN006oQnj2nuGfz94yY3iYo0bmuFM079tQg=
github.com/bparli/lfuda-go v0.3.0/go.mod h1:BR5a9lwlqRqnPhU3F5ojFK3VhTKg8iFVtJJKgZBQhAo=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
@ -223,6 +225,8 @@ github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec/go.mod h1:CG3wsDv5BiV
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lucas-clemente/quic-go v0.19.1 h1:J9TkQJGJVOR3UmGhd4zdVYwKSA0EoXbLRf15uQJ6gT4= github.com/lucas-clemente/quic-go v0.19.1 h1:J9TkQJGJVOR3UmGhd4zdVYwKSA0EoXbLRf15uQJ6gT4=
github.com/lucas-clemente/quic-go v0.19.1/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= github.com/lucas-clemente/quic-go v0.19.1/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0=
github.com/lucas-clemente/quic-go v0.19.2 h1:w8BBYUx5Z+kNpeaOeQW/KzcNsKWhh4O6PeQhb0nURPg=
github.com/lucas-clemente/quic-go v0.19.2/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5/go.mod h1:c2mYKRyMb1BPkO5St0c/ps62L4S0W2NAkaTXj9qEI+0= github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5/go.mod h1:c2mYKRyMb1BPkO5St0c/ps62L4S0W2NAkaTXj9qEI+0=
github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6/go.mod h1:sFlOUpQL1YcjhFVXhg1CG8ZASEs/Mf1oVb6H75JL/zg= github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6/go.mod h1:sFlOUpQL1YcjhFVXhg1CG8ZASEs/Mf1oVb6H75JL/zg=

View file

@ -58,6 +58,7 @@ func TestCachingStore_CacheMiss(t *testing.T) {
if !bytes.Equal(b, res) { if !bytes.Equal(b, res) {
t.Errorf("expected Get() to return %s, got %s", string(b), string(res)) t.Errorf("expected Get() to return %s, got %s", string(b), string(res))
} }
time.Sleep(10 * time.Millisecond) //storing to cache is done async so let's give it some time
lyoshenka commented 2020-11-27 22:24:56 +01:00 (Migrated from github.com)
Review

need a way to do these sync or async. at the very least, an option for the cache. ideally, some process of notifying when writes finish.

need a way to do these sync or async. at the very least, an option for the cache. ideally, some process of notifying when writes finish.
has, err := cache.Has(hash) has, err := cache.Has(hash)
if err != nil { if err != nil {

118
store/lfuda.go Normal file
View file

@ -0,0 +1,118 @@
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
package store
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
import (
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
"github.com/bparli/lfuda-go"
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
"github.com/lbryio/lbry.go/v2/extras/errors"
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
"github.com/lbryio/lbry.go/v2/stream"
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
"github.com/lbryio/reflector.go/internal/metrics"
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// LRUStore adds a max cache size and LRU eviction to a BlobStore
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
type LFUDAStore struct {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// underlying store
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:27:23 +01:00 (Migrated from github.com)
Review

if this is very similar to LRUStore, maybe we need a generic EvictionStrategy struct of some sort

if this is very similar to LRUStore, maybe we need a generic EvictionStrategy struct of some sort
store BlobStore
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// lfuda implementation
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lfuda *lfuda.Cache
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// NewLRUStore initialize a new LRUStore
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func NewLFUDAStore(component string, store BlobStore, maxSize float64) *LFUDAStore {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lfuda := lfuda.NewGDSFWithEvict(maxSize, func(key interface{}, value interface{}) {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
metrics.CacheLRUEvictCount.With(metrics.CacheLabels(store.Name(), component)).Inc()
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
_ = store.Delete(key.(string)) // TODO: log this error. may happen if underlying entry is gone but cache entry still there
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
})
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lfuda.Age()
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l := &LFUDAStore{
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
store: store,
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lfuda: lfuda,
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
go func() {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if lstr, ok := store.(lister); ok {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
err := l.loadExisting(lstr, int(maxSize/2000000.0))
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if err != nil {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
panic(err) // TODO: what should happen here? panic? return nil? just keep going?
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}()
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return l
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
const nameLFUDA = "lfuda"
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
var fakeTrue = []byte{'t'}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Name is the cache type name
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) Name() string { return nameLFUDA }
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Has returns whether the blob is in the store, without updating the recent-ness.
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) Has(hash string) (bool, error) {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return l.lfuda.Contains(hash), nil
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Get returns the blob or an error if the blob doesn't exist.
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) Get(hash string) (stream.Blob, error) {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
_, has := l.lfuda.Get(hash)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if !has {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return nil, errors.Err(ErrBlobNotFound)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
blob, err := l.store.Get(hash)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if errors.Is(err, ErrBlobNotFound) {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Blob disappeared from underlying store
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l.lfuda.Remove(hash)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return blob, err
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:29:30 +01:00 (Migrated from github.com)
Review

👍 for the comment

:+1: for the comment
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Put stores the blob. Following LFUDA rules it's not guaranteed that a SET will store the value!!!
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) Put(hash string, blob stream.Blob) error {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
err := l.store.Put(hash, blob)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if err != nil {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return err
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l.lfuda.Set(hash, fakeTrue)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return nil
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// PutSD stores the sd blob
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) PutSD(hash string, blob stream.Blob) error {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
err := l.store.PutSD(hash, blob)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:31:02 +01:00 (Migrated from github.com)
Review

why are Put and PutSD implemented differently?

why are Put and PutSD implemented differently?
if err != nil {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return err
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l.lfuda.Set(hash, fakeTrue)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return nil
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Delete deletes the blob from the store
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) Delete(hash string) error {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
err := l.store.Delete(hash)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if err != nil {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return err
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// This must come after store.Delete()
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// Remove triggers onEvict function, which also tries to delete blob from store
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// We need to delete it manually first so any errors can be propagated up
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l.lfuda.Remove(hash)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return nil
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
// loadExisting imports existing blobs from the underlying store into the LRU cache
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
func (l *LFUDAStore) loadExisting(store lister, maxItems int) error {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
existing, err := store.list()
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if err != nil {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return err
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:32:23 +01:00 (Migrated from github.com)
Review

stuff like this makes me even more confident that LRU and LFUDA should be less copy-pasted and more the same object with an eviction strategy selector

stuff like this makes me even more confident that LRU and LFUDA should be less copy-pasted and more the same object with an eviction strategy selector
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
added := 0
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
for _, h := range existing {
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
l.lfuda.Set(h, fakeTrue)
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
added++
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
if maxItems > 0 && added >= maxItems { // underlying cache is bigger than LRU cache
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
break
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
return nil
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool
}
lyoshenka commented 2020-11-27 22:26:46 +01:00 (Migrated from github.com)
Review

seems weird to do this. why not an actual bool, or an empty struct?

seems weird to do this. why not an actual `bool`, or an empty struct?
nikooo777 commented 2020-12-09 19:19:18 +01:00 (Migrated from github.com)
Review

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM.

I since worked with the developer of the library to address this so i believe we can go back to using a bool

the reason I did this was because the library wasn't treating a bool as a 1byte type and it would waste a lot of RAM. I since worked with the developer of the library to address this so i believe we can go back to using a bool

139
store/lfuda_test.go Normal file
View file

@ -0,0 +1,139 @@
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
package store
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
import (
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"io/ioutil"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"os"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"reflect"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"testing"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"time"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"github.com/lbryio/lbry.go/v2/extras/errors"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
log "github.com/sirupsen/logrus"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"github.com/stretchr/testify/assert"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"github.com/stretchr/testify/require"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
const cacheMaxSize = 3
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
func getTestLFUDAStore() (*LFUDAStore, *MemStore) {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
m := NewMemStore()
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
return NewLFUDAStore("test", m, cacheMaxSize), m
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
func TestFUDAStore_Eviction(t *testing.T) {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda, mem := getTestLFUDAStore()
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
b := []byte("x")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err := lfuda.Put("one", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("two", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("three", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("four", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("five", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("five", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("four", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Put("two", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:33:36 +01:00 (Migrated from github.com)
Review

check the blob value too?

check the blob value too?
_, err = lfuda.Get("five")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
_, err = lfuda.Get("four")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
_, err = lfuda.Get("two")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, cacheMaxBlobs, len(mem.Debug()))
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
for k, v := range map[string]bool{
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"one": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"two": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"three": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"four": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"five": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"six": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
} {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
has, err := lfuda.Has(k)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, v, has)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda.Get("two") // touch so it stays in cache
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda.Get("five") // touch so it stays in cache
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda.Put("six", b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, cacheMaxBlobs, len(mem.Debug()))
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
keys := lfuda.lfuda.Keys()
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
log.Infof("%+v", keys)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
for k, v := range map[string]bool{
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"one": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"two": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"three": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"four": false,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"five": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
"six": true,
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
} {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
has, err := lfuda.Has(k)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, v, has)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Delete("six")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Delete("five")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = lfuda.Delete("two")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, 0, len(mem.Debug()))
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
func TestFUDAStore_UnderlyingBlobMissing(t *testing.T) {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda, mem := getTestLFUDAStore()
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
hash := "hash"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
b := []byte("this is a blob of stuff")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err := lfuda.Put(hash, b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = mem.Delete(hash)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
// hash still exists in lru
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.True(t, lfuda.lfuda.Contains(hash))
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
blob, err := lfuda.Get(hash)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Nil(t, blob)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.True(t, errors.Is(err, ErrBlobNotFound), "expected (%s) %s, got (%s) %s",
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
reflect.TypeOf(ErrBlobNotFound).String(), ErrBlobNotFound.Error(),
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
reflect.TypeOf(err).String(), err.Error())
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
// lru.Get() removes hash if underlying store doesn't have it
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.False(t, lfuda.lfuda.Contains(hash))
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
func TestFUDAStore_loadExisting(t *testing.T) {
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
tmpDir, err := ioutil.TempDir("", "reflector_test_*")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
defer os.RemoveAll(tmpDir)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
d := NewDiskStore(tmpDir, 2)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
hash := "hash"
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
b := []byte("this is a blob of stuff")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
err = d.Put(hash, b)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
existing, err := d.list()
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.Equal(t, 1, len(existing), "blob should exist in cache")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.Equal(t, hash, existing[0])
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
lfuda := NewLFUDAStore("test", d, 3) // lru should load existing blobs when it's created
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
time.Sleep(100 * time.Millisecond) // async load so let's wait...
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
has, err := lfuda.Has(hash)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
require.NoError(t, err)
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
assert.True(t, has, "hash should be loaded from disk store but it's not")
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement
}
lyoshenka commented 2020-11-27 22:34:03 +01:00 (Migrated from github.com)
Review

use t.Log() insteade

use `t.Log()` insteade
nikooo777 commented 2020-12-09 19:20:19 +01:00 (Migrated from github.com)
Review

ah right, this can actually be removed. it was a debug statement

ah right, this can actually be removed. it was a debug statement

View file

@ -5,6 +5,7 @@ import (
"os" "os"
"reflect" "reflect"
"testing" "testing"
"time"
"github.com/lbryio/lbry.go/v2/extras/errors" "github.com/lbryio/lbry.go/v2/extras/errors"
@ -114,7 +115,8 @@ func TestLRUStore_loadExisting(t *testing.T) {
require.Equal(t, 1, len(existing), "blob should exist in cache") require.Equal(t, 1, len(existing), "blob should exist in cache")
assert.Equal(t, hash, existing[0]) assert.Equal(t, hash, existing[0])
lru := NewLRUStore("test", d, 3) // lru should load existing blobs when it's created lru := NewLRUStore("test", d, 3) // lru should load existing blobs when it's created
time.Sleep(100 * time.Millisecond) // async load so let's wait...
has, err := lru.Has(hash) has, err := lru.Has(hash)
require.NoError(t, err) require.NoError(t, err)
assert.True(t, has, "hash should be loaded from disk store but it's not") assert.True(t, has, "hash should be loaded from disk store but it's not")