Skip to content

Instantly share code, notes, and snippets.

View arielvalentin's full-sized avatar

Ariel Valentin arielvalentin

View GitHub Profile
@arielvalentin
arielvalentin / accumulo-client-unknown-host
Last active August 29, 2015 14:09
Accumulo Client Retries to connect to TServers that have invalid hostnames
22:14:53,549 DEBUG [org.apache.zookeeper.ClientCnxn] (http-/192.168.220.198:8080-1-SendThread(ZKHOST:2181)) Reading reply sessionid:0x1498bc00431010f, packet:: clientPath:null serverPath:null finished:false header:: 414,3 replyHeader:: 414,107374188046,0 request:: '/accumulo/4663a372-d7f0-4956-a110-ff063c781ead/tservers/TSERVER_HOST:10011/zlock-0000000036,T response:: s{107374187891,107374187891,1415398174207,1415398174207,0,0,0,92758924158107923,33,0,107374187891}
22:14:53,922 DEBUG [org.apache.zookeeper.ClientCnxn] (http-/192.168.220.198:8080-1-SendThread(ZKHOST:2181)) Reading reply sessionid:0x1498bc00431010f, packet:: clientPath:null serverPath:null finished:false header:: 415,4 replyHeader:: 415,107374188046,0 request:: '/accumulo/4663a372-d7f0-4956-a110-ff063c781ead/tservers/TSERVER_HOST:10011/zlock-0000000036,T response:: #54534552565f434c49454e543d7330322d6265732d646e6f6436323a3130303131,s{107374187891,107374187891,1415398174207,1415398174207,0,0,0,92758924158107923,33,0,107374187891}
22:14:53
@arielvalentin
arielvalentin / exceptions.rb
Created August 5, 2014 03:20
Sample code Throwable vs RubyException
# The following block logs java.lang.Throwable correctly: http://www.slf4j.org/api/org/slf4j/Logger.html#error(java.lang.String,%20java.lang.Throwable)
begin
Java::ComGoogleCommonBase::Preconditions.check_argument(false, "I don't like you")
rescue => e
logger = Java::OrgSlf4j::LoggerFactory.get_logger('logger')
logger.error("This works", e)
end
# However RubyException is not a throwable and treats it as a java.lang.Object: http://www.slf4j.org/api/org/slf4j/Logger.html#error(java.lang.String,%20java.lang.Object...)
begin
raise "error"
@arielvalentin
arielvalentin / console.log
Created July 29, 2014 23:48
JRuby 1.7.4 AWS Euca SDK Open SSL Error
java.lang.RuntimeException: org.jruby.exceptions.RaiseException: (SSLError) jar:file:/var/lib/storm/supervisor/stormdist/test_rsync-4-1406677418/stormjar.jar!/gems/gems/aws-sdk-euca-1.8.5/ca-bundle.crt
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:107) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:78) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:77) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
at backtype.storm.daemon.executor$eval3918$fn__3919$fn__3931$fn__3978.invoke(executor.clj:745) ~[na:na]
at backtype.storm.util$async_loop$fn__384.invoke(util.clj:433) ~[na:na]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.4.0.jar:na]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_60]
org.jruby.exceptions.RaiseException: (SSLError) jar:file:/var/li
@arielvalentin
arielvalentin / httpd.conf
Last active September 12, 2015 08:31
Sample Apache mod_proxy_balancer config for torquebox
<VirtualHost *:443>
#mod_ssl options and Certs ...
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
@arielvalentin
arielvalentin / Gemfile
Last active January 3, 2016 23:19 — forked from mkristian/Gemfile
source 'https://rubygems.org'
# Specify your gem's dependencies in vtd-xml.gemspec
gemspec
# needed to build the gem but fails when it is part of the gems
gem "ruby-maven", '~> 3.1.1.0'
@arielvalentin
arielvalentin / gem_home_issue.sh
Last active January 2, 2016 18:58
JRuby Build Error
# well...
arielvalentin@kimura:~/dev/repos/jruby
git:(1.7.5-424-gc4ecd6b)
→ GEM_HOME=./lib/ruby/gems/shared/ bin/jruby -S bin/rake test:mri19 --trace
...
5012 tests, 874184 assertions, 0 failures, 0 errors, 9 skips
** Execute test:mri19
@arielvalentin
arielvalentin / manually_add_to_classpath.log
Last active January 2, 2016 04:39
Starting MiniAccumuloCluster via JRuby
→ jruby manually_add_to_classpath.rb
/var/folders/4m/jqf69nlx38s5hyqp10y9_bvc0000gp/T/d20140107-525-wdgmbz
grabbed zookeeper
crated table
wrote record
created a scanner
anger
wtf
@arielvalentin
arielvalentin / jruby_timeout.rb
Last active December 23, 2015 09:29 — forked from jorgenpt/jruby_timeout.rb
Don't use this
# Workaround for IO.popen.readlines being allowed to block indefinitely even if
# wrapped in a Timeout::timeout call.
#
# Test case:
# $ time jruby -rtimeout -e "timeout(1) { IO.popen('sleep 10').readlines }"
# * Propagating errors executed in the block
# * Thread.raise experiences a TypeError because it cannot convert a java Exception into a ruby Error so I've added handling any errors raised from the java code to be propagated correctly
# * Renamed some variables so that they matched
require 'timeout'
@arielvalentin
arielvalentin / config.ru
Last active December 21, 2015 18:48
Enable profiling for jruby apps deployed to torquebox
require 'rubygems'
require 'rack'
require 'jruby/profiler'
app = lambda {|env|
profile_data = JRuby::Profiler::profile do
output = (0..50).map do |i|
50 * i
end
puts output
@arielvalentin
arielvalentin / hornetq-jms.xml
Created August 20, 2013 03:10
Torquebox Messaging JMS Exception "There is no queue with name"
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<!-- Connection factory stuff -->
<queue name="DissemQueue">
<entry name="/queues/DissemQueue"/>
</queue>
</configuration>