Skip to content

Conversation

@carlosrmng
Copy link
Contributor

This PR adds #size() to Result API, it implements size() for existing backends. The complete disscusion can be found in GORA-444.

Some issues with this PR:
-new tests are need.
-Backends: Accumulo, Avro, HBase, don't support size() functions, so an approach using batchSize was used instead.

Code review welcome, thanks

@lewismc
Copy link
Member

lewismc commented Mar 24, 2018

@carlosrmng great 👍
Can you please format 2 space indents the same as the other source code?
Thanks

@lewismc
Copy link
Member

lewismc commented Mar 25, 2018

I am +1 for committing this. @carlosrmng it would be great if we could add tests to DataStoreTestBase.java to accommodate this proposed addition to the core API.

@nishadi
Copy link
Contributor

nishadi commented Mar 27, 2018

This is great work...!!! As Lewis mentioned, shall we add tests for this? As well we will need to document all the public APIs as well.

@lewismc
Copy link
Member

lewismc commented Mar 27, 2018

Yep tests would be great. IMHO, as this is something we want to test for every Datastore, I suggest it be implemented within DataStoreTestUtil.java

@djkevincr
Copy link
Member

+1

@carlosrmng
Copy link
Contributor Author

Thanks for your support, I will start working in some tests and documentation.

public int size() {
return cacheKeySet.size();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

@carlosrmng It is a good practice if you can avoid empty lines like this :)

-Implement tests within DataStoreTestBase and DataStoreTestUtil.
-Fix size() implementation for MemStore, Accumulo, Solr, JCache and OrientDB.
return map.navigableKeySet().size();
int totalSize = map.navigableKeySet().size();
int intLimit = (int)this.limit;
return intLimit > 0 && totalSize>intLimit ? intLimit : totalSize;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please reformat the code with desired spacing.

@nishadi
Copy link
Contributor

nishadi commented May 1, 2018

Hi Carlos, This is great. One thing to note is when sending PRs please make sure code is well formatted and all required Java docs are added for public methods. These improvements will show a good standard in your coding :)

@cguzel
Copy link
Member

cguzel commented May 1, 2018

+1

@lewismc
Copy link
Member

lewismc commented May 2, 2018

+1, can someone merge into master?

return intLimit > 0 && totalSize>intLimit ? intLimit : totalSize;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the ending new line

@carlosrmng
Copy link
Contributor Author

Is this okay for merge?

@djkevincr
Copy link
Member

If any one have concerns please raise, otherwise I will proceed merging this PR to master.

Copy link
Member

@lewismc lewismc left a comment

Choose a reason for hiding this comment

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

+1

@asfgit asfgit merged commit fb4b355 into apache:master May 17, 2018
@djkevincr
Copy link
Member

djkevincr commented May 17, 2018

I just merged your PR to master. Awesome work Carlos 👍 One minor thing to point out, it s good if you can be consistent with commit messages. Have a look at this post.
[1] https://chris.beams.io/posts/git-commit/

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.

6 participants