moves consts to stores folder
This commit is contained in:
parent
034473c84f
commit
41ae2abe62
|
@ -32,7 +32,7 @@ import pkg/ethers
|
|||
|
||||
import ./discovery
|
||||
import ./stores
|
||||
import ./consts
|
||||
import ./stores/consts
|
||||
|
||||
export DefaultCacheSizeMiB, net, DefaultQuotaBytes, DefaultBlockTtl, DefaultBlockMaintenanceInterval, DefaultNumberOfBlocksToMaintainPerInterval, RepoKind
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
type
|
||||
RepoKind* = enum
|
||||
repoFS = "fs"
|
||||
repoSQLite = "sqlite"
|
||||
|
||||
const
|
||||
MiB* = 1024 * 1024
|
|
@ -15,7 +15,7 @@ import pkg/confutils
|
|||
import pkg/confutils/defs
|
||||
|
||||
import ../namespaces
|
||||
import ../consts
|
||||
import ./consts
|
||||
import ./blockstore
|
||||
import ./repostore
|
||||
import ./cachestore
|
||||
|
|
|
@ -21,7 +21,7 @@ import pkg/questionable
|
|||
import pkg/questionable/results
|
||||
|
||||
import ./blockstore
|
||||
import ../consts
|
||||
import ./consts
|
||||
import ../chunker
|
||||
import ../manifest
|
||||
|
||||
|
@ -35,10 +35,6 @@ type
|
|||
backingStore: BlockStore
|
||||
cache: LruCache[Cid, Block]
|
||||
|
||||
const
|
||||
DefaultCacheSizeMiB* = 5
|
||||
DefaultCacheSize* = DefaultCacheSizeMiB * MiB
|
||||
|
||||
method getBlock*(self: CacheStore, cid: Cid): Future[?!Block] {.async.} =
|
||||
if cid.isEmpty:
|
||||
trace "Empty block, ignoring"
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import pkg/chronos
|
||||
|
||||
type
|
||||
RepoKind* = enum
|
||||
repoFS = "fs"
|
||||
repoSQLite = "sqlite"
|
||||
|
||||
const
|
||||
MiB* = 1024 * 1024
|
||||
DefaultCacheSizeMiB* = 5
|
||||
DefaultCacheSize* = DefaultCacheSizeMiB * MiB
|
||||
DefaultBlockMaintenanceInterval* = 10.minutes
|
||||
DefaultNumberOfBlocksToMaintainPerInterval* = 1000
|
||||
DefaultMemoryStoreCapacityMiB* = 5
|
||||
DefaultMemoryStoreCapacity* = DefaultMemoryStoreCapacityMiB * MiB
|
||||
DefaultBlockTtl* = 24.hours
|
||||
DefaultQuotaBytes* = 1'u shl 33'u # ~8GB
|
|
@ -20,10 +20,6 @@ import ../utils/timer
|
|||
import ../clock
|
||||
import ../systemclock
|
||||
|
||||
const
|
||||
DefaultBlockMaintenanceInterval* = 10.minutes
|
||||
DefaultNumberOfBlocksToMaintainPerInterval* = 1000
|
||||
|
||||
type
|
||||
BlockMaintainer* = ref object of RootObj
|
||||
repoStore: RepoStore
|
||||
|
|
|
@ -22,7 +22,7 @@ import pkg/questionable
|
|||
import pkg/questionable/results
|
||||
|
||||
import ./blockstore
|
||||
import ../consts
|
||||
import ./consts
|
||||
import ../chunker
|
||||
import ../manifest
|
||||
|
||||
|
@ -42,10 +42,6 @@ type
|
|||
table: Table[Cid, DoublyLinkedNode[MemoryStoreNode]]
|
||||
list: DoublyLinkedList[MemoryStoreNode]
|
||||
|
||||
const
|
||||
DefaultMemoryStoreCapacityMiB* = 5
|
||||
DefaultMemoryStoreCapacity* = DefaultMemoryStoreCapacityMiB * MiB
|
||||
|
||||
method getBlock*(self: MemoryStore, cid: Cid): Future[?!Block] {.async.} =
|
||||
trace "Getting block from cache", cid
|
||||
if cid.isEmpty:
|
||||
|
|
|
@ -21,6 +21,7 @@ import pkg/stew/endians2
|
|||
|
||||
import ./blockstore
|
||||
import ./keyutils
|
||||
import ./consts
|
||||
import ../blocktype
|
||||
import ../clock
|
||||
import ../systemclock
|
||||
|
@ -30,10 +31,6 @@ export blocktype, libp2p
|
|||
logScope:
|
||||
topics = "codex repostore"
|
||||
|
||||
const
|
||||
DefaultBlockTtl* = 24.hours
|
||||
DefaultQuotaBytes* = 1'u shl 33'u # ~8GB
|
||||
|
||||
type
|
||||
QuotaUsedError* = object of CodexError
|
||||
QuotaNotEnoughError* = object of CodexError
|
||||
|
|
|
@ -11,9 +11,9 @@ import pkg/libp2p
|
|||
import pkg/stew/endians2
|
||||
import pkg/datastore
|
||||
|
||||
import pkg/codex/stores/cachestore
|
||||
import pkg/codex/chunker
|
||||
import pkg/codex/stores
|
||||
import pkg/codex/stores/consts
|
||||
import pkg/codex/blocktype as bt
|
||||
import pkg/codex/clock
|
||||
|
||||
|
|
Loading…
Reference in New Issue