Class ServiceURI
Service URI syntax and components
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}
- Since:
- 4.8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ServiceURIThe default local bk service uri.static final StringService string for bookkeeper service.static final intstatic final StringService string for dlog service.static final StringService string for ledger service that uses zookeeper as metadata store. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic ServiceURICreate a service uri instance from a uri string.static ServiceURICreate a service uri instance from aURIinstance.booleanString[]String[]getUri()inthashCode()
-
Field Details
-
SERVICE_ZK
Service string for ledger service that uses zookeeper as metadata store.- See Also:
-
SERVICE_DLOG
Service string for dlog service.- See Also:
-
SERVICE_BK
Service string for bookkeeper service.- See Also:
-
SERVICE_BK_PORT
public static final int SERVICE_BK_PORT- See Also:
-
DEFAULT_LOCAL_STREAM_STORAGE_SERVICE_URI
The default local bk service uri.
-
-
Method Details
-
create
Create a service uri instance from a uri string.- Parameters:
uriStr- service uri string- Returns:
- a service uri instance
- Throws:
NullPointerException- ifuriStris nullIllegalArgumentException- if the given string violates RFC 2396
-
create
Create a service uri instance from aURIinstance.- Parameters:
uri-URIinstance- Returns:
- a service uri instance
- Throws:
NullPointerException- ifuriStris nullIllegalArgumentException- if the given string violates RFC 2396
-
getServiceInfos
-
getServiceHosts
-
getServiceName
-
getServiceUser
-
getServicePath
-
getUri
-
equals
-
canEqual
-
hashCode
public int hashCode()
-