scassandra / scassandra-server

Stubbed Cassandra
http://www.scassandra.org
Other
87 stars 34 forks source link

Add units to time spans. #126

Open MicahZoltu opened 8 years ago

MicahZoltu commented 8 years ago

https://github.com/scassandra/scassandra-server/blob/master/java-client/src/main/java/org/scassandra/http/client/PrimingRequest.java#L270

fixedDelay has no units in the variable name and just wants a long. If targeting Java 8, I recommend taking a Duration instead (so you don't need to worry about units). If targeting Java 7 or lower then I recommend either taking a TimeUnit parameter as well or changing the name everywhere to fixedDelayInMilliseconds or fixedDelayInSeconds or fixedDelayInFortnights.

MicahZoltu commented 8 years ago

Also, what are the units? Milliseconds?

chbatey commented 8 years ago

yes it is milliseconds. FYI the Java API is a wrapper around a JSON/HTTP API, so we could use duration or timeunit but would require some serialisation on the Java side and then on the Scala server side into a Scala Duration. I don't have anytime to work on this atm but will happily review a PR. Beware the API needs to be backward compatible.