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

Start Vitess when starting server in DEVELOPMENT environment #699

Merged
merged 3 commits into from Jan 3, 2019

Conversation

tirsen
Copy link
Collaborator

@tirsen tirsen commented Dec 12, 2018

No description provided.

@tirsen tirsen force-pushed the jontirsen/2018-12-10/start-vt-in-dev branch from 8339d31 to bff2508 Compare December 12, 2018 10:55

@Qualifier
@Target(AnnotationTarget.FIELD, AnnotationTarget.FUNCTION)
annotation class Movies
Copy link
Collaborator

Choose a reason for hiding this comment

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

note to self: rename this to MoviesDb

println("java.io.tmpdir = ${System.getProperty("java.io.tmpdir")}")
// We can't use Files::createTempDirectory because it creates a directory under the path
// /var/folders that is not possible to mount in Docker
schemaDir = Paths.get("/tmp/vitess_schema_${System.currentTimeMillis()}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

if you’re trying to be unique, inject a TokenGenerator. currentTimeMillis() isn’t unique enough!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because VitessClusters are cached globally it's very awkward to inject into them. This will be sufficiently unique for our purposes I believe. Very rarely does a developer start more than a single cluster at exactly the same millisecond.

* Copy the resource to the specified filename [destination], creating all of the parent
* directories if necessary.
*/
private fun copyResource(address: String, destination: Path) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

awesome

@swankjesse
Copy link
Collaborator

swankjesse commented Dec 12, 2018

Love it!

@tirsen tirsen force-pushed the jontirsen/2018-12-10/start-vt-in-dev branch 2 times, most recently from 39b2faa to f5e8913 Compare December 21, 2018 16:04
@tirsen tirsen force-pushed the jontirsen/2018-12-10/start-vt-in-dev branch from f5e8913 to f094fbc Compare January 3, 2019 15:16
@tirsen tirsen merged commit 1684dbf into master Jan 3, 2019
@tirsen tirsen deleted the jontirsen/2018-12-10/start-vt-in-dev branch January 3, 2019 16:17
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.

None yet

2 participants