efault/mytable/col").build();
Alternatively, {@code KijiURI} objects can be constructed from components by using a builder:
final KijiURI uri = KijiURI.newBuilder() .withInstanceName("default") .withTableName("mytable") .addColumnName(KijiColumnName.create(col)) .build();
Syntax
A KijiURI is composed of multiple components: a {@code scheme}, a {@code cluster-identifier}, and optionally, an {@code instance-name}, a {@code table-name}, and {@code column-names}. The text format of a {@code KijiURI} must be of the form:
scheme://cluster-identifier[/instance-name[/table-name[/column-names]]]
where square brackets indicate optional components.
Scheme
The scheme of all {@code KijiURI}s is a identifier prefixed with the string " {@code kiji}", and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-").
The scheme is specific to the type of cluster identified, and determines how the remaining components will be parsed.
The default {@code KijiURI} scheme is "{@value #KIJI_SCHEME}". When this scheme is parsed an {@link org.kiji.schema.hbase.HBaseKijiURI} will be created.
Cluster Identifier
The cluster identifier contains the information necessary for Kiji to identify the host cluster. The exact form of the cluster identifier is specific to the cluster type (which is identified by the scheme). At a minimum, the cluster identifier includes ZooKeeper ensemble information for connecting to the ZooKeeper service hosting Kiji. The ZooKeeper Ensemble address is located in the 'authority' position as defined in RFC3986, and may take one of the following host/port forms, depending on whether one or more hosts is specified, and whether a port is specified:
{@code .env} {@code host} {@code host:port} {@code host1,host2} {@code (host1,host2):port}The {@value #ENV_URI_STRING} value will resolve at runtime to a ZooKeeper ensemble addresstaken from the environment. Specifics of how the address is resolved is scheme-specific. Note that, depending on the scheme, the cluster identifier may contain path segments, and thus is potentially larger than just the URI authority.
Instance Name
The instance name component is optional. Identifies a Kiji instance hosted on the cluster. Only valid Kiji instance names may be used. Table Name
The table name component is optional, and may only be used if the instance name is defined. The table name identifies a Kiji table in the identified instance. Only a valid Kiji table name may be used. Column Names
The column names component is optional, and may only be used if the table name is defined. The column names identify a set of Kiji column names in the specified table. The column names are comma separated with no spaces, and may contain only valid Kiji column names. Examples
The following are valid {@code KijiURI}s: {@code kiji://zkHost} {@code kiji://zkHost/instance} {@code kiji://zkHost/instance/table} {@code kiji://zkHost:zkPort/instance/table} {@code kiji://zkHost1,zkHost2/instance/table} {@code kiji://(zkHost1,zkHost2):zkPort/instance/table} {@code kiji://zkHost/instance/table/col} {@code kiji://zkHost/instance/table/col1,col2} {@code kiji://.env/instance/table}Usage
The {@link KijiURI} class is not directly instantiable (it is effectively {@code abstract}). The builder will instead return a concrete subclass based on the scheme of the provided URI or URI string. If no URI or URI string is provided to create the builder, then the default {@link org.kiji.schema.hbase.HBaseKijiURI} will be assumed.All {@link KijiURI} implementations are immutable and thread-safe.