I'm trying to Parse JFR dump using JAVA.
I followed this blog, http://hirt.se/blog/?p=446 .
But these methods are deprecated now. Is there any supported parsers for JFR to JAVA? if not can you point me is it possible to retrieve data from JFR dump?
There is currently no supported parser.
There are however many people both inside and outside of Oracle who are using the parsers mentioned in that blog post quite successfully.
There will possibly be a supported parser in the future, there will certainly be changes to the parser, I'm just no sure if it will be "supported" or not.
But the code you are writing now should work just fine with JDK 7 and 8 flight recordings, and will not will with JDK 9 recordings.
As Klara mentioned, there is no officially supported parser. Hopefully the JFR parser will be supported officially in JDK 9. For now, you can use the APIs mentioned in Hirt's blog. Don't worry about those being deprecated. :)
I have successfully used JFR parser in my jfr-flame-graph project. Please note that my project uses Maven and the JFR parsers are not available in Maven Central (or any other repository). Therefore the "Step 1" in the README is important and it'll copy JFR parser jars to a local repository and you can use those jars as dependencies in your pom.xml
I hope this helps.
Related
I am trying to use Vowpal Wabbit through Java. I have downloaded and successfully compiled the code from GitHub. The command line tool works fine.
After having a quick look at the repository (especially here), I can only assume that using it through Java is supposed to be already possible, and I don't really want to reinvent the wheel.
A wrapper around Vowpal Wabbit that allows use through Java. This wrapper is designed to be self contained. Because
of the use of JNI, a number of platforms are supported in this JAR.
I have added the maven dependency (found here) to my project, but without any kind of document, I don't really know where to start.
I have seen in another question that it seems to be possible to use VW with Java, but the guy only uses Runtime.getRuntime.exec() to call his bash command, and I can't find any documentation about any other way of doing (and there are only 2 questions mixing VW and Java on SO, which doesn't help).
I am new to JNI, so most likely there is something easy that I don't see.
To be perfectly clear, my questions are :
Should I just make a valid vw command and use it through Runtime.getRuntime.exec()? This doesn't seem to be the spirit of JNI, for there is no need for any wrapper/library for this. Plus, this doesn't make it very portable.
Where (the hell) is the (Java API) documentation ?
Any kind of help or guidance would be welcome.
I was one of the two primary authors of the VW JNI wrapper. Since the posting of this question the interface has significantly changed. We now encourage users to compile the native side on their own and provide it on the java.library.path. We have updated the README significantly to show how to use the library from Java.
I totally agree with your criticism that we have not published the Java API. I will work on that the next time I modify this code. In the meantime please feel free to clone the library and run mvn install and you can generate the Java API docs yourself. They should be quite detailed as we spent a lot of effort writing detailed docs.
You may checkout vowpal wabbit JNI wrapper we've built in Indeed: https://github.com/indeedeng/vowpal-wabbit-java.
We wrote integration test that can work as usage examples and we wrote API documentation as well. Check "using the library" section of README.
Hope this will help.
I don't think this adds a lot, but none of the previous answers really provided a clear answer. Like #Macchiatow mentioned, to use the Java wrapper which comes with Vowpal Wabbit, you would:
(on the project root dir) make all java or make java
cd into java and verify the installation with mvn test
you'd then mvn install to have the Java API jarred up and placed in your local maven repository. Supposedly this builds the JNI parts on your machine, so as to fit the C/C++ libraries of your platform if you have the necessary native C/C++ libraries installed and available to the make command.
you'd supposedly be able to include the vowpal package/s from those jars in the build tool used in your own project (ant/maven/boot/leiningen/sbt/etc. as in here).
For more background maybe see the Vowpal Wabbit Java readme. I think what it tries to say there, is that if you want a ready made jar from maven central, you should make sure it's the same vowpal version you're using, but without knowing more I'd guess if you built it like above, you are by definition using the same version.
I've had the above process work off a fresh clone, with Ubuntu 16.04 and Java 8.
This link may be of some help with regards to setting up a JNI wrapper.
I wasn't able to find Java API documentation anywhere, but Java code seems well documented - did you maybe try generating Javadoc yourself from the code?
There is indeed Java JNI wrapper to have a basic access to VW. By basic I mean to teach your model and to predict probability later on. They also provide Python library that can do far more than wrapper for Java. Recently I was forced to expose few more VW methods to Java by extending code provided.
Back to the questions:
Rather use the vw-jni artifact available in central maven repo and clone their code and run make all java. I some cases compiling code yourself will be the only solution, as for example provided artifact won't run on OpenSuse (my case)
Code available pretty straight forward. VWLearners::create is a factory to get an instance of VW from Java.
I am looking for Fest APIs for Java swing application testing.
I can't seem to find any APIs posted online anywhere (their website seems to be down) and I've decided to check out the Git repository that you can download the source code from to do what you wish with.
But when I do this there are tons of errors and the Java doc refuses to get generated.
I was curious if anyone knew where I could either find a copy of the docs or if it is possible to generate the docs directly from Git?
As mentioned in fest-assert-2.x issue 167:
Fest Assert is not active anymore these days, you might have a look to AssertJ a fork of fest-assert-2.x.
... And yes, that fork AssertJ does have a JavaDoc API!
http://joel-costigliola.github.io/assertj/core-8/api/index.html
The latest release dates from 10 days ago: AssertJ Core 2.8.0 2017-05-21.
I'm working on a project where I'd like to use Apache Tika and Apache Jena. However, when I try to run the project I get the following exception:
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String; Ljava/lang/Object;Ljava/lang/Throwable;)V
My understanding is that this is because Apache Tika includes an old version of SLF4J (pre 1.6.0) and Apache Jena includes a newer version (1.6.0 or later), and that there is a breaking change between the two versions of SLF4J.
How do I get around this issue so that I can use both Tika and Jena at the same time?
Some existing posts talk about using Maven to work around this, but a) I don't use Maven and I'm not familiar enough with it to fully understand the solutions and b) I'm working on a development network that isn't connected to the internet.
slf4j is actually fairly compatible across versions for many usages. Jena does not use many features of SLF4j. It does not LocationAwareLogger as far as I'm aware. It may work with pre 1.6.X. While nothing is guaranteed (AKA you have to test it), it's worth a try.
If that fails, you'll need to rebuild one system and tweak what needs to be changed. Both systems are open source with both code and build system is available.
I wouldn't use these 2 libraries until they have the same version unless I'm absolutely have to do that.
If you think so, then a good explanation of the issue is here: java-classpath-classloading-multiple-versions-of-the-same-jar-project
The solution was to change the order of the libraries so that the library with the newer version of SLF4J (Apache Jena) was before the older version(s) on the build path.
I need to mirror some websites from my Java application. I was looking for an open source java library to do this job, but didn't find anything suitable.
Does anybody know about some java-friendly tool to retrieve entire websites, or must I stick to exec wget from my program?
Thanks a lot.
The biggest problem I found with this kind of libraries was the lack of support for css parsing, so the imported stylesheets, background images and so on get downloaded as well when mirroring the website.
wget has built in support for this (at least in recent versions), and although it's not a very clean solution to run this program from java, I'd first try it and see if it fits your needs.
I would recommend a crawler/spider. Aspider and Sperowider use Apache HttpClient lib (my favourite httplib) and crawls through the site following links. Since they are OSS you should be able to integrate it into your software. They are also currently unmaintained, but Apache HttpClient lib would be a good place to start if you want to write your own mirroring tool in java.
The network between our company and Sun's javadocs seems to be down. Where can I get a copy of the javadocs for a given package, so that I can keep my own stash to handle network outages in the future? Are there any mirrors for the Sun javadocs?
For each major release there is a large doc package, e.g. here for JDK 1.6.
(I hope the link is correct, picked it out of the docs I downloaded a while ago. Can't connect to SUN either from here.)
Down for me too (java.sun.com seems to be MIA at the moment).
Some form of the JDK docs are here: http://www.docjar.com/docs/api/java/
Most surefire bet: download the source and run Javadoc over it yourself, and stick it on an internal web server.
(FWIW - I can't reach their javadocs from my internal network right now either.)
I run classfinder on a MacMini locally. It's a small webserver dedicated to serving Javadoc and related source. You just take the zipped Javadoc and (optionally) the source package, and drop them in the appropriate directory. Classfinder works out the dependencies between all the docs and presents everything as a unified set of docs.
If you have multiple versions of packages (e.g. different servlet docs) you can dynamically select what you want to display. It all works beautifully and deserves much more fame than it currently gets.