SlideShare a Scribd company logo
1 of 87
Download to read offline
RubyKaigi2009    COBOL


seki@druby.org
3360

                              dRuby
•                               Web

•       Pragmatic Bookshelf

    •
$32.00


• International Journal of
  PARALLEL PROGRAMING
!?
MapReduce Rinda
(map, reduce)


map reduce
key value

 [    ,     ]   [   ,   ID]
map()
                       ["Applied", 1]        ["rb_binding_new", 1]                  ["ruby", 1]
     ["eval", 1]
                  ["Communication", 1]                ["void", 1]                     ["if", 1]
       ["c", 1]
                     ["Laboratory", 1]         ["NORETURN", 1]                    ["defined", 1]                ["void", 1]
   ["Author", 1]
                           ["Inc", 1]                 ["void", 1]              ["__APPLE__", 1]            ["Init_heap", 1]
    ["nobu", 1]
                      ["Copyright", 1]        ["rb_raise_jump", 1]                 ["define", 1]                ["void", 1]
  ["created", 1]
                            ["C", 1]                ["VALUE", 1]                  ["environ", 1]               ["void", 1]
       ["at", 1]
                         ["2000", 1]                   ["ID", 1]             ["_NSGetEnviron", 1]        ["Init_BareVM", 1]
     ["Thu", 1]
                    ["Information", 1]       ["rb_frame_callee", 1]                  ["elif", 1]               ["void", 1]
      ["Jun", 1]
                     ["technology", 1]                ["void", 1]                 ["defined", 1]                ["void", 1]
      ["10", 1]
                     ["Promotion", 1]               ["VALUE", 1]                 ["_WIN32", 1]             ["ruby_init", 1]
      ["14", 1]
                        ["Agency", 1]     ["rb_eLocalJumpError", 1]                ["extern", 1]               ["void", 1]
      ["22", 1]
                         ["Japan", 1]               ["VALUE", 1]                    ["char", 1]               ["static", 1]
      ["17", 1]
                        ["include", 1]     ["rb_eSysStackError", 1]               ["environ", 1]                ["int", 1]
     ["JST", 1]
                     ["eval_intern", 1]              ["define", 1]                   ["endif", 1]           ["initialized", 1]
    ["1993", 1]
                            ["h", 1]        ["exception_error", 1]                  ["char", 1]                  ["0", 1]
 ["Copyright", 1]
                        ["include", 1]            ["GET_VM", 1]              ["rb_origenviron", 1]              ["int", 1]
       ["C", 1]
                          ["iseq", 1]      ["special_exceptions", 1]                ["void", 1]               ["state", 1]
    ["1993", 1]
                            ["h", 1]      ["ruby_error_reenter", 1]       ["rb_clear_trace_func", 1]             ["if", 1]
    ["2007", 1]
                        ["VALUE", 1]                ["include", 1]                  ["void", 1]            ["initialized", 1]
  ["Yukihiro", 1]
                    ["proc_invoke", 1]           ["eval_error", 1]                  ["void", 1]              ["return", 1]
["Matsumoto", 1]
                        ["VALUE", 1]                    ["c", 1]     ["rb_thread_stop_timer_thread", 1]    ["initialized", 1]
 ["Copyright", 1]
                        ["VALUE", 1]                ["include", 1]                  ["void", 1]                  ["1", 1]
       ["C", 1]
                        ["VALUE", 1]             ["eval_jump", 1]                   ["void", 1]         ["rb_origenviron", 1]
    ["2000", 1]
                        ["VALUE", 1]                    ["c", 1]               ["rb_call_inits", 1]
 ["Network", 1]
                        ["VALUE", 1]               ["initialize", 1]                ["void", 1]
map()                   reduce()




        ordered list   BigTable
map



key                value

          key value

 [    ,        ]
reduce()
  ["ANYARGS", 1]           ["Author", 1]
  ["ANYARGS", 1]           ["Author", 1]       ["Communication", 1]
  ["ANYARGS", 1]          ["Bignum", 1]        ["Communication", 1]
  ["ANYARGS", 1]          ["Bignum", 1]           ["Copyright", 1]
  ["ANYARGS", 1]           ["Binding", 1]         ["Copyright", 1]
  ["ANYARGS", 1]           ["Binding", 1]         ["Copyright", 1]
  ["ANYARGS", 6]              ["C", 1]            ["Copyright", 3]
     ["ARGV", 1]              ["C", 1]      ["EXEC_EVENT_HOOK", 1]
     ["ARGV", 1]              ["C", 1]      ["EXEC_EVENT_HOOK", 1]
      ["Adds", 1]             ["C", 3]           ["EXEC_TAG", 1]
      ["Adds", 1]       ["CONST_ID", 1]          ["EXEC_TAG", 1]
    ["Agency", 1]       ["CONST_ID", 1]          ["EXEC_TAG", 1]
    ["Agency", 1]            ["Call", 1]         ["EXEC_TAG", 1]
    ["Applied", 1]           ["Call", 1]         ["EXEC_TAG", 1]
    ["Applied", 1]           ["Can", 1]          ["EXEC_TAG", 1]
