feldera 0.96.0__py3-none-any.whl → 0.98.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of feldera might be problematic. Click here for more details.

feldera/enums.py CHANGED
@@ -36,155 +36,126 @@ class BuildMode(Enum):
36
36
 
37
37
  class PipelineStatus(Enum):
38
38
  """
39
- Represents the state that this pipeline is currently in.
40
-
41
- .. code-block:: text
42
-
43
- Shutdown ◄────┐
44
-
45
- /deploy
46
- ⌛ShuttingDown
47
- ▼ ▲
48
- ⌛Provisioning
49
-
50
- Provisioned │
51
- ▼ │/shutdown
52
- ⌛Initializing │
53
-
54
- ┌────────┴─────────┴─┐
55
-
56
- Paused
57
- │ │ ▲ │
58
- │/start │/pause
59
- │ ▼ │ │
60
- │ Running │
61
- └──────────┬─────────┘
62
-
63
-
64
- Failed
65
- """
66
-
67
- NOT_FOUND = 1
39
+ Represents the state that this pipeline is currently in.
40
+
41
+ .. code-block:: text
42
+
43
+ Stopped ◄─────────── Stopping ◄───── All states can transition
44
+ ▲ to Stopping by either:
45
+ /start or /pause (1) user calling /stop?force=true, or;
46
+ (2) pipeline encountering a fatal
47
+ ⌛Provisioning Suspending resource or runtime error,
48
+ ▲ having the system call /stop?force=true
49
+ /stop effectively
50
+ ⌛Initializing ─────────────┤ ?force=false
51
+ │ │
52
+ ┌─────────┼────────────────────┴─────┐
53
+
54
+ │ Paused ◄──────► Unavailable │
55
+ │ │ ▲ ▲ │
56
+ │ /start │ │ /pause │ │
57
+
58
+ Running ◄─────────────┘
59
+ └────────────────────────────────────┘
60
+ """
61
+
62
+ NOT_FOUND = 0
68
63
  """
69
64
  The pipeline has not been created yet.
70
65
  """
71
66
 
72
- SHUTDOWN = 2
67
+ STOPPED = 1
73
68
  """
74
- Pipeline has not been started or has been shut down.
69
+ The pipeline has not (yet) been started or has been stopped either
70
+ manually by the user or automatically by the system due to a
71
+ resource or runtime error.
75
72
 
76
- The pipeline remains in this state until the user triggers
77
- a deployment by invoking the `/deploy` endpoint.
78
- """
73
+ The pipeline remains in this state until:
79
74
 
80
- PROVISIONING = 3
75
+ 1. The user starts it via `/start` or `/pause`, transitioning to `PROVISIONING`.
76
+ 2. Early start fails (e.g., compilation failure), transitioning to `STOPPING`.
81
77
  """
82
- The runner triggered a deployment of the pipeline and is
83
- waiting for the pipeline HTTP server to come up.
84
-
85
- In this state, the runner provisions a runtime for the pipeline,
86
- starts the pipeline within this runtime and waits for it to start accepting HTTP requests.
87
78
 
88
- The user is unable to communicate with the pipeline during this
89
- time. The pipeline remains in this state until:
79
+ PROVISIONING = 2
80
+ """
81
+ Compute (and optionally storage) resources needed for running the pipeline
82
+ are being provisioned.
90
83
 
91
- 1. Its HTTP server is up and running; the pipeline transitions to the
92
- `PipelineStatus.INITIALIZING` state.
93
- 2. A pre-defined timeout has passed. The runner performs forced
94
- shutdown of the pipeline; returns to the `PipelineStatus.SHUTDOWN` state.
95
- 3. The user cancels the pipeline by invoking the `/shutdown` endpoint.
96
- The manager performs forced shutdown of the pipeline, returns to the
97
- `PipelineStatus.SHUTDOWN` state.
84
+ The pipeline remains in this state until:
98
85
 
86
+ 1. Resources are provisioned successfully, transitioning to `INITIALIZING`.
87
+ 2. Provisioning fails or times out, transitioning to `STOPPING`.
88
+ 3. The user cancels the pipeline via `/stop`, transitioning to `STOPPING`.
99
89
  """
