Last active
December 10, 2015 10:09
-
-
Save mkristian/a46851705427f68ce310 to your computer and use it in GitHub Desktop.
phoenix setup for jruby. needs to install jars first before running the jdbc.rb script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lock_jars --tree | |
-- jar root dependencies -- | |
org.apache.phoenix:phoenix-server:4.6.0-HBase-1.1:compile | |
sqlline:sqlline:1.1.9:compile | |
-- jar dependency tree -- | |
no_group_id_given:jars:jar:0.0.0 | |
+- org.apache.phoenix:phoenix-server:jar:4.6.0-HBase-1.1:compile | |
| +- org.apache.phoenix:phoenix-server-client:jar:4.6.0-HBase-1.1:compile | |
| +- org.apache.calcite:calcite-avatica:jar:1.3.0-incubating:compile | |
| | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.1:compile | |
| | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.1:compile | |
| | \- com.fasterxml.jackson.core:jackson-databind:jar:2.1.1:compile | |
| +- org.apache.calcite:calcite-avatica-server:jar:1.3.0-incubating:compile | |
| | +- javax.servlet:javax.servlet-api:jar:3.0.1:compile | |
| | +- com.google.guava:guava:jar:14.0.1:compile | |
| | +- org.eclipse.jetty:jetty-server:jar:9.2.7.v20150116:compile | |
| | | +- org.eclipse.jetty:jetty-http:jar:9.2.7.v20150116:compile | |
| | | \- org.eclipse.jetty:jetty-io:jar:9.2.7.v20150116:compile | |
| | \- org.eclipse.jetty:jetty-util:jar:9.2.7.v20150116:compile | |
| +- org.apache.phoenix:phoenix-core:jar:4.6.0-HBase-1.1:compile | |
| | +- org.antlr:antlr:jar:3.5:compile | |
| | | \- org.antlr:ST4:jar:4.0.7:compile | |
| | +- org.antlr:antlr-runtime:jar:3.5:compile | |
| | | \- org.antlr:stringtemplate:jar:3.2.1:compile | |
| | | \- antlr:antlr:jar:2.7.7:compile | |
| | +- joda-time:joda-time:jar:2.7:compile | |
| | +- net.sourceforge.findbugs:annotations:jar:1.3.2:compile | |
| | +- org.codehaus.jackson:jackson-core-asl:jar:1.8.8:compile | |
| | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.8:compile | |
| | +- junit:junit:jar:4.12:compile | |
| | | \- org.hamcrest:hamcrest-core:jar:1.3:compile | |
| | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile | |
| | +- org.apache.httpcomponents:httpclient:jar:4.0.1:compile | |
| | | \- org.apache.httpcomponents:httpcore:jar:4.0.1:compile | |
| | +- log4j:log4j:jar:1.2.17:compile | |
| | +- org.slf4j:slf4j-api:jar:1.6.4:compile | |
| | +- org.iq80.snappy:snappy:jar:0.3:compile | |
| | +- org.apache.htrace:htrace-core:jar:3.1.0-incubating:compile | |
| | +- io.netty:netty-all:jar:4.0.23.Final:compile | |
| | +- commons-codec:commons-codec:jar:1.7:compile | |
| | +- commons-collections:commons-collections:jar:3.2.1:compile | |
| | +- org.apache.commons:commons-csv:jar:1.0:compile | |
| | +- com.google.code.findbugs:jsr305:jar:2.0.1:compile | |
| | +- org.apache.hbase:hbase-annotations:jar:1.1.0:compile | |
| | | +- jdk.tools:jdk.tools:jar:1.7:system | |
| | | \- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile | |
| | +- org.apache.hbase:hbase-common:jar:1.1.0:compile | |
| | | +- commons-lang:commons-lang:jar:2.6:compile | |
| | | +- commons-io:commons-io:jar:2.4:compile | |
| | | \- org.mortbay.jetty:jetty-util:jar:6.1.26:compile | |
| | +- org.apache.hbase:hbase-protocol:jar:1.1.0:compile | |
| | +- org.apache.hbase:hbase-client:jar:1.1.0:compile | |
| | | +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile | |
| | | +- org.jruby.jcodings:jcodings:jar:1.0.8:compile | |
| | | \- org.apache.hadoop:hadoop-auth:jar:2.5.1:compile | |
| | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile | |
| | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile | |
| | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile | |
| | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile | |
| | +- org.apache.hbase:hbase-server:jar:1.1.0:compile | |
| | | +- org.apache.hbase:hbase-procedure:jar:1.1.0:compile | |
| | | | \- org.apache.hbase:hbase-common:jar:tests:1.1.0:compile | |
| | | +- org.apache.hbase:hbase-prefix-tree:jar:1.1.0:runtime | |
| | | +- commons-httpclient:commons-httpclient:jar:3.1:compile | |
| | | +- org.apache.hbase:hbase-hadoop2-compat:jar:1.1.0:compile | |
| | | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile | |
| | | +- com.sun.jersey:jersey-core:jar:1.9:compile | |
| | | +- com.sun.jersey:jersey-server:jar:1.9:compile | |
| | | | \- asm:asm:jar:3.1:compile | |
| | | +- commons-cli:commons-cli:jar:1.2:compile | |
| | | +- org.apache.commons:commons-math:jar:2.2:compile | |
| | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile | |
| | | +- org.mortbay.jetty:jetty-sslengine:jar:6.1.26:compile | |
| | | +- org.mortbay.jetty:jsp-2.1:jar:6.1.14:compile | |
| | | +- org.mortbay.jetty:jsp-api-2.1:jar:6.1.14:compile | |
| | | +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.14:compile | |
| | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile | |
| | | +- tomcat:jasper-compiler:jar:5.5.23:compile | |
| | | +- tomcat:jasper-runtime:jar:5.5.23:compile | |
| | | +- org.jamon:jamon-runtime:jar:2.3.1:compile | |
| | | +- com.lmax:disruptor:jar:3.3.0:compile | |
| | | +- org.apache.hadoop:hadoop-client:jar:2.5.1:compile | |
| | | | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.5.1:compile | |
| | | | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.5.1:compile | |
| | | | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.5.1:compile | |
| | | | | | | \- com.sun.jersey:jersey-client:jar:1.9:compile | |
| | | | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.5.1:compile | |
| | | | | \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.5.1:compile | |
| | | | | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile | |
| | | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.5.1:compile | |
| | | | \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.5.1:compile | |
| | | \- org.apache.hadoop:hadoop-hdfs:jar:2.5.1:compile | |
| | | \- commons-daemon:commons-daemon:jar:1.0.13:compile | |
| | +- org.apache.hbase:hbase-hadoop-compat:jar:1.1.0:compile | |
| | +- org.apache.hadoop:hadoop-common:jar:2.5.1:compile | |
| | | +- org.apache.commons:commons-math3:jar:3.1.1:compile | |
| | | +- xmlenc:xmlenc:jar:0.52:compile | |
| | | +- commons-net:commons-net:jar:3.1:compile | |
| | | +- javax.servlet:servlet-api:jar:2.5:compile | |
| | | +- com.sun.jersey:jersey-json:jar:1.9:compile | |
| | | | +- org.codehaus.jettison:jettison:jar:1.1:compile | |
| | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile | |
| | | | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile | |
| | | +- javax.servlet.jsp:jsp-api:jar:2.1:runtime | |
| | | +- commons-el:commons-el:jar:1.0:compile | |
| | | +- net.java.dev.jets3t:jets3t:jar:0.9.0:compile | |
| | | | \- com.jamesmurty.utils:java-xmlbuilder:jar:0.4:compile | |
| | | +- commons-configuration:commons-configuration:jar:1.6:compile | |
| | | | +- commons-digester:commons-digester:jar:1.8:compile | |
| | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile | |
| | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile | |
| | | +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile | |
| | | +- org.apache.avro:avro:jar:1.7.4:compile | |
| | | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile | |
| | | +- com.jcraft:jsch:jar:0.1.42:compile | |
| | | \- org.apache.commons:commons-compress:jar:1.4.1:compile | |
| | | \- org.tukaani:xz:jar:1.0:compile | |
| | +- org.apache.hadoop:hadoop-annotations:jar:2.5.1:compile | |
| | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.5.1:compile | |
| | | +- org.apache.hadoop:hadoop-yarn-common:jar:2.5.1:compile | |
| | | | +- javax.xml.bind:jaxb-api:jar:2.2.2:compile | |
| | | | | +- javax.xml.stream:stax-api:jar:1.0-2:compile | |
| | | | | \- javax.activation:activation:jar:1.1:compile | |
| | | | +- com.google.inject:guice:jar:3.0:compile | |
| | | | | +- javax.inject:javax.inject:jar:1:compile | |
| | | | | \- aopalliance:aopalliance:jar:1.0:compile | |
| | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile | |
| | | +- com.google.inject.extensions:guice-servlet:jar:3.0:compile | |
| | | \- io.netty:netty:jar:3.6.2.Final:compile | |
| | \- org.jruby.joni:joni:jar:2.1.2:compile | |
| \- commons-logging:commons-logging:jar:1.2:compile | |
\- sqlline:sqlline:jar:1.1.9:compile | |
\- jline:jline:jar:2.10:compile | |
Jars.lock is up to date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jar 'org.apache.phoenix:phoenix-server:4.6.0-HBase-1.1' | |
jar 'sqlline:sqlline:1.1.9' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jars/setup' | |
java_import 'org.apache.phoenix.jdbc.PhoenixDriver' | |
java_import 'java.sql.Connection' | |
java_import 'java.sql.DriverManager' | |
java_import 'java.sql.ResultSet' | |
java_import 'java.sql.SQLException' | |
java_import 'java.sql.PreparedStatement' | |
java_import 'java.sql.Statement' | |
DriverManager.registerDriver(PhoenixDriver::INSTANCE) | |
Connection con = DriverManager.getConnection("jdbc:phoenix:localhost:2181") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby jdbc.rb | |
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). | |
log4j:WARN Please initialize the log4j system properly. | |
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment