org.apache.ignite.internal.processors.cache.query.jdbc

## Class GridCacheQueryJdbcValidationTask

- java.lang.Object
- - org.apache.ignite.compute.ComputeTaskAdapter<T,R>
  - - org.apache.ignite.compute.ComputeTaskSplitAdapter<String,Boolean>
    - - org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcValidationTask

All Implemented Interfaces:
  Serializable, ComputeTask<String,Boolean>

    public class GridCacheQueryJdbcValidationTask
    extends ComputeTaskSplitAdapter<String,Boolean>

Task to validate connection. Checks that cache with provided name exists in grid.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheQueryJdbcValidationTask()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Boolean` `reduce(List<ComputeJobResult> results)` Reduces (or aggregates) results received so far into one compound result to be returned to caller via `ComputeTaskFuture.get()` method.
`protected Collection<? extends ComputeJob>` `split(int gridSize, String cacheName)` This is a simplified version of `ComputeTask.map(List, Object)` method.

### Methods inherited from class org.apache.ignite.compute.ComputeTaskSplitAdapter

`map`

### Methods inherited from class org.apache.ignite.compute.ComputeTaskAdapter

`result`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GridCacheQueryJdbcValidationTask

    public GridCacheQueryJdbcValidationTask()

### Method Detail

#### split

    protected Collection<? extends ComputeJob> split(int gridSize,
                                                     @Nullable
                                                     String cacheName)

This is a simplified version of `ComputeTask.map(List, Object)` method.

This method basically takes given argument and splits it into a collection of `ComputeJob` using provided grid size as indication of how many node are available. These jobs will be randomly mapped to available grid nodes. Note that if number of jobs is greater than number of grid nodes (i.e, grid size), the grid nodes will be reused and some jobs will end up on the same grid nodes.

Specified by:
  `split` in class `ComputeTaskSplitAdapter<String,Boolean>`
Parameters:
  `gridSize` - Number of available grid nodes. Note that returned number of jobs can be less, equal or greater than this grid size.
  `cacheName` - Task execution argument. Can be `null`.
Returns:
  Collection of grid jobs. These jobs will be randomly mapped to available grid nodes. Note that if number of jobs is greater than number of grid nodes (i.e, grid size), the grid nodes will be reused and some jobs will end up on the same grid nodes.
See Also:
  `ComputeTask.map(List, Object)`

#### reduce

    public Boolean reduce(List<ComputeJobResult> results)

Reduces (or aggregates) results received so far into one compound result to be returned to caller via `ComputeTaskFuture.get()` method.

Note, that if some jobs did not succeed and could not be failed over then the list of results passed into this method will include the failed results. Otherwise, failed results will not be in the list.

Parameters:
  `results` - Received results of broadcasted remote executions. Note that if task class has `ComputeTaskNoResultCache` annotation, then this list will be empty.
Returns:
  Grid job result constructed from results of remote executions.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019