Short posting. I've created a repo so that I can clone it everytime I want to create new project. See here:
https://github.com/bpdp/vim-java
https://github.com/bpdp/vim-java
$ ls total 74744 drwxr-xr-x 2 bpdp bpdp 4096 Jul 11 06:57 . drwxr-xr-x 25 bpdp bpdp 4096 Jul 18 10:37 .. -rw-r--r-- 1 bpdp bpdp 76521205 May 14 22:48 titan-all-0.3.1.zip -rw-r--r-- 1 bpdp bpdp 64 Jun 24 12:43 url $ cat url http://s3.thinkaurelius.com/downloads/titan/titan-all-0.3.1.zip $
... ... $CASSANDRA_HOME=$HOME/software/apache-cassandra-1.2.6 export PATH=$PATH:$CASSANDRA_HOME/bin ... ...
cluster_name: 'KintamaniCluster' data_file_directories: - /home/bpdp/db/cassandra/data # commit log commitlog_directory: /home/bpdp/db/cassandra/commitlog saved_caches_directory: /home/bpdp/db/cassandra/saved_caches
$ cassandra -f
... ... INFO 05:07:53,670 Node localhost/127.0.0.1 state jump to normal INFO 05:07:53,686 Startup completed! Now serving reads. INFO 05:07:53,948 Starting listening for CQL clients on localhost/127.0.0.1:9042... INFO 05:07:54,010 Binding thrift service to localhost/127.0.0.1:9160 INFO 05:07:54,083 Using TFramedTransport with a max frame size of 15728640 bytes. INFO 05:07:54,090 Using synchronous/threadpool thrift server on localhost : 9160 INFO 05:07:54,090 Listening for thrift clients... INFO 05:12:51,681 Compacting [SSTableReader(path='/home/bpdp/db/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-ic-15-Data.db'), SSTableReader(path='/home/bpdp/db/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-ic-13-Data.db'), SSTableReader(path='/home/bpdp/db/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-ic-16-Data.db'), SSTableReader(path='/home/bpdp/db/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-ic-14-Data.db')] INFO 05:12:52,233 Compacted 4 sstables to [/home/bpdp/db/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-ic-17,]. 20,712 bytes to 6,933 (~33% of original) in 550ms = 0.012021MB/s. 10 total rows, 4 unique. Row merge counts were {1:2, 2:0, 3:0, 4:2, }
... ... $TITAN_HOME=$HOME/software/titan export PATH=$PATH:$TITAN_HOME/bin ... ...
$ gremlin.sh \,,,/ (o o) -----oOOo-(_)-oOOo----- gremlin> conf = new BaseConfiguration(); ==>org.apache.commons.configuration.BaseConfiguration@13015e8 gremlin> conf.setProperty("storage.backend","cassandra"); ==>null gremlin> conf.setProperty("storage.hostname","127.0.0.1"); ==>null gremlin> g = TitanFactory.open(conf); 13/07/20 06:29:02 INFO impl.ConnectionPoolMBeanManager: Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,name=ClusterTitanConnectionPool,ServiceType=connectionpool 13/07/20 06:29:02 INFO impl.CountingConnectionPoolMonitor: AddHost: 127.0.0.1 13/07/20 06:29:02 INFO impl.ConnectionPoolMBeanManager: Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,name=KeyspaceTitanConnectionPool,ServiceType=connectionpool 13/07/20 06:29:02 INFO impl.CountingConnectionPoolMonitor: AddHost: 127.0.0.1 ==>titangraph[cassandra:127.0.0.1] gremlin> bambang = g.addVertex(null); ==>v[360004] gremlin> domain = g.addVertex(null); ==>v[360008] gremlin> bambang.setProperty("name", "Bambang Purnomosidi"); ==>null gremlin> domain.setProperty("name", "Pragmatic Web"); ==>null gremlin> e = g.addEdge(null, bambang, domain, "researching"); ==>e[7ygD-1vEw-2F0LaTPQTs][360004-researching->360008] gremlin> print e.getVertex(Direction.OUT).getProperty("name") + "---" + e.getLabel() + "-->" + e.getVertex(Direction.IN).getProperty("name"); Bambang Purnomosidi---researching-->Pragmatic Web==>null gremlin>
$ cassandra -f $ gremlin.sh
Posted in Big data, Blueprints, Cassandra, Gremlin, Tinkerpop, Titan
$ gradle --version
------------------------------------------------------------
Gradle 1.6
------------------------------------------------------------
Gradle build time: Tuesday, May 7, 2013 9:12:14 AM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_25 (Oracle Corporation 23.25-b01)
OS: Linux 3.9.9-1-ARCH i386
$
package name.bpdp.grizzly;
apply plugin: 'java'
version = "0.0.1"
group = "name.bpdp.grizzly"
dependencies {
compile group: 'org.glassfish.grizzly', name: 'grizzly-framework', version: '2.3.3'
compile group: 'org.glassfish.grizzly', name: 'grizzly-http-server', version: '2.3.3'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile group: 'org.glassfish.grizzly', name: 'grizzly-framework', version: '2.3.3'
testCompile group: 'org.glassfish.grizzly', name: 'grizzly-http-server', version: '2.3.3'
}
repositories {
mavenCentral()
}
task(runApp, dependsOn: 'classes', type: JavaExec) {
main = 'name.bpdp.grizzly.BlockingHttpHandlerSample'
classpath = sourceSets.main.runtimeClasspath
}
test {
maxParallelForks = 5
maxHeapSize = '1024m'
}
$ gradle build
:compileJava
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-framework/2.3.3/grizzly-framework-2.3.3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-project/2.3.3/grizzly-project-2.3.3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-bom/2.3.3/grizzly-bom-2.3.3.pom
Download http://repo1.maven.org/maven2/net/java/jvnet-parent/3/jvnet-parent-3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http-server/2.3.3/grizzly-http-server-2.3.3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http/2.3.3/grizzly-http-2.3.3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-rcm/2.3.3/grizzly-rcm-2.3.3.pom
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-framework/2.3.3/grizzly-framework-2.3.3.jar
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http-server/2.3.3/grizzly-http-server-2.3.3.jar
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http/2.3.3/grizzly-http-2.3.3.jar
Download http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-rcm/2.3.3/grizzly-rcm-2.3.3.jar
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
Download http://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.pom
Download http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
Download http://repo1.maven.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
Download http://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.jar
Download http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
:check
:build
BlUILD SUCCESSFUL
Total time: 48.44 secs
$
$ gradle runApp
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:runApp
Jul 15, 2013 8:39:56 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:8080]
Jul 15, 2013 8:39:56 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Client connected!
Writing request:
HttpRequestPacket (
method=POST
url=/echo
query=null
protocol=HTTP/1.1
content-length=-1
headers=[
Host=localhost:8080]
)
contentA-
contentB-
contentC-
contentD
Echoed POST Data: contentA-contentB-contentC-contentD
Jul 15, 2013 8:39:56 PM org.glassfish.grizzly.http.server.NetworkListener stop
INFO: Stopped listener bound to [0.0.0.0:8080]
BUILD SUCCESSFUL
Total time: 7.916 secs
$
Using Vim for Java + Gradle