-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(share/eds/store): expose eds store params (#2724)
Adds exported params to allow control of eds store configuration
- Loading branch information
Showing
16 changed files
with
90 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package eds | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
type Parameters struct { | ||
// GC performs DAG store garbage collection by reclaiming transient files of | ||
// shards that are currently available but inactive, or errored. | ||
// We don't use transient files right now, so GC is turned off by default. | ||
GCInterval time.Duration | ||
|
||
// RecentBlocksCacheSize is the size of the cache for recent blocks. | ||
RecentBlocksCacheSize int | ||
|
||
// BlockstoreCacheSize is the size of the cache for blockstore requested accessors. | ||
BlockstoreCacheSize int | ||
} | ||
|
||
// DefaultParameters returns the default configuration values for the EDS store parameters. | ||
func DefaultParameters() *Parameters { | ||
return &Parameters{ | ||
GCInterval: 0, | ||
RecentBlocksCacheSize: 10, | ||
BlockstoreCacheSize: 128, | ||
} | ||
} | ||
|
||
func (p *Parameters) Validate() error { | ||
if p.GCInterval < 0 { | ||
return fmt.Errorf("eds: GC interval cannot be negative") | ||
} | ||
|
||
if p.RecentBlocksCacheSize < 1 { | ||
return fmt.Errorf("eds: recent blocks cache size must be positive") | ||
} | ||
|
||
if p.BlockstoreCacheSize < 1 { | ||
return fmt.Errorf("eds: blockstore cache size must be positive") | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters