slayer-thrift 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/InstalledFiles +1 -0
- data/Makefile +512 -0
- data/Makefile.am +49 -0
- data/Makefile.in +512 -0
- data/Manifest +103 -0
- data/README +43 -0
- data/Rakefile +102 -0
- data/benchmark/Benchmark.thrift +24 -0
- data/benchmark/benchmark.rb +271 -0
- data/benchmark/client.rb +74 -0
- data/benchmark/gen-rb/benchmark_constants.rb +10 -0
- data/benchmark/gen-rb/benchmark_service.rb +80 -0
- data/benchmark/gen-rb/benchmark_types.rb +9 -0
- data/benchmark/server.rb +82 -0
- data/benchmark/thin_server.rb +44 -0
- data/debug_proto_test/gen-rb/debug_proto_test_constants.rb +273 -0
- data/debug_proto_test/gen-rb/debug_proto_test_types.rb +705 -0
- data/debug_proto_test/gen-rb/empty_service.rb +24 -0
- data/debug_proto_test/gen-rb/inherited.rb +79 -0
- data/debug_proto_test/gen-rb/reverse_order_service.rb +82 -0
- data/debug_proto_test/gen-rb/service_for_exception_with_a_map.rb +81 -0
- data/debug_proto_test/gen-rb/srv.rb +330 -0
- data/ext/binary_protocol_accelerated.c +441 -0
- data/ext/binary_protocol_accelerated.h +20 -0
- data/ext/compact_protocol.c +618 -0
- data/ext/compact_protocol.h +20 -0
- data/ext/constants.h +96 -0
- data/ext/extconf.rb +30 -0
- data/ext/macros.h +41 -0
- data/ext/memory_buffer.c +131 -0
- data/ext/memory_buffer.h +20 -0
- data/ext/protocol.c +185 -0
- data/ext/protocol.h +20 -0
- data/ext/struct.c +716 -0
- data/ext/struct.h +25 -0
- data/ext/thrift_native.c +196 -0
- data/lib/thrift.rb +64 -0
- data/lib/thrift/client.rb +62 -0
- data/lib/thrift/core_ext.rb +23 -0
- data/lib/thrift/core_ext/fixnum.rb +29 -0
- data/lib/thrift/exceptions.rb +84 -0
- data/lib/thrift/processor.rb +57 -0
- data/lib/thrift/protocol/base_protocol.rb +290 -0
- data/lib/thrift/protocol/binary_protocol.rb +229 -0
- data/lib/thrift/protocol/binary_protocol_accelerated.rb +39 -0
- data/lib/thrift/protocol/compact_protocol.rb +426 -0
- data/lib/thrift/serializer/deserializer.rb +33 -0
- data/lib/thrift/serializer/serializer.rb +34 -0
- data/lib/thrift/server/base_server.rb +31 -0
- data/lib/thrift/server/mongrel_http_server.rb +58 -0
- data/lib/thrift/server/nonblocking_server.rb +305 -0
- data/lib/thrift/server/simple_server.rb +43 -0
- data/lib/thrift/server/thread_pool_server.rb +75 -0
- data/lib/thrift/server/threaded_server.rb +47 -0
- data/lib/thrift/struct.rb +237 -0
- data/lib/thrift/struct_union.rb +192 -0
- data/lib/thrift/thrift_native.rb +24 -0
- data/lib/thrift/transport/base_server_transport.rb +37 -0
- data/lib/thrift/transport/base_transport.rb +107 -0
- data/lib/thrift/transport/buffered_transport.rb +108 -0
- data/lib/thrift/transport/framed_transport.rb +116 -0
- data/lib/thrift/transport/http_client_transport.rb +51 -0
- data/lib/thrift/transport/io_stream_transport.rb +39 -0
- data/lib/thrift/transport/memory_buffer_transport.rb +125 -0
- data/lib/thrift/transport/server_socket.rb +63 -0
- data/lib/thrift/transport/socket.rb +137 -0
- data/lib/thrift/transport/unix_server_socket.rb +60 -0
- data/lib/thrift/transport/unix_socket.rb +40 -0
- data/lib/thrift/types.rb +101 -0
- data/lib/thrift/union.rb +179 -0
- data/script/proto_benchmark.rb +121 -0
- data/script/read_struct.rb +43 -0
- data/script/write_struct.rb +30 -0
- data/setup.rb +1585 -0
- data/slayer-thrift.gemspec +30 -0
- data/spec/ThriftSpec.thrift +132 -0
- data/spec/base_protocol_spec.rb +160 -0
- data/spec/base_transport_spec.rb +351 -0
- data/spec/binary_protocol_accelerated_spec.rb +46 -0
- data/spec/binary_protocol_spec.rb +61 -0
- data/spec/binary_protocol_spec_shared.rb +375 -0
- data/spec/client_spec.rb +100 -0
- data/spec/compact_protocol_spec.rb +133 -0
- data/spec/exception_spec.rb +142 -0
- data/spec/gen-rb/nonblocking_service.rb +272 -0
- data/spec/gen-rb/thrift_spec_constants.rb +10 -0
- data/spec/gen-rb/thrift_spec_types.rb +345 -0
- data/spec/http_client_spec.rb +64 -0
- data/spec/mongrel_http_server_spec.rb +117 -0
- data/spec/nonblocking_server_spec.rb +265 -0
- data/spec/processor_spec.rb +83 -0
- data/spec/serializer_spec.rb +69 -0
- data/spec/server_socket_spec.rb +80 -0
- data/spec/server_spec.rb +160 -0
- data/spec/socket_spec.rb +61 -0
- data/spec/socket_spec_shared.rb +104 -0
- data/spec/spec_helper.rb +58 -0
- data/spec/struct_spec.rb +295 -0
- data/spec/types_spec.rb +116 -0
- data/spec/union_spec.rb +193 -0
- data/spec/unix_socket_spec.rb +108 -0
- data/thrift.gemspec +30 -0
- data/tmp/thrift-0.7.0.gem +0 -0
- metadata +207 -0
data/benchmark/client.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
21
|
+
require 'thrift'
|
22
|
+
$:.unshift File.dirname(__FILE__) + "/gen-rb"
|
23
|
+
require 'benchmark_service'
|
24
|
+
|
25
|
+
class Client
|
26
|
+
def initialize(host, port, clients_per_process, calls_per_client, log_exceptions)
|
27
|
+
@host = host
|
28
|
+
@port = port
|
29
|
+
@clients_per_process = clients_per_process
|
30
|
+
@calls_per_client = calls_per_client
|
31
|
+
@log_exceptions = log_exceptions
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
@clients_per_process.times do
|
36
|
+
socket = Thrift::Socket.new(@host, @port)
|
37
|
+
transport = Thrift::FramedTransport.new(socket)
|
38
|
+
protocol = Thrift::BinaryProtocol.new(transport)
|
39
|
+
client = ThriftBenchmark::BenchmarkService::Client.new(protocol)
|
40
|
+
begin
|
41
|
+
start = Time.now
|
42
|
+
transport.open
|
43
|
+
Marshal.dump [:start, start], STDOUT
|
44
|
+
rescue => e
|
45
|
+
Marshal.dump [:connection_failure, Time.now], STDOUT
|
46
|
+
print_exception e if @log_exceptions
|
47
|
+
else
|
48
|
+
begin
|
49
|
+
@calls_per_client.times do
|
50
|
+
Marshal.dump [:call_start, Time.now], STDOUT
|
51
|
+
client.fibonacci(15)
|
52
|
+
Marshal.dump [:call_end, Time.now], STDOUT
|
53
|
+
end
|
54
|
+
transport.close
|
55
|
+
Marshal.dump [:end, Time.now], STDOUT
|
56
|
+
rescue Thrift::TransportException => e
|
57
|
+
Marshal.dump [:connection_error, Time.now], STDOUT
|
58
|
+
print_exception e if @log_exceptions
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def print_exception(e)
|
65
|
+
STDERR.puts "ERROR: #{e.message}"
|
66
|
+
STDERR.puts "\t#{e.backtrace * "\n\t"}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
log_exceptions = true if ARGV[0] == '-log-exceptions' and ARGV.shift
|
71
|
+
|
72
|
+
host, port, clients_per_process, calls_per_client = ARGV
|
73
|
+
|
74
|
+
Client.new(host, port.to_i, clients_per_process.to_i, calls_per_client.to_i, log_exceptions).run
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (0.7.0)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'benchmark_types'
|
9
|
+
|
10
|
+
module ThriftBenchmark
|
11
|
+
module BenchmarkService
|
12
|
+
class Client
|
13
|
+
include ::Thrift::Client
|
14
|
+
|
15
|
+
def fibonacci(n)
|
16
|
+
send_fibonacci(n)
|
17
|
+
return recv_fibonacci()
|
18
|
+
end
|
19
|
+
|
20
|
+
def send_fibonacci(n)
|
21
|
+
send_message('fibonacci', Fibonacci_args, :n => n)
|
22
|
+
end
|
23
|
+
|
24
|
+
def recv_fibonacci()
|
25
|
+
result = receive_message(Fibonacci_result)
|
26
|
+
return result.success unless result.success.nil?
|
27
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fibonacci failed: unknown result')
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
class Processor
|
33
|
+
include ::Thrift::Processor
|
34
|
+
|
35
|
+
def process_fibonacci(seqid, iprot, oprot)
|
36
|
+
args = read_args(iprot, Fibonacci_args)
|
37
|
+
result = Fibonacci_result.new()
|
38
|
+
result.success = @handler.fibonacci(args.n)
|
39
|
+
write_result(result, oprot, 'fibonacci', seqid)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
45
|
+
|
46
|
+
class Fibonacci_args
|
47
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
48
|
+
N = 1
|
49
|
+
|
50
|
+
FIELDS = {
|
51
|
+
N => {:type => ::Thrift::Types::BYTE, :name => 'n'}
|
52
|
+
}
|
53
|
+
|
54
|
+
def struct_fields; FIELDS; end
|
55
|
+
|
56
|
+
def validate
|
57
|
+
end
|
58
|
+
|
59
|
+
::Thrift::Struct.generate_accessors self
|
60
|
+
end
|
61
|
+
|
62
|
+
class Fibonacci_result
|
63
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
64
|
+
SUCCESS = 0
|
65
|
+
|
66
|
+
FIELDS = {
|
67
|
+
SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
|
68
|
+
}
|
69
|
+
|
70
|
+
def struct_fields; FIELDS; end
|
71
|
+
|
72
|
+
def validate
|
73
|
+
end
|
74
|
+
|
75
|
+
::Thrift::Struct.generate_accessors self
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
data/benchmark/server.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
21
|
+
require 'thrift'
|
22
|
+
$:.unshift File.dirname(__FILE__) + "/gen-rb"
|
23
|
+
require 'benchmark_service'
|
24
|
+
|
25
|
+
module Server
|
26
|
+
include Thrift
|
27
|
+
|
28
|
+
class BenchmarkHandler
|
29
|
+
# 1-based index into the fibonacci sequence
|
30
|
+
def fibonacci(n)
|
31
|
+
seq = [1, 1]
|
32
|
+
3.upto(n) do
|
33
|
+
seq << seq[-1] + seq[-2]
|
34
|
+
end
|
35
|
+
seq[n-1] # n is 1-based
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.start_server(host, port, serverClass)
|
40
|
+
handler = BenchmarkHandler.new
|
41
|
+
processor = ThriftBenchmark::BenchmarkService::Processor.new(handler)
|
42
|
+
transport = ServerSocket.new(host, port)
|
43
|
+
transport_factory = FramedTransportFactory.new
|
44
|
+
args = [processor, transport, transport_factory, nil, 20]
|
45
|
+
if serverClass == NonblockingServer
|
46
|
+
logger = Logger.new(STDERR)
|
47
|
+
logger.level = Logger::WARN
|
48
|
+
args << logger
|
49
|
+
end
|
50
|
+
server = serverClass.new(*args)
|
51
|
+
@server_thread = Thread.new do
|
52
|
+
server.serve
|
53
|
+
end
|
54
|
+
@server = server
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.shutdown
|
58
|
+
return if @server.nil?
|
59
|
+
if @server.respond_to? :shutdown
|
60
|
+
@server.shutdown
|
61
|
+
else
|
62
|
+
@server_thread.kill
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def resolve_const(const)
|
68
|
+
const and const.split('::').inject(Object) { |k,c| k.const_get(c) }
|
69
|
+
end
|
70
|
+
|
71
|
+
host, port, serverklass = ARGV
|
72
|
+
|
73
|
+
Server.start_server(host, port.to_i, resolve_const(serverklass))
|
74
|
+
|
75
|
+
# let our host know that the interpreter has started
|
76
|
+
# ideally we'd wait until the server was serving, but we don't have a hook for that
|
77
|
+
Marshal.dump(:started, STDOUT)
|
78
|
+
STDOUT.flush
|
79
|
+
|
80
|
+
Marshal.load(STDIN) # wait until we're instructed to shut down
|
81
|
+
|
82
|
+
Server.shutdown
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
21
|
+
require 'thrift'
|
22
|
+
$:.unshift File.dirname(__FILE__) + "/gen-rb"
|
23
|
+
require 'benchmark_service'
|
24
|
+
HOST = 'localhost'
|
25
|
+
PORT = 42587
|
26
|
+
|
27
|
+
class BenchmarkHandler
|
28
|
+
# 1-based index into the fibonacci sequence
|
29
|
+
def fibonacci(n)
|
30
|
+
seq = [1, 1]
|
31
|
+
3.upto(n) do
|
32
|
+
seq << seq[-1] + seq[-2]
|
33
|
+
end
|
34
|
+
seq[n-1] # n is 1-based
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
handler = BenchmarkHandler.new
|
39
|
+
processor = ThriftBenchmark::BenchmarkService::Processor.new(handler)
|
40
|
+
transport = Thrift::ServerSocket.new(HOST, PORT)
|
41
|
+
transport_factory = Thrift::FramedTransportFactory.new
|
42
|
+
logger = Logger.new(STDERR)
|
43
|
+
logger.level = Logger::WARN
|
44
|
+
Thrift::NonblockingServer.new(processor, transport, transport_factory, nil, 20, logger).serve
|
@@ -0,0 +1,273 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (0.7.0)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'debug_proto_test_types'
|
8
|
+
|
9
|
+
COMPACT_TEST = CompactProtoTestStruct.new({
|
10
|
+
%q"a_byte" => 127,
|
11
|
+
%q"a_i16" => 32000,
|
12
|
+
%q"a_i32" => 1000000000,
|
13
|
+
%q"a_i64" => 1099511627775,
|
14
|
+
%q"a_double" => 5.6789,
|
15
|
+
%q"a_string" => %q"my string",
|
16
|
+
%q"true_field" => true,
|
17
|
+
%q"false_field" => false,
|
18
|
+
%q"empty_struct_field" => Empty.new({
|
19
|
+
}),
|
20
|
+
%q"byte_list" => [
|
21
|
+
-127,
|
22
|
+
-1,
|
23
|
+
0,
|
24
|
+
1,
|
25
|
+
127,
|
26
|
+
],
|
27
|
+
%q"i16_list" => [
|
28
|
+
-1,
|
29
|
+
0,
|
30
|
+
1,
|
31
|
+
32767,
|
32
|
+
],
|
33
|
+
%q"i32_list" => [
|
34
|
+
-1,
|
35
|
+
0,
|
36
|
+
255,
|
37
|
+
65535,
|
38
|
+
16777215,
|
39
|
+
2147483647,
|
40
|
+
],
|
41
|
+
%q"i64_list" => [
|
42
|
+
-1,
|
43
|
+
0,
|
44
|
+
255,
|
45
|
+
65535,
|
46
|
+
16777215,
|
47
|
+
4294967295,
|
48
|
+
1099511627775,
|
49
|
+
281474976710655,
|
50
|
+
72057594037927935,
|
51
|
+
9223372036854775807,
|
52
|
+
],
|
53
|
+
%q"double_list" => [
|
54
|
+
0.1,
|
55
|
+
0.2,
|
56
|
+
0.3,
|
57
|
+
],
|
58
|
+
%q"string_list" => [
|
59
|
+
%q"first",
|
60
|
+
%q"second",
|
61
|
+
%q"third",
|
62
|
+
],
|
63
|
+
%q"boolean_list" => [
|
64
|
+
true,
|
65
|
+
true,
|
66
|
+
true,
|
67
|
+
false,
|
68
|
+
false,
|
69
|
+
false,
|
70
|
+
],
|
71
|
+
%q"struct_list" => [
|
72
|
+
Empty.new({
|
73
|
+
}),
|
74
|
+
Empty.new({
|
75
|
+
}),
|
76
|
+
],
|
77
|
+
%q"byte_set" => Set.new([
|
78
|
+
-127,
|
79
|
+
-1,
|
80
|
+
0,
|
81
|
+
1,
|
82
|
+
127,
|
83
|
+
]),
|
84
|
+
%q"i16_set" => Set.new([
|
85
|
+
-1,
|
86
|
+
0,
|
87
|
+
1,
|
88
|
+
32767,
|
89
|
+
]),
|
90
|
+
%q"i32_set" => Set.new([
|
91
|
+
1,
|
92
|
+
2,
|
93
|
+
3,
|
94
|
+
]),
|
95
|
+
%q"i64_set" => Set.new([
|
96
|
+
-1,
|
97
|
+
0,
|
98
|
+
255,
|
99
|
+
65535,
|
100
|
+
16777215,
|
101
|
+
4294967295,
|
102
|
+
1099511627775,
|
103
|
+
281474976710655,
|
104
|
+
72057594037927935,
|
105
|
+
9223372036854775807,
|
106
|
+
]),
|
107
|
+
%q"double_set" => Set.new([
|
108
|
+
0.1,
|
109
|
+
0.2,
|
110
|
+
0.3,
|
111
|
+
]),
|
112
|
+
%q"string_set" => Set.new([
|
113
|
+
%q"first",
|
114
|
+
%q"second",
|
115
|
+
%q"third",
|
116
|
+
]),
|
117
|
+
%q"boolean_set" => Set.new([
|
118
|
+
true,
|
119
|
+
false,
|
120
|
+
]),
|
121
|
+
%q"struct_set" => Set.new([
|
122
|
+
Empty.new({
|
123
|
+
}),
|
124
|
+
]),
|
125
|
+
%q"byte_byte_map" => {
|
126
|
+
1 => 2,
|
127
|
+
},
|
128
|
+
%q"i16_byte_map" => {
|
129
|
+
1 => 1,
|
130
|
+
-1 => 1,
|
131
|
+
32767 => 1,
|
132
|
+
},
|
133
|
+
%q"i32_byte_map" => {
|
134
|
+
1 => 1,
|
135
|
+
-1 => 1,
|
136
|
+
2147483647 => 1,
|
137
|
+
},
|
138
|
+
%q"i64_byte_map" => {
|
139
|
+
0 => 1,
|
140
|
+
1 => 1,
|
141
|
+
-1 => 1,
|
142
|
+
9223372036854775807 => 1,
|
143
|
+
},
|
144
|
+
%q"double_byte_map" => {
|
145
|
+
-1.1 => 1,
|
146
|
+
1.1 => 1,
|
147
|
+
},
|
148
|
+
%q"string_byte_map" => {
|
149
|
+
%q"first" => 1,
|
150
|
+
%q"second" => 2,
|
151
|
+
%q"third" => 3,
|
152
|
+
%q"" => 0,
|
153
|
+
},
|
154
|
+
%q"boolean_byte_map" => {
|
155
|
+
true => 1,
|
156
|
+
false => 0,
|
157
|
+
},
|
158
|
+
%q"byte_i16_map" => {
|
159
|
+
1 => 1,
|
160
|
+
2 => -1,
|
161
|
+
3 => 32767,
|
162
|
+
},
|
163
|
+
%q"byte_i32_map" => {
|
164
|
+
1 => 1,
|
165
|
+
2 => -1,
|
166
|
+
3 => 2147483647,
|
167
|
+
},
|
168
|
+
%q"byte_i64_map" => {
|
169
|
+
1 => 1,
|
170
|
+
2 => -1,
|
171
|
+
3 => 9223372036854775807,
|
172
|
+
},
|
173
|
+
%q"byte_double_map" => {
|
174
|
+
1 => 0.1,
|
175
|
+
2 => -0.1,
|
176
|
+
3 => 1e+06,
|
177
|
+
},
|
178
|
+
%q"byte_string_map" => {
|
179
|
+
1 => %q"",
|
180
|
+
2 => %q"blah",
|
181
|
+
3 => %q"loooooooooooooong string",
|
182
|
+
},
|
183
|
+
%q"byte_boolean_map" => {
|
184
|
+
1 => true,
|
185
|
+
2 => false,
|
186
|
+
},
|
187
|
+
%q"list_byte_map" => {
|
188
|
+
[
|
189
|
+
1,
|
190
|
+
2,
|
191
|
+
3,
|
192
|
+
] => 1,
|
193
|
+
[
|
194
|
+
0,
|
195
|
+
1,
|
196
|
+
] => 2,
|
197
|
+
[
|
198
|
+
] => 0,
|
199
|
+
},
|
200
|
+
%q"set_byte_map" => {
|
201
|
+
Set.new([
|
202
|
+
1,
|
203
|
+
2,
|
204
|
+
3,
|
205
|
+
]) => 1,
|
206
|
+
Set.new([
|
207
|
+
0,
|
208
|
+
1,
|
209
|
+
]) => 2,
|
210
|
+
Set.new([
|
211
|
+
]) => 0,
|
212
|
+
},
|
213
|
+
%q"map_byte_map" => {
|
214
|
+
{
|
215
|
+
1 => 1,
|
216
|
+
} => 1,
|
217
|
+
{
|
218
|
+
2 => 2,
|
219
|
+
} => 2,
|
220
|
+
{
|
221
|
+
} => 0,
|
222
|
+
},
|
223
|
+
%q"byte_map_map" => {
|
224
|
+
0 => {
|
225
|
+
},
|
226
|
+
1 => {
|
227
|
+
1 => 1,
|
228
|
+
},
|
229
|
+
2 => {
|
230
|
+
1 => 1,
|
231
|
+
2 => 2,
|
232
|
+
},
|
233
|
+
},
|
234
|
+
%q"byte_set_map" => {
|
235
|
+
0 => Set.new([
|
236
|
+
]),
|
237
|
+
1 => Set.new([
|
238
|
+
1,
|
239
|
+
]),
|
240
|
+
2 => Set.new([
|
241
|
+
1,
|
242
|
+
2,
|
243
|
+
]),
|
244
|
+
},
|
245
|
+
%q"byte_list_map" => {
|
246
|
+
0 => [
|
247
|
+
],
|
248
|
+
1 => [
|
249
|
+
1,
|
250
|
+
],
|
251
|
+
2 => [
|
252
|
+
1,
|
253
|
+
2,
|
254
|
+
],
|
255
|
+
},
|
256
|
+
})
|
257
|
+
|
258
|
+
MYCONST = 2
|
259
|
+
|
260
|
+
MY_SOME_ENUM = 1
|
261
|
+
|
262
|
+
MY_SOME_ENUM_1 = 1
|
263
|
+
|
264
|
+
MY_ENUM_MAP = {
|
265
|
+
1 => 2,
|
266
|
+
}
|
267
|
+
|
268
|
+
EXTRA_CRAZY_MAP = {
|
269
|
+
1 => StructWithSomeEnum.new({
|
270
|
+
%q"blah" => 2,
|
271
|
+
}),
|
272
|
+
}
|
273
|
+
|