Skip to content

Instantly share code, notes, and snippets.

@benlee
benlee / gist:4631407
Created January 25, 2013 03:08
ThriftSequenceFileOutputFormat
import com.foursquare.base2.MessageLogging
import com.foursquare.hfile.common.HFileUtil.BoundedTBase
import org.apache.hadoop.hbase.io.hfile.{Compression, HFile}
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.io.{BytesWritable, NullWritable}
import org.apache.hadoop.mapreduce.{RecordWriter, TaskAttemptContext}
import org.apache.hadoop.mapreduce.lib.output.{FileOutputFormat, SequenceFileOutputFormat}
class ThriftSequenceFileOutputFormat[T <: BoundedTBase] extends FileOutputFormat[NullWritable, T] {
private[io] val sequenceOutput = new SequenceFileOutputFormat[NullWritable, BytesWritable]()
@benlee
benlee / gist:4192475
Created December 3, 2012 03:26
spotted pig weirdness
393dd78f964a520782b1fe3
{
oid: 4cb71a6786e09eb08caf62e2 name: University Center Building
s: 0.1828
t: 0.0000
oid: 4d408a3234f42d43f5874385 name: Harlem Heritage and Cultural Center
s: 0.1973
t: 0.0000
oid: 4d24597dbda959411386c07d name: Sony Ericsson Tennis Hotspot
s: 0.2124
import com.foursquare.venue.rec._
import com.foursquare.geo.Radius
val bounds = Radius((40.7,-74),10000)
RecommendationSearch.exploreNearbyPopularRankableVenues(services, None, com.foursquare.venue.TopLevelCategory.All, Nil, bounds, 250)