a
URI that uniquely identifies a Fiji instance, table, and column-set.
Use
com.moz.fiji.schema.KConstants#DEFAULT_HBASE_URI for the default Fiji instance URI.
FijiURI objects can be constructed directly from parsing a URI string:
final FijiURI uri = FijiURI.newBuilder("fiji://.env/default/mytable/col").build();
Alternatively,
FijiURI objects can be constructed from components by using a builder:
final FijiURI uri = FijiURI.newBuilder()
.withInstanceName("default")
.withTableName("mytable")
.addColumnName(FijiColumnName.create(col))
.build();
Syntax
A FijiURI is composed of multiple components: a
scheme, a
cluster-identifier,
and optionally, an
instance-name, a
table-name, and
column-names.
The text format of a
FijiURI 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
FijiURIs is a identifier prefixed with the string "
fiji", 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
FijiURI scheme is "
#FIJI_SCHEME". When this scheme is parsed an
com.moz.fiji.schema.hbase.HBaseFijiURI will be created.
Cluster Identifier
The cluster identifier contains the information necessary for Fiji 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 Fiji. 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:
-
.env
-
host
-
host:port
-
host1,host2
-
(host1,host2):port
The
#ENV_URI_STRING value will resolve at runtime to a ZooKeeper ensemble address
taken 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 Fiji instance hosted on the cluster.
Only valid Fiji 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 Fiji table in the identified instance. Only a valid Fiji 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 Fiji column names in the specified table. The column names
are comma separated with no spaces, and may contain only valid Fiji column names.
Examples
The following are valid
FijiURIs:
-
fiji://zkHost
-
fiji://zkHost/instance
-
fiji://zkHost/instance/table
-
fiji://zkHost:zkPort/instance/table
-
fiji://zkHost1,zkHost2/instance/table
-
fiji://(zkHost1,zkHost2):zkPort/instance/table
-
fiji://zkHost/instance/table/col
-
fiji://zkHost/instance/table/col1,col2
-
fiji://.env/instance/table
Usage
The
FijiURI class is not directly instantiable (it is effectively
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
com.moz.fiji.schema.hbase.HBaseFijiURI will be assumed.
All
FijiURI implementations are immutable and thread-safe.