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

Java/servlet Caching implementation and updates #2906

Merged
merged 10 commits into from
Jul 3, 2017

Conversation

zloster
Copy link
Contributor

@zloster zloster commented Jun 28, 2017

  • Updated dependencies
  • Code clean up
  • Added Caching implementation using cache2k

My notes about the test rules: IMO the test must mandate the usage of non-repeatable random numbers for the IDs. Here I've tried to use the API to get all the cache objects with one operation. But if there are duplicates in the keys list, the resulting list will contain less than the requested number of objects. And currently this is flagged as a warning:

Accessing URL http://TFB-server:8080/servlet/cached-worlds?queries=:
Response (trimmed to 40 bytes): "[{"id":8829,"randomNumber":685}]"
WARN for http://TFB-server:8080/servlet/cached-worlds?queries=501

 JSON array length of 491 != expected length of 500

I suspect that most of the cache implementation will have similar semantic.

@zloster
Copy link
Contributor Author

zloster commented Jun 28, 2017

Travis build for servlet will need a restart. The computer where the build was running was powered off.

@NateBrady23
Copy link
Member

NateBrady23 commented Jun 28, 2017

@zloster You are right, we can explicitly state that somewhere, however, it is implied by the following rule:

The request handler must retrieve a set of CachedWorld objects, equal in count to the count parameter, from the CachedWorld database table. Note that the CachedWorld database table uses a schema idential to the World table used for Test #3 but is distinct to avoid confusion.

I'll get some wording from the rest of the team and see if we can't get that in the docs.

@NateBrady23
Copy link
Member

Restarted the job

@zloster
Copy link
Contributor Author

zloster commented Jun 30, 2017

More updates:

  • Introduce Maven profiles and update shell scripts to reflect that
  • Enable only the relevant servlets i.e. when testing PostgreSQL don't deploy MySQL and plaintext/JSON servlets

Please, don't merge yet. I want to update the README.md

@NateBrady23
Copy link
Member

@zloster sure, let me know

@zloster
Copy link
Contributor Author

zloster commented Jul 1, 2017

@nbrady-techempower Ready.

  • Documentation updated
  • Removed the duplicated code for DB and Fortune tests for MySQL and PostgreSQL. The Update test is still different: MySQL is using batch updates, PostgreSQL in not
  • Also minor clean up in the Java/Jetty README.md

TODO: different implementation for single query and multiple queries tests. Currently there are warnings due to usage of the same code.

@NateBrady23 NateBrady23 merged commit 8ab7a8c into TechEmpower:master Jul 3, 2017
@zloster zloster deleted the servlet-cache branch August 7, 2017 08:30
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.

2 participants