Class: Cascading::BaseTap
- Inherits:
-
Object
- Object
- Cascading::BaseTap
- Defined in:
- lib/cascading/tap.rb
Overview
A BaseTap wraps up a pair of Cascading taps, one for Cascading local mode and the other for Hadoop mode. Note that these are optional, but at least one must be provided for most taps. A SequenceFile is a notable example of a Scheme for which there is no Cascading local mode version, so a Tap you build with it will have no local_tap.
Instance Attribute Summary collapse
-
#hadoop_tap ⇒ Object
readonly
Returns the value of attribute hadoop_tap.
-
#local_tap ⇒ Object
readonly
Returns the value of attribute local_tap.
Instance Method Summary collapse
-
#hadoop? ⇒ Boolean
Returns false if the hadoop_tap is nil, true otherwise.
-
#initialize(local_tap, hadoop_tap) ⇒ BaseTap
constructor
Constructor that accepts the local_tap and hadoop_tap, which may be nil.
-
#local? ⇒ Boolean
Returns false if the local_tap is nil, true otherwise.
-
#to_s ⇒ Object
Passes through printing the local_tap and hadoop_tap.
Constructor Details
#initialize(local_tap, hadoop_tap) ⇒ BaseTap
Constructor that accepts the local_tap and hadoop_tap, which may be nil
11 12 13 14 |
# File 'lib/cascading/tap.rb', line 11 def initialize(local_tap, hadoop_tap) @local_tap = local_tap @hadoop_tap = hadoop_tap end |
Instance Attribute Details
#hadoop_tap ⇒ Object (readonly)
Returns the value of attribute hadoop_tap.
8 9 10 |
# File 'lib/cascading/tap.rb', line 8 def hadoop_tap @hadoop_tap end |
#local_tap ⇒ Object (readonly)
Returns the value of attribute local_tap.
8 9 10 |
# File 'lib/cascading/tap.rb', line 8 def local_tap @local_tap end |
Instance Method Details
#hadoop? ⇒ Boolean
Returns false if the hadoop_tap is nil, true otherwise
27 28 29 |
# File 'lib/cascading/tap.rb', line 27 def hadoop? !hadoop_tap.nil? end |
#local? ⇒ Boolean
Returns false if the local_tap is nil, true otherwise
22 23 24 |
# File 'lib/cascading/tap.rb', line 22 def local? !local_tap.nil? end |
#to_s ⇒ Object
Passes through printing the local_tap and hadoop_tap
17 18 19 |
# File 'lib/cascading/tap.rb', line 17 def to_s "Local: #{local_tap}, Hadoop: #{hadoop_tap}" end |