scala spark - No TypeTag available
Received the error No TypeTag available when trying to package a spark sql app. Turns out, it was caused by having a case class defined inside a method. Moving it outside of the method fixes the compilation;
scala.runtime.VolatileObjectRef.zero() when submitting job to spark
➜ SparkyOne ~/Tools/spark-1.4.1/bin/spark-submit --class Crocodil target/scala-2.11/sparkyone_2.11-1.0.jar Exception in thread "main" java.lang.NoSuchMethodError: scala.runtime.VolatileObjectRef.zero()Lscala/runtime/VolatileObjectRef; at Crocodil$.main(Crocodil.scala) at Crocodil.main(Crocodil.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:665)
I received the above error when doing a submit. Turns out, my spark 1.4.1 was using scala 2.10.4, while my scala compiler was 2.11.8. Changing to this in my build.sbt:
followed by a repackage, and a resubmit to spark, fixed the issue.
view logs for a hadoop jar execution
Assuming you started a jar with
, you might see
something similar to this, when the job starts:1
hadoop jar your_jar some_args
16/04/24 07:33:01 INFO mapreduce.Job: The url to track the job: http://quickstart.cloudera:8088/proxy/application_1461491409387_0019/
Once the job finishes, a way to view your logs is by issuing this command:
I found this helpful for viewing log statements that I added in the jar.
splitting a big file into multiple smaller ones
Used the following to split the cloudera zip into smaller ones:
vagrant private network and /etc/udev/rules.d/70-persistent-net.rules
Encountered the following error when trying to setup private networking in vagrant:
Additionally, the call to private_network had to be changed to this:
The issue is discussed here, and this post helped me fix the issue. Basically, you have to check the contents of the file: /etc/udev/rules.d/70-persistent-net.rules. The safest bet seems to be to delete that file, so that vagrant can assign device names without MAC address issues. Thanks a lot, ablecoder!
decompressing gzip http response with node-red
Add zlib in settings.js, if you don’t already have it:
Then create a new function node with the following code:
This won’t yield the best performance, but it works in my case. Most likely, if could be done better by using the callback version of gunzip, and then using send to pass the msg to the next node.
Parse data from another agent using WebsiteAgent in huginn
For one use case, I had to use a PostAgent, which returned html, and I wanted to parse it’s created events with a WebsiteAgent. Here’s the code that made it happen:
PostAgent:
The events created by the previous agent will be in the following format:
And here’s the WebsiteAgent that parses the events created ( make sure to set the previous agent as source ):
activate ssh-agent automatically when opening bash, in windows
Taken from here.
I added the following in my .bashrc ( on the windows system ). You’re likely to find it
in the following location 1
C:\Users\YourUserName\.bashrc