flight
Arrow Flight utilities.
MultiEndpointStream
MultiEndpointStream(endpoints, initial_client)
Bases: AbstractContextManager
Multi-threaded Arrow Flight endpoint stream iterator context manager
Given a list of endpoints, connect to all of them in parallel and stream data from them all interleaved.
Source code in arrakis/flight.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
__iter__
__iter__(timeout=constants.DEFAULT_QUEUE_TIMEOUT)
Execute the streams and yield the results
Yielded results are a tuple of the data chunk, and the endpoint it came from.
The timeout is expected to be a timedelta object.
Source code in arrakis/flight.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
close
close()
close all streams
Source code in arrakis/flight.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
unpack
unpack()
Unpack stream data into individual elements
Source code in arrakis/flight.py
211 212 213 214 |
|
create_command
create_command(request_type, **kwargs)
Create a Flight command containing a JSON-encoded request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_type
|
RequestType
|
The type of request. |
required |
**kwargs
|
dict
|
Extra arguments corresponding to the specific request. |
{}
|
Returns:
Type | Description |
---|---|
bytes
|
The JSON-encoded request. |
Source code in arrakis/flight.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
create_descriptor
create_descriptor(request_type, **kwargs)
Create a Flight descriptor given a request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_type
|
RequestType
|
The type of request. |
required |
**kwargs
|
dict
|
Extra arguments corresponding to the specific request. |
{}
|
Returns:
Type | Description |
---|---|
FlightDescriptor
|
A Flight Descriptor containing the request. |
Source code in arrakis/flight.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
parse_command
parse_command(cmd)
Parse a Flight command into a request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cmd
|
bytes
|
The JSON-encoded request. |
required |
Returns:
Name | Type | Description |
---|---|---|
request_type |
RequestType
|
The type of request. |
kwargs |
dict
|
Arguments corresponding to the specific request. |
Source code in arrakis/flight.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|