Skip to content

JAVA-444: Add process information to UUID LSB#521

Closed
pmaedel wants to merge 1 commit intoapache:2.1from
CupSoftware:java444
Closed

JAVA-444: Add process information to UUID LSB#521
pmaedel wants to merge 1 commit intoapache:2.1from
CupSoftware:java444

Conversation

@pmaedel
Copy link
Copy Markdown

@pmaedel pmaedel commented Nov 12, 2015

Java-444
For relevant discussion see also respective ticket for C*: CASSANDRA-7925

@datastax-bot
Copy link
Copy Markdown

Hi @pmaedel, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Sincerely,
DataStax Bot.

@datastax-bot
Copy link
Copy Markdown

Thank you @pmaedel for signing the Contribution License Agreement.

Cheers,
DataStax Bot.

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Nov 23, 2015

Yes, I agree that we need to address this.

Since using getRuntimeMXBean is not an "official" way to get the PID, I'd like to add the following:

  • extract the actual number from the bean name, and log it at DEBUG level
  • if the bean name has an unexpected format or an exception is thrown, fallback to the random number, but also log a WARN message
  • allow the pid to be overridden by a system property (e.g. com.datastax.driver.PID). It would probably be a good idea to also mention that property in the warn message above.

@pmaedel, do you have time to take a look at this?

@pmaedel
Copy link
Copy Markdown
Author

pmaedel commented Nov 23, 2015

Well there is no single official way to get the PID, up until Java 9
With that in mind, I think we should go for the same solution as C*
@olim7t, could you add your proposal to CASSANDRA-7925 as well?

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Dec 2, 2015

C* uses Sigar to get the PID, amongst other things. That works well for them because Cassandra is a standalone program, they just need to include all Sigar files in the binary distribution and it's easy to reference them.

In our case it's a bit more complicated because the driver uses Maven for dependencies. Sigar is present in Maven central, but apparently it was deployed by a third party and I see a number of problems with it:

  • not all platform-specific binaries are present (compare the list to what's present in Cassandra)
  • some files in the repo don't follow Maven naming conventions, so I don't see how they could be referenced from our POM. For example: http://repo1.maven.org/maven2/org/fusesource/sigar/1.6.4/libsigar-universal64-macosx-1.6.4.dylib
  • there's also a sigar-native.jar file containing all the platform-specific binaries, but it's not usable as-is, i.e. we can't just include it in our POM and expect Sigar to load from it. Apparently you're supposed to extract the files in a directory and pass the path as a system property, again something that's fine for a standalone program but not for a library like the driver.

Long story short, I think Sigar is too complicated for the driver, the getRuntimeMXBean solution should be good enough for most cases, provided we take the few precautions I outlined in my previous message.

@pmaedel
Copy link
Copy Markdown
Author

pmaedel commented Dec 2, 2015

@olim7t Thank you for elaborating. I agree with your reasoning and will look into the proposed adjustments asap.

@adutra
Copy link
Copy Markdown
Contributor

adutra commented Feb 15, 2016

Closing in favor of #593.

@adutra adutra closed this Feb 15, 2016
Sfurti-yb pushed a commit to yugabyte/cassandra-java-driver that referenced this pull request Dec 8, 2023
Local temporals are converted into their local representation using the session timezone.

[closes apache#521]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
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.

4 participants