Class Server
-
- All Implemented Interfaces:
public final class ServerConnects this JVM process to the Airflow coordinator and dispatches task execution requests to the registered Bundle.
The typical entry point is:
public static void main(String[] args) { Server.create(args).serve(new MyBundleBuilder().build()); }The process exits when the coordinator closes the connection (normally after one task-instance execution).
-
-
Constructor Summary
Constructors Constructor Description Server(InetSocketAddress comm, InetSocketAddress logs)
-
Method Summary
Modifier and Type Method Description final Unitserve(Bundle bundle)Blocking entry point: connects to the coordinator and serves task-execution requests from the given bundle. final JobserveAsync(Bundle bundle)Suspending entry point: connects to the coordinator and serves task-execution requests from the given bundle. final static Servercreate(Array<String> args)Parses coordinator addresses from command-line arguments and returns a ready-to-use Server. -
-
Method Detail
-
serve
final Unit serve(Bundle bundle)
Blocking entry point: connects to the coordinator and serves task-execution requests from the given bundle.
This is a convenience wrapper around serveAsync for use from a plain
mainmethod. Prefer serveAsync when calling from an existing coroutine. The call returns when the coordinator closes the connection (normally after one task-instance execution).- Parameters:
bundle- Bundle containing all Dags this process can execute.
-
serveAsync
final Job serveAsync(Bundle bundle)
Suspending entry point: connects to the coordinator and serves task-execution requests from the given bundle.
Opens both the task-execution channel (
--comm) and the log-forwarding channel (--logs) concurrently, then processes incoming requests until the coordinator closes the connection (normally after one task-instance execution). The coroutine returns once both channels have been closed.Use this variant when calling from an existing coroutine scope; use the blocking serve from a plain
mainmethod.- Parameters:
bundle- Bundle containing all Dags this process can execute.
-
create
final static Server create(Array<String> args)
Parses coordinator addresses from command-line arguments and returns a ready-to-use Server.
The arguments are supplied automatically by Airflow and are not intended to be constructed by hand:
--comm host:portaddress for task-execution messages.--logs host:portaddress for log forwarding.
-
-
-
-