@InterfaceAudience.Public @InterfaceStability.Evolving public class ServiceURI extends java.lang.Object
At the highest level a service uri is a URI in string
form has the syntax.
[service[service-specific-part]:[//authority][path]
where the characters : and / stand for themselves.
The service-specific-part of a service URI consists of the backend information used for services to use. It has the syntax as below:
[(-|+)][backend-part]
where the characters - and + stand as a separator to separate service type
from service backend information.
The authority component of a service URI has the same meaning as the authority component
in a URI. If specified, it should be server-based. A server-based
authority parses according to the familiar syntax
[user-info@]host[:port]
where the characters @ and : stand for themselves.
The path component of a service URI is itself said to be absolute. It typically means which path a service stores metadata or data.
All told, then, a service URI instance has the following components:
service Stringservice-specific-part Stringauthority Stringuser-info Stringhost Stringport intpath String
Some examples of service URIs are:
zk://localhost:2181/cluster1/ledgers=> ledger service uri using default ledger manager
zk+hierarchical://localhost:2181/ledgers=> ledger service uri using hierarchical ledger manager
etcd://localhost/ledgers=> ledger service uri using etcd as metadata store
distributedlog://localhost:2181/distributedlog=> distributedlog namespace
distributedlog-bk://localhost:2181/distributedlog=> distributedlog namespace with bk backend
bk://bookkeeper-cluster/=> stream storage service uri
host1:port,host2:port=> a list of hosts as bootstrap hosts to a stream storage cluster}
| Modifier and Type | Field and Description |
|---|---|
static ServiceURI |
DEFAULT_LOCAL_STREAM_STORAGE_SERVICE_URI
The default local bk service uri.
|
static java.lang.String |
SERVICE_BK
Service string for bookkeeper service.
|
static int |
SERVICE_BK_PORT |
static java.lang.String |
SERVICE_DLOG
Service string for dlog service.
|
static java.lang.String |
SERVICE_ZK
Service string for ledger service that uses zookeeper as metadata store.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canEqual(java.lang.Object other) |
static ServiceURI |
create(java.lang.String uriStr)
Create a service uri instance from a uri string.
|
static ServiceURI |
create(java.net.URI uri)
Create a service uri instance from a
URI instance. |
boolean |
equals(java.lang.Object o) |
java.lang.String[] |
getServiceHosts() |
java.lang.String[] |
getServiceInfos() |
java.lang.String |
getServiceName() |
java.lang.String |
getServicePath() |
java.lang.String |
getServiceUser() |
java.net.URI |
getUri() |
int |
hashCode() |
public static final java.lang.String SERVICE_ZK
public static final java.lang.String SERVICE_DLOG
public static final java.lang.String SERVICE_BK
public static final int SERVICE_BK_PORT
public static final ServiceURI DEFAULT_LOCAL_STREAM_STORAGE_SERVICE_URI
public static ServiceURI create(java.lang.String uriStr)
uriStr - service uri stringjava.lang.NullPointerException - if uriStr is nulljava.lang.IllegalArgumentException - if the given string violates RFC 2396public static ServiceURI create(java.net.URI uri)
URI instance.uri - URI instancejava.lang.NullPointerException - if uriStr is nulljava.lang.IllegalArgumentException - if the given string violates RFC 2396public java.lang.String[] getServiceInfos()
public java.lang.String[] getServiceHosts()
public java.lang.String getServiceName()
public java.lang.String getServiceUser()
public java.lang.String getServicePath()
public java.net.URI getUri()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode in class java.lang.ObjectCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.