["ArgumentError", 1]         ["Can", 1]          ["EXEC_TAG", 1]
["ArgumentError", 1]         ["Can", 2]          ["EXEC_TAG", 1]
["ArgumentError", 2]    ["Check_Type", 1]        ["EXEC_TAG", 1]
      ["Array", 1]      ["Check_Type", 1]        ["EXEC_TAG", 1]
      ["Array", 1]      ["Check_Type", 1]        ["EXEC_TAG", 1]
      ["Array", 1]      ["Check_Type", 3]
      ["Array", 3]
key
group_by
COBOL

RubyKaigi2009   COBOL
key
[key, value]




               ↑
Rinda
tuple, tuple space
out, in rd
Tuple Space


         Engine
                                     Client




Engine                  TupleSpace




                                      Client
           Engine
Ruby      Linda

dRuby

Tuple Array
Tuple


[:chopstick, 2]
[:room_ticket]
[‘abc’, 2, 5]
[:matrix, 1.6, 3.14]
[‘family’, ‘is-sister’, ’Carolyn’, ’Elinor’]
Tuple           ===

  case equals

  Regexp, Range, Class

nil
Pattern


[/^A/, nil, nil]
[:matrix, Numeric, Numeric]
[’family’, ’is-sister’, ’Carolyn’, nil]
[nil, ’age’, (0..18)]
[’seki’, ’age’, 20]

>>   require ‘rinda/tuplespace’
>>   ts = Rinda::TupleSpace.new
>>   ts.write([’seki’, ’age’, 20])
>>   ts.write([’sougo’, ’age’, 18])
>>   ts.write([’leonard’, ’age’, 18])
>>   ts.read_all([nil, ’age’, 0..19])
=>   [["sougo", "age", 18], ["leonard", "age", 18]]
>>   ts.read_all([/^s/, ’age’, Numeric])
=>   [["seki", "age", 20], ["sougo", "age", 18]]
>> ts.write([:seki, :age, 20])
=> #<Rinda::TupleEntry:...>
>>                               TupleSpace


                                        :seki   :age   20
>> ts.write([:seki, :age, 20])
=> #<Rinda::TupleEntry:...>
>>                                               TupleSpace

>> ts.take([:seki, :age, nil])
=> [:seki, :age, 20]
>>


                                 :seki   :age   20
>> ts.take([:seki, :age, nil])

                                 TupleSpace
>> ts.take([:seki, :age, nil])
>> ts.write([:seki, :age, 20])
                                 TupleSpace
=> #<Rinda::TupleEntry:...>
>>
                                        :seki   :age   20
>> ts.take([:seki, :age, nil])
>> ts.write([:seki, :age, 20])
                                                 TupleSpace
=> #<Rinda::TupleEntry:...>
>>
=> [:seki, :age, 20]
>>


                                 :seki   :age   20
toRuby
Rinda

 MapReduce
[String, Integer]



map reduce
while line = gets
  line.scan(/w+/) do |w|
    ts.write([w, 1])
  end
end
word = ts.read_all.sort_by {|t| t[0]}.first[0]




            ‥

     O(n)
ary = ts.read_all([word, nil])
ts.read_all.sort_by {|t| t[0]}.first



                    !!

           O(n)
hash.keys.sort



      keys.sort

             key

      hash         key
Hash TupleSpace key

          key

    key

 read_all, keys
reduce




         Linda
RDB
Ruby Hash
Hash

key-values

key

             key
key
ID
[   ,   ID   ]
http://chalow.net/2008-01-18-1.html
[ ]
and, or
ID
[[       ,   ID], nil]

key

     value

key
BigTable

Tokyo Cabinet

RBTree
QDBM         B+

key String




                  C
sqlite→QDBM→Tokyo Cabinet
 OODB

Ruby                   key, value

       key value
