arkouda.client

Module Contents

Functions

connect(server: str = 'localhost', port: int = 5555, timeout: int = 0, access_token: str = None, connect_url=None) → None

Connect to a running arkouda server.

disconnect() → None

Disconnects the client from the Arkouda server

shutdown() → None

Sends a shutdown message to the Arkouda server that does the

get_config() → Mapping[str, Union[str, int, float]]

Get runtime information about the server.

get_mem_used() → int

Compute the amount of memory used by objects in the server's symbol table.

ruok() → str

Simply sends an "ruok" message to the server and, if the return message is

arkouda.client.connect(server: str = 'localhost', port: int = 5555, timeout: int = 0, access_token: str = None, connect_url=None) None

Connect to a running arkouda server.

Parameters
  • server (str, optional) – The hostname of the server (must be visible to the current machine). Defaults to localhost.

  • port (int, optional) – The port of the server. Defaults to 5555.

  • timeout (int, optional) – The timeout in seconds for client send and receive operations. Defaults to 0 seconds, whicn is interpreted as no timeout.

  • access_token (str, optional) – The token used to connect to an existing socket to enable access to an Arkouda server where authentication is enabled. Defaults to None.

  • connect_url (str, optional) – The complete url in the format of tcp://server:port?token=<token_value> where the token is optional

Returns

Return type

None

Raises
  • ConnectionError – Raised if there’s an error in connecting to the Arkouda server

  • ValueError – Raised if there’s an error in parsing the connect_url parameter

  • RuntimeError – Raised if there is a server-side error

Notes

On success, prints the connected address, as seen by the server. If called with an existing connection, the socket will be re-initialized.

arkouda.client.disconnect() None

Disconnects the client from the Arkouda server

Returns

Return type

None

Raises

ConnectionError – Raised if there’s an error disconnecting from the Arkouda server

arkouda.client.shutdown() None

Sends a shutdown message to the Arkouda server that does the following:

  1. Delete all objects in the SymTable

  2. Shuts down the Arkouda server

  3. Disconnects the client from the stopped Arkouda Server

Returns

Return type

None

Raises

RuntimeError – Raised if the client is not connected to the Arkouda server or there is an error in disconnecting from the server

arkouda.client.get_config() Mapping[str, Union[str, int, float]]

Get runtime information about the server.

Returns

serverHostname serverPort numLocales numPUs (number of processor units per locale) maxTaskPar (maximum number of tasks per locale) physicalMemory

Return type

Mapping[str, Union[str, int, float]]

Raises

RuntimeError – Raised if the client is not connected to a server

arkouda.client.get_mem_used() int

Compute the amount of memory used by objects in the server’s symbol table.

Returns

Indicates the amount of memory allocated to symbol table objects.

Return type

int

Raises
  • RuntimeError – Raised if there is a server-side error in getting memory used

  • ValueError – Raised if the returned value is not an int-formatted string

arkouda.client.ruok() str

Simply sends an “ruok” message to the server and, if the return message is “imok”, this means the arkouda_server is up and operating normally. A return message of “imnotok” indicates an error occurred or the connection timed out.

This method is basically a way to do a quick healthcheck in a way that does not require error handling.

Returns

A string indicating if the server is operating normally (imok), if there’s an error server-side, or if ruok did not return a response (imnotok) in both of the latter cases

Return type

str