springml / spark-sftp

Spark connector for SFTP
Apache License 2.0
100 stars 98 forks source link

Use an UUID instead of Random.nextInt(1000) when creating a temporary filename #17

Closed utdemir closed 6 years ago

utdemir commented 6 years ago

We use this library to create many files, and sometimes it throws an exception saying the file already exists; because this library creates a temporary file and the random suffix it assigns does not have enough range.

This PR makes it use java.util.UUID.randomUUID instead of Random.nextInt(1000); which makes having collisions practically impossible, at the cost of a slightly unpleasant filenames, but I think it is a good trade off.

utdemir commented 6 years ago

Thank you for merging!

Is it possible for you to also publish a release to Maven?

springml commented 6 years ago

@utdemir Will publish it and update this PR

springml commented 6 years ago

@utdemir Published new aritifact to maven repository. Will take few hours to get reflected in maven repository

utdemir commented 6 years ago

Thank you @springml !

It's been almost a day, but I couldn't see any version bumps on build.sbt or new artifact on maven(I'm looking at this page: https://mvnrepository.com/artifact/com.springml/spark-sftp_2.11).

Am I looking at the wrong thing? Where can I find the new release?

springml commented 6 years ago

@utdemir It is available over here. Soon it will be available to maven repository as well