public interface IgniteClient extends AutoCloseable
Unlike Ignite client nodes, thin clients do not start Ignite infrastructure and communicate with Ignite cluster over a fast and lightweight protocol.
Modifier and Type | Method and Description |
---|---|
ClientAtomicLong |
atomicLong(String name,
ClientAtomicConfiguration cfg,
long initVal,
boolean create)
Gets an atomic long from cache and creates one if it has not been created yet and
create flag
is true . |
ClientAtomicLong |
atomicLong(String name,
long initVal,
boolean create)
Gets an atomic long from cache and creates one if it has not been created yet and
create flag
is true . |
IgniteBinary |
binary() |
<K,V> ClientCache<K,V> |
cache(String name)
Get existing cache.
|
Collection<String> |
cacheNames()
Gets the names of all available caches.
|
IgniteClientFuture<Collection<String>> |
cacheNamesAsync()
Gets the names of all available caches.
|
void |
close()
Closes this client's open connections and relinquishes all underlying resources.
|
ClientCluster |
cluster()
Gets client cluster facade.
|
ClientCompute |
compute()
Gets compute facade over all cluster nodes started in server mode.
|
ClientCompute |
compute(ClientClusterGroup grp)
Gets compute facade over the specified cluster group.
|
<K,V> ClientCache<K,V> |
createCache(ClientCacheConfiguration cfg)
Creates a cache with the specified configuration.
|
<K,V> ClientCache<K,V> |
createCache(String name)
Creates a cache with a default configuration.
|
<K,V> IgniteClientFuture<ClientCache<K,V>> |
createCacheAsync(ClientCacheConfiguration cfg)
Creates a cache with the specified configuration.
|
<K,V> IgniteClientFuture<ClientCache<K,V>> |
createCacheAsync(String name)
Creates a cache with a default configuration.
|
void |
destroyCache(String name)
Destroys the cache with the given name.
|
IgniteClientFuture<Void> |
destroyCacheAsync(String name)
Destroys the cache with the given name.
|
<K,V> ClientCache<K,V> |
getOrCreateCache(ClientCacheConfiguration cfg)
Gets the existing cache or creates a new cache if it does not exist.
|
<K,V> ClientCache<K,V> |
getOrCreateCache(String name)
Gets the existing cache or creates a new cache with default configuration if it does not exist.
|
<K,V> IgniteClientFuture<ClientCache<K,V>> |
getOrCreateCacheAsync(ClientCacheConfiguration cfg)
Gets the existing cache or creates a new cache if it does not exist.
|
<K,V> IgniteClientFuture<ClientCache<K,V>> |
getOrCreateCacheAsync(String name)
Gets the existing cache or creates a new cache with default configuration if it does not exist.
|
FieldsQueryCursor<List<?>> |
query(SqlFieldsQuery qry)
Execute SQL query and get cursor to iterate over results.
|
ClientServices |
services()
Gets
services facade over all cluster nodes started in server mode. |
ClientServices |
services(ClientClusterGroup grp)
Gets
services facade over nodes within the cluster group. |
<T> ClientIgniteSet<T> |
set(String name,
@Nullable ClientCollectionConfiguration cfg)
Gets a distributed set from cache.
|
ClientTransactions |
transactions()
Gets client transactions facade.
|
<K,V> ClientCache<K,V> getOrCreateCache(String name) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.name
- Cache name.ClientException
<K,V> IgniteClientFuture<ClientCache<K,V>> getOrCreateCacheAsync(String name) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.name
- Cache name.ClientException
<K,V> ClientCache<K,V> getOrCreateCache(ClientCacheConfiguration cfg) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.cfg
- Cache configuration. If the cache exists, this configuration is ignored.ClientException
<K,V> IgniteClientFuture<ClientCache<K,V>> getOrCreateCacheAsync(ClientCacheConfiguration cfg) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.cfg
- Cache configuration. If the cache exists, this configuration is ignored.ClientException
<K,V> ClientCache<K,V> cache(String name)
K
- Type of the cache key.V
- Type of the cache value.name
- Cache name.Collection<String> cacheNames() throws ClientException
ClientException
IgniteClientFuture<Collection<String>> cacheNamesAsync() throws ClientException
ClientException
void destroyCache(String name) throws ClientException
ClientException
if the cache does not exist.name
- Name of the cache to destroy.ClientException
IgniteClientFuture<Void> destroyCacheAsync(String name) throws ClientException
ClientException
if the cache does not exist.name
- Name of the cache to destroy.ClientException
<K,V> ClientCache<K,V> createCache(String name) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.name
- Cache name.ClientException
<K,V> IgniteClientFuture<ClientCache<K,V>> createCacheAsync(String name) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.name
- Cache name.ClientException
<K,V> ClientCache<K,V> createCache(ClientCacheConfiguration cfg) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.cfg
- Cache configuration.ClientException
<K,V> IgniteClientFuture<ClientCache<K,V>> createCacheAsync(ClientCacheConfiguration cfg) throws ClientException
K
- Type of the cache key.V
- Type of the cache value.cfg
- Cache configuration.ClientException
IgniteBinary binary()
IgniteBinary
interface.FieldsQueryCursor<List<?>> query(SqlFieldsQuery qry)
qry
- SQL query.ClientTransactions transactions()
ClientCompute compute()
ClientCompute compute(ClientClusterGroup grp)
ClientCompute
instance will only include nodes from
this cluster group.grp
- Cluster group.ClientCluster cluster()
ClientServices services()
services
facade over all cluster nodes started in server mode.ClientServices services(ClientClusterGroup grp)
services
facade over nodes within the cluster group. All operations
on the returned ClientServices
instance will only include nodes from
the specified cluster group.
Note: In some cases there will be additional requests for each service invocation from client to server
to resolve cluster group.grp
- Cluster group.Services
functionality over given cluster group.ClientAtomicLong atomicLong(String name, long initVal, boolean create)
create
flag
is true
.name
- Name of atomic long.initVal
- Initial value for atomic long. Ignored if create
flag is false
.create
- Boolean flag indicating whether data structure should be created if it does not exist.ClientAtomicLong atomicLong(String name, ClientAtomicConfiguration cfg, long initVal, boolean create)
create
flag
is true
.name
- Name of atomic long.cfg
- Configuration.initVal
- Initial value for atomic long. Ignored if create
flag is false
.create
- Boolean flag indicating whether data structure should be created if it does not exist.<T> ClientIgniteSet<T> set(String name, @Nullable @Nullable ClientCollectionConfiguration cfg)
cfg
is not null
.T
- Type of the elements in set.name
- Set name.cfg
- Set configuration if new set should be created.IgniteException
- If set could not be fetched or created.void close()
close
in interface AutoCloseable
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023