URI
A URI, short for Uniform Resource Identifier, is a sequence of characters that identifies a resource on the web. Deephaven's URIs provide the means to receive tables and other Deephaven objects through a sequence of characters.
Syntax
dh+plain://<authority>/<path>
Parameters
Parameter | Type | Description |
---|---|---|
scheme | str |
|
authority | str | The path on the authority. This will be a Docker container name if sharing locally or hostname/IP and port of the web resource; e.g., |
path | str | The path to a Deephaven object, which is generally |
Examples
This first example illustrates sharing a table locally. It assumes that two Docker containers have been set up, each running Deephaven. The first, table-producer
, which runs on port 10000, creates a real-time table. The second, table-consumer
, which runs on a different port, resolves it via a URI.
The following code creates a time table:
from deephaven import time_table
source = time_table("PT1S").update(["X = 0.1 * i", "Y = sin(X)"])
The following code resolves it:
from deephaven.uri import resolve
result = resolve("dh+plain://table-producer:10000/scope/source")
If no port is specified when resolving a local URI, Deephaven tries port 10000. Thus, to resolve a local asset that is found on port 10000, this can be omitted. Otherwise, the port must be explicitly set.
In the following example, a table is shared across a network. When sharing remotely, the IP/hostname, port, and table name are needed. In this case, the hypothetical IP is 192.168.5.1
, and Deephaven is being run on port 10000
. The table is the same as the local sharing example above.
The following code creates the source table:
from deephaven import empty_table
source = empty_table(50).update(["X = i", "Y = i % 2"])
- source
The following code resolves it:
from deephaven.uri import resolve
result = resolve("dh+plain://192.168.5.1:10000/scope/source")