use of org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest in project ignite by apache.
the class TestBinaryClient method cacheMetrics.
/**
* @param cacheName Cache name.
* @return Metrics.
* @throws IgniteCheckedException In case of error.
*/
public <K> Map<String, Long> cacheMetrics(@NotNull String cacheName) throws IgniteCheckedException {
GridClientCacheRequest metrics = new GridClientCacheRequest(METRICS);
metrics.requestId(idCntr.getAndIncrement());
metrics.cacheName(cacheName);
return makeRequest(metrics).getObject();
}
use of org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest in project ignite by apache.
the class TestBinaryClient method cacheRemove.
/**
* @param cacheName Cache name.
* @param key Key.
* @return Whether entry was actually removed.
* @throws IgniteCheckedException In case of error.
*/
@SuppressWarnings("unchecked")
public <K> boolean cacheRemove(@NotNull String cacheName, K key) throws IgniteCheckedException {
assert key != null;
GridClientCacheRequest req = new GridClientCacheRequest(RMV);
req.requestId(idCntr.getAndIncrement());
req.cacheName(cacheName);
req.key(key);
return makeRequest(req).<Boolean>getObject();
}
use of org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest in project ignite by apache.
the class TestBinaryClient method cacheCompareAndSet.
/**
* @param cacheName Cache name.
* @param key Key.
* @param val1 Value 1.
* @param val2 Value 2.
* @return Whether new value was actually set.
* @throws IgniteCheckedException In case of error.
*/
public <K, V> boolean cacheCompareAndSet(@NotNull String cacheName, K key, @Nullable V val1, @Nullable V val2) throws IgniteCheckedException {
assert key != null;
GridClientCacheRequest msg = new GridClientCacheRequest(CAS);
msg.requestId(idCntr.getAndIncrement());
msg.cacheName(cacheName);
msg.key(key);
msg.value(val1);
msg.value2(val2);
return makeRequest(msg).<Boolean>getObject();
}
use of org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest in project ignite by apache.
the class GridClientNioTcpConnection method cacheRemoveAll.
/** {@inheritDoc} */
@Override
public <K> GridClientFutureAdapter<Boolean> cacheRemoveAll(String cacheName, Collection<K> keys, Set<GridClientCacheFlag> flags, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException {
assert keys != null;
GridClientCacheRequest req = new GridClientCacheRequest(RMV_ALL);
req.cacheName(cacheName);
req.keys((Iterable<Object>) keys);
req.cacheFlagsOn(encodeCacheFlags(flags));
return makeRequest(req, destNodeId);
}
use of org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest in project ignite by apache.
the class GridClientNioTcpConnection method cacheAppend.
/** {@inheritDoc} */
@Override
public <K, V> GridClientFutureAdapter<Boolean> cacheAppend(String cacheName, K key, V val, Set<GridClientCacheFlag> flags, UUID destNodeId) throws GridClientConnectionResetException, GridClientClosedException {
assert key != null;
assert val != null;
GridClientCacheRequest append = new GridClientCacheRequest(APPEND);
append.cacheName(cacheName);
append.key(key);
append.value(val);
append.cacheFlagsOn(encodeCacheFlags(flags));
return makeRequest(append, destNodeId);
}
Aggregations