Skip to content

Commit 021b6d5

Browse files
committed
[FAB-9733] Add Done() to State interface
This change set adds a Done() method to the state interface, so that the underlying Query executor could be released. Change-Id: I6d10b8557b56b6a56bd108c295d4b0e5a08a309f Signed-off-by: yacovm <yacovm@il.ibm.com>
1 parent fb60186 commit 021b6d5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

core/handlers/endorsement/api/state/state.go

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type State interface {
2121

2222
// GetTransientByTXID gets the values private data associated with the given txID
2323
GetTransientByTXID(txID string) ([]*rwset.TxPvtReadWriteSet, error)
24+
25+
// Done releases resources occupied by the State
26+
Done()
2427
}
2528

2629
// StateFetcher retrieves an instance of a state

core/handlers/validation/api/state/state.go

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type State interface {
2121
// can be supplied as empty strings. However, a full scan should be used judiciously for performance reasons.
2222
// The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.
2323
GetStateRangeScanIterator(namespace string, startKey string, endKey string) (ResultsIterator, error)
24+
25+
// Done releases resources occupied by the State
26+
Done()
2427
}
2528

2629
// StateFetcher retrieves an instance of a state

0 commit comments

Comments
 (0)