Created
March 18, 2009 19:13
-
-
Save aviflombaum/81326 to your computer and use it in GitHub Desktop.
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
# What Does Harvest Do? | |
# Connects to a DataSource | |
# Downloads a Set of Data | |
# Normalizes Format | |
# Stores it in Sharded Harvest DB -> Silos | |
# Possibly removes data? | |
# What Does Processor Do? | |
# Connects to a Silo | |
# According to a Process, Denormalizes the Data | |
# Connects to a Field | |
# Plants the Data in (Writes the to the DB) | |
# What Does Farm Do? | |
# Allows for easy reporting of huge sets of data (Silos) by pre-Processing or Processing | |
# shards on-demand. | |
class Harvest | |
def initialize(params = {}) | |
end | |
def connect(field) | |
end | |
def reap(params = {}) | |
end | |
def thresh(params = {}) | |
end | |
def store(silo) | |
end | |
end | |
class Field | |
def initialize(params = {}) | |
end | |
end | |
class GoogleAnalytics < Field | |
end | |
# Field::GoogleAnayltics | |
class Silo | |
def initialize(params = {}) | |
end | |
end | |
class Field::GoogleAnayltics | |
end | |
analytics_harvest_params = {} | |
analytics_params = {} | |
analytics_data_params = {} | |
analytics_threshing_params = {} | |
analytics_silo_params = {} | |
analytics_harvest = Harvest.new(analytics_harvest_params) | |
analytics_harvest.connect(Field::GoogleAnalytics.new(analytics_params)) | |
analytics_harvest.reap(analytics_data_params) | |
analytics_harvest.thresh(analytics_threshing_params) | |
# analytics_harvest.store(Silo::Database.new(analytics_silo_params)) # Silo::S3.new(analytics_silo_params) # Silo:CouchDB | |
user_activity_harvest.store() # Silo.new(:name => "dp_user_activity_3_18_09") | |
# class Harvest | |
# attr_accessor :connected | |
# | |
# def initialize(params = {}) | |
# connect | |
# end | |
# | |
# def connected? | |
# return true if connected | |
# end | |
# end | |
# | |
# class Harvest::GoogleAnalytics < Harvest | |
# def connect | |
# @conected = true | |
# end | |
# end | |
# | |
# class Harvest::Emails < Harvest | |
# def connect | |
# @conected = false | |
# end | |
# end | |
# | |
# class Harvest::Databases < Harvest | |
# def connect | |
# @conected = true | |
# end | |
# end | |
# | |
# google_params = {} | |
# db_params = {} | |
# email_params = {} | |
# | |
# google_analytics = Harvest::GoogleAnalytics.new(google_params) | |
# db = Harvest::Databases.new(db_params) | |
# emails = Harvest::Emails.new(email_params) | |
# | |
# puts "#{google_analytics}" | |
# puts " #{google_analytics.connected?.to_s}" | |
# puts "#{db}" | |
# puts " #{db.connected?}" | |
# puts "#{emails}" | |
# puts " #{emails.connected?}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment