Module: Fairy

Extended by:
Exception2MessageMapper
Defined in:
lib/fairy/node.rb,
lib/fairy.rb,
lib/fairy/logger.rb,
lib/fairy/master.rb,
lib/fairy/version.rb,
lib/fairy/client/wc.rb,
lib/fairy/node/p-wc.rb,
lib/fairy/processor.rb,
lib/fairy/share/log.rb,
lib/fairy/client/cat.rb,
lib/fairy/client/map.rb,
lib/fairy/controller.rb,
lib/fairy/node/p-map.rb,
lib/fairy/share/conf.rb,
lib/fairy/share/port.rb,
lib/fairy/client/exec.rb,
lib/fairy/client/find.rb,
lib/fairy/client/here.rb,
lib/fairy/client/roma.rb,
lib/fairy/client/sort.rb,
lib/fairy/master/atom.rb,
lib/fairy/master/c-wc.rb,
lib/fairy/node/p-exec.rb,
lib/fairy/node/p-find.rb,
lib/fairy/node/p-here.rb,
lib/fairy/node/p-sort.rb,
lib/fairy/node/p-task.rb,
lib/fairy/share/debug.rb,
lib/fairy/share/vfile.rb,
lib/fairy/client/input.rb,
lib/fairy/client/there.rb,
lib/fairy/master/c-cat.rb,
lib/fairy/master/c-map.rb,
lib/fairy/node/p-there.rb,
lib/fairy/share/hash-1.rb,
lib/fairy/share/locale.rb,
lib/fairy/share/stdout.rb,
lib/fairy/share/varray.rb,
lib/fairy/client/filter.rb,
lib/fairy/client/inject.rb,
lib/fairy/client/output.rb,
lib/fairy/client/select.rb,
lib/fairy/master/c-exec.rb,
lib/fairy/master/c-find.rb,
lib/fairy/master/c-here.rb,
lib/fairy/master/c-sort.rb,
lib/fairy/node/p-filter.rb,
lib/fairy/node/p-inject.rb,
lib/fairy/node/p-select.rb,
lib/fairy/client/barrier.rb,
lib/fairy/client/seg-map.rb,
lib/fairy/client/seg-zip.rb,
lib/fairy/master/c-input.rb,
lib/fairy/master/c-there.rb,
lib/fairy/node/p-barrier.rb,
lib/fairy/node/p-seg-map.rb,
lib/fairy/node/p-seg-zip.rb,
lib/fairy/share/base-app.rb,
lib/fairy/share/encoding.rb,
lib/fairy/share/hash-md5.rb,
lib/fairy/client/group-by.rb,
lib/fairy/client/junction.rb,
lib/fairy/client/roma-put.rb,
lib/fairy/client/seg-join.rb,
lib/fairy/master/c-filter.rb,
lib/fairy/master/c-inject.rb,
lib/fairy/master/c-output.rb,
lib/fairy/master/c-select.rb,
lib/fairy/node/p-group-by.rb,
lib/fairy/node/p-identity.rb,
lib/fairy/node/p-seg-join.rb,
lib/fairy/share/hash-rb18.rb,
lib/fairy/share/inspector.rb,
lib/fairy/share/reference.rb,
lib/fairy/client/io-filter.rb,
lib/fairy/client/seg-split.rb,
lib/fairy/master/c-barrier.rb,
lib/fairy/master/c-seg-map.rb,
lib/fairy/master/c-seg-zip.rb,
lib/fairy/master/scheduler.rb,
lib/fairy/node/p-io-filter.rb,
lib/fairy/node/p-seg-split.rb,
lib/fairy/share/file-place.rb,
lib/fairy/client/input-file.rb,
lib/fairy/client/input-iota.rb,
lib/fairy/master/c-group-by.rb,
lib/fairy/master/c-junction.rb,
lib/fairy/master/c-seg-join.rb,
lib/fairy/node/p-input-file.rb,
lib/fairy/node/p-input-iota.rb,
lib/fairy/share/hash-murmur.rb,
lib/fairy/client/output-file.rb,
lib/fairy/client/output-null.rb,
lib/fairy/client/seg-shuffle.rb,
lib/fairy/master/c-io-filter.rb,
lib/fairy/master/c-seg-split.rb,
lib/fairy/node/p-output-file.rb,
lib/fairy/node/p-output-null.rb,
lib/fairy/share/block-source.rb,
lib/fairy/client/input-varray.rb,
lib/fairy/master/c-input-file.rb,
lib/fairy/master/c-input-iota.rb,
lib/fairy/master/c-inputtable.rb,
lib/fairy/node/p-input-varray.rb,
lib/fairy/share/fast-tempfile.rb,
lib/fairy/share/lc/exceptions.rb,
lib/fairy/client/output-varray.rb,
lib/fairy/master/c-output-file.rb,
lib/fairy/master/c-output-null.rb,
lib/fairy/master/c-seg-shuffle.rb,
lib/fairy/node/p-output-varray.rb,
lib/fairy/client/basic-group-by.rb,
lib/fairy/client/direct-product.rb,
lib/fairy/client/merge-group-by.rb,
lib/fairy/master/c-input-varray.rb,
lib/fairy/master/c-inputtable18.rb,
lib/fairy/master/c-inputtable19.rb,
lib/fairy/node/p-basic-group-by.rb,
lib/fairy/node/p-direct-product.rb,
lib/fairy/share/pool-dictionary.rb,
lib/fairy/client/top_n_into_roma.rb,
lib/fairy/master/c-output-varray.rb,
lib/fairy/master/job-interpriter.rb,
lib/fairy/node/p-merger-group-by.rb,
lib/fairy/share/hash-simple-hash.rb,
lib/fairy/share/lc/ja/exceptions.rb,
lib/fairy/client/input-local-file.rb,
lib/fairy/master/c-basic-group-by.rb,
lib/fairy/master/c-direct-product.rb,
lib/fairy/master/c-merge-group-by.rb,
lib/fairy/node/p-input-local-file.rb,
lib/fairy/client/output-local-file.rb,
lib/fairy/node/p-output-local-file.rb,
lib/fairy/node/p-single-exportable.rb,
lib/fairy/master/c-input-local-file.rb,
lib/fairy/master/c-output-local-file.rb,
lib/fairy/share/port-marshaled-queue.rb,
ext/simple_hash/simple_hash.c

Overview

Copyright © 2007-2010 Rakuten, Inc.

Defined Under Namespace

Modules: CInputtable, CSort, Debug, ERR, HValueGenerator, InputInterface, Interface, OnMemoryQueue, OutputInterface, PDirectProduct, PSingleExportable, PSort, RomaInterface, RomaPutInterface, SimpleHash, Sort, TopNIntoRomaInterface Classes: AbortCreateNode, Atom, BBlock, BScript, Barrier, BaseAPP, BasicGroupBy, BasicMGroupBy, BlockSource, BreakCreateNode, CBarrier, CBasicGroupBy, CBasicMGroupBy, CCat, CDirectProduct, CExec, CFilePlace, CFilter, CFind, CGroupBy, CHere, CIOFilter, CInject, CInput, CInputFile, CInputIota, CInputLocalFile, CInputVArray, CIotaPlace, CJunction, CLocalIOPlace, CMap, CMergeGroupBy, COutput, COutputFile, COutputLocalFile, COutputNull, COutputVArray, CSegJoin, CSegMap, CSegShuffle, CSegSplit, CSegZip, CSelect, CThere, CTherePlace, CVarrayPlace, CWC, Cat, ChunkedFileBufferdQueue, ChunkedPoolQueue, ChunkedSizedPoolQueue, Conf, Controller, DirectProduct, Exec, Export, Fairy, FastTempfile, FileBufferdQueue, FileMarshaledQueue, Filter, FilterChain, Find, GroupBy, Here, IOFilter, Import, Inject, InputFile, InputIota, InputLocalFile, InputVArray, Inspector, JobInterpriter, Junction, Log, Logger, Map, MarshaledQueue, Master, MergeGroupBy, Node, OnMemorySortedQueue, OutputFile, OutputLocalFile, OutputNull, OutputVArray, PBarrierMemoryBuffer, PBasicGroupBy, PBasicMGroupBy, PExec, PFilePlace, PFilter, PFindResult, PGroupBy, PHere, PIOFilter, PIdentity, PInject, PInputFile, PInputIota, PInputLocalFile, PInputVArray, PIotaPlace, PLocalFind, PLocalIOPlace, PLocalInject, PMap, PMergeGroupBy, POutputFile, POutputLocalFile, POutputNull, POutputVArray, PSegJoin, PSegMap, PSegSplit, PSegZip, PSelect, PSingleExportFilter, PSingleExportInput, PTask, PThere, PTherePlace, PVarrayPlace, PWC, PWideInject, PoolDictionary, PoolQueue, Processor, Reference, Scheduler, SegJoin, SegMap, SegShuffle, SegSplit, SegZip, Select, SizedMarshaledQueue, SizedPoolQueue, SizedQueue, SortedQueue, SortedQueue1, Stdout, There, VArray, VFile, WC

