publish
Publisher API.
Publisher ¶
Publisher(publisher_id, url=None, replay_id=None)
Publish timeseries data to Arrakis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
publisher_id
|
str
|
Publisher ID string. |
required |
url
|
str | None
|
Initial Flight URL to connect to. Will be automatically determined if not specified. |
None
|
replay_id
|
str | None
|
If set, publish under this replay context. Channels will be written to replay-namespaced topics. |
None
|
Source code in arrakis/publish.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
close ¶
close()
Exit publication context manager.
Source code in arrakis/publish.py
334 335 336 337 338 | |
enter ¶
enter()
Enter publication context manager
Source code in arrakis/publish.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
publish ¶
publish(block, timeout=constants.DEFAULT_TIMEOUT)
Publish timeseries data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
SeriesBlock
|
A data block with all channels to publish. |
required |
timeout
|
timedelta
|
The maximum time to wait to publish before timing out. Default is 2 seconds. |
DEFAULT_TIMEOUT
|
Source code in arrakis/publish.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | |
register ¶
register(channels=None)
register channels for publication
For most publishers, channels are not specified when registering and this method will query the server for the allowable channels for this publisher and register them internally.
For publishers allowed to register their own channels
("dynamic" publishers), all channels they expect to publish
should be provided as argument. Any channel that is new, or
whose core metadata (sample rate or data type) has changed
relative to the server's current registration for this
publisher, will be partitioned dynamically via the server,
which will respond with the required Kafka partition
information. If the server does not permit dynamic
partitioning for this publisher, a
:class:pyarrow.flight.FlightUnauthorizedError is raised
with a server-provided explanatory message.
Source code in arrakis/publish.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
serialize_batch ¶
serialize_batch(batch)
Serialize a record batch to bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
batch
|
RecordBatch
|
The batch to serialize. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
The serialized buffer. |
Source code in arrakis/publish.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |