Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Only in evented-starling/: .DS_Store
- diff -u -r evented-starling/.git/config britted-starling/.git/config
- --- evented-starling/.git/config 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/config 2008-02-08 18:35:04.000000000 -0800
- @@ -4,7 +4,7 @@
- bare = false
- logallrefupdates = true
- [remote "origin"]
- - url = git://github.com/defunkt/starling.git
- + url = git://github.com/anotherbritt/starling.git
- fetch = +refs/heads/*:refs/remotes/origin/*
- [branch "master"]
- remote = origin
- Binary files evented-starling/.git/index and britted-starling/.git/index differ
- diff -u -r evented-starling/.git/logs/HEAD britted-starling/.git/logs/HEAD
- --- evented-starling/.git/logs/HEAD 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/logs/HEAD 2008-02-08 18:35:04.000000000 -0800
- @@ -1 +1 @@
- -0000000000000000000000000000000000000000 3ac7b46d69527f5d2e3b1a52b40915ff24a8e28a Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202413199 -0800
- +0000000000000000000000000000000000000000 4ab87b48517db49c45c21b3f4307610a0dc544ef Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202524504 -0800
- diff -u -r evented-starling/.git/logs/refs/heads/master britted-starling/.git/logs/refs/heads/master
- --- evented-starling/.git/logs/refs/heads/master 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/logs/refs/heads/master 2008-02-08 18:35:04.000000000 -0800
- @@ -1 +1 @@
- -0000000000000000000000000000000000000000 3ac7b46d69527f5d2e3b1a52b40915ff24a8e28a Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202413199 -0800
- +0000000000000000000000000000000000000000 4ab87b48517db49c45c21b3f4307610a0dc544ef Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202524504 -0800
- diff -u -r evented-starling/.git/logs/refs/remotes/origin/master britted-starling/.git/logs/refs/remotes/origin/master
- --- evented-starling/.git/logs/refs/remotes/origin/master 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/logs/refs/remotes/origin/master 2008-02-08 18:35:04.000000000 -0800
- @@ -1 +1 @@
- -0000000000000000000000000000000000000000 3ac7b46d69527f5d2e3b1a52b40915ff24a8e28a Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202413199 -0800 clone: from git://github.com/defunkt/starling.git
- +0000000000000000000000000000000000000000 4ab87b48517db49c45c21b3f4307610a0dc544ef Evan Weaver <weavere@c13-chd-dev1.cnet.com> 1202524504 -0800 clone: from git://github.com/anotherbritt/starling.git
- Only in britted-starling/.git/objects/pack: pack-c94afa33c0e9f9d62e2a0ca3be4e4bcfa2335112.idx
- Only in britted-starling/.git/objects/pack: pack-c94afa33c0e9f9d62e2a0ca3be4e4bcfa2335112.keep
- Only in britted-starling/.git/objects/pack: pack-c94afa33c0e9f9d62e2a0ca3be4e4bcfa2335112.pack
- Only in evented-starling/.git/objects/pack: pack-e8eeccdbdbed58a21f0fe9f1aa5e66f68cfa9e5f.idx
- Only in evented-starling/.git/objects/pack: pack-e8eeccdbdbed58a21f0fe9f1aa5e66f68cfa9e5f.keep
- Only in evented-starling/.git/objects/pack: pack-e8eeccdbdbed58a21f0fe9f1aa5e66f68cfa9e5f.pack
- diff -u -r evented-starling/.git/refs/heads/master britted-starling/.git/refs/heads/master
- --- evented-starling/.git/refs/heads/master 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/refs/heads/master 2008-02-08 18:35:04.000000000 -0800
- @@ -1 +1 @@
- -3ac7b46d69527f5d2e3b1a52b40915ff24a8e28a
- +4ab87b48517db49c45c21b3f4307610a0dc544ef
- diff -u -r evented-starling/.git/refs/remotes/origin/master britted-starling/.git/refs/remotes/origin/master
- --- evented-starling/.git/refs/remotes/origin/master 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/.git/refs/remotes/origin/master 2008-02-08 18:35:04.000000000 -0800
- @@ -1 +1 @@
- -3ac7b46d69527f5d2e3b1a52b40915ff24a8e28a
- +4ab87b48517db49c45c21b3f4307610a0dc544ef
- diff -u -r evented-starling/lib/starling/handler.rb britted-starling/lib/starling/handler.rb
- --- evented-starling/lib/starling/handler.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/lib/starling/handler.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -49,6 +49,7 @@
- STAT queue_%s_logsize %d
- STAT queue_%s_expired_items %d\n".freeze
- + @@cc = 0
- ##
- # Creates a new handler for the MemCache protocol that communicates with a
- # given client.
- @@ -63,7 +64,9 @@
- def post_init
- @stash = []
- @data = ""
- + @data_buf = ""
- @server = @opts[:server]
- + @logger = StarlingServer::Base.logger
- @expiry_stats = Hash.new(0)
- @expected_length = nil
- @server.stats[:total_connections] += 1
- @@ -79,15 +82,20 @@
- response = process(data)
- end
- + @@cc = @@cc+1
- send_data response if response
- end
- def process(data)
- + data = @data_buf + data if @data_buf.size > 0
- # our only non-normal state is consuming an object's data
- # when @expected_length is present
- if @expected_length && data.size == @expected_length
- - return set_data(data)
- + response = set_data(data)
- + @data_buf = ""
- + return response
- elsif @expected_length
- + @data_buf = data
- return
- end
- @@ -126,13 +134,16 @@
- def set_data(incoming)
- key, flags, expiry = @stash
- data = incoming.slice(0...@expected_length-2)
- + logger.info "[loltrace] [q: #{key}] [m:set_data got data] #{data.inspect}" if data.include?('loltrace')
- @stash = []
- @expected_length = nil
- internal_data = [expiry.to_i, data].pack(DATA_PACK_FMT)
- if @queue_collection.put(key, internal_data)
- + logger.info "[loltrace] [q: #{key}] [m:set_data sending success] #{data.inspect}" if data.include?('loltrace')
- respond SET_RESPONSE_SUCCESS
- else
- + logger.info "[loltrace] [q: #{key}] [m:set_data sending failure] #{data.inspect}" if data.include?('loltrace')
- respond SET_RESPONSE_FAILURE
- end
- end
- @@ -142,6 +153,7 @@
- while response = @queue_collection.take(key)
- expiry, data = response.unpack(DATA_PACK_FMT)
- + logger.info "[loltrace] [q: #{key}] [m:get got data with expiry #{expiry}] #{data.inspect}" if data.include?('loltrace')
- break if expiry == 0 || expiry >= now
- @@ -150,6 +162,7 @@
- end
- if data
- + logger.info "[loltrace] [q: #{key}] [m:get sending success] #{data.inspect}" if data.include?('loltrace')
- respond GET_RESPONSE, key, 0, data.size, data
- else
- respond GET_RESPONSE_EMPTY
- @@ -190,7 +203,7 @@
- end
- def logger
- - @server.logger
- + @logger
- end
- end
- end
- diff -u -r evented-starling/lib/starling/queue_collection.rb britted-starling/lib/starling/queue_collection.rb
- --- evented-starling/lib/starling/queue_collection.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/lib/starling/queue_collection.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -21,6 +21,7 @@
- @shutdown_mutex = Mutex.new
- @path = path
- + @logger = StarlingServer::Base.logger
- @queues = {}
- @queue_init_mutexes = {}
- @@ -39,6 +40,7 @@
- @stats[:total_items] += 1
- queue.push(data)
- + @logger.info "[loltrace] [q: #{key}] [m:queue_push] #{data.inspect}" if data.include?('loltrace')
- return true
- end
- diff -u -r evented-starling/lib/starling/runner.rb britted-starling/lib/starling/runner.rb
- --- evented-starling/lib/starling/runner.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/lib/starling/runner.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -14,7 +14,7 @@
- def initialize
- parse_options
- - @process = ProcessHelper.new(options[:log_file], options[:pid_file], options[:user], options[:group])
- + @process = ProcessHelper.new(options[:logger], options[:pid_file], options[:user], options[:group])
- pid = @process.running?
- if pid
- @@ -31,7 +31,7 @@
- self.options = { :host => '127.0.0.1',
- :port => 22122,
- :path => File.join(%w( / var spool starling )),
- - :log_level => 0,
- + :log_level => Logger::ERROR,
- :daemonize => false,
- :pid_file => File.join(%w( / var run starling.pid )) }
- @@ -83,11 +83,11 @@
- opts.separator ""; opts.separator "Logging:"
- opts.on("-l", "--log [FILE]", "Path to print debugging information.") do |log_path|
- - options[:log] = log_path
- + options[:logger] = log_path
- end
- - opts.on("-v", "Increase logging verbosity.") do
- - options[:log_level] += 1
- + opts.on("-v", "Increase logging verbosity (may be used multiple times).") do
- + options[:log_level] -= 1
- end
- opts.separator ""; opts.separator "Miscellaneous:"
- @@ -127,7 +127,7 @@
- def shutdown
- begin
- STDOUT.puts "Shutting down."
- - @server.logger.info "Shutting down."
- + StarlingServer::Base.logger.info "Shutting down."
- @server.stop
- rescue Object => e
- STDERR.puts "There was an error shutting down: #{e}"
- diff -u -r evented-starling/lib/starling/server.rb britted-starling/lib/starling/server.rb
- --- evented-starling/lib/starling/server.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/lib/starling/server.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -2,6 +2,7 @@
- require 'logger'
- require 'rubygems'
- require 'eventmachine'
- +require 'analyzer_tools/syslog_logger'
- here = File.dirname(__FILE__)
- @@ -10,7 +11,7 @@
- module StarlingServer
- - VERSION = "0.9.4"
- + VERSION = "0.9.5.1"
- class Base
- attr_reader :logger
- @@ -64,14 +65,14 @@
- def run
- @stats[:start_time] = Time.now
- - @logger = case @opts[:logger]
- - when IO, String; Logger.new(@opts[:logger])
- + @@logger = case @opts[:logger]
- + when IO, String; SyslogLogger.new(@opts[:logger])
- when Logger; @opts[:logger]
- else; Logger.new(STDERR)
- end
- @opts[:queue] = QueueCollection.new(@opts[:path])
- - @logger.level = @opts[:log_level] || Logger::ERROR
- + @@logger.level = @opts[:log_level] || Logger::ERROR
- EventMachine.run do
- EventMachine.epoll
- @@ -80,6 +81,11 @@
- end
- end
- + def self.logger
- + @@logger
- + end
- +
- +
- ##
- # Stop accepting new connections and shutdown gracefully.
- diff -u -r evented-starling/License.txt britted-starling/License.txt
- --- evented-starling/License.txt 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/License.txt 2008-02-08 18:35:04.000000000 -0800
- @@ -1,4 +1,4 @@
- -Copyright (c) 2007 Blaine Cook, Twitter, Inc.
- +Copyright (c) 2007 FIXME full name
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- @@ -17,4 +17,4 @@
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- \ No newline at end of file
- diff -u -r evented-starling/README.txt britted-starling/README.txt
- --- evented-starling/README.txt 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/README.txt 2008-02-08 18:35:04.000000000 -0800
- @@ -29,8 +29,7 @@
- = Known Issues
- * Starling is "slow" as far as messaging systems are concerned. In practice,
- - it's fast enough. If you'd like to help make it faster please do. Starting
- - points would be to use an event-driven interface, and get rid of threading.
- + it's fast enough.
- = Authors
- @@ -40,3 +39,5 @@
- Starling - a light-weight server for reliable distributed message passing.
- Copyright 2007 Blaine Cook <blaine@twitter.com>, Twitter Inc.
- +
- +<<to be completed>>
- Only in evented-starling/: speed
- diff -u -r evented-starling/test/test_helper.rb britted-starling/test/test_helper.rb
- --- evented-starling/test/test_helper.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/test/test_helper.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -1,8 +1,2 @@
- require 'test/unit'
- -require 'fileutils'
- $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
- -
- -lib = File.join(File.dirname(__FILE__), "..")
- -tmp = File.join(lib, 'tmp')
- -FileUtils.mkdir tmp unless File.exists? tmp
- -$:.unshift(File.join(lib, "lib"))
- diff -u -r evented-starling/test/test_starling.rb britted-starling/test/test_starling.rb
- --- evented-starling/test/test_starling.rb 2008-02-07 11:39:59.000000000 -0800
- +++ britted-starling/test/test_starling.rb 2008-02-08 18:35:04.000000000 -0800
- @@ -14,19 +14,14 @@
- class TestStarling < Test::Unit::TestCase
- def setup
- - @server = StarlingServer::Base.new(:host => '127.0.0.1',
- - :port => 22133,
- - :path => tmp_path)
- + @server, @acceptor = StarlingServer::Base.start(:host => '127.0.0.1',
- + :port => 22133,
- + :path => tmp_path)
- @client = MemCache.new('127.0.0.1:22133')
- -
- - @thread = Thread.new do
- - @server.run
- - end
- end
- def teardown
- - sleep 0.01
- @server.stop
- @client.reset
- FileUtils.rm_f(File.join(tmp_path, '*'))
- @@ -96,19 +91,16 @@
- end
- end
- - def test_funknown_command_returns_valid_result
- - @client.set('blah', 'blah')
- + def test_unknown_command_returns_valid_result
- response = @client.add('blah', 1)
- assert_match 'CLIENT_ERROR', response
- - response = @client.get('blah')
- - assert_equal 'blah', response
- end
- - def test_disconnecting_and_reconnecting_works
- + def test_that_disconnecting_and_reconnecting_works
- v = rand(2**32-1)
- - @client.set('test_disconnecting_and_reconnecting_works', v)
- + @client.set('test_that_disconnecting_and_reconnecting_works', v)
- @client.reset
- - assert_equal v, @client.get('test_disconnecting_and_reconnecting_works')
- + assert_equal v, @client.get('test_that_disconnecting_and_reconnecting_works')
- end
- private
Add Comment
Please, Sign In to add comment