100
90
 
101
- INITIALIZING = 4
91
+ INITIALIZING = 3
102
92
  """
103
93
  The pipeline is initializing its internal state and connectors.
104
94
 
105
- This state is part of the pipeline's deployment process. In this state,
106
- the pipeline's HTTP server is up and running, but its query engine
107
- and input and output connectors are still initializing.
108
-
109
95
  The pipeline remains in this state until:
110
96
 
111
- 1. Initialization completes successfully; the pipeline transitions to the
112
- `PipelineStatus.PAUSED` state.
113
- 2. Initialization fails; transitions to the `PipelineStatus.FAILED` state.
114
- 3. A pre-defined timeout has passed. The runner performs forced
115
- shutdown of the pipeline; returns to the `PipelineStatus.SHUTDOWN` state.
116
- 4. The user cancels the pipeline by invoking the `/shutdown` endpoint.
117
- The manager performs forced shutdown of the pipeline; returns to the
118
- `PipelineStatus.SHUTDOWN` state.
119
-
97
+ 1. Initialization succeeds, transitioning to `PAUSED`.
98
+ 2. Initialization fails or times out, transitioning to `STOPPING`.
99
+ 3. The user suspends the pipeline via `/suspend`, transitioning to `SUSPENDING`.
100
+ 4. The user stops the pipeline via `/stop`, transitioning to `STOPPING`.
120
101
  """
121
102
 
122
- PAUSED = 5
103
+ PAUSED = 4
123
104
  """
124
- The pipeline is fully initialized, but data processing has been paused.
105
+ The pipeline is initialized but data processing is paused.
125
106
 
126
107
  The pipeline remains in this state until:
127
108
 
128
- 1. The user starts the pipeline by invoking the `/start` endpoint. The
129
- manager passes the request to the pipeline; transitions to the
130
- `PipelineStatus.RUNNING` state.
131
- 2. The user cancels the pipeline by invoking the `/shutdown` endpoint.
132
- The manager passes the shutdown request to the pipeline to perform a
133
- graceful shutdown; transitions to the `PipelineStatus.SHUTTING_DOWN` state.
134
- 3. An unexpected runtime error renders the pipeline `PipelineStatus.FAILED`.
135
-
109
+ 1. The user starts it via `/start`, transitioning to `RUNNING`.
110
+ 2. A runtime error occurs, transitioning to `STOPPING`.
111
+ 3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
112
+ 4. The user stops it via `/stop`, transitioning to `STOPPING`.
136
113
  """
137
114
 
138
- RUNNING = 6
115
+ RUNNING = 5
139
116
  """
140
117
  The pipeline is processing data.
141
118
 
142
119
  The pipeline remains in this state until:
143
120
 
144
- 1. The user pauses the pipeline by invoking the `/pause` endpoint. The
145
- manager passes the request to the pipeline; transitions to the
146
- `PipelineStatus.PAUSED` state.
147
- 2. The user cancels the pipeline by invoking the `/shutdown` endpoint.
148
- The runner passes the shutdown request to the pipeline to perform a
149
- graceful shutdown; transitions to the
150
- `PipelineStatus.SHUTTING_DOWN` state.
151
- 3. An unexpected runtime error renders the pipeline
152
- `PipelineStatus.FAILED`.
153
-
121
+ 1. The user pauses it via `/pause`, transitioning to `PAUSED`.
122
+ 2. A runtime error occurs, transitioning to `STOPPING`.
123
+ 3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
124
+ 4. The user stops it via `/stop`, transitioning to `STOPPING`.
154
125
  """
155
126
 
