publish
Publisher API.
Publisher
Publisher(publisher_id, url=None)
Publish timeseries data to Arrakis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Publisher ID string. |
required |
url
|
str | None
|
Initial Flight URL to connect to. Will be automatically determined if not specified. |
None
|
Source code in arrakis/publish.py
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 | |
close
close()
Exit publication context manager.
Source code in arrakis/publish.py
289 290 291 292 293 | |
enter
enter()
Enter publication context manager
Source code in arrakis/publish.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
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
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
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, all channels they expect to publish should be provided as argument, and they will be registered with the server, who will in turn provide the necessarily partition information for the channels to be published into kafka.
Source code in arrakis/publish.py
107 108 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 | |
channel_to_dtype_name
channel_to_dtype_name(channel)
Given a channel, return the data type's name.
Source code in arrakis/publish.py
69 70 71 72 | |
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
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |