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
define macro with-sqlite-db | |
{ with-sqlite-db (?db-location:expression) ?:body end } | |
=> { | |
let (result, sqlite3-db) = sqlite3-open(?db-location); | |
?body; | |
sqlite3-close(sqlite3-db); | |
} | |
end macro with-sqlite-db; |
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
package com.simplymeasured.doormouse.mapreduce.utils; | |
import org.apache.hadoop.hbase.KeyValue; | |
/** | |
* Stupid-simple builder pattern applied to the HBase KeyValue class. | |
* | |
* Makes it easier to manipulate KeyValues in map/reduce jobs | |
* | |
* @author [email protected] |
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
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.client.HBaseAdmin | |
import org.apache.hadoop.hbase.client.HTable | |
import org.apache.hadoop.hbase.util.Bytes | |
conf = HBaseConfiguration.create() | |
admin = HBaseAdmin.new(conf) | |
tables = admin.listTables() |
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
; nREPL 0.1.6 | |
user> (use 'midje.repl) | |
CompilerException java.lang.NoClassDefFoundError: org/apache/http/client/AuthCache, compiling:(cemerick/pomegranate/aether.clj:40:54) | |
user> (pst) | |
CompilerException java.lang.RuntimeException: Unable to resolve symbol: pst in this context, compiling:(NO_SOURCE_PATH:1:1) | |
user> |
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
; nREPL 0.1.6 | |
user> (use 'midje.repl) | |
CompilerException java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SchemeSocketFactory, compiling:(cemerick/pomegranate/aether.clj:40:54) | |
user> |
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
@Override | |
public void persist(Map<String, Object> data) throws Exception { | |
Map<String, List<Row>> databaseOperations = generateDatabaseOperations(data); | |
for(String table: databaseOperations.keySet()) { | |
List<Row> batch = databaseOperations.get(table); | |
PutHelper.writeToTable(connectionPool, table, batch); | |
} | |
} |
NewerOlder