Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private Data Comparison #2861

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

jcastrence
Copy link
Contributor

Resolves #2818

Signed-off-by: Julian Castrence juliancastrence@ibm.com

Type of change

  • New feature
  • Improvement (improvement to code, performance, etc)

Description

  • Compare command now generates a list of differences between the private data in a separate json output file.

Related issues

@jcastrence jcastrence requested a review from a team as a code owner August 27, 2021 01:55
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
@jcastrence jcastrence force-pushed the compare_snapshots_pvtdata branch 2 times, most recently from a3861cd to a0cc6cb Compare August 30, 2021 22:58
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
s.highestRecord = (*s.records)[0]
s.highestIndex = 0
} else {
for i, r := range *s.records {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterating through all the records every time is not an efficient way to do this. Better to keep the firstRecords sorted. But this could be improved in a follow-on PR since this is not the main intent of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The follow-on PR can implement a min-max heap to reduce runtime.

internal/ledgerutil/compare.go Show resolved Hide resolved
internal/ledgerutil/compare.go Outdated Show resolved Hide resolved
Resolves hyperledger#2818

Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
@denyeart denyeart merged commit b1d7538 into hyperledger:main Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ledger comparison utility - Private data comparison
3 participants