Class: Storm::Grouping

Inherits:
Thrift::Union
  • Object
show all
Includes:
Thrift::Struct_Union
Defined in:
lib/storm/thrift/storm_types.rb

Constant Summary collapse

FIELDS =
{
  FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRING}},
  SHUFFLE => {:type => ::Thrift::Types::STRUCT, :name => 'shuffle', :class => NullStruct},
  ALL => {:type => ::Thrift::Types::STRUCT, :name => 'all', :class => NullStruct},
  NONE => {:type => ::Thrift::Types::STRUCT, :name => 'none', :class => NullStruct},
  DIRECT => {:type => ::Thrift::Types::STRUCT, :name => 'direct', :class => NullStruct},
  CUSTOM_OBJECT => {:type => ::Thrift::Types::STRUCT, :name => 'custom_object', :class => JavaObject},
  CUSTOM_SERIALIZED => {:type => ::Thrift::Types::STRING, :name => 'custom_serialized', :binary => true},
  LOCAL_OR_SHUFFLE => {:type => ::Thrift::Types::STRUCT, :name => 'local_or_shuffle', :class => NullStruct}
}
SHUFFLE =
2
ALL =
3
NONE =
4
DIRECT =
5
CUSTOM_OBJECT =
6
CUSTOM_SERIALIZED =
7
LOCAL_OR_SHUFFLE =
8

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all(val) ⇒ Object



129
130
131
# File 'lib/storm/thrift/storm_types.rb', line 129

def all(val)
  Grouping.new(:all, val)
end

.custom_object(val) ⇒ Object



141
142
143
# File 'lib/storm/thrift/storm_types.rb', line 141

def custom_object(val)
  Grouping.new(:custom_object, val)
end

.custom_serialized(val) ⇒ Object



145
146
147
# File 'lib/storm/thrift/storm_types.rb', line 145

def custom_serialized(val)
  Grouping.new(:custom_serialized, val)
end

.direct(val) ⇒ Object



137
138
139
# File 'lib/storm/thrift/storm_types.rb', line 137

def direct(val)
  Grouping.new(:direct, val)
end

.fields(val) ⇒ Object



121
122
123
# File 'lib/storm/thrift/storm_types.rb', line 121

def fields(val)
  Grouping.new(:fields, val)
end

.local_or_shuffle(val) ⇒ Object



149
150
151
# File 'lib/storm/thrift/storm_types.rb', line 149

def local_or_shuffle(val)
  Grouping.new(:local_or_shuffle, val)
end

.none(val) ⇒ Object



133
134
135
# File 'lib/storm/thrift/storm_types.rb', line 133

def none(val)
  Grouping.new(:none, val)
end

.shuffle(val) ⇒ Object



125
126
127
# File 'lib/storm/thrift/storm_types.rb', line 125

def shuffle(val)
  Grouping.new(:shuffle, val)
end

Instance Method Details

#struct_fieldsObject



174
# File 'lib/storm/thrift/storm_types.rb', line 174

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (StandardError)


176
177
178
# File 'lib/storm/thrift/storm_types.rb', line 176

def validate
  raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?
end