# memory
[“m.#{oid}”, class.to_s]

# property
[“p.#{oid}@#{name}”, Marshal.dump([klass, value])]




                 key
OODB
dRuby

        OODB


Koya
Ruby
transaction
RB   (≠Ruby )

Key Ruby Object

                  - MultiRBTree



     Ruby
dRuby



        in-memory + logging



 memcached      (             )
dRuby



dRuby
FUD
!!!
CVS                         !

      add/delete

      add/delete   commit
akr   Ruby/CVS

add/delete
,v
[[word, doc_id, rev_id, mode, lineno], nil]




           ,      ID, revision ID, add|del|log,
Tokyo Cabinet BDD



 WEBrick::CGI   4   cgi
10
> Google
3360

                              dRuby
•                               Web

•       Pragmatic Bookshelf

    •
RubyKaigi2009   COBOL

More Related Content

What's hot

NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法
Tomohiro Nishimura
 

What's hot (19)

Productive Programming in Groovy
Productive Programming in GroovyProductive Programming in Groovy
Productive Programming in Groovy
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
 
Building DSLs with Groovy
Building DSLs with GroovyBuilding DSLs with Groovy
Building DSLs with Groovy
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
 
NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法NoSQL を Ruby で実践するための n 個の方法
NoSQL を Ruby で実践するための n 個の方法
 
The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.4.1 book - Part 12 of 31
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31
 
Realm to Json & Royal
Realm to Json & RoyalRealm to Json & Royal
Realm to Json & Royal
 
RxSwift 시작하기
RxSwift 시작하기RxSwift 시작하기
RxSwift 시작하기
 
The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 
The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.5.2 book - Part 43 of 181
 
Mongo db mug_2012-02-07
Mongo db mug_2012-02-07Mongo db mug_2012-02-07
Mongo db mug_2012-02-07
 
360|iDev
360|iDev360|iDev
360|iDev
 
The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.5 book - Part 3 of 31
 
Embedding a language into string interpolator
Embedding a language into string interpolatorEmbedding a language into string interpolator
Embedding a language into string interpolator
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
 
The Ring programming language version 1.5.2 book - Part 14 of 181
The Ring programming language version 1.5.2 book - Part 14 of 181The Ring programming language version 1.5.2 book - Part 14 of 181
The Ring programming language version 1.5.2 book - Part 14 of 181
 
The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.10 book - Part 50 of 212
 

Viewers also liked (7)

富蘭克林坦伯頓全球債券基金
富蘭克林坦伯頓全球債券基金富蘭克林坦伯頓全球債券基金
富蘭克林坦伯頓全球債券基金
 
Road to Nishinasuno public hall
Road to Nishinasuno public hallRoad to Nishinasuno public hall
Road to Nishinasuno public hall
 
drb09
drb09drb09
drb09
 
The last decade of RWiki and lazy me.
The last decade of RWiki and lazy me.The last decade of RWiki and lazy me.
The last decade of RWiki and lazy me.
 
toRubyKaigi02 LT - Trailler
toRubyKaigi02 LT - TraillertoRubyKaigi02 LT - Trailler
toRubyKaigi02 LT - Trailler
 
TDD and me trailler
TDD and me traillerTDD and me trailler
TDD and me trailler
 
Untitled
UntitledUntitled
Untitled
 

Similar to Great BigTable and my toys

Useful javascript
Useful javascriptUseful javascript
Useful javascript
Lei Kang
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
Siva Arunachalam
 
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzingGareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
Yury Chemerkin
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
aztack
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
Ross Lawley
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 

Similar to Great BigTable and my toys (20)

Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
 
python beginner talk slide
python beginner talk slidepython beginner talk slide
python beginner talk slide
 
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzingGareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
NUS iOS Swift Talk
NUS iOS Swift TalkNUS iOS Swift Talk
NUS iOS Swift Talk
 
A Few of My Favorite (Python) Things
A Few of My Favorite (Python) ThingsA Few of My Favorite (Python) Things
A Few of My Favorite (Python) Things
 
Cascading
CascadingCascading
Cascading
 
Oracle APEX Cheat Sheet
Oracle APEX Cheat SheetOracle APEX Cheat Sheet
Oracle APEX Cheat Sheet
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Tokyo r18
Tokyo r18Tokyo r18
Tokyo r18
 
Brief intro to clojure
Brief intro to clojureBrief intro to clojure
Brief intro to clojure
 
R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)R v01 rprogamming_basic01 (R 프로그래밍 기본)
R v01 rprogamming_basic01 (R 프로그래밍 기본)
 
2015 10-7-9am regex-functions-loops.key
2015 10-7-9am regex-functions-loops.key2015 10-7-9am regex-functions-loops.key
2015 10-7-9am regex-functions-loops.key
 
Erlang for data ops
Erlang for data opsErlang for data ops
Erlang for data ops
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
Python: The Dynamic!
Python: The Dynamic!Python: The Dynamic!
Python: The Dynamic!
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 

Great BigTable and my toys

  • 1. RubyKaigi2009 COBOL seki@druby.org
  • 2.
  • 3.
  • 4. 3360 dRuby • Web • Pragmatic Bookshelf •
  • 5. $32.00 • International Journal of PARALLEL PROGRAMING
  • 6. !?
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. key value [ , ] [ , ID]
  • 16. map() ["Applied", 1] ["rb_binding_new", 1] ["ruby", 1] ["eval", 1] ["Communication", 1] ["void", 1] ["if", 1] ["c", 1] ["Laboratory", 1] ["NORETURN", 1] ["defined", 1] ["void", 1] ["Author", 1] ["Inc", 1] ["void", 1] ["__APPLE__", 1] ["Init_heap", 1] ["nobu", 1] ["Copyright", 1] ["rb_raise_jump", 1] ["define", 1] ["void", 1] ["created", 1] ["C", 1] ["VALUE", 1] ["environ", 1] ["void", 1] ["at", 1] ["2000", 1] ["ID", 1] ["_NSGetEnviron", 1] ["Init_BareVM", 1] ["Thu", 1] ["Information", 1] ["rb_frame_callee", 1] ["elif", 1] ["void", 1] ["Jun", 1] ["technology", 1] ["void", 1] ["defined", 1] ["void", 1] ["10", 1] ["Promotion", 1] ["VALUE", 1] ["_WIN32", 1] ["ruby_init", 1] ["14", 1] ["Agency", 1] ["rb_eLocalJumpError", 1] ["extern", 1] ["void", 1] ["22", 1] ["Japan", 1] ["VALUE", 1] ["char", 1] ["static", 1] ["17", 1] ["include", 1] ["rb_eSysStackError", 1] ["environ", 1] ["int", 1] ["JST", 1] ["eval_intern", 1] ["define", 1] ["endif", 1] ["initialized", 1] ["1993", 1] ["h", 1] ["exception_error", 1] ["char", 1] ["0", 1] ["Copyright", 1] ["include", 1] ["GET_VM", 1] ["rb_origenviron", 1] ["int", 1] ["C", 1] ["iseq", 1] ["special_exceptions", 1] ["void", 1] ["state", 1] ["1993", 1] ["h", 1] ["ruby_error_reenter", 1] ["rb_clear_trace_func", 1] ["if", 1] ["2007", 1] ["VALUE", 1] ["include", 1] ["void", 1] ["initialized", 1] ["Yukihiro", 1] ["proc_invoke", 1] ["eval_error", 1] ["void", 1] ["return", 1] ["Matsumoto", 1] ["VALUE", 1] ["c", 1] ["rb_thread_stop_timer_thread", 1] ["initialized", 1] ["Copyright", 1] ["VALUE", 1] ["include", 1] ["void", 1] ["1", 1] ["C", 1] ["VALUE", 1] ["eval_jump", 1] ["void", 1] ["rb_origenviron", 1] ["2000", 1] ["VALUE", 1] ["c", 1] ["rb_call_inits", 1] ["Network", 1] ["VALUE", 1] ["initialize", 1] ["void", 1]
  • 17. map() reduce() ordered list BigTable
  • 18. map key value key value [ , ]
  • 19. reduce() ["ANYARGS", 1] ["Author", 1] ["ANYARGS", 1] ["Author", 1] ["Communication", 1] ["ANYARGS", 1] ["Bignum", 1] ["Communication", 1] ["ANYARGS", 1] ["Bignum", 1] ["Copyright", 1] ["ANYARGS", 1] ["Binding", 1] ["Copyright", 1] ["ANYARGS", 1] ["Binding", 1] ["Copyright", 1] ["ANYARGS", 6] ["C", 1] ["Copyright", 3] ["ARGV", 1] ["C", 1] ["EXEC_EVENT_HOOK", 1] ["ARGV", 1] ["C", 1] ["EXEC_EVENT_HOOK", 1] ["Adds", 1] ["C", 3] ["EXEC_TAG", 1] ["Adds", 1] ["CONST_ID", 1] ["EXEC_TAG", 1] ["Agency", 1] ["CONST_ID", 1] ["EXEC_TAG", 1] ["Agency", 1] ["Call", 1] ["EXEC_TAG", 1] ["Applied", 1] ["Call", 1] ["EXEC_TAG", 1] ["Applied", 1] ["Can", 1] ["EXEC_TAG", 1] ["ArgumentError", 1] ["Can", 1] ["EXEC_TAG", 1] ["ArgumentError", 1] ["Can", 2] ["EXEC_TAG", 1] ["ArgumentError", 2] ["Check_Type", 1] ["EXEC_TAG", 1] ["Array", 1] ["Check_Type", 1] ["EXEC_TAG", 1] ["Array", 1] ["Check_Type", 1] ["EXEC_TAG", 1] ["Array", 1] ["Check_Type", 3] ["Array", 3]
  • 20. key
  • 23. key
  • 24.
  • 26.
  • 27. Rinda
  • 29. Tuple Space Engine Client Engine TupleSpace Client Engine
  • 30. Ruby Linda dRuby Tuple Array
  • 31. Tuple [:chopstick, 2] [:room_ticket] [‘abc’, 2, 5] [:matrix, 1.6, 3.14] [‘family’, ‘is-sister’, ’Carolyn’, ’Elinor’]
  • 32. Tuple === case equals Regexp, Range, Class nil
  • 33. Pattern [/^A/, nil, nil] [:matrix, Numeric, Numeric] [’family’, ’is-sister’, ’Carolyn’, nil] [nil, ’age’, (0..18)]
  • 34. [’seki’, ’age’, 20] >> require ‘rinda/tuplespace’ >> ts = Rinda::TupleSpace.new >> ts.write([’seki’, ’age’, 20]) >> ts.write([’sougo’, ’age’, 18]) >> ts.write([’leonard’, ’age’, 18]) >> ts.read_all([nil, ’age’, 0..19]) => [["sougo", "age", 18], ["leonard", "age", 18]] >> ts.read_all([/^s/, ’age’, Numeric]) => [["seki", "age", 20], ["sougo", "age", 18]]
  • 35. >> ts.write([:seki, :age, 20]) => #<Rinda::TupleEntry:...> >> TupleSpace :seki :age 20
  • 36. >> ts.write([:seki, :age, 20]) => #<Rinda::TupleEntry:...> >> TupleSpace >> ts.take([:seki, :age, nil]) => [:seki, :age, 20] >> :seki :age 20
  • 37. >> ts.take([:seki, :age, nil]) TupleSpace
  • 38. >> ts.take([:seki, :age, nil]) >> ts.write([:seki, :age, 20]) TupleSpace => #<Rinda::TupleEntry:...> >> :seki :age 20
  • 39. >> ts.take([:seki, :age, nil]) >> ts.write([:seki, :age, 20]) TupleSpace => #<Rinda::TupleEntry:...> >> => [:seki, :age, 20] >> :seki :age 20
  • 43. while line = gets line.scan(/w+/) do |w| ts.write([w, 1]) end end
  • 44. word = ts.read_all.sort_by {|t| t[0]}.first[0] ‥ O(n)
  • 47.
  • 48. hash.keys.sort keys.sort key hash key
  • 49. Hash TupleSpace key key key read_all, keys
  • 50.
  • 51.
  • 52.
  • 53. reduce Linda
  • 54. RDB
  • 57. key
  • 58. ID
  • 59. [ , ID ]
  • 62. ID
  • 63. [[ , ID], nil] key value key
  • 64.
  • 66. QDBM B+ key String C
  • 68. # memory [“m.#{oid}”, class.to_s] # property [“p.#{oid}@#{name}”, Marshal.dump([klass, value])] key
  • 69. OODB dRuby OODB Koya
  • 71. RB (≠Ruby ) Key Ruby Object - MultiRBTree Ruby
  • 72. dRuby in-memory + logging memcached ( )
  • 74. FUD
  • 75.
  • 76. !!!
  • 77. CVS ! add/delete add/delete commit
  • 78. akr Ruby/CVS add/delete
  • 79.
  • 80. ,v
  • 81. [[word, doc_id, rev_id, mode, lineno], nil] , ID, revision ID, add|del|log,
  • 82. Tokyo Cabinet BDD WEBrick::CGI 4 cgi
  • 83. 10
  • 85.
  • 86. 3360 dRuby • Web • Pragmatic Bookshelf •
  • 87. RubyKaigi2009 COBOL