skynet 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +49 -0
- data/Manifest.txt +84 -6
- data/README.txt +75 -64
- data/app_generators/skynet_install/skynet_install_generator.rb +14 -8
- data/app_generators/skynet_install/templates/migration.rb +1 -24
- data/app_generators/skynet_install/templates/skynet_config.rb +50 -0
- data/app_generators/skynet_install/templates/skynet_initializer.rb +1 -0
- data/app_generators/skynet_install/templates/{skynet_schema.sql → skynet_mysql_schema.sql} +1 -24
- data/bin/skynet +37 -10
- data/bin/skynet_install +5 -5
- data/bin/skynet_tuplespace_server +27 -19
- data/examples/dgrep/README +70 -0
- data/examples/dgrep/config/skynet_config.rb +26 -0
- data/examples/dgrep/data/shakespeare/README +2 -0
- data/examples/dgrep/data/shakespeare/poetry/loverscomplaint +381 -0
- data/examples/dgrep/data/shakespeare/poetry/rapeoflucrece +2199 -0
- data/examples/dgrep/data/shakespeare/poetry/sonnets +2633 -0
- data/examples/dgrep/data/shakespeare/poetry/various +640 -0
- data/examples/dgrep/data/shakespeare/poetry/venusandadonis +1423 -0
- data/examples/dgrep/data/testfile1.txt +1 -0
- data/examples/dgrep/data/testfile2.txt +1 -0
- data/examples/dgrep/data/testfile3.txt +1 -0
- data/examples/dgrep/data/testfile4.txt +1 -0
- data/examples/dgrep/lib/dgrep.rb +59 -0
- data/examples/dgrep/lib/mapreduce_test.rb +32 -0
- data/examples/dgrep/lib/most_common_words.rb +45 -0
- data/examples/dgrep/script/dgrep +75 -0
- data/examples/rails_mysql_example/README +66 -0
- data/examples/rails_mysql_example/Rakefile +10 -0
- data/examples/rails_mysql_example/app/controllers/application.rb +10 -0
- data/examples/rails_mysql_example/app/helpers/application_helper.rb +3 -0
- data/examples/rails_mysql_example/app/models/user.rb +21 -0
- data/examples/rails_mysql_example/app/models/user_favorite.rb +5 -0
- data/examples/rails_mysql_example/app/models/user_mailer.rb +12 -0
- data/examples/rails_mysql_example/app/views/user_mailer/welcome.erb +5 -0
- data/examples/rails_mysql_example/config/boot.rb +109 -0
- data/examples/rails_mysql_example/config/database.yml +42 -0
- data/examples/rails_mysql_example/config/environment.rb +59 -0
- data/examples/rails_mysql_example/config/environments/development.rb +18 -0
- data/examples/rails_mysql_example/config/environments/production.rb +19 -0
- data/examples/rails_mysql_example/config/environments/test.rb +22 -0
- data/examples/rails_mysql_example/config/initializers/inflections.rb +10 -0
- data/examples/rails_mysql_example/config/initializers/mime_types.rb +5 -0
- data/examples/rails_mysql_example/config/initializers/skynet.rb +1 -0
- data/examples/rails_mysql_example/config/routes.rb +35 -0
- data/examples/rails_mysql_example/config/skynet_config.rb +36 -0
- data/examples/rails_mysql_example/db/migrate/001_create_skynet_tables.rb +43 -0
- data/examples/rails_mysql_example/db/migrate/002_create_users.rb +16 -0
- data/examples/rails_mysql_example/db/migrate/003_create_user_favorites.rb +14 -0
- data/examples/rails_mysql_example/db/schema.rb +85 -0
- data/examples/rails_mysql_example/db/skynet_mysql_schema.sql +33 -0
- data/examples/rails_mysql_example/doc/README_FOR_APP +2 -0
- data/examples/rails_mysql_example/lib/tasks/rails_mysql_example.rake +20 -0
- data/examples/rails_mysql_example/public/.htaccess +40 -0
- data/examples/rails_mysql_example/public/404.html +30 -0
- data/examples/rails_mysql_example/public/422.html +30 -0
- data/examples/rails_mysql_example/public/500.html +30 -0
- data/examples/rails_mysql_example/public/dispatch.cgi +10 -0
- data/examples/rails_mysql_example/public/dispatch.fcgi +24 -0
- data/examples/rails_mysql_example/public/dispatch.rb +10 -0
- data/{log/debug.log → examples/rails_mysql_example/public/favicon.ico} +0 -0
- data/examples/rails_mysql_example/public/images/rails.png +0 -0
- data/examples/rails_mysql_example/public/index.html +277 -0
- data/examples/rails_mysql_example/public/javascripts/application.js +2 -0
- data/examples/rails_mysql_example/public/javascripts/controls.js +963 -0
- data/examples/rails_mysql_example/public/javascripts/dragdrop.js +972 -0
- data/examples/rails_mysql_example/public/javascripts/effects.js +1120 -0
- data/examples/rails_mysql_example/public/javascripts/prototype.js +4225 -0
- data/examples/rails_mysql_example/public/robots.txt +5 -0
- data/examples/rails_mysql_example/script/about +3 -0
- data/examples/rails_mysql_example/script/console +3 -0
- data/examples/rails_mysql_example/script/destroy +3 -0
- data/examples/rails_mysql_example/script/generate +3 -0
- data/examples/rails_mysql_example/script/performance/benchmarker +3 -0
- data/examples/rails_mysql_example/script/performance/profiler +3 -0
- data/examples/rails_mysql_example/script/performance/request +3 -0
- data/examples/rails_mysql_example/script/plugin +3 -0
- data/examples/rails_mysql_example/script/process/inspector +3 -0
- data/examples/rails_mysql_example/script/process/reaper +3 -0
- data/examples/rails_mysql_example/script/process/spawner +3 -0
- data/examples/rails_mysql_example/script/runner +3 -0
- data/examples/rails_mysql_example/script/server +3 -0
- data/examples/rails_mysql_example/test/fixtures/user_favorites.yml +9 -0
- data/examples/rails_mysql_example/test/fixtures/users.yml +11 -0
- data/examples/rails_mysql_example/test/test_helper.rb +38 -0
- data/examples/rails_mysql_example/test/unit/user_favorite_test.rb +8 -0
- data/examples/rails_mysql_example/test/unit/user_test.rb +8 -0
- data/extras/README +7 -0
- data/extras/init.d/skynet +87 -0
- data/extras/nagios/check_skynet.sh +121 -0
- data/extras/rails/controllers/skynet_controller.rb +43 -0
- data/extras/rails/views/skynet/index.rhtml +137 -0
- data/lib/skynet.rb +59 -1
- data/lib/skynet/mapreduce_helper.rb +2 -2
- data/lib/skynet/mapreduce_test.rb +32 -1
- data/lib/skynet/message_queue_adapters/mysql.rb +422 -539
- data/lib/skynet/message_queue_adapters/tuple_space.rb +45 -71
- data/lib/skynet/skynet_active_record_extensions.rb +22 -11
- data/lib/skynet/skynet_config.rb +54 -20
- data/lib/skynet/skynet_console.rb +4 -1
- data/lib/skynet/skynet_console_helper.rb +5 -1
- data/lib/skynet/skynet_debugger.rb +58 -4
- data/lib/skynet/skynet_job.rb +61 -24
- data/lib/skynet/skynet_launcher.rb +29 -3
- data/lib/skynet/skynet_logger.rb +11 -1
- data/lib/skynet/skynet_manager.rb +403 -240
- data/lib/skynet/skynet_message.rb +1 -3
- data/lib/skynet/skynet_message_queue.rb +42 -19
- data/lib/skynet/skynet_partitioners.rb +19 -15
- data/lib/skynet/skynet_ruby_extensions.rb +18 -0
- data/lib/skynet/skynet_tuplespace_server.rb +17 -14
- data/lib/skynet/skynet_worker.rb +132 -98
- data/lib/skynet/version.rb +1 -1
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/txt2html +0 -0
- data/test/test_helper.rb +2 -0
- data/test/test_skynet.rb +13 -5
- data/test/test_skynet_manager.rb +24 -9
- data/test/test_skynet_task.rb +1 -1
- data/website/index.html +77 -29
- data/website/index.txt +53 -24
- data/website/stylesheets/screen.css +12 -12
- metadata +156 -66
- data/app_generators/skynet_install/templates/skynet +0 -46
- data/log/skynet.log +0 -29
- data/log/skynet_tuplespace_server.log +0 -7
- data/log/skynet_worker.pid +0 -1
@@ -0,0 +1,42 @@
|
|
1
|
+
# MySQL. Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Install the MySQL driver:
|
4
|
+
# gem install mysql
|
5
|
+
# On Mac OS X:
|
6
|
+
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
|
7
|
+
# On Mac OS X Leopard:
|
8
|
+
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
9
|
+
# This sets the ARCHFLAGS environment variable to your native architecture
|
10
|
+
# On Windows:
|
11
|
+
# gem install mysql
|
12
|
+
# Choose the win32 build.
|
13
|
+
# Install MySQL and put its /bin directory on your path.
|
14
|
+
#
|
15
|
+
# And be sure to use new-style password hashing:
|
16
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
17
|
+
development:
|
18
|
+
adapter: mysql
|
19
|
+
encoding: utf8
|
20
|
+
database: rails_mysql_example_development
|
21
|
+
username: root
|
22
|
+
password:
|
23
|
+
socket: /opt/local/var/run/mysql5/mysqld.sock
|
24
|
+
|
25
|
+
# Warning: The database defined as 'test' will be erased and
|
26
|
+
# re-generated from your development database when you run 'rake'.
|
27
|
+
# Do not set this db to the same as development or production.
|
28
|
+
test:
|
29
|
+
adapter: mysql
|
30
|
+
encoding: utf8
|
31
|
+
database: rails_mysql_example_test
|
32
|
+
username: root
|
33
|
+
password:
|
34
|
+
socket: /opt/local/var/run/mysql5/mysqld.sock
|
35
|
+
|
36
|
+
production:
|
37
|
+
adapter: mysql
|
38
|
+
encoding: utf8
|
39
|
+
database: rails_mysql_example_production
|
40
|
+
username: root
|
41
|
+
password:
|
42
|
+
socket: /opt/local/var/run/mysql5/mysqld.sock
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file
|
2
|
+
|
3
|
+
# Uncomment below to force Rails into production mode when
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
6
|
+
|
7
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
8
|
+
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
|
9
|
+
|
10
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
11
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
12
|
+
|
13
|
+
Rails::Initializer.run do |config|
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
# See Rails::Configuration for more options.
|
18
|
+
|
19
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails).
|
20
|
+
# To use Rails without a database, you must remove the Active Record framework
|
21
|
+
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
22
|
+
|
23
|
+
# Only load the plugins named here, in the order given. By default, all plugins
|
24
|
+
# in vendor/plugins are loaded in alphabetical order.
|
25
|
+
# :all can be used as a placeholder for all plugins not explicitly named
|
26
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
27
|
+
|
28
|
+
# Add additional load paths for your own custom dirs
|
29
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
30
|
+
|
31
|
+
# Force all environments to use the same logger level
|
32
|
+
# (by default production uses :info, the others :debug)
|
33
|
+
# config.log_level = :debug
|
34
|
+
|
35
|
+
# Your secret key for verifying cookie session data integrity.
|
36
|
+
# If you change this key, all old sessions will become invalid!
|
37
|
+
# Make sure the secret is at least 30 characters and all random,
|
38
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
39
|
+
config.action_controller.session = {
|
40
|
+
:session_key => '_rails_mysql_example_session',
|
41
|
+
:secret => 'd4db9c4042902a6ffea104d1400f85a72ecac047ed1ec7e509b3670f1d77dd00318e9cc6a03d010e70b11e32c6195714e34ec1324d5856fda6b92a02104eca93'
|
42
|
+
}
|
43
|
+
|
44
|
+
# Use the database for sessions instead of the cookie-based default,
|
45
|
+
# which shouldn't be used to store highly confidential information
|
46
|
+
# (create the session table with 'rake db:sessions:create')
|
47
|
+
# config.action_controller.session_store = :active_record_store
|
48
|
+
|
49
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
50
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
51
|
+
# like if you have constraints or database-specific column types
|
52
|
+
# config.active_record.schema_format = :sql
|
53
|
+
|
54
|
+
# Activate observers that should always be running
|
55
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
56
|
+
|
57
|
+
# Make Active Record use UTC-base instead of local time
|
58
|
+
# config.active_record.default_timezone = :utc
|
59
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
13
|
+
config.action_view.debug_rjs = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
config.action_view.cache_template_extensions = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Use a different logger for distributed setups
|
8
|
+
# config.logger = SyslogLogger.new
|
9
|
+
|
10
|
+
# Full error reports are disabled and caching is turned on
|
11
|
+
config.action_controller.consider_all_requests_local = false
|
12
|
+
config.action_controller.perform_caching = true
|
13
|
+
config.action_view.cache_template_loading = true
|
14
|
+
|
15
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
16
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
17
|
+
|
18
|
+
# Disable delivery errors, bad email addresses will be ignored
|
19
|
+
# config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Disable request forgery protection in test environment
|
17
|
+
config.action_controller.allow_forgery_protection = false
|
18
|
+
|
19
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
20
|
+
# The :test delivery method accumulates sent emails in the
|
21
|
+
# ActionMailer::Base.deliveries array.
|
22
|
+
config.action_mailer.delivery_method = :test
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1 @@
|
|
1
|
+
require RAILS_ROOT+'/config/skynet_config.rb'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
|
4
|
+
# Sample of regular route:
|
5
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
6
|
+
# Keep in mind you can assign values other than :controller and :action
|
7
|
+
|
8
|
+
# Sample of named route:
|
9
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
10
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
11
|
+
|
12
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
13
|
+
# map.resources :products
|
14
|
+
|
15
|
+
# Sample resource route with options:
|
16
|
+
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
17
|
+
|
18
|
+
# Sample resource route with sub-resources:
|
19
|
+
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
20
|
+
|
21
|
+
# Sample resource route within a namespace:
|
22
|
+
# map.namespace :admin do |admin|
|
23
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
24
|
+
# admin.resources :products
|
25
|
+
# end
|
26
|
+
|
27
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
28
|
+
# map.root :controller => "welcome"
|
29
|
+
|
30
|
+
# See how all your routes lay out with "rake routes"
|
31
|
+
|
32
|
+
# Install the default routes as the lowest priority.
|
33
|
+
map.connect ':controller/:action/:id'
|
34
|
+
map.connect ':controller/:action/:id.:format'
|
35
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Skynet Configuration File. Should be in APP_ROOT/config/skynet_config.rb
|
2
|
+
# Start skynet from within your app root with
|
3
|
+
# > skynet start
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'skynet'
|
7
|
+
|
8
|
+
# Load your rails app
|
9
|
+
if not defined?(RAILS_GEM_VERSION)
|
10
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../config/environment'
|
11
|
+
end
|
12
|
+
|
13
|
+
Skynet::CONFIG[:SKYNET_LOG_LEVEL] = Logger::ERROR
|
14
|
+
Skynet::CONFIG[:APP_ROOT] = RAILS_ROOT
|
15
|
+
Skynet::CONFIG[:SKYNET_LOG_DIR] = File.expand_path(Skynet::CONFIG[:APP_ROOT]+ "/log")
|
16
|
+
Skynet::CONFIG[:SKYNET_PID_DIR] = File.expand_path(Skynet::CONFIG[:APP_ROOT] + "/log")
|
17
|
+
Skynet::CONFIG[:SKYNET_LOG_FILE] = "skynet_#{RAILS_ENV}.log"
|
18
|
+
Skynet::CONFIG[:SKYNET_PID_FILE] = "skynet_#{RAILS_ENV}.pid"
|
19
|
+
|
20
|
+
|
21
|
+
# Use the mysql message queue adapter
|
22
|
+
Skynet::CONFIG[:MESSAGE_QUEUE_ADAPTER] = "Skynet::MessageQueueAdapter::Mysql"
|
23
|
+
|
24
|
+
# ==================================================================
|
25
|
+
# = Require any other libraries you want skynet to know about here =
|
26
|
+
# ==================================================================
|
27
|
+
|
28
|
+
|
29
|
+
# ===========================================
|
30
|
+
# = Set your own configuration options here =
|
31
|
+
# ===========================================
|
32
|
+
# You can also configure skynet with
|
33
|
+
# Skynet.configure(:SOME_CONFIG_OPTION => true, :SOME_OTHER_CONFIG => 3)
|
34
|
+
|
35
|
+
Skynet::CONFIG[:SKYNET_LOG_LEVEL] = Logger::INFO
|
36
|
+
Skynet::CONFIG[:TS_USE_RINGSERVER] = false
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class CreateSkynetTables < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :skynet_message_queues do |t|
|
4
|
+
t.column :id, "bigint unsigned primary key"
|
5
|
+
t.column :queue_id, :integer, :default => 0
|
6
|
+
t.column :tran_id, "bigint unsigned"
|
7
|
+
t.column :created_on, :timestamp
|
8
|
+
t.column :updated_on, :timestamp
|
9
|
+
t.column :tasktype, :string
|
10
|
+
t.column :task_id, 'bigint unsigned'
|
11
|
+
t.column :job_id, 'bigint unsigned'
|
12
|
+
t.column :raw_payload, "longtext"
|
13
|
+
t.column :payload_type, :string
|
14
|
+
t.column :name, :string
|
15
|
+
t.column :expiry, :integer
|
16
|
+
t.column :expire_time, "decimal(16,4)"
|
17
|
+
t.column :iteration, :integer
|
18
|
+
t.column :version, :integer
|
19
|
+
t.column :timeout, "decimal(16,4)"
|
20
|
+
t.column :retry, :integer, :default => 0
|
21
|
+
end
|
22
|
+
create_table :skynet_queue_temperature do |t|
|
23
|
+
t.column :id, "bigint unsigned primary key"
|
24
|
+
t.column :queue_id, :integer, :default => 0
|
25
|
+
t.column :updated_on, :timestamp
|
26
|
+
t.column :count, :integer, :default => 0
|
27
|
+
t.column :temperature, "decimal(6,4) default 1"
|
28
|
+
t.column :type, :string
|
29
|
+
end
|
30
|
+
add_index :skynet_message_queues, :job_id
|
31
|
+
add_index :skynet_message_queues, :task_id
|
32
|
+
add_index :skynet_message_queues, :tran_id, :unique => true
|
33
|
+
add_index :skynet_message_queues, [:queue_id,:tasktype,:payload_type,:expire_time], :name => "index_skynet_mqueue_for_take"
|
34
|
+
execute "insert into skynet_queue_temperature (queue_id,type) values (0,'master')"
|
35
|
+
execute "insert into skynet_queue_temperature (queue_id,type) values (0,'any')"
|
36
|
+
execute "insert into skynet_queue_temperature (queue_id,type) values (0,'task')"
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.down
|
40
|
+
drop_table :skynet_queue_temperature
|
41
|
+
drop_table :skynet_message_queues
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :users do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :password
|
6
|
+
t.string :favorites
|
7
|
+
t.string :email
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :users
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
+
# please use the migrations feature of ActiveRecord to incrementally modify your database, and
|
3
|
+
# then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
+
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
+
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
+
#
|
10
|
+
# It's strongly recommended to check this file into your version control system.
|
11
|
+
|
12
|
+
ActiveRecord::Schema.define(:version => 3) do
|
13
|
+
|
14
|
+
create_table "skynet_message_queues", :force => true do |t|
|
15
|
+
t.integer "queue_id", :default => 0
|
16
|
+
t.integer "tran_id", :limit => 20
|
17
|
+
t.datetime "created_on"
|
18
|
+
t.datetime "updated_on"
|
19
|
+
t.string "tasktype"
|
20
|
+
t.integer "task_id", :limit => 20
|
21
|
+
t.integer "job_id", :limit => 20
|
22
|
+
t.text "raw_payload"
|
23
|
+
t.string "payload_type"
|
24
|
+
t.string "name"
|
25
|
+
t.integer "expiry"
|
26
|
+
t.decimal "expire_time", :precision => 16, :scale => 4
|
27
|
+
t.integer "iteration"
|
28
|
+
t.integer "version"
|
29
|
+
t.decimal "timeout", :precision => 16, :scale => 4
|
30
|
+
t.integer "retry", :default => 0
|
31
|
+
end
|
32
|
+
|
33
|
+
add_index "skynet_message_queues", ["tran_id"], :name => "index_skynet_message_queues_on_tran_id", :unique => true
|
34
|
+
add_index "skynet_message_queues", ["job_id"], :name => "index_skynet_message_queues_on_job_id"
|
35
|
+
add_index "skynet_message_queues", ["task_id"], :name => "index_skynet_message_queues_on_task_id"
|
36
|
+
add_index "skynet_message_queues", ["queue_id", "tasktype", "payload_type", "expire_time"], :name => "index_skynet_mqueue_for_take"
|
37
|
+
|
38
|
+
create_table "skynet_queue_temperature", :force => true do |t|
|
39
|
+
t.integer "queue_id", :default => 0
|
40
|
+
t.datetime "updated_on"
|
41
|
+
t.integer "count", :default => 0
|
42
|
+
t.decimal "temperature", :precision => 6, :scale => 4
|
43
|
+
t.string "type"
|
44
|
+
end
|
45
|
+
|
46
|
+
create_table "skynet_worker_queues", :force => true do |t|
|
47
|
+
t.integer "queue_id", :default => 0
|
48
|
+
t.datetime "created_on"
|
49
|
+
t.datetime "updated_on"
|
50
|
+
t.string "tasktype"
|
51
|
+
t.string "tasksubtype"
|
52
|
+
t.integer "worker_id", :limit => 20
|
53
|
+
t.string "hostname"
|
54
|
+
t.integer "process_id"
|
55
|
+
t.integer "job_id", :limit => 20
|
56
|
+
t.integer "task_id", :limit => 20
|
57
|
+
t.integer "iteration"
|
58
|
+
t.string "name"
|
59
|
+
t.string "map_or_reduce"
|
60
|
+
t.decimal "started_at", :precision => 16, :scale => 4
|
61
|
+
t.integer "version"
|
62
|
+
t.integer "processed"
|
63
|
+
t.decimal "timeout", :precision => 16, :scale => 4
|
64
|
+
end
|
65
|
+
|
66
|
+
add_index "skynet_worker_queues", ["worker_id"], :name => "index_skynet_worker_queues_on_worker_id", :unique => true
|
67
|
+
add_index "skynet_worker_queues", ["hostname", "process_id"], :name => "index_skynet_worker_queues_on_hostname_and_process_id"
|
68
|
+
|
69
|
+
create_table "user_favorites", :force => true do |t|
|
70
|
+
t.integer "user_id"
|
71
|
+
t.string "favorite"
|
72
|
+
t.datetime "created_at"
|
73
|
+
t.datetime "updated_at"
|
74
|
+
end
|
75
|
+
|
76
|
+
create_table "users", :force => true do |t|
|
77
|
+
t.string "name"
|
78
|
+
t.string "password"
|
79
|
+
t.string "favorites"
|
80
|
+
t.string "email"
|
81
|
+
t.datetime "created_at"
|
82
|
+
t.datetime "updated_at"
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
CREATE TABLE skynet_message_queues (
|
2
|
+
id int(11) NOT NULL auto_increment,
|
3
|
+
queue_id int(11) default '0',
|
4
|
+
tran_id bigint(20) unsigned default NULL,
|
5
|
+
created_on datetime default NULL,
|
6
|
+
updated_on datetime default NULL,
|
7
|
+
tasktype varchar(255) default NULL,
|
8
|
+
task_id bigint(20) unsigned default NULL,
|
9
|
+
job_id bigint(20) unsigned default NULL,
|
10
|
+
raw_payload longtext,
|
11
|
+
payload_type varchar(255) default NULL,
|
12
|
+
name varchar(255) default NULL,
|
13
|
+
expiry int(11) default NULL,
|
14
|
+
expire_time decimal(16,4) default NULL,
|
15
|
+
iteration int(11) default NULL,
|
16
|
+
version int(11) default NULL,
|
17
|
+
timeout decimal(16,4) default NULL,
|
18
|
+
retry int(11) default '0',
|
19
|
+
PRIMARY KEY (id),
|
20
|
+
UNIQUE KEY index_skynet_message_queues_on_tran_id (tran_id),
|
21
|
+
KEY index_skynet_message_queues_on_job_id (job_id),
|
22
|
+
KEY index_skynet_message_queues_on_task_id (task_id),
|
23
|
+
KEY index_skynet_mqueue_for_take (queue_id,tasktype,payload_type,expire_time)
|
24
|
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
25
|
+
CREATE TABLE skynet_queue_temperature (
|
26
|
+
id int(11) NOT NULL auto_increment,
|
27
|
+
queue_id int(11) default '0',
|
28
|
+
updated_on datetime default NULL,
|
29
|
+
count int(11) default '0',
|
30
|
+
temperature decimal(6,4) default NULL,
|
31
|
+
type varchar(255) default NULL,
|
32
|
+
PRIMARY KEY (id)
|
33
|
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|