@@ -12,91 +12,224 @@ package ni.datamonikers.v1;
1212
1313//---------------------------------------------------------------------
1414//---------------------------------------------------------------------
15- option csharp_namespace = "NationalInstruments.DataMonikers" ;
16-
17- // Service for reading and writing data using monikers
15+ option csharp_namespace = "NationalInstruments.DataMonikers.V1" ;
16+ option cc_enable_arenas = true ;
17+ option go_package = "datamonikersv1" ;
18+ option java_multiple_files = true ;
19+ option java_outer_classname = "DataMonikerServiceProto" ;
20+ option java_package = "com.ni.datamonikers.v1" ;
21+ option objc_class_prefix = "NIDM" ;
22+ option php_namespace = "NI\\DataMonikers\\V1" ;
23+ option ruby_package = "NI::DataMonikers::V1" ;
24+
25+ // Service for reading and writing data values using data monikers.
26+ //
27+ // Not all implementations implement all RPCs and clients should
28+ // handle this gracefully.
1829service MonikerService {
30+ // Negotiates a sideband transport for the specified monikers.
31+ //
32+ // Use this RPC when higher throughput or lower latency are required
33+ // beyond what is traditionally possible with the standard gRPC transport.
34+ // The client supplies the preferred strategy and the list of monikers.
35+ // The server responds with the selected strategy plus the connection
36+ // metadata needed to establish the sideband channel. After this call,
37+ // the actual data exchange is expected to happen over the selected
38+ // sideband transport, not over this unary RPC.
1939 rpc BeginSidebandStream (BeginMonikerSidebandStreamRequest ) returns (BeginMonikerSidebandStreamResponse ) {};
40+
41+ // Subscribes to updates from the requested monikers.
42+ //
43+ // A response message is returned once a data value is available from
44+ // each read moniker. The order of data values returned matches the order
45+ // of the read monikers. The semantics for when data is published and how
46+ // updates are triggered is implementation dependent.
47+ //
48+ // Status codes for errors:
49+ //
50+ // - NOT_FOUND: Specified moniker does not exist
2051 rpc StreamRead (MonikerList ) returns (stream MonikerReadResult ) {};
52+
53+ // Streams values to one or more monikers.
54+ //
55+ // The first request message specifies the write monikers that will be updated.
56+ // Subsequent request messages supply new data values to be written to the
57+ // monikers. The number of data values in each request message must match the
58+ // number of monikers supplied in the original request. The data values are
59+ // applied in order and are paired positionally with the monikers declared in
60+ // the first message. Implementations may choose to return a response message
61+ // after each request has been processed for flow control purposes or no
62+ // response message at all.
63+ //
64+ // Status codes for errors:
65+ //
66+ // - NOT_FOUND: Specified moniker does not exist
2167 rpc StreamWrite (stream MonikerWriteRequest ) returns (stream StreamWriteResponse ) {};
68+
69+ // Streams data to and from the specified read and write monikers.
70+ //
71+ // The first request message is used to setup the stream and specifies the
72+ // monikers that are to be read and written. No response message is sent for
73+ // the first request message.
74+ //
75+ // The second and subsequent request messages carry new data values to be written
76+ // to the write monikers similar to the StreamWrite RPC. For each of these request
77+ // message, a response message is returned containing data values from the read
78+ // monikers similar to the StreamRead RPC. Write monikers are always updated before
79+ // data is read from the read monikers.Communication continues in this ping-pong
80+ // fashion until the stream is closed.
81+ //
82+ // Status codes for errors:
83+ //
84+ // - NOT_FOUND: Specified moniker does not exist
2285 rpc StreamReadWrite (stream MonikerWriteRequest ) returns (stream MonikerReadResult ) {};
86+
87+ // Reads the current value for a single moniker.
88+ //
89+ // If no data value is available, implementations may choose to return an empty
90+ // response or return an error.
91+ //
92+ // Status codes for errors:
93+ //
94+ // - NOT_FOUND: Specified moniker does not exist
2395 rpc ReadFromMoniker (Moniker ) returns (ReadFromMonikerResult ) {};
96+
97+ // Writes a single value to a single moniker.
98+ //
99+ // Status codes for errors:
100+ //
101+ // - NOT_FOUND: Specified moniker does not exist
102+ // - INVALID_ARGUMENT: Data type of the data value is not compatible with the moniker
24103 rpc WriteToMoniker (WriteToMonikerRequest ) returns (WriteToMonikerResponse ) {};
25104}
26105
27106enum SidebandStrategy {
107+ // No strategy selected.
28108 UNKNOWN = 0 ;
109+
110+ // Standard gRPC transport.
29111 GRPC = 1 ;
112+
113+ // Shared memory transport. Client and server must be on the same machine.
30114 SHARED_MEMORY = 2 ;
115+
116+ // Same as SHARED_MEMORY except double buffered. This uses more memory but
117+ // allows the client and server to read and write at the same time without
118+ // blocking each other.
31119 DOUBLE_BUFFERED_SHARED_MEMORY = 3 ;
120+
121+ // TCP Socket-based transport.
32122 SOCKETS = 4 ;
123+
124+ // TCP Socket-based transport optimized for lower latency at the expense
125+ // of higher CPU usage.
33126 SOCKETS_LOW_LATENCY = 5 ;
127+
128+ // Hypervisor-assisted socket transport. Not currently implemented.
34129 HYPERVISOR_SOCKETS = 6 ;
130+
131+ // RDMA-based transport. Requires that the network card on both the client
132+ // and the server support RDMA.
35133 RDMA = 7 ;
134+
135+ // RDMA transport optimized for lower latency at the expense of higher
136+ // CPU usage.
36137 RDMA_LOW_LATENCY = 8 ;
37138}
38139
39- // Moniker is a unique identifier for a data source.
140+ // Identifier used to represent a data source from which data values can
141+ // be read or written.
40142message Moniker {
143+ // Service location or endpoint identifier.
41144 string service_location = 1 ;
145+
146+ // Logical data source name.
42147 string data_source = 2 ;
148+
149+ // Specific instance identifier within the data source.
43150 int64 data_instance = 3 ;
44151}
45152
153+ // Message which contains a batch of data values.
154+ //
155+ // For reads, values contains the returned data values for one or more
156+ // data monikers. For writes, values contains the data values to be
157+ // applied to one or more data monikers.
46158message MonikerValues {
159+ // Data values carried as protobuf Any messages.
47160 repeated google.protobuf.Any values = 1 ;
48161}
49162
163+ // Message which identifies the set of read and write monikers for a
164+ // particular operation.
50165message MonikerList {
51- bool is_initial_write = 1 ;
166+ // Deprecated. Preserved for backward compatibility.
167+ bool is_initial_write = 1 [deprecated = true ];
168+
169+ // Monikers from which to read.
52170 repeated Moniker read_monikers = 2 ;
171+
172+ // Monikers to update with new data values.
53173 repeated Moniker write_monikers = 3 ;
54174}
55175
56176message BeginMonikerSidebandStreamRequest {
177+ // The transport to use for the sideband communication channel.
57178 SidebandStrategy strategy = 1 ;
179+
180+ // Monikers participating in the sideband communication channel.
58181 MonikerList monikers = 2 ;
59182}
60183
61- message BeginMonikerSidebandStreamResponse {
184+ message BeginMonikerSidebandStreamResponse {
185+ // Selected transport used for the the sideband communication channel.
62186 SidebandStrategy strategy = 1 ;
187+
188+ // Transport-specific URL or endpoint used to establish the sideband connection.
63189 string connection_url = 2 ;
190+
191+ // Identifier used to identify communication session within the transport.
64192 string sideband_identifier = 3 ;
193+
194+ // The buffer size in bytes used for the sideband transport.
65195 sint64 buffer_size = 4 ;
66196}
67197
198+ // Request message used to perform streaming writes.
68199message MonikerWriteRequest {
69200 oneof write_data {
201+ // Initial handshake message that declares the target monikers.
70202 MonikerList monikers = 1 ;
203+
204+ // Value payload for the established write session.
205+ //
206+ // This field should be set on all subsequent messages after the initial
207+ // handshake message.
71208 MonikerValues data = 2 ;
72209 }
73210}
74211
212+ // Response message used to perform streaming reads.
75213message MonikerReadResult {
214+ // Data values returned from the read monikers.
76215 MonikerValues data = 1 ;
77216}
78217
79- message SidebandWriteRequest {
80- bool cancel = 1 ;
81- MonikerValues values = 2 ;
82- }
83-
84- message SidebandReadResponse {
85- bool cancel = 1 ;
86- MonikerValues values = 2 ;
87- }
88-
89218message StreamWriteResponse {
90219}
91220
92221message ReadFromMonikerResult {
222+ // Data value read from the moniker or empty if no value was available.
93223 google.protobuf.Any value = 1 ;
94224}
95225
96226message WriteToMonikerRequest {
227+ // The data moniker to update.
97228 Moniker moniker = 1 ;
229+
230+ // The data value to write to the moniker.
98231 google.protobuf.Any value = 2 ;
99232}
100233
101234message WriteToMonikerResponse {
102- }
235+ }
0 commit comments