NAME

Gearman::JobScheduler::Admin - Gearman administration utilities.

Reimplements functionality of "gearadmin" (http://bazaar.launchpad.net/~tangent-trunk/gearmand/1.2/view/head:/bin/gearadmin.cc) in Perl.

(static) server_version($config)

Get the version number from all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns hashref of configured servers and their versions, e.g.:

Returns undef on error.

(static) server_version_on_server($server)

Get the version number from a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns a string server version, e.g. '1.1.9'.

Returns undef on error.

(static) server_verbose($config)

Get the verbose setting from all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns hashref of configured servers and their verbosity levels, e.g.:

Available verbosity levels:

    * FATAL

    * ALERT (currently unused in Gearman)

    * CRITICAL (currently unused in Gearman)

    * ERROR

    * WARN

    * NOTICE

    * INFO

    * DEBUG

Returns undef on error.

(static) server_verbose_on_server($server)

Get the verbose setting from a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns string verbose setting (see server_verbose for possible values).

Returns undef on error.

(static) create_function($function_name, $config)

Create the function on all the configured servers.

Parameters:

  • Function name (e.g. hello_world)

  • Instance of Gearman::JobScheduler::Configuration

Returns true (1) if the function has been created, false (undef) on error.

(static) create_function_on_server($function_name, $server)

Create the function on a server.

Parameters:

  • Function name (e.g. hello_world)

  • Server as "host:port" (e.g. "localhost:4730")

Returns true (1) if the function has been created, false (undef) on error.

(static) drop_function($function_name, $config)

Drop the function on all the configured servers.

Parameters:

  • Function name (e.g. hello_world)

  • Instance of Gearman::JobScheduler::Configuration

Returns true (1) if the function has been dropped, false (undef) on error.

(static) drop_function_on_server($function_name, $server)

Drop the function on a server.

Parameters:

  • Function name (e.g. hello_world)

  • Server as "host:port" (e.g. "localhost:4730")

Returns true (1) if the function has been dropped, false (undef) on error.

(static) show_jobs($config)

Show all jobs on all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns a hashref of servers and their jobs, e.g.:

Returns undef on error.

(static) show_jobs_on_server($server)

Show all jobs on a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns a hashref of job statuses, e.g.:

Returns undef on error.

(static) show_unique_jobs($config)

Show unique jobs on all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns an arrayref of unique job identifiers, e.g.:

Returns undef on error.

(static) show_unique_jobs_on_server($server)

Show unique jobs on a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns an arrayref of unique job identifiers, e.g.:

Returns undef on error.

(static) cancel_job($gearman_job_id, $config)

Remove a given job from all the configured servers' queues.

Parameters:

  • Gearman job ID (e.g. "H:localhost.localdomain:8")

  • Instance of Gearman::JobScheduler::Configuration

Returns true (1) if the job has been cancelled, false (undef) on error.

(static) cancel_job_on_server($gearman_job_id, $server)

Remove a given job from a server's queue.

Parameters:

  • Gearman job ID (e.g. "H:localhost.localdomain:8")

  • Server as "host:port" (e.g. "localhost:4730")

Returns true (1) if the job has been cancelled, false (undef) on error.

(static) get_pid($config)

Get Process ID (PID) of all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns hashref of configured servers and their integer PIDs, e.g.:

Returns undef on error.

(static) get_pid_for_server($server)

Get Process ID (PID) of a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns integer PID (e.g. 1234).

Returns undef on error.

(static) status($config)

Get status from all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns a hashref of servers and their statuses, e.g.:

Returns undef on error.

(static) status_on_server($server)

Get status of a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns a hashref of Gearman functions and their statuses, e.g.:

Returns undef on error.

(static) workers($config)

Get a list of workers from all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns a hashref of servers and their workers, e.g.:

Returns undef on error.

(static) workers_on_server($server)

Get a list of workers on a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns an arrayref of hashrefs for each of the registered worker, e.g.:

Returns undef on error.

(static) shutdown_all_servers($config)

Shutdown all the configured servers.

Parameters:

  • Instance of Gearman::JobScheduler::Configuration

Returns true (1) if the Gearman servers have been shutdown.

Returns false (undef) on error.

(static) shutdown_server($server)

Shutdown a server.

Parameters:

  • Server as "host:port" (e.g. "localhost:4730")

Returns true (1) if the Gearman server has been shutdown.

Returns false (undef) on error.