Constant Summary collapse

Version =
"0.6.0-001"
CONF_PATH =
[
  "/etc/fairy.conf",
  RbConfig::CONFIG["libdir"]+"/fairy/etc/fairy.conf",
  ENV["FAIRY_HOME"] && ENV["FAIRY_HOME"]+"/etc/fairy.conf", 
  ENV["HOME"]+"/.fairyrc",
  ENV["FAIRY_CONF"]
]
DEFAULT_CONF =
Conf::DefaultConf.new
CONF =

DEFAULT_CONF.THREAD_STACK_SIZE = 1024*100

DEFAULT_CONF
PORT_DEFAULT_KEEP_IDENTITY_CLASSES =
[
  Binding,
  UnboundMethod,
  Method,
  Proc,
  Dir,
  File,
  IO,
  ThreadGroup,
  Thread,
  Data,
#    DeepConnect::Reference
]
PORT_KEEP_IDENTITY_CLASS_SET =
{}
OnMemorySizedQueue =
SizedQueue
OnMemorySizedPoolQueue =
SizedPoolQueue
LC_MESSAGES =
IRB::Locale.new
FilterInterfaces =
[]
URI_REGEXP =
/:\/\//
SPLIT_NO =
CONF.IOTA_SPLIT_NO
BSource =
BScript

Class Method Summary collapse

Class Method Details

.add_port_keep_identity_class(klass) ⇒ Object



40
41
42
# File 'lib/fairy/share/port.rb', line 40

def self.add_port_keep_identity_class(klass)
  PORT_KEEP_IDENTITY_CLASS_SET[klass] = klass
end

.def_fairy_interface(mod) ⇒ Object



196
197
198
# File 'lib/fairy.rb', line 196

def def_fairy_interface(mod)
  ::Fairy::Fairy.instance_eval{include mod}
end

.def_filter(name, opts = {}, &definition) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fairy.rb', line 21

def Fairy::def_filter(name, opts={}, &definition)
  name = name.intern if name.kind_of?(String)
  @USER_LEVEL_FILTERS[name] = definition

  interface_mod = Module.new

  if !opts[:sub]
    interface_mod.module_eval %{
      def #{name}(*args)
 p = ::Fairy::user_level_filter(:#{name})
 ::Fairy::ERR.Raise ::Fairy::ERR::INTERNAL::NoSuchDefiledUserLevelFilter, name unless p
 p.call(@fairy, self, *args)			     
      end
    }
  else
    interface_mod.module_eval %{
      def #{name}(*args)
 p = ::Fairy::user_level_filter(:#{name})
 ::Fairy::ERR.Raise ::Fairy::ERR::INTERNAL::NoSuchDefiledUserLevelFilter, name unless p
	  sub{|subf, input| p.call(subf, input, *args)}			     
      end
    }
  end
Fairy.def_filter_interface interface_mod
end

.def_filter_interface(mod) ⇒ Object



10
11
12
13
# File 'lib/fairy/client/filter.rb', line 10

def self.def_filter_interface(mod)
  FilterInterfaces.push mod
  Filter.instance_eval{include mod}
end

.def_post_initialize(&block) ⇒ Object



20
21
22
# File 'lib/fairy/client/filter.rb', line 20

def self.def_post_initialize(&block)
  @PostInitializers.push block
end

.post_initializeObject



24
25
26
# File 'lib/fairy/client/filter.rb', line 24

def self.post_initialize
  @PostInitializers.each{|proc| proc.call}
end

.REPLACE_CONF(conf) ⇒ Object



380
381
382
383
# File 'lib/fairy/share/conf.rb', line 380

def REPLACE_CONF(conf)
  remove_const(:CONF)
  const_set(:CONF, conf)
end

.user_level_filter(name) ⇒ Object



47
48
49
# File 'lib/fairy.rb', line 47

def Fairy::user_level_filter(name)
  @USER_LEVEL_FILTERS[name]
end