Skip to content

Instantly share code, notes, and snippets.

View kusakari's full-sized avatar

KUSAKARI Kei kusakari

View GitHub Profile
@yukim
yukim / re.md
Created March 4, 2013 23:05
RE:cassandraを運用していて困っていること

@oranie さんのブログ記事への返信です。 たいへん遅くなりました。申し訳ないです。

repairとcompactionのコストが高すぎる

Cassandraにノードを追加する(Bootstrap)と、そのノードが担当するレプリカのデータを他のノードから取得します。 Repairはノードが保持するレプリカの整合性を検証して修復します。

どちらもデータを他のノードから取得しますが、ファイルを1つづつやり取りするため時間がかかるのは事実です。 この部分にまだまだ改善の余地があります。次のメジャーバージョンで抜本的に見直します

@alexaivars
alexaivars / setter_pattern.coffee
Created January 12, 2012 08:41
Getter Setter patter for Coffeescript
Function::define = (prop, desc) ->
Object.defineProperty this.prototype, prop, desc
class GetterSetterTest
constructor: (@_obj = {}) ->
# 'obj' is defined via the prototype, the definition proxied through
# to 'Object.defineProperty' via a function called 'define' providing
# some nice syntactic sugar. Remember, the value of '@' is
# GetterSetterTest itself when used in the body of it's class definition.
@miyucy
miyucy / bench.rb
Created September 11, 2010 20:08
require 'benchmark'
require 'open-uri'
$: << File.expand_path(File.join("..", "lib"), File.dirname(__FILE__))
require 'swfmill'
SWFMILL = File.expand_path('~/bin/swfmill')
# stolen from swfmill_ruby
def xml2swf(xml, option = "-e cp932")
IO.popen("#{SWFMILL} #{option} xml2swf stdin", "r+") do |io|
require './handler_socket'
require 'pp'
if false
require 'rubygems'
require 'active_support'
require 'active_record'
ActiveRecord::Base.establish_connection(:adapter => 'mysql',
:encoding => 'utf8',
:host => 'localhost',
# Drop this file in config/initializers to run your Rails project on Ruby 1.9.
# This is three separate monkey patches -- see comments in code below for the source of each.
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects.
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9.
#
# Andre Lewis 1/2010
# encoding: utf-8