Skip to content

Commit

Permalink
[FAB-9733] Add Done() to State interface
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yacovm committed May 6, 2018
1 parent fb60186 commit 021b6d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/handlers/endorsement/api/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type State interface {

// GetTransientByTXID gets the values private data associated with the given txID
GetTransientByTXID(txID string) ([]*rwset.TxPvtReadWriteSet, error)

// Done releases resources occupied by the State
Done()
}

// StateFetcher retrieves an instance of a state
Expand Down
3 changes: 3 additions & 0 deletions core/handlers/validation/api/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type State interface {
// can be supplied as empty strings. However, a full scan should be used judiciously for performance reasons.
// The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.
GetStateRangeScanIterator(namespace string, startKey string, endKey string) (ResultsIterator, error)

// Done releases resources occupied by the State
Done()
}

// StateFetcher retrieves an instance of a state
Expand Down

0 comments on commit 021b6d5

Please sign in to comment.