156
- SHUTTING_DOWN = 7
127
+ UNAVAILABLE = 6
157
128
  """
158
- Graceful shutdown in progress.
159
-
160
- In this state, the pipeline finishes any ongoing data processing,
161
- produces final outputs, shuts down input/output connectors and
162
- terminates.
129
+ The pipeline was initialized at least once but is currently unreachable
130
+ or not ready.
163
131
 
164
132
  The pipeline remains in this state until:
165
133
 
166
- 1. Shutdown completes successfully; transitions to the `PipelineStatus.SHUTDOWN` state.
167
- 2. A pre-defined timeout has passed. The manager performs forced shutdown of the pipeline; returns to the
168
- `PipelineStatus.SHUTDOWN` state.
134
+ 1. A successful status check transitions it back to `PAUSED` or `RUNNING`.
135
+ 2. A runtime error occurs, transitioning to `STOPPING`.
136
+ 3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
137
+ 4. The user stops it via `/stop`, transitioning to `STOPPING`.
169
138
 
139
+ Note: While in this state, `/start` or `/pause` express desired state but
140
+ are only applied once the pipeline becomes reachable.
170
141
  """
171
142
 
172
- FAILED = 8
173
- """
174
- The pipeline remains in this state until the users acknowledge the failure
175
- by issuing a call to shutdown the pipeline; transitions to the
176
- `PipelineStatus.SHUTDOWN` state.
143
+ SUSPENDING = 7
177
144
  """
145
+ The pipeline is being suspended to storage.
178
146
 
179
- UNAVAILABLE = 9
180
- """
181
- The pipeline was at least once initialized, but in the most recent status check either
182
- could not be reached or returned it is not yet ready.
147
+ The pipeline remains in this state until:
148
+
149
+ 1. Suspension succeeds, transitioning to `STOPPING`.
150
+ 2. A runtime error occurs, transitioning to `STOPPING`.
183
151
  """
184
152
 
185
- SUSPENDED = 10
153
+ STOPPING = 8
186
154
  """
187
- The pipeline was successfully suspended to storage.
155
+ The pipeline's compute resources are being scaled down to zero.
156
+
157
+ The pipeline remains in this state until deallocation completes,
158
+ transitioning to `STOPPED`.
188
159
  """
189
160
 
190
161
  @staticmethod
@@ -258,3 +229,49 @@ class CheckpointStatus(Enum):
258
229
  """
259
230
 
260
231
  return self.error
232
+
233
+
234
+ class StorageStatus(Enum):
235
+ """
236
+ Represents the current storage usage status of the pipeline.
237
+ """
238
+
239
+ CLEARED = 0
240
+ """
241
+ The pipeline has not been started before, or the user has cleared storage.
242
+
243
+ In this state, the pipeline has no storage resources bound to it.
244
+ """
245
+
246
+ INUSE = 1
247
+ """
248
+ The pipeline was (attempted to be) started before, transitioning from `STOPPED`
249
+ to `PROVISIONING`, which caused the storage status to become `INUSE`.
250
+
251
+ Being in the `INUSE` state restricts certain edits while the pipeline is `STOPPED`.
252
+
253
+ The pipeline remains in this state until the user invokes `/clear`, transitioning
254
+ it to `CLEARING`.
255
+ """
256
+
257
+ CLEARING = 2
258
+ """
259
+ The pipeline is in the process of becoming unbound from its storage resources.
260
+
261
+ If storage resources are configured to be deleted upon clearing, their deletion
262
+ occurs before transitioning to `CLEARED`. Otherwise, no actual work is required,
263
+ and the transition happens immediately.
264
+
265
+ If storage is not deleted during clearing, the responsibility to manage or delete
266
+ those resources lies with the user.
267
+ """
268
+
269
+ @staticmethod
270
+ def from_str(value):
271
+ for member in StorageStatus:
272
+ if member.name.lower() == value.lower():
273
+ return member
274
+ raise ValueError(f"Unknown value '{value}' for enum {StorageStatus.__name__}")
275
+
276
+ def __eq__(self, other):
277
+ return self.value == other.value