Skip to content

Instantly share code, notes, and snippets.

View butlermh's full-sized avatar

Mark H. Butler butlermh

  • Santa Clara, United States
View GitHub Profile
{
"recording-list":{
"offset":0,
"count":243,
"recording":[ {
"score":"100",
"id":"1d86aa9d-21a2-4504-a668-61d488d3f251",
"title":"Bowie",
"length":162400,
"artist-credit":{
@butlermh
butlermh / es.txt1
Created June 12, 2011 16:27
ElasticSearch indices created from a MusicBrainz recording
_all
_source
_type
_uid
artist-credit.name-credit.artist.id
artist-credit.name-credit.artist.name
artist-credit.name-credit.artist.sort-name
id
length
puid-list.puid.id
@butlermh
butlermh / musicbrainz.rb
Created June 12, 2011 13:06
Ruby code to get JSON data from MusicBrainz and post it to a local NoSQL / Search database e.g. CouchDB, ElasticSearch
#!/usr/bin/ruby
#Retrieve data from MusicBrainz in JSON format and upload it to server
require 'rubygems'
require 'json'
require 'open-uri'
require 'active_support'
require 'net/http'
$KCODE = "UTF8"
@butlermh
butlermh / build.gradle
Created June 11, 2011 17:30
Building ElasticSearch in Eclipse 2
eclipseClasspath {
defaultOutputDir = file('build/eclipse-build')
}
@butlermh
butlermh / build.gradle
Created June 11, 2011 17:29
Building ElasticSearch in Eclipse 1
dependsOn(':test-testng')
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
@butlermh
butlermh / hadoopexample11
Created June 9, 2011 10:54
changing driver for the new Hadoop API 4
JobClient.runJob(job);
BECOMES
job.waitForCompletion(true);
@butlermh
butlermh / hadoopexample10
Created June 9, 2011 10:52
Changing Driver for the new Hadoop API 3
DistributedCache.addCacheArchive(new URI(path), job);
BECOMES
DistributedCache.addCacheArchive(new URI(path), job.getConfiguration());
job.set("some_property", property_value);
BECOMES
job.getConfiguration().set("some_property", property_value);
@butlermh
butlermh / hadoopexample9
Created June 9, 2011 10:50
Changing Driver for new Hadoop API 2
job.setInputFormat(SequenceFileInputFormat.class);
job.setOutputFormat(SequenceFileOutputFormat.class);
BECOMES
job.setInputFormatClass(SequenceFileInputFormat.class);
job.setOutputFormatClass(SequenceFileOutputFormat.class);
@butlermh
butlermh / hadoopexample8
Created June 9, 2011 10:48
Changing Driver for new Hadoop API 1
JobConf job = new JobConf(getConf());
BECOMES
Job job = new Job(getConf());
@butlermh
butlermh / hadoopexample7
Created June 9, 2011 10:42
Changing mapper for new Hadoop API 6
String application_value = job.get("app.value");
BECOMES
String application_value = config.get("app.value");
Path[] localArchives = DistributedCache.getLocalCacheArchives(job);
BECOMES
Path[] localArchives = DistributedCache.getLocalCacheArchives(config);
Class handlerClass = job.getClass(handlerName, SomeProcessor.class);
BECOMES