impala 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +28 -0
- data/Rakefile +15 -0
- data/impala.gemspec +25 -0
- data/lib/impala.rb +33 -0
- data/lib/impala/connection.rb +93 -0
- data/lib/impala/cursor.rb +86 -0
- data/lib/impala/protocol.rb +6 -0
- data/lib/impala/protocol/beeswax_constants.rb +14 -0
- data/lib/impala/protocol/beeswax_service.rb +747 -0
- data/lib/impala/protocol/beeswax_types.rb +192 -0
- data/lib/impala/protocol/data_constants.rb +12 -0
- data/lib/impala/protocol/data_sinks_constants.rb +12 -0
- data/lib/impala/protocol/data_sinks_types.rb +107 -0
- data/lib/impala/protocol/data_types.rb +77 -0
- data/lib/impala/protocol/descriptors_constants.rb +12 -0
- data/lib/impala/protocol/descriptors_types.rb +266 -0
- data/lib/impala/protocol/exprs_constants.rb +12 -0
- data/lib/impala/protocol/exprs_types.rb +345 -0
- data/lib/impala/protocol/facebook_service.rb +706 -0
- data/lib/impala/protocol/fb303_constants.rb +14 -0
- data/lib/impala/protocol/fb303_types.rb +24 -0
- data/lib/impala/protocol/frontend_constants.rb +12 -0
- data/lib/impala/protocol/frontend_types.rb +347 -0
- data/lib/impala/protocol/hive_metastore_constants.rb +52 -0
- data/lib/impala/protocol/hive_metastore_types.rb +697 -0
- data/lib/impala/protocol/impala_internal_service.rb +244 -0
- data/lib/impala/protocol/impala_internal_service_constants.rb +12 -0
- data/lib/impala/protocol/impala_internal_service_types.rb +362 -0
- data/lib/impala/protocol/impala_plan_service.rb +310 -0
- data/lib/impala/protocol/impala_plan_service_constants.rb +12 -0
- data/lib/impala/protocol/impala_plan_service_types.rb +36 -0
- data/lib/impala/protocol/impala_service.rb +260 -0
- data/lib/impala/protocol/impala_service_constants.rb +12 -0
- data/lib/impala/protocol/impala_service_types.rb +46 -0
- data/lib/impala/protocol/java_constants_constants.rb +42 -0
- data/lib/impala/protocol/java_constants_types.rb +14 -0
- data/lib/impala/protocol/opcodes_constants.rb +12 -0
- data/lib/impala/protocol/opcodes_types.rb +309 -0
- data/lib/impala/protocol/partitions_constants.rb +12 -0
- data/lib/impala/protocol/partitions_types.rb +44 -0
- data/lib/impala/protocol/plan_nodes_constants.rb +12 -0
- data/lib/impala/protocol/plan_nodes_types.rb +345 -0
- data/lib/impala/protocol/planner_constants.rb +12 -0
- data/lib/impala/protocol/planner_types.rb +78 -0
- data/lib/impala/protocol/runtime_profile_constants.rb +12 -0
- data/lib/impala/protocol/runtime_profile_types.rb +97 -0
- data/lib/impala/protocol/state_store_service.rb +244 -0
- data/lib/impala/protocol/state_store_service_constants.rb +12 -0
- data/lib/impala/protocol/state_store_service_types.rb +185 -0
- data/lib/impala/protocol/state_store_subscriber_service.rb +82 -0
- data/lib/impala/protocol/state_store_subscriber_service_constants.rb +12 -0
- data/lib/impala/protocol/state_store_subscriber_service_types.rb +67 -0
- data/lib/impala/protocol/statestore_types_constants.rb +12 -0
- data/lib/impala/protocol/statestore_types_types.rb +77 -0
- data/lib/impala/protocol/status_constants.rb +12 -0
- data/lib/impala/protocol/status_types.rb +44 -0
- data/lib/impala/protocol/thrift_hive_metastore.rb +4707 -0
- data/lib/impala/protocol/types_constants.rb +12 -0
- data/lib/impala/protocol/types_types.rb +86 -0
- data/lib/impala/version.rb +3 -0
- data/thrift/Data.thrift +52 -0
- data/thrift/DataSinks.thrift +61 -0
- data/thrift/Descriptors.thrift +115 -0
- data/thrift/Exprs.thrift +134 -0
- data/thrift/Frontend.thrift +193 -0
- data/thrift/ImpalaInternalService.thrift +265 -0
- data/thrift/ImpalaPlanService.thrift +44 -0
- data/thrift/ImpalaService.thrift +105 -0
- data/thrift/JavaConstants.thrift +60 -0
- data/thrift/Opcodes.thrift +317 -0
- data/thrift/Partitions.thrift +41 -0
- data/thrift/PlanNodes.thrift +184 -0
- data/thrift/Planner.thrift +72 -0
- data/thrift/RuntimeProfile.thrift +58 -0
- data/thrift/StateStoreService.thrift +121 -0
- data/thrift/StateStoreSubscriberService.thrift +64 -0
- data/thrift/StatestoreTypes.thrift +50 -0
- data/thrift/Status.thrift +31 -0
- data/thrift/Types.thrift +71 -0
- data/thrift/beeswax.thrift +175 -0
- data/thrift/fb303.thrift +112 -0
- data/thrift/hive_metastore.thrift +528 -0
- metadata +206 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
// Copyright 2012 Cloudera Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
namespace cpp impala
|
16
|
+
namespace java com.cloudera.impala.thrift
|
17
|
+
namespace rb Impala.Protocol
|
18
|
+
|
19
|
+
include "Exprs.thrift"
|
20
|
+
|
21
|
+
enum TPartitionType {
|
22
|
+
UNPARTITIONED,
|
23
|
+
|
24
|
+
// round-robin partitioning
|
25
|
+
RANDOM,
|
26
|
+
|
27
|
+
// unordered partitioning on a set of exprs
|
28
|
+
HASH_PARTITIONED,
|
29
|
+
|
30
|
+
// ordered partitioning on a list of exprs
|
31
|
+
RANGE_PARTITIONED
|
32
|
+
}
|
33
|
+
|
34
|
+
// Specification of how a single logical data stream is partitioned.
|
35
|
+
// This leaves out the parameters that determine the physical partitioning (for hash
|
36
|
+
// partitioning, the number of partitions; for range partitioning, the partitions'
|
37
|
+
// boundaries), which need to be specified by the enclosing structure/context.
|
38
|
+
struct TDataPartition {
|
39
|
+
1: required TPartitionType type
|
40
|
+
2: optional list<Exprs.TExpr> partitioning_exprs
|
41
|
+
}
|
@@ -0,0 +1,184 @@
|
|
1
|
+
// Copyright 2012 Cloudera Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
//
|
16
|
+
// This file contains all structs, enums, etc., that together make up
|
17
|
+
// a plan tree. All information recorded in struct TPlan and below is independent
|
18
|
+
// of the execution parameters of any one of the backends on which it is running
|
19
|
+
// (those are recorded in TPlanFragmentExecParams).
|
20
|
+
|
21
|
+
namespace cpp impala
|
22
|
+
namespace java com.cloudera.impala.thrift
|
23
|
+
namespace rb Impala.Protocol
|
24
|
+
|
25
|
+
include "Exprs.thrift"
|
26
|
+
include "Types.thrift"
|
27
|
+
|
28
|
+
enum TPlanNodeType {
|
29
|
+
HDFS_SCAN_NODE,
|
30
|
+
HBASE_SCAN_NODE,
|
31
|
+
HASH_JOIN_NODE,
|
32
|
+
AGGREGATION_NODE,
|
33
|
+
SORT_NODE,
|
34
|
+
EXCHANGE_NODE,
|
35
|
+
MERGE_NODE
|
36
|
+
}
|
37
|
+
|
38
|
+
// The information contained in subclasses of ScanNode captured in two separate
|
39
|
+
// Thrift structs:
|
40
|
+
// - TScanRange: the data range that's covered by the scan (which varies with the
|
41
|
+
// particular partition of the plan fragment of which the scan node is a part)
|
42
|
+
// - T<subclass>: all other operational parameters that are the same across
|
43
|
+
// all plan fragments
|
44
|
+
|
45
|
+
// Specification of subsection of a single hdfs file.
|
46
|
+
struct THdfsFileSplit {
|
47
|
+
// file path
|
48
|
+
1: required string path
|
49
|
+
|
50
|
+
// starting offset
|
51
|
+
2: required i64 offset
|
52
|
+
|
53
|
+
// length of split
|
54
|
+
3: required i64 length
|
55
|
+
|
56
|
+
// ID of partition in parent THdfsScanNode. Meaningful only
|
57
|
+
// in the context of a single THdfsScanNode, may not be unique elsewhere.
|
58
|
+
4: required i64 partition_id
|
59
|
+
}
|
60
|
+
|
61
|
+
// key range for single THBaseScanNode
|
62
|
+
// TODO: does 'binary' have an advantage over string? strings can
|
63
|
+
// already store binary data
|
64
|
+
struct THBaseKeyRange {
|
65
|
+
// inclusive
|
66
|
+
1: optional string startKey
|
67
|
+
|
68
|
+
// exclusive
|
69
|
+
2: optional string stopKey
|
70
|
+
}
|
71
|
+
|
72
|
+
// Specification of an individual data range which is held in its entirety
|
73
|
+
// by a storage server
|
74
|
+
struct TScanRange {
|
75
|
+
// one of these must be set for every TScanRange2
|
76
|
+
1: optional THdfsFileSplit hdfs_file_split
|
77
|
+
2: optional THBaseKeyRange hbase_key_range
|
78
|
+
}
|
79
|
+
|
80
|
+
struct THdfsScanNode {
|
81
|
+
1: required Types.TTupleId tuple_id
|
82
|
+
}
|
83
|
+
|
84
|
+
struct THBaseFilter {
|
85
|
+
1: required string family
|
86
|
+
2: required string qualifier
|
87
|
+
// Ordinal number into enum HBase CompareFilter.CompareOp.
|
88
|
+
// We don't use TExprOperator because the op is interpreted by an HBase Filter, and
|
89
|
+
// not the c++ expr eval.
|
90
|
+
3: required i32 op_ordinal
|
91
|
+
4: required string filter_constant
|
92
|
+
}
|
93
|
+
|
94
|
+
struct THBaseScanNode {
|
95
|
+
1: required Types.TTupleId tuple_id
|
96
|
+
|
97
|
+
// TODO: remove this, we already have THBaseTable.tableName
|
98
|
+
2: required string table_name
|
99
|
+
|
100
|
+
3: optional list<THBaseFilter> filters
|
101
|
+
}
|
102
|
+
|
103
|
+
struct TEqJoinCondition {
|
104
|
+
// left-hand side of "<a> = <b>"
|
105
|
+
1: required Exprs.TExpr left;
|
106
|
+
// right-hand side of "<a> = <b>"
|
107
|
+
2: required Exprs.TExpr right;
|
108
|
+
}
|
109
|
+
|
110
|
+
enum TJoinOp {
|
111
|
+
INNER_JOIN,
|
112
|
+
LEFT_OUTER_JOIN,
|
113
|
+
LEFT_SEMI_JOIN,
|
114
|
+
RIGHT_OUTER_JOIN,
|
115
|
+
FULL_OUTER_JOIN
|
116
|
+
}
|
117
|
+
|
118
|
+
struct THashJoinNode {
|
119
|
+
1: required TJoinOp join_op
|
120
|
+
|
121
|
+
// anything from the ON, USING or WHERE clauses that's an equi-join predicate
|
122
|
+
2: required list<TEqJoinCondition> eq_join_conjuncts
|
123
|
+
|
124
|
+
// anything from the ON or USING clauses (but *not* the WHERE clause) that's not an
|
125
|
+
// equi-join predicate
|
126
|
+
3: optional list<Exprs.TExpr> other_join_conjuncts
|
127
|
+
}
|
128
|
+
|
129
|
+
struct TAggregationNode {
|
130
|
+
1: optional list<Exprs.TExpr> grouping_exprs
|
131
|
+
2: required list<Exprs.TExpr> aggregate_exprs
|
132
|
+
3: required Types.TTupleId agg_tuple_id
|
133
|
+
|
134
|
+
// Set to true if this aggregation function requires finalization to complete after all
|
135
|
+
// rows have been aggregated, and this node is not an intermediate node.
|
136
|
+
4: required bool need_finalize
|
137
|
+
}
|
138
|
+
|
139
|
+
struct TSortNode {
|
140
|
+
1: required list<Exprs.TExpr> ordering_exprs
|
141
|
+
2: required list<bool> is_asc_order
|
142
|
+
// Indicates whether the backend service should use topn vs. sorting
|
143
|
+
3: required bool use_top_n;
|
144
|
+
}
|
145
|
+
|
146
|
+
struct TMergeNode {
|
147
|
+
// List or expr lists materialized by this node.
|
148
|
+
// There is one list of exprs per query stmt feeding into this merge node.
|
149
|
+
1: required list<list<Exprs.TExpr>> result_expr_lists
|
150
|
+
// Separate list of expr lists coming from a constant select stmts.
|
151
|
+
2: required list<list<Exprs.TExpr>> const_expr_lists
|
152
|
+
}
|
153
|
+
|
154
|
+
// This is essentially a union of all messages corresponding to subclasses
|
155
|
+
// of PlanNode.
|
156
|
+
struct TPlanNode {
|
157
|
+
// node id, needed to reassemble tree structure
|
158
|
+
1: required Types.TPlanNodeId node_id
|
159
|
+
2: required TPlanNodeType node_type
|
160
|
+
3: required i32 num_children
|
161
|
+
4: required i64 limit
|
162
|
+
5: required list<Types.TTupleId> row_tuples
|
163
|
+
|
164
|
+
// nullable_tuples[i] is true if row_tuples[i] is nullable
|
165
|
+
6: required list<bool> nullable_tuples
|
166
|
+
7: optional list<Exprs.TExpr> conjuncts
|
167
|
+
|
168
|
+
// Produce data in compact format.
|
169
|
+
8: required bool compact_data
|
170
|
+
|
171
|
+
// one field per PlanNode subclass
|
172
|
+
9: optional THdfsScanNode hdfs_scan_node
|
173
|
+
10: optional THBaseScanNode hbase_scan_node
|
174
|
+
11: optional THashJoinNode hash_join_node
|
175
|
+
12: optional TAggregationNode agg_node
|
176
|
+
13: optional TSortNode sort_node
|
177
|
+
14: optional TMergeNode merge_node
|
178
|
+
}
|
179
|
+
|
180
|
+
// A flattened representation of a tree of PlanNodes, obtained by depth-first
|
181
|
+
// traversal.
|
182
|
+
struct TPlan {
|
183
|
+
1: required list<TPlanNode> nodes
|
184
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
// Copyright 2012 Cloudera Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
//
|
16
|
+
// This file contains structures produced by the planner.
|
17
|
+
|
18
|
+
namespace cpp impala
|
19
|
+
namespace java com.cloudera.impala.thrift
|
20
|
+
namespace rb Impala.Protocol
|
21
|
+
|
22
|
+
include "Types.thrift"
|
23
|
+
include "Exprs.thrift"
|
24
|
+
include "DataSinks.thrift"
|
25
|
+
include "PlanNodes.thrift"
|
26
|
+
include "Partitions.thrift"
|
27
|
+
|
28
|
+
// TPlanFragment encapsulates info needed to execute a particular
|
29
|
+
// plan fragment, including how to produce and how to partition its output.
|
30
|
+
// It leaves out node-specific parameters neede for the actual execution.
|
31
|
+
struct TPlanFragment {
|
32
|
+
// no plan or descriptor table: query without From clause
|
33
|
+
2: optional PlanNodes.TPlan plan
|
34
|
+
|
35
|
+
// exprs that produce values for slots of output tuple (one expr per slot);
|
36
|
+
// if not set, plan fragment materializes full rows of plan_tree
|
37
|
+
4: optional list<Exprs.TExpr> output_exprs
|
38
|
+
|
39
|
+
// Specifies the destination of this plan fragment's output rows.
|
40
|
+
// For example, the destination could be a stream sink which forwards
|
41
|
+
// the data to a remote plan fragment, or a sink which writes to a table (for
|
42
|
+
// insert stmts).
|
43
|
+
5: optional DataSinks.TDataSink output_sink
|
44
|
+
|
45
|
+
// Partitioning of the data created by all instances of this plan fragment;
|
46
|
+
// partitioning.type has the following meaning:
|
47
|
+
// - UNPARTITIONED: there is only one instance of the plan fragment
|
48
|
+
// - RANDOM: a particular output row is randomly assigned to any of the instances
|
49
|
+
// - HASH_PARTITIONED: output row r is produced by
|
50
|
+
// hash_value(partitioning.partitioning_exprs(r)) % #partitions
|
51
|
+
// - RANGE_PARTITIONING: currently not supported
|
52
|
+
// This is distinct from the partitioning of each plan fragment's
|
53
|
+
// output, which is specified by output_sink.output_partitioning.
|
54
|
+
6: required Partitions.TDataPartition partition
|
55
|
+
}
|
56
|
+
|
57
|
+
// location information for a single scan range
|
58
|
+
struct TScanRangeLocation {
|
59
|
+
1: required Types.THostPort server
|
60
|
+
|
61
|
+
// disk volume identifier of a particular scan range at 'server';
|
62
|
+
// -1 indicates an unknown volume id;
|
63
|
+
// only set for TScanRange.hdfs_file_split
|
64
|
+
2: optional i32 volume_id = -1
|
65
|
+
}
|
66
|
+
|
67
|
+
// A single scan range plus the hosts that serve it
|
68
|
+
struct TScanRangeLocations {
|
69
|
+
1: required PlanNodes.TScanRange scan_range
|
70
|
+
// non-empty list
|
71
|
+
2: list<TScanRangeLocation> locations
|
72
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
// Copyright 2012 Cloudera Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
namespace cpp impala
|
16
|
+
namespace java com.cloudera.impala.thrift
|
17
|
+
namespace rb Impala.Protocol
|
18
|
+
|
19
|
+
// Counter data types.
|
20
|
+
enum TCounterType {
|
21
|
+
UNIT,
|
22
|
+
UNIT_PER_SECOND,
|
23
|
+
TIME_MS,
|
24
|
+
CPU_TICKS,
|
25
|
+
BYTES
|
26
|
+
BYTES_PER_SECOND,
|
27
|
+
}
|
28
|
+
|
29
|
+
// Counter data
|
30
|
+
struct TCounter {
|
31
|
+
1: required string name
|
32
|
+
2: required TCounterType type
|
33
|
+
3: required i64 value
|
34
|
+
}
|
35
|
+
|
36
|
+
// A single runtime profile
|
37
|
+
struct TRuntimeProfileNode {
|
38
|
+
1: required string name
|
39
|
+
2: required i32 num_children
|
40
|
+
3: required list<TCounter> counters
|
41
|
+
// TODO: should we make metadata a serializable struct? We only use it to
|
42
|
+
// store the node id right now so this is sufficient.
|
43
|
+
4: required i64 metadata
|
44
|
+
|
45
|
+
// indicates whether the child will be printed with extra indentation;
|
46
|
+
// corresponds to indent param of RuntimeProfile::AddChild()
|
47
|
+
5: required bool indent
|
48
|
+
|
49
|
+
// map of key,value info strings that capture any kind of additional information
|
50
|
+
// about the profiled object
|
51
|
+
6: required map<string, string> info_strings
|
52
|
+
}
|
53
|
+
|
54
|
+
// A flattened tree of runtime profiles, obtained by an
|
55
|
+
// in-order traversal
|
56
|
+
struct TRuntimeProfileTree {
|
57
|
+
1: required list<TRuntimeProfileNode> nodes
|
58
|
+
}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
// Copyright 2012 Cloudera Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
namespace cpp impala
|
16
|
+
namespace java com.cloudera.impala.thrift
|
17
|
+
namespace rb Impala.Protocol
|
18
|
+
|
19
|
+
include "StatestoreTypes.thrift"
|
20
|
+
include "Status.thrift"
|
21
|
+
include "Types.thrift"
|
22
|
+
|
23
|
+
enum StateStoreServiceVersion {
|
24
|
+
V1
|
25
|
+
}
|
26
|
+
|
27
|
+
struct TRegisterServiceRequest {
|
28
|
+
1: required StateStoreServiceVersion protocol_version =
|
29
|
+
StateStoreServiceVersion.V1
|
30
|
+
|
31
|
+
// Address where the StateStoreSubscriberService is running. Required in V1.
|
32
|
+
2: optional Types.THostPort subscriber_address
|
33
|
+
|
34
|
+
// Service running on the node. Multiple services can be registered using multiple
|
35
|
+
// RegisterService() calls from the same subscriber. Currently, we assume that at most
|
36
|
+
// one instance of a particular service will be registered with each subscriber.
|
37
|
+
// Required in V1.
|
38
|
+
3: optional string service_id
|
39
|
+
4: optional Types.THostPort service_address
|
40
|
+
}
|
41
|
+
|
42
|
+
struct TRegisterServiceResponse {
|
43
|
+
// Required in V1.
|
44
|
+
1: optional Status.TStatus status
|
45
|
+
}
|
46
|
+
|
47
|
+
struct TUnregisterServiceRequest {
|
48
|
+
1: required StateStoreServiceVersion protocol_version =
|
49
|
+
StateStoreServiceVersion.V1
|
50
|
+
|
51
|
+
// Address of the subscriber. Required in V1.
|
52
|
+
2: optional Types.THostPort subscriber_address
|
53
|
+
|
54
|
+
// Service that should be unregistered. Required in V1.
|
55
|
+
3: optional string service_id
|
56
|
+
}
|
57
|
+
|
58
|
+
struct TUnregisterServiceResponse {
|
59
|
+
// Required in V1.
|
60
|
+
1: optional Status.TStatus status
|
61
|
+
}
|
62
|
+
|
63
|
+
struct TRegisterSubscriptionRequest {
|
64
|
+
1: required StateStoreServiceVersion protocol_version =
|
65
|
+
StateStoreServiceVersion.V1
|
66
|
+
|
67
|
+
// Address where the StateStoreSubscriberService is running. Required in V1.
|
68
|
+
2: optional Types.THostPort subscriber_address
|
69
|
+
|
70
|
+
// Services for which updates should be pushed to the given subscriber. Required in V1.
|
71
|
+
3: optional set<string> services
|
72
|
+
|
73
|
+
// The subscription ID to use for this request. All IDs are local to the
|
74
|
+
// subscriber, so as long as a single subscriber does not reuse IDs there is no
|
75
|
+
// danger of collision.
|
76
|
+
// Required in V1
|
77
|
+
4: optional string subscription_id;
|
78
|
+
}
|
79
|
+
|
80
|
+
struct TRegisterSubscriptionResponse {
|
81
|
+
// Required in V1.
|
82
|
+
1: optional Status.TStatus status
|
83
|
+
}
|
84
|
+
|
85
|
+
struct TUnregisterSubscriptionRequest {
|
86
|
+
1: required StateStoreServiceVersion protocol_version =
|
87
|
+
StateStoreServiceVersion.V1
|
88
|
+
|
89
|
+
// Address of the subscriber. Required in V1.
|
90
|
+
2: optional Types.THostPort subscriber_address
|
91
|
+
|
92
|
+
// Identifier for the subscription that should be unregistered. Required in V1.
|
93
|
+
3: optional string subscription_id
|
94
|
+
}
|
95
|
+
|
96
|
+
struct TUnregisterSubscriptionResponse {
|
97
|
+
// Required in V1.
|
98
|
+
1: optional Status.TStatus status
|
99
|
+
}
|
100
|
+
|
101
|
+
// A repository and distribution mechanism for global system state. Stored state is not
|
102
|
+
// made persistent and is considered soft-state (i.e., it needs to be re-supplied
|
103
|
+
// when a StateStore restarts). Updates to the global state are distributed to
|
104
|
+
// subscribers asynchronously and with an arbitrary (but typically reasonably small)
|
105
|
+
// delay.
|
106
|
+
service StateStoreService {
|
107
|
+
// Registers an instance of a service.
|
108
|
+
TRegisterServiceResponse RegisterService(1: TRegisterServiceRequest request);
|
109
|
+
|
110
|
+
// Unregisters an instance of a service.
|
111
|
+
TUnregisterServiceResponse UnregisterService(1: TUnregisterServiceRequest request);
|
112
|
+
|
113
|
+
// Registers to receive updates for a set of services.
|
114
|
+
TRegisterSubscriptionResponse RegisterSubscription(
|
115
|
+
1: TRegisterSubscriptionRequest request);
|
116
|
+
|
117
|
+
// Unregisters the given subscription. A subscriber will be updated at most one more
|
118
|
+
// time after unregistering.
|
119
|
+
TUnregisterSubscriptionResponse UnregisterSubscription(
|
120
|
+
1: TUnregisterSubscriptionRequest request);
|
121
|
+
}
|