Class TarantoolMetadata
- java.lang.Object
-
- io.tarantool.driver.core.metadata.TarantoolMetadata
-
- All Implemented Interfaces:
TarantoolMetadataOperations
public class TarantoolMetadata extends Object implements TarantoolMetadataOperations
Base class forTarantoolMetadataOperations
implementations
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Integer,Map<String,TarantoolIndexMetadata>>
indexMetadataBySpaceId
protected Map<String,Map<String,TarantoolIndexMetadata>>
indexMetadataBySpaceName
protected Map<Integer,TarantoolSpaceMetadata>
spaceMetadataById
protected 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 cachevoid
scheduleRefresh()
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:TarantoolMetadataOperations
Initiates metadata refresh cycle- Specified by:
scheduleRefresh
in interfaceTarantoolMetadataOperations
-
refresh
public CompletableFuture<Void> refresh() throws TarantoolClientException
Description copied from interface:TarantoolMetadataOperations
Refresh metadata cache- Specified by:
refresh
in 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:TarantoolMetadataOperations
Get metadata for the space specified by name- Specified by:
getSpaceByName
in 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:TarantoolMetadataOperations
Get metadata for index from the specified space by name- Specified by:
getIndexByName
in 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:TarantoolMetadataOperations
Get metadata for index from the specified space by name- Specified by:
getIndexByName
in 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:TarantoolMetadataOperations
Get metadata for index from the specified space by index ID- Specified by:
getIndexById
in 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:TarantoolMetadataOperations
Get metadata for index from the specified space by index ID- Specified by:
getIndexById
in 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:TarantoolMetadataOperations
Get metadata for the space specified by id- Specified by:
getSpaceById
in 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:TarantoolMetadataOperations
Get metadata for all indexes for space specified by id- Specified by:
getSpaceIndexes
in 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:TarantoolMetadataOperations
Get metadata for all indexes for space specified by name- Specified by:
getSpaceIndexes
in interfaceTarantoolMetadataOperations
- Parameters:
spaceName
- the space name, must not be null or empty- Returns:
- nullable map of index names to index metadata wrapped in
Optional
-
-