public class ZKMetadataStore extends Object implements MetadataStore
| Constructor and Description |
|---|
ZKMetadataStore(String metadataURL,
MetadataStoreConfig metadataStoreConfig) |
ZKMetadataStore(org.apache.zookeeper.ZooKeeper zkc) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
delete(String path,
Optional<Long> optExpectedVersion) |
CompletableFuture<Boolean> |
exists(String path)
Read whether a specific path exists.
|
CompletableFuture<Optional<GetResult>> |
get(String path)
|
CompletableFuture<List<String>> |
getChildren(String path)
Return all the nodes (lexicographically sorted) that are children to the specific path.
|
CompletableFuture<Stat> |
put(String path,
byte[] value,
Optional<Long> optExpectedVersion)
Put a new value for a given key.
|
public ZKMetadataStore(String metadataURL, MetadataStoreConfig metadataStoreConfig) throws IOException
IOExceptionpublic ZKMetadataStore(org.apache.zookeeper.ZooKeeper zkc)
public CompletableFuture<Optional<GetResult>> get(String path)
MetadataStoreGetResult that will contain the value and the
associated Stat object.
If the value is not found, the future will yield an empty Optional.get in interface MetadataStorepath - the path of the key to get from the storepublic CompletableFuture<List<String>> getChildren(String path)
MetadataStoregetChildren in interface MetadataStorepath - webSocketProxyEnabledpublic CompletableFuture<Boolean> exists(String path)
MetadataStoreexists in interface MetadataStorepath - the path of the key to check on the storepublic CompletableFuture<Stat> put(String path, byte[] value, Optional<Long> optExpectedVersion)
MetadataStoreStat object associated with the newly inserted value.put in interface MetadataStorepath - the path of the key to delete from the storevalue - the value tooptExpectedVersion - if present, the version will have to match with the currently stored value for the operation to
succeed. Use -1 to enforce a non-existing value.public CompletableFuture<Void> delete(String path, Optional<Long> optExpectedVersion)
delete in interface MetadataStorepath - the path of the key to delete from the storeoptExpectedVersion - if present, the version will have to match with the currently stored value for the operation to
succeedpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.