{"modulePath":"github.com/matrixorigin/matrixcube","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Variables\n\n```go\nvar (\n\t// None no need to next scan\n\tNone = ScanStartKeyPolicy(0)\n\t// GenWithResultLastKey use `kv.NextKey(last result key)` as startKey for next scan\n\tGenWithResultLastKey = ScanStartKeyPolicy(1)\n\t// UseShardEnd use the endKey of the shard as startKey for next scan\n\tUseShardEnd = ScanStartKeyPolicy(2)\n)\n```\n\n## Types\n\n```go\ntype DataStorageScanner interface {\n\t// Scan Scan the data in the specified shard to satisfy the conditions,\n\t// the qualifying conditions can be specified using options.\n\t//\n\t// When a key satisfies the condition, the handler will be called.\n\t// The key and value passed to the handler are not safe and will be reused\n\t// between multiple handler calls, and need to be copied if they need to be saved.\n\t//\n\t// completed to true means that the scan is completed in all shards, otherwise the\n\t// client needs nextKeyPolicy to create the startKey for the next scan.\n\tScan(shard meta.Shard, handler func(key, value []byte) error, options ...ScanOption) (completed bool, nextKeyPolicy ScanStartKeyPolicy, err error)\n}\n```\nDataStorageScanner\n\n```go\nfunc NewKVBasedDataStorageScanner(kv storage.KVStorage) DataStorageScanner\n```\nNewKVBasedDataStorageScanner create a kv based DataStorageScanner\n\n```go\ntype ScanOption func(*scanOptions)\n```\nScanOption scan option func\n\n```go\nfunc WithScanBuffer(buffer *buf.ByteBuf) ScanOption\n```\nWithScanBuffer set the buffer of scan to avoid memory overhead\n\n```go\nfunc WithScanBytesLimit(value uint64) ScanOption\n```\nWithScanBytesLimit set the maximum number of bytes of data to be included in the result\n\n```go\nfunc WithScanCountLimit(value uint64) ScanOption\n```\nWithScanCountLimit set the maximum number of data to be included in the result\n\n```go\nfunc WithScanEndKey(endKey []byte) ScanOption\n```\nWithScanEndKey set the endKey of scan\n\n```go\nfunc WithScanFilterFunc(filterFunc func([]byte) bool) ScanOption\n```\nWithScanFilterFunc set the key filter and return true to indicate that the record meets the condition\n\n```go\nfunc WithScanStartKey(startKey []byte) ScanOption\n```\nWithScanStartKey set the startKey of scan\n\n```go\nfunc WithValue() ScanOption\n```\nWithValue set whether the return result of scan contains value\n\n```go\ntype ScanStartKeyPolicy int\n```\nScanStartKeyPolicy calculation strategy for the startKey of next scan\n\n","path":"github.com/matrixorigin/matrixcube/storage/executor","name":"executor","synopsis":"","isRedistributable":true}
