-
Notifications
You must be signed in to change notification settings - Fork 2
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
Avoid duplicate transfer #41
Conversation
Rishi, how this code will behave if agent will need to compare 1k-10k records? My understanding you want to compare dataset request with another agent. A dataset may contains 10k files. That's why I asked. Can you add unit/integration test to verify that both comparison function and request one will sustain a request with 10k records? |
@vkuznet First I am fetching all the files of requested data set from the source DB. After that, I am fetching the files of the same dataset from the destination agent. Then, I am storing destination's file name as a key and hash as its value in a separate map. This will help us to reduce the time complexity. The overall time complexity will be the O(N * m) where m is the search complexity of map. In many cases, it will be constant. Very soon I will add the unit tests. Can you suggest some better approach for this? |
@vkuznet I just added the test. Also, I did the benchmark of it. It is working fine. |
ok, good, please fix %s in printouts of the test.
…On 0, Rishi ***@***.***> wrote:
@vkuznet I just added the test. Also, I did the benchmark of it. It is working fine.
Checkout screen shot.
![screen shot 2017-08-18 at 1 59 08 am](https://user-images.githubusercontent.com/10094679/29432321-c84ab0b2-83b8-11e7-9759-28a5afa646d0.png)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#41 (comment)
|
Already, fixed that. Check out this commit. |
test/compare_test.go
Outdated
) | ||
|
||
// Compare 1k files of source with the same 1k files of destination | ||
func TestCompareThousand(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest either to delete this test since you have identical TenThousand one or make test to accept optional parameter for number of catalog entries, e.g. 1k or 10k or whatever. So far TestCompareThousand and TestCompareTenThousand are identical except one parameter in their body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
No description provided.