Class TarantoolMetadata
- java.lang.Object
-
- io.tarantool.driver.core.metadata.TarantoolMetadata
-
- All Implemented Interfaces:
TarantoolMetadataOperations
public class TarantoolMetadata extends Object implements TarantoolMetadataOperations
Base class forTarantoolMetadataOperationsimplementations
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Integer,Map<String,TarantoolIndexMetadata>>indexMetadataBySpaceIdprotected Map<String,Map<String,TarantoolIndexMetadata>>indexMetadataBySpaceNameprotected Map<Integer,TarantoolSpaceMetadata>spaceMetadataByIdprotected Map<String,TarantoolSpaceMetadata>spaceMetadataByName
-
Constructor Summary
Constructors Constructor Description TarantoolMetadata(TarantoolMetadataProvider metadataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<TarantoolIndexMetadata>getIndexById(int spaceId, int indexId)Get metadata for index from the specified space by index IDOptional<TarantoolIndexMetadata>getIndexById(String spaceName, int indexId)Get metadata for index from the specified space by index IDOptional<TarantoolIndexMetadata>getIndexByName(int spaceId, String indexName)Get metadata for index from the specified space by nameOptional<TarantoolIndexMetadata>getIndexByName(String spaceName, String indexName)Get metadata for index from the specified space by nameprotected Map<String,Map<String,TarantoolIndexMetadata>>getIndexMetadata()protected Map<Integer,Map<String,TarantoolIndexMetadata>>getIndexMetadataBySpaceId()Optional<TarantoolSpaceMetadata>getSpaceById(int spaceId)Get metadata for the space specified by idOptional<TarantoolSpaceMetadata>getSpaceByName(String spaceName)Get metadata for the space specified by nameOptional<Map<String,TarantoolIndexMetadata>>getSpaceIndexes(int spaceId)Get metadata for all indexes for space specified by idOptional<Map<String,TarantoolIndexMetadata>>getSpaceIndexes(String spaceName)Get metadata for all indexes for space specified by nameprotected Map<String,TarantoolSpaceMetadata>getSpaceMetadata()protected Map<Integer,TarantoolSpaceMetadata>getSpaceMetadataById()CompletableFuture<Void>refresh()Refresh metadata cachevoidscheduleRefresh()Initiates metadata refresh cycle
-
-
-
Field Detail
-
spaceMetadataByName
protected final Map<String,TarantoolSpaceMetadata> spaceMetadataByName
-
spaceMetadataById
protected final Map<Integer,TarantoolSpaceMetadata> spaceMetadataById
-
indexMetadataBySpaceName
protected final Map<String,Map<String,TarantoolIndexMetadata>> indexMetadataBySpaceName
-
indexMetadataBySpaceId
protected final Map<Integer,Map<String,TarantoolIndexMetadata>> indexMetadataBySpaceId
-
-
Constructor Detail
-
TarantoolMetadata
public TarantoolMetadata(TarantoolMetadataProvider metadataProvider)
-
-
Method Detail
-
getSpaceMetadata
protected Map<String,TarantoolSpaceMetadata> getSpaceMetadata()
-
getSpaceMetadataById
protected Map<Integer,TarantoolSpaceMetadata> getSpaceMetadataById()
-
getIndexMetadata
protected Map<String,Map<String,TarantoolIndexMetadata>> getIndexMetadata()
-
getIndexMetadataBySpaceId
protected Map<Integer,Map<String,TarantoolIndexMetadata>> getIndexMetadataBySpaceId()
-
scheduleRefresh
public void scheduleRefresh()
Description copied from interface:TarantoolMetadataOperationsInitiates metadata refresh cycle- Specified by:
scheduleRefreshin interfaceTarantoolMetadataOperations
-
refresh
public CompletableFuture<Void> refresh() throws TarantoolClientException
Description copied from interface:TarantoolMetadataOperationsRefresh metadata cache- Specified by:
refreshin interfaceTarantoolMetadataOperations- Returns:
- future with empty value for tracking the refresh progress
- Throws:
TarantoolClientException- if fetching data failed with error
-
getSpaceByName
public Optional<TarantoolSpaceMetadata> getSpaceByName(String spaceName)
Description copied from interface:TarantoolMetadataOperationsGet metadata for the space specified by name- Specified by:
getSpaceByNamein interfaceTarantoolMetadataOperations- Parameters:
spaceName- the space name, must not be null or empty- Returns:
- nullable space metadata wrapped in
Optional
-
getIndexByName
public Optional<TarantoolIndexMetadata> getIndexByName(int spaceId, String indexName)
Description copied from interface:TarantoolMetadataOperationsGet metadata for index from the specified space by name- Specified by:
getIndexByNamein interfaceTarantoolMetadataOperations- Parameters:
spaceId- the space ID, must be greater than 0indexName- index name, must not be null or empty- Returns:
- nullable index metadata wrapped in
Optional
-
getIndexByName
public Optional<TarantoolIndexMetadata> getIndexByName(String spaceName, String indexName)
Description copied from interface:TarantoolMetadataOperationsGet metadata for index from the specified space by name- Specified by:
getIndexByNamein interfaceTarantoolMetadataOperations- Parameters:
spaceName- the space name, must not be null or emptyindexName- index name, must not be null or empty- Returns:
- nullable index metadata wrapped in
Optional
-
getIndexById
public Optional<TarantoolIndexMetadata> getIndexById(String spaceName, int indexId)
Description copied from interface:TarantoolMetadataOperationsGet metadata for index from the specified space by index ID- Specified by:
getIndexByIdin interfaceTarantoolMetadataOperations- Parameters:
spaceName- the space name, must not be null or emptyindexId- index ID, must not be must be greater or equal than 0- Returns:
- nullable index metadata wrapped in
Optional
-
getIndexById
public Optional<TarantoolIndexMetadata> getIndexById(int spaceId, int indexId)
Description copied from interface:TarantoolMetadataOperationsGet metadata for index from the specified space by index ID- Specified by:
getIndexByIdin interfaceTarantoolMetadataOperations- Parameters:
spaceId- the space ID, must be greater than 0indexId- index ID, must not be must be greater or equal than 0- Returns:
- nullable index metadata wrapped in
Optional
-
getSpaceById
public Optional<TarantoolSpaceMetadata> getSpaceById(int spaceId)
Description copied from interface:TarantoolMetadataOperationsGet metadata for the space specified by id- Specified by:
getSpaceByIdin interfaceTarantoolMetadataOperations- Parameters:
spaceId- the space ID, must be greater than 0- Returns:
- nullable space metadata wrapped in
Optional
-
getSpaceIndexes
public Optional<Map<String,TarantoolIndexMetadata>> getSpaceIndexes(int spaceId)
Description copied from interface:TarantoolMetadataOperationsGet metadata for all indexes for space specified by id- Specified by:
getSpaceIndexesin interfaceTarantoolMetadataOperations- Parameters:
spaceId- the space ID, must be greater than 0- Returns:
- nullable map of index names to index metadata wrapped in
Optional
-
getSpaceIndexes
public Optional<Map<String,TarantoolIndexMetadata>> getSpaceIndexes(String spaceName)
Description copied from interface:TarantoolMetadataOperationsGet metadata for all indexes for space specified by name- Specified by:
getSpaceIndexesin interfaceTarantoolMetadataOperations- Parameters:
spaceName- the space name, must not be null or empty- Returns:
- nullable map of index names to index metadata wrapped in
Optional
-
-