http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java index 797e31a..df0200b 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java @@ -486,9 +486,9 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda /** * Loads all left pages. * - * @throws GridInterruptedException If thread is interrupted. + * @throws InternalInterruptedException If thread is interrupted. */ - protected abstract void loadAllPages() throws GridInterruptedException; + protected abstract void loadAllPages() throws InternalInterruptedException; /** * Clears future. @@ -528,7 +528,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda try { cancelQuery(); - onDone(new IgniteFutureTimeoutException("Query timed out.")); + onDone(new InternalFutureTimeoutException("Query timed out.")); } catch (IgniteCheckedException e) { onDone(e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java index 25c0668..47c039d 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java @@ -92,8 +92,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte for (Map.Entry<Long, GridFutureAdapter<QueryResult<K, V>>> entry : futs.entrySet()) { final Object recipient = recipient(nodeId, entry.getKey()); - entry.getValue().listenAsync(new CIX1<IgniteFuture<QueryResult<K, V>>>() { - @Override public void applyx(IgniteFuture<QueryResult<K, V>> f) throws IgniteCheckedException { + entry.getValue().listenAsync(new CIX1<InternalFuture<QueryResult<K, V>>>() { + @Override public void applyx(InternalFuture<QueryResult<K, V>> f) throws IgniteCheckedException { f.get().closeIfNotShared(recipient); } }); @@ -106,8 +106,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte for (Map.Entry<Long, GridFutureAdapter<FieldsResult>> entry : fieldsFuts.entrySet()) { final Object recipient = recipient(nodeId, entry.getKey()); - entry.getValue().listenAsync(new CIX1<IgniteFuture<FieldsResult>>() { - @Override public void applyx(IgniteFuture<FieldsResult> f) + entry.getValue().listenAsync(new CIX1<InternalFuture<FieldsResult>>() { + @Override public void applyx(InternalFuture<FieldsResult> f) throws IgniteCheckedException { f.get().closeIfNotShared(recipient); } @@ -178,7 +178,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte * @param valType Value type. * @return Future that will be completed when rebuilding of all indexes is finished. */ - public IgniteFuture<?> rebuildIndexes(Class<?> valType) { + public InternalFuture<?> rebuildIndexes(Class<?> valType) { return rebuildIndexes(valType.getName()); } @@ -188,7 +188,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte * @param typeName Value type name. * @return Future that will be completed when rebuilding of all indexes is finished. */ - public IgniteFuture<?> rebuildIndexes(String typeName) { + public InternalFuture<?> rebuildIndexes(String typeName) { if (!enterBusy()) throw new IllegalStateException("Failed to rebuild indexes (grid is stopping)."); @@ -205,7 +205,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte * * @return Future that will be completed when rebuilding of all indexes is finished. */ - public IgniteFuture<?> rebuildAllIndexes() { + public InternalFuture<?> rebuildAllIndexes() { if (!enterBusy()) throw new IllegalStateException("Failed to rebuild indexes (grid is stopping)."); @@ -1472,7 +1472,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte Map<Long, GridFutureAdapter<QueryResult<K, V>>> futs = qryIters.get(sndId); if (futs != null) { - IgniteFuture<QueryResult<K, V>> fut; + InternalFuture<QueryResult<K, V>> fut; synchronized (futs) { fut = futs.remove(reqId); @@ -1598,7 +1598,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte Map<Long, GridFutureAdapter<FieldsResult>> futs = fieldsQryRes.get(sndId); if (futs != null) { - IgniteFuture<FieldsResult> fut; + InternalFuture<FieldsResult> fut; synchronized (futs) { fut = futs.remove(reqId); @@ -1692,14 +1692,14 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte Collection<Collection<CacheSqlMetadata>> res = new ArrayList<>(nodes.size() + 1); - IgniteFuture<Collection<Collection<CacheSqlMetadata>>> rmtFut = null; + InternalFuture<Collection<Collection<CacheSqlMetadata>>> rmtFut = null; // Get metadata from remote nodes. if (!nodes.isEmpty()) rmtFut = cctx.closures().callAsyncNoFailover(BROADCAST, F.asSet(job), nodes, true); // Get local metadata. - IgniteFuture<Collection<CacheSqlMetadata>> locFut = cctx.closures().callLocalSafe(job, true); + InternalFuture<Collection<CacheSqlMetadata>> locFut = cctx.closures().callLocalSafe(job, true); if (rmtFut != null) res.addAll(rmtFut.get()); @@ -2601,7 +2601,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> reloadAsync() { + @Override public InternalFuture<V> reloadAsync() { throw new UnsupportedOperationException(); } @@ -2643,7 +2643,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getAsync() { + @Override public InternalFuture<V> getAsync() { return new GridFinishedFuture<V>(cctx.kernalContext(), getValue()); } @@ -2658,7 +2658,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> setAsync(V val, IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<V> setAsync(V val, IgnitePredicate<GridCacheEntry<K, V>>... filter) { throw new UnsupportedOperationException(); } @@ -2668,7 +2668,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> setIfAbsentAsync(V val) { + @Override public InternalFuture<V> setIfAbsentAsync(V val) { throw new UnsupportedOperationException(); } @@ -2678,7 +2678,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> setxAsync(V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<Boolean> setxAsync(V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { throw new UnsupportedOperationException(); } @@ -2688,7 +2688,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> setxIfAbsentAsync(V val) { + @Override public InternalFuture<Boolean> setxIfAbsentAsync(V val) { throw new UnsupportedOperationException(); } @@ -2698,7 +2698,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(IgniteClosure<V, V> transformer) { + @Override public InternalFuture<?> transformAsync(IgniteClosure<V, V> transformer) { throw new UnsupportedOperationException(); } @@ -2708,7 +2708,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> replaceAsync(V val) { + @Override public InternalFuture<V> replaceAsync(V val) { throw new UnsupportedOperationException(); } @@ -2718,7 +2718,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replacexAsync(V val) { + @Override public InternalFuture<Boolean> replacexAsync(V val) { throw new UnsupportedOperationException(); } @@ -2728,7 +2728,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replaceAsync(V oldVal, V newVal) { + @Override public InternalFuture<Boolean> replaceAsync(V oldVal, V newVal) { throw new UnsupportedOperationException(); } @@ -2738,7 +2738,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<V> removeAsync(IgnitePredicate<GridCacheEntry<K, V>>... filter) { throw new UnsupportedOperationException(); } @@ -2748,7 +2748,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<Boolean> removexAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { throw new UnsupportedOperationException(); } @@ -2758,7 +2758,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removeAsync(V val) { + @Override public InternalFuture<Boolean> removeAsync(V val) { throw new UnsupportedOperationException(); } @@ -2783,7 +2783,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAsync(long timeout, + @Override public InternalFuture<Boolean> lockAsync(long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { throw new UnsupportedOperationException(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryMetadataAware.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryMetadataAware.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryMetadataAware.java index 66060e0..177fe66 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryMetadataAware.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryMetadataAware.java @@ -21,5 +21,5 @@ public interface GridCacheQueryMetadataAware { /** * @return Future to retrieve metadata. */ - public IgniteFuture<List<GridQueryFieldMetadata>> metadata(); + public InternalFuture<List<GridQueryFieldMetadata>> metadata(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryEntry.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryEntry.java index 75453ee..548c1ba 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryEntry.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryEntry.java @@ -231,7 +231,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> getAsync() { + @Override public InternalFuture<V> getAsync() { assert impl != null; ctx.denyOnFlag(LOCAL); @@ -249,7 +249,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> reloadAsync() { + @Override public InternalFuture<V> reloadAsync() { assert impl != null; ctx.denyOnFlag(READ); @@ -331,7 +331,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> setAsync(V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<V> setAsync(V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { assert impl != null; ctx.denyOnFlag(READ); @@ -349,7 +349,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> setIfAbsentAsync(V val) { + @Override public InternalFuture<V> setIfAbsentAsync(V val) { assert impl != null; ctx.denyOnFlag(READ); @@ -368,7 +368,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> setxAsync(V val, + @Override public InternalFuture<Boolean> setxAsync(V val, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { assert impl != null; @@ -387,7 +387,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> setxIfAbsentAsync(V val) { + @Override public InternalFuture<Boolean> setxIfAbsentAsync(V val) { assert impl != null; ctx.denyOnFlag(READ); @@ -401,7 +401,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<?> transformAsync(IgniteClosure<V, V> transformer) { + @Override public InternalFuture<?> transformAsync(IgniteClosure<V, V> transformer) { ctx.denyOnFlag(READ); return new GridFinishedFuture<>(ctx.kernalContext(), false); @@ -417,7 +417,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> replaceAsync(V val) { + @Override public InternalFuture<V> replaceAsync(V val) { assert impl != null; ctx.denyOnFlag(READ); @@ -435,7 +435,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replacexAsync(V val) { + @Override public InternalFuture<Boolean> replacexAsync(V val) { assert impl != null; ctx.denyOnFlag(READ); @@ -453,7 +453,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> replaceAsync(V oldVal, V newVal) { + @Override public InternalFuture<Boolean> replaceAsync(V oldVal, V newVal) { assert impl != null; ctx.denyOnFlag(READ); @@ -472,7 +472,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<V> removeAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<V> removeAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { assert impl != null; ctx.denyOnFlag(READ); @@ -490,7 +490,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removexAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { + @Override public InternalFuture<Boolean> removexAsync(@Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { assert impl != null; ctx.denyOnFlag(READ); @@ -508,7 +508,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> removeAsync(V val) { + @Override public InternalFuture<Boolean> removeAsync(V val) { assert impl != null; ctx.denyOnFlag(READ); @@ -553,7 +553,7 @@ public class GridCacheContinuousQueryEntry<K, V> implements GridCacheEntry<K, V> } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> lockAsync(long timeout, + @Override public InternalFuture<Boolean> lockAsync(long timeout, @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) { assert impl != null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshot.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshot.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshot.java index 77aa057..a60922b 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshot.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshot.java @@ -86,9 +86,9 @@ public class GridClockDeltaSnapshot { * Awaits either until snapshot is ready or timeout elapses. * * @param timeout Timeout to wait. - * @throws GridInterruptedException If wait was interrupted. + * @throws InternalInterruptedException If wait was interrupted. */ - public synchronized void awaitReady(long timeout) throws GridInterruptedException { + public synchronized void awaitReady(long timeout) throws InternalInterruptedException { long start = System.currentTimeMillis(); try { @@ -104,7 +104,7 @@ public class GridClockDeltaSnapshot { catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new GridInterruptedException(e); + throw new InternalInterruptedException(e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockServer.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockServer.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockServer.java index 60ef4c7..3d2a970 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockServer.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockServer.java @@ -167,7 +167,7 @@ public class GridClockServer { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { DatagramPacket packet = new DatagramPacket(new byte[GridClockMessage.PACKET_SIZE], GridClockMessage.PACKET_SIZE); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockSyncProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockSyncProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockSyncProcessor.java index 31b1e14..f3fedf3 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockSyncProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockSyncProcessor.java @@ -332,7 +332,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { while (!isCancelled()) { GridDiscoveryTopologySnapshot top = lastSnapshot; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/closure/GridClosureProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/closure/GridClosureProcessor.java index f19327e..ad1c0d8 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/closure/GridClosureProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/closure/GridClosureProcessor.java @@ -114,7 +114,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Task execution future. */ - public IgniteFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends Runnable> jobs, + public InternalFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends Runnable> jobs, @Nullable Collection<ClusterNode> nodes) { return runAsync(mode, jobs, nodes, false); } @@ -126,7 +126,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param sys If {@code true}, then system pool will be used. * @return Task execution future. */ - public IgniteFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends Runnable> jobs, + public InternalFuture<?> runAsync(GridClosureCallMode mode, @Nullable Collection<? extends Runnable> jobs, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -154,7 +154,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Task execution future. */ - public IgniteFuture<?> runAsync(GridClosureCallMode mode, @Nullable Runnable job, + public InternalFuture<?> runAsync(GridClosureCallMode mode, @Nullable Runnable job, @Nullable Collection<ClusterNode> nodes) { return runAsync(mode, job, nodes, false); } @@ -166,7 +166,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param sys If {@code true}, then system pool will be used. * @return Task execution future. */ - public IgniteFuture<?> runAsync(GridClosureCallMode mode, @Nullable Runnable job, + public InternalFuture<?> runAsync(GridClosureCallMode mode, @Nullable Runnable job, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -294,7 +294,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R2> Type. * @return Reduced result. */ - public <R1, R2> IgniteFuture<R2> forkjoinAsync(GridClosureCallMode mode, + public <R1, R2> InternalFuture<R2> forkjoinAsync(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R1>> jobs, @Nullable IgniteReducer<R1, R2> rdc, @Nullable Collection<ClusterNode> nodes) { assert mode != null; @@ -324,7 +324,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<Collection<R>> callAsync( + public <R> InternalFuture<Collection<R>> callAsync( GridClosureCallMode mode, @Nullable Collection<? extends Callable<R>> jobs, @Nullable Collection<ClusterNode> nodes) { @@ -339,7 +339,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<Collection<R>> callAsync(GridClosureCallMode mode, + public <R> InternalFuture<Collection<R>> callAsync(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R>> jobs, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -370,7 +370,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<R> callAsync(GridClosureCallMode mode, + public <R> InternalFuture<R> callAsync(GridClosureCallMode mode, @Nullable Callable<R> job, @Nullable Collection<ClusterNode> nodes) { return callAsync(mode, job, nodes, false); } @@ -382,7 +382,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Job future. */ - public <R> IgniteFuture<R> affinityCall(@Nullable String cacheName, Object affKey, Callable<R> job, + public <R> InternalFuture<R> affinityCall(@Nullable String cacheName, Object affKey, Callable<R> job, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -412,7 +412,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Job future. */ - public IgniteFuture<?> affinityRun(@Nullable String cacheName, Object affKey, Runnable job, + public InternalFuture<?> affinityRun(@Nullable String cacheName, Object affKey, Runnable job, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -443,7 +443,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<R> callAsyncNoFailover(GridClosureCallMode mode, @Nullable Callable<R> job, + public <R> InternalFuture<R> callAsyncNoFailover(GridClosureCallMode mode, @Nullable Callable<R> job, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -474,7 +474,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<Collection<R>> callAsyncNoFailover(GridClosureCallMode mode, + public <R> InternalFuture<Collection<R>> callAsyncNoFailover(GridClosureCallMode mode, @Nullable Collection<? extends Callable<R>> jobs, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -506,7 +506,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param <R> Type. * @return Grid future for collection of closure results. */ - public <R> IgniteFuture<R> callAsync(GridClosureCallMode mode, + public <R> InternalFuture<R> callAsync(GridClosureCallMode mode, @Nullable Callable<R> job, @Nullable Collection<ClusterNode> nodes, boolean sys) { assert mode != null; @@ -534,7 +534,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Grid future for execution result. */ - public <T, R> IgniteFuture<R> callAsync(IgniteClosure<T, R> job, @Nullable T arg, + public <T, R> InternalFuture<R> callAsync(IgniteClosure<T, R> job, @Nullable T arg, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -557,7 +557,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Grid future for execution result. */ - public <T, R> IgniteFuture<Collection<R>> broadcast(IgniteClosure<T, R> job, @Nullable T arg, + public <T, R> InternalFuture<Collection<R>> broadcast(IgniteClosure<T, R> job, @Nullable T arg, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -580,7 +580,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Grid future for execution result. */ - public <T, R> IgniteFuture<Collection<R>> broadcastNoFailover(IgniteClosure<T, R> job, @Nullable T arg, + public <T, R> InternalFuture<Collection<R>> broadcastNoFailover(IgniteClosure<T, R> job, @Nullable T arg, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -604,7 +604,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Grid future for execution result. */ - public <T, R> IgniteFuture<Collection<R>> callAsync(IgniteClosure<T, R> job, @Nullable Collection<? extends T> args, + public <T, R> InternalFuture<Collection<R>> callAsync(IgniteClosure<T, R> job, @Nullable Collection<? extends T> args, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -628,7 +628,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param nodes Grid nodes. * @return Grid future for execution result. */ - public <T, R1, R2> IgniteFuture<R2> callAsync(IgniteClosure<T, R1> job, + public <T, R1, R2> InternalFuture<R2> callAsync(IgniteClosure<T, R1> job, Collection<? extends T> args, IgniteReducer<R1, R2> rdc, @Nullable Collection<ClusterNode> nodes) { enterBusy(); @@ -695,7 +695,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @return Future. * @throws IgniteCheckedException Thrown in case of any errors. */ - private IgniteFuture<?> runLocal(@Nullable final Runnable c, boolean sys) throws IgniteCheckedException { + private InternalFuture<?> runLocal(@Nullable final Runnable c, boolean sys) throws IgniteCheckedException { return runLocal(c, sys ? GridClosurePolicy.SYSTEM_POOL : GridClosurePolicy.PUBLIC_POOL); } @@ -705,7 +705,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @return Future. * @throws IgniteCheckedException Thrown in case of any errors. */ - private IgniteFuture<?> runLocal(@Nullable final Runnable c, GridClosurePolicy plc) throws IgniteCheckedException { + private InternalFuture<?> runLocal(@Nullable final Runnable c, GridClosurePolicy plc) throws IgniteCheckedException { if (c == null) return new GridFinishedFuture(ctx); @@ -770,7 +770,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param c Closure to execute. * @return Future. */ - public IgniteFuture<?> runLocalSafe(Runnable c) { + public InternalFuture<?> runLocalSafe(Runnable c) { return runLocalSafe(c, true); } @@ -782,7 +782,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param sys If {@code true}, then system pool will be used, otherwise public pool will be used. * @return Future. */ - public IgniteFuture<?> runLocalSafe(Runnable c, boolean sys) { + public InternalFuture<?> runLocalSafe(Runnable c, boolean sys) { return runLocalSafe(c, sys ? GridClosurePolicy.SYSTEM_POOL : GridClosurePolicy.PUBLIC_POOL); } @@ -794,7 +794,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param plc Policy to choose executor pool. * @return Future. */ - public IgniteFuture<?> runLocalSafe(Runnable c, GridClosurePolicy plc) { + public InternalFuture<?> runLocalSafe(Runnable c, GridClosurePolicy plc) { try { return runLocal(c, plc); } @@ -831,7 +831,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @return Future. * @throws IgniteCheckedException Thrown in case of any errors. */ - private <R> IgniteFuture<R> callLocal(@Nullable final Callable<R> c, boolean sys) throws IgniteCheckedException { + private <R> InternalFuture<R> callLocal(@Nullable final Callable<R> c, boolean sys) throws IgniteCheckedException { return callLocal(c, sys ? GridClosurePolicy.SYSTEM_POOL : GridClosurePolicy.PUBLIC_POOL); } @@ -842,7 +842,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @return Future. * @throws IgniteCheckedException Thrown in case of any errors. */ - private <R> IgniteFuture<R> callLocal(@Nullable final Callable<R> c, GridClosurePolicy plc) throws IgniteCheckedException { + private <R> InternalFuture<R> callLocal(@Nullable final Callable<R> c, GridClosurePolicy plc) throws IgniteCheckedException { if (c == null) return new GridFinishedFuture<>(ctx); @@ -905,7 +905,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param c Closure to execute. * @return Future. */ - public <R> IgniteFuture<R> callLocalSafe(Callable<R> c) { + public <R> InternalFuture<R> callLocalSafe(Callable<R> c) { return callLocalSafe(c, true); } @@ -917,7 +917,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param sys If {@code true}, then system pool will be used, otherwise public pool will be used. * @return Future. */ - public <R> IgniteFuture<R> callLocalSafe(Callable<R> c, boolean sys) { + public <R> InternalFuture<R> callLocalSafe(Callable<R> c, boolean sys) { return callLocalSafe(c, sys ? GridClosurePolicy.SYSTEM_POOL : GridClosurePolicy.PUBLIC_POOL); } @@ -929,7 +929,7 @@ public class GridClosureProcessor extends GridProcessorAdapter { * @param plc Policy to choose executor pool. * @return Future. */ - public <R> IgniteFuture<R> callLocalSafe(Callable<R> c, GridClosurePolicy plc) { + public <R> InternalFuture<R> callLocalSafe(Callable<R> c, GridClosurePolicy plc) { try { return callLocal(c, plc); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousProcessor.java index 14d89f3..4198cf8 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousProcessor.java @@ -343,7 +343,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter { * @return Future. */ @SuppressWarnings("TooBroadScope") - public IgniteFuture<UUID> startRoutine(GridContinuousHandler hnd, int bufSize, long interval, + public InternalFuture<UUID> startRoutine(GridContinuousHandler hnd, int bufSize, long interval, boolean autoUnsubscribe, @Nullable IgnitePredicate<ClusterNode> prjPred) { assert hnd != null; assert bufSize > 0; @@ -529,7 +529,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter { * @param routineId Consume ID. * @return Future. */ - public IgniteFuture<?> stopRoutine(UUID routineId) { + public InternalFuture<?> stopRoutine(UUID routineId) { assert routineId != null; boolean doStop = false; @@ -905,7 +905,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter { try { U.sleep(interval0); } - catch (GridInterruptedException ignored) { + catch (InternalInterruptedException ignored) { break; } @@ -1058,7 +1058,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter { break; } - catch (GridInterruptedException e) { + catch (InternalInterruptedException e) { throw e; } catch (IgniteCheckedException e) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadUpdateJob.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadUpdateJob.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadUpdateJob.java index 8b01cb3..93982b5 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadUpdateJob.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadUpdateJob.java @@ -73,7 +73,7 @@ class GridDataLoadUpdateJob<K, V> implements GridPlainCallable<Object> { GridCacheAdapter<Object, Object> cache = ctx.cache().internalCache(cacheName); - IgniteFuture<?> f = cache.context().preloader().startFuture(); + InternalFuture<?> f = cache.context().preloader().startFuture(); if (!f.isDone()) f.get(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessor.java index 10f0487..8645899 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessor.java @@ -73,7 +73,7 @@ public class GridDataLoaderProcessor<K, V> extends GridProcessorAdapter { return; flusher = new IgniteThread(new GridWorker(ctx.gridName(), "grid-data-loader-flusher", log) { - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { while (!isCancelled()) { IgniteDataLoaderImpl<K, V> ldr = flushQ.take(); @@ -120,7 +120,7 @@ public class GridDataLoaderProcessor<K, V> extends GridProcessorAdapter { try { ldr.close(cancel); } - catch (GridInterruptedException e) { + catch (InternalInterruptedException e) { U.warn(log, "Interrupted while waiting for completion of the data loader: " + ldr, e); } catch (IgniteCheckedException e) { @@ -146,8 +146,8 @@ public class GridDataLoaderProcessor<K, V> extends GridProcessorAdapter { ldrs.add(ldr); - ldr.future().listenAsync(new CI1<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> f) { + ldr.future().listenAsync(new CI1<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> f) { boolean b = ldrs.remove(ldr); assert b : "Loader has not been added to set: " + ldr; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/IgniteDataLoaderImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/IgniteDataLoaderImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/IgniteDataLoaderImpl.java index e6ce07e..ce01c22 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/IgniteDataLoaderImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/IgniteDataLoaderImpl.java @@ -108,12 +108,12 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** Active futures of this data loader. */ @GridToStringInclude - private final Collection<IgniteFuture<?>> activeFuts = new GridConcurrentHashSet<>(); + private final Collection<InternalFuture<?>> activeFuts = new GridConcurrentHashSet<>(); /** Closure to remove from active futures. */ @GridToStringExclude - private final IgniteInClosure<IgniteFuture<?>> rmvActiveFut = new IgniteInClosure<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> t) { + private final IgniteInClosure<InternalFuture<?>> rmvActiveFut = new IgniteInClosure<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> t) { boolean rmv = activeFuts.remove(t); assert rmv; @@ -248,7 +248,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay } /** {@inheritDoc} */ - @Override public IgniteFuture<?> future() { + @Override public InternalFuture<?> future() { return fut; } @@ -337,14 +337,14 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay } /** {@inheritDoc} */ - @Override public IgniteFuture<?> addData(Map<K, V> entries) throws IllegalStateException { + @Override public InternalFuture<?> addData(Map<K, V> entries) throws IllegalStateException { A.notNull(entries, "entries"); return addData(entries.entrySet()); } /** {@inheritDoc} */ - @Override public IgniteFuture<?> addData(Collection<? extends Map.Entry<K, V>> entries) { + @Override public InternalFuture<?> addData(Collection<? extends Map.Entry<K, V>> entries) { A.notEmpty(entries, "entries"); enterBusy(); @@ -374,21 +374,21 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay } /** {@inheritDoc} */ - @Override public IgniteFuture<?> addData(Map.Entry<K, V> entry) throws IgniteCheckedException, IllegalStateException { + @Override public InternalFuture<?> addData(Map.Entry<K, V> entry) throws IgniteCheckedException, IllegalStateException { A.notNull(entry, "entry"); return addData(F.asList(entry)); } /** {@inheritDoc} */ - @Override public IgniteFuture<?> addData(K key, V val) throws IgniteCheckedException, IllegalStateException { + @Override public InternalFuture<?> addData(K key, V val) throws IgniteCheckedException, IllegalStateException { A.notNull(key, "key"); return addData(new Entry0<>(key, val)); } /** {@inheritDoc} */ - @Override public IgniteFuture<?> removeData(K key) throws IgniteCheckedException, IllegalStateException { + @Override public InternalFuture<?> removeData(K key) throws IgniteCheckedException, IllegalStateException { return addData(key, null); } @@ -468,8 +468,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay final Collection<Map.Entry<K, V>> entriesForNode = e.getValue(); - IgniteInClosure<IgniteFuture<?>> lsnr = new IgniteInClosure<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> t) { + IgniteInClosure<InternalFuture<?>> lsnr = new IgniteInClosure<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> t) { try { t.get(); @@ -498,7 +498,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay try { f = buf.update(entriesForNode, lsnr); } - catch (GridInterruptedException e1) { + catch (InternalInterruptedException e1) { resFut.onDone(e1); return; @@ -523,11 +523,11 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay private void doFlush() throws IgniteCheckedException { lastFlushTime = U.currentTimeMillis(); - List<IgniteFuture> activeFuts0 = null; + List<InternalFuture> activeFuts0 = null; int doneCnt = 0; - for (IgniteFuture<?> f : activeFuts) { + for (InternalFuture<?> f : activeFuts) { if (!f.isDone()) { if (activeFuts0 == null) activeFuts0 = new ArrayList<>((int)(activeFuts.size() * 1.2)); @@ -545,10 +545,10 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay return; while (true) { - Queue<IgniteFuture<?>> q = null; + Queue<InternalFuture<?>> q = null; for (Buffer buf : bufMappings.values()) { - IgniteFuture<?> flushFut = buf.flush(); + InternalFuture<?> flushFut = buf.flush(); if (flushFut != null) { if (q == null) @@ -563,7 +563,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay boolean err = false; - for (IgniteFuture fut = q.poll(); fut != null; fut = q.poll()) { + for (InternalFuture fut = q.poll(); fut != null; fut = q.poll()) { try { fut.get(); } @@ -583,7 +583,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay doneCnt = 0; for (int i = 0; i < activeFuts0.size(); i++) { - IgniteFuture f = activeFuts0.get(i); + InternalFuture f = activeFuts0.get(i); if (f == null) doneCnt++; @@ -623,7 +623,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay * Does not wait for result and does not fail on errors assuming that this method * should be called periodically. */ - @Override public void tryFlush() throws GridInterruptedException { + @Override public void tryFlush() throws InternalInterruptedException { if (!busyLock.enterBusy()) return; @@ -720,7 +720,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay private final ClusterNode node; /** Active futures. */ - private final Collection<IgniteFuture<Object>> locFuts; + private final Collection<InternalFuture<Object>> locFuts; /** Buffered entries. */ private List<Map.Entry<K, V>> entries; @@ -743,8 +743,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** Closure to signal on task finish. */ @GridToStringExclude - private final IgniteInClosure<IgniteFuture<Object>> signalC = new IgniteInClosure<IgniteFuture<Object>>() { - @Override public void apply(IgniteFuture<Object> t) { + private final IgniteInClosure<InternalFuture<Object>> signalC = new IgniteInClosure<InternalFuture<Object>>() { + @Override public void apply(InternalFuture<Object> t) { signalTaskFinished(t); } }; @@ -773,11 +773,11 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** * @param newEntries Infos. * @param lsnr Listener for the operation future. - * @throws GridInterruptedException If failed. + * @throws InternalInterruptedException If failed. * @return Future for operation. */ @Nullable GridFutureAdapter<?> update(Iterable<Map.Entry<K, V>> newEntries, - IgniteInClosure<IgniteFuture<?>> lsnr) throws GridInterruptedException { + IgniteInClosure<InternalFuture<?>> lsnr) throws InternalInterruptedException { List<Map.Entry<K, V>> entries0 = null; GridFutureAdapter<Object> curFut0; @@ -818,10 +818,9 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** * @return Future if any submitted. * - * @throws GridInterruptedException If thread has been interrupted. + * @throws InternalInterruptedException If thread has been interrupted. */ - @Nullable - IgniteFuture<?> flush() throws GridInterruptedException { + @Nullable InternalFuture<?> flush() throws InternalInterruptedException { List<Map.Entry<K, V>> entries0 = null; GridFutureAdapter<Object> curFut0 = null; @@ -842,14 +841,14 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay // Create compound future for this flush. GridCompoundFuture<Object, Object> res = null; - for (IgniteFuture<Object> f : locFuts) { + for (InternalFuture<Object> f : locFuts) { if (res == null) res = new GridCompoundFuture<>(ctx); res.add(f); } - for (IgniteFuture<Object> f : reqs.values()) { + for (InternalFuture<Object> f : reqs.values()) { if (res == null) res = new GridCompoundFuture<>(ctx); @@ -865,16 +864,16 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** * Increments active tasks count. * - * @throws GridInterruptedException If thread has been interrupted. + * @throws InternalInterruptedException If thread has been interrupted. */ - private void incrementActiveTasks() throws GridInterruptedException { + private void incrementActiveTasks() throws InternalInterruptedException { U.acquire(sem); } /** * @param f Future that finished. */ - private void signalTaskFinished(IgniteFuture<Object> f) { + private void signalTaskFinished(InternalFuture<Object> f) { assert f != null; sem.release(); @@ -883,17 +882,17 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay /** * @param entries Entries to submit. * @param curFut Current future. - * @throws GridInterruptedException If interrupted. + * @throws InternalInterruptedException If interrupted. */ private void submit(final Collection<Map.Entry<K, V>> entries, final GridFutureAdapter<Object> curFut) - throws GridInterruptedException { + throws InternalInterruptedException { assert entries != null; assert !entries.isEmpty(); assert curFut != null; incrementActiveTasks(); - IgniteFuture<Object> fut; + InternalFuture<Object> fut; if (isLocNode) { fut = ctx.closure().callLocalSafe( @@ -901,8 +900,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay locFuts.add(fut); - fut.listenAsync(new IgniteInClosure<IgniteFuture<Object>>() { - @Override public void apply(IgniteFuture<Object> t) { + fut.listenAsync(new IgniteInClosure<InternalFuture<Object>>() { + @Override public void apply(InternalFuture<Object> t) { try { boolean rmv = locFuts.remove(t); @@ -1090,7 +1089,7 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K, V>, Delay void cancelAll() { IgniteCheckedException err = new IgniteCheckedException("Data loader has been cancelled: " + IgniteDataLoaderImpl.this); - for (IgniteFuture<?> f : locFuts) { + for (InternalFuture<?> f : locFuts) { try { f.cancel(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dr/GridDrDataLoadCacheUpdater.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dr/GridDrDataLoadCacheUpdater.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dr/GridDrDataLoadCacheUpdater.java index 3522cf8..8f7a423 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dr/GridDrDataLoadCacheUpdater.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dr/GridDrDataLoadCacheUpdater.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.dr; import org.apache.ignite.*; import org.apache.ignite.dataload.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.processors.cache.*; @@ -42,7 +41,7 @@ public class GridDrDataLoadCacheUpdater<K, V> implements IgniteDataLoadCacheUpda if (log.isDebugEnabled()) log.debug("Running DR put job [nodeId=" + ctx.localNodeId() + ", cacheName=" + cacheName + ']'); - IgniteFuture<?> f = cache.context().preloader().startFuture(); + InternalFuture<?> f = cache.context().preloader().startFuture(); if (!f.isDone()) f.get(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridEmailProcessorAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridEmailProcessorAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridEmailProcessorAdapter.java index ab942f0..0711c70 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridEmailProcessorAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridEmailProcessorAdapter.java @@ -11,7 +11,6 @@ package org.gridgain.grid.kernal.processors.email; import org.apache.ignite.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.processors.*; @@ -61,7 +60,7 @@ public abstract class GridEmailProcessorAdapter extends GridProcessorAdapter { * @param html HTML format flag. * @return Future for scheduled email. */ - public abstract IgniteFuture<Boolean> schedule(String subj, String body, boolean html); + public abstract InternalFuture<Boolean> schedule(String subj, String body, boolean html); /** * Schedules sending of given email. If SMTP is disabled - this method is no-op. Emails will be send @@ -74,5 +73,5 @@ public abstract class GridEmailProcessorAdapter extends GridProcessorAdapter { * @param addrs Addresses. * @return Future for scheduled email. */ - public abstract IgniteFuture<Boolean> schedule(String subj, String body, boolean html, Collection<String> addrs); + public abstract InternalFuture<Boolean> schedule(String subj, String body, boolean html, Collection<String> addrs); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridNoopEmailProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridNoopEmailProcessor.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridNoopEmailProcessor.java index 5aacb7d..ce4c58b 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridNoopEmailProcessor.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/email/GridNoopEmailProcessor.java @@ -37,12 +37,12 @@ public class GridNoopEmailProcessor extends GridEmailProcessorAdapter { } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> schedule(String subj, String body, boolean html) { + @Override public InternalFuture<Boolean> schedule(String subj, String body, boolean html) { return new GridFinishedFuture<>(ctx, true); } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> schedule(String subj, String body, boolean html, Collection<String> addrs) { + @Override public InternalFuture<Boolean> schedule(String subj, String body, boolean html, Collection<String> addrs) { return new GridFinishedFuture<>(ctx, true); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java index e22c0b7..9ff20d3 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAsyncImpl.java @@ -13,7 +13,6 @@ import org.apache.ignite.*; import org.apache.ignite.fs.*; import org.apache.ignite.fs.mapreduce.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.jetbrains.annotations.*; import java.net.*; @@ -128,7 +127,7 @@ public class GridGgfsAsyncImpl extends IgniteAsyncSupportAdapter implements Grid } /** {@inheritDoc} */ - @Override public IgniteFuture<?> awaitDeletesAsync() throws IgniteCheckedException { + @Override public InternalFuture<?> awaitDeletesAsync() throws IgniteCheckedException { return ggfs.awaitDeletesAsync(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java index a42f530..2f3fe7b 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDataManager.java @@ -62,7 +62,7 @@ public class GridGgfsDataManager extends GridGgfsManager { private GridCache<Object, Object> dataCache; /** */ - private IgniteFuture<?> dataCacheStartFut; + private InternalFuture<?> dataCacheStartFut; /** Local GGFS metrics. */ private GridGgfsLocalMetrics metrics; @@ -101,7 +101,7 @@ public class GridGgfsDataManager extends GridGgfsManager { private long trashPurgeTimeout; /** On-going remote reads futures. */ - private final ConcurrentHashMap8<GridGgfsBlockKey, IgniteFuture<byte[]>> rmtReadFuts = + private final ConcurrentHashMap8<GridGgfsBlockKey, InternalFuture<byte[]>> rmtReadFuts = new ConcurrentHashMap8<>(); /** Executor service for puts in dual mode */ @@ -229,7 +229,7 @@ public class GridGgfsDataManager extends GridGgfsManager { // Always wait thread exit. U.join(delWorker); } - catch (GridInterruptedException e) { + catch (InternalInterruptedException e) { log.warning("Got interrupter while waiting for delete worker to stop (will continue stopping).", e); } @@ -370,7 +370,7 @@ public class GridGgfsDataManager extends GridGgfsManager { * @return Requested data block or {@code null} if nothing found. * @throws IgniteCheckedException If failed. */ - @Nullable public IgniteFuture<byte[]> dataBlock(final GridGgfsFileInfo fileInfo, final IgniteFsPath path, + @Nullable public InternalFuture<byte[]> dataBlock(final GridGgfsFileInfo fileInfo, final IgniteFsPath path, final long blockIdx, @Nullable final IgniteFsReader secReader) throws IgniteCheckedException { //assert validTxState(any); // Allow this method call for any transaction state. @@ -391,17 +391,17 @@ public class GridGgfsDataManager extends GridGgfsManager { ", blockIdx=" + blockIdx + ']'); } - IgniteFuture<byte[]> fut = dataCachePrj.getAsync(key); + InternalFuture<byte[]> fut = dataCachePrj.getAsync(key); if (secReader != null) { - fut = fut.chain(new CX1<IgniteFuture<byte[]>, byte[]>() { - @Override public byte[] applyx(IgniteFuture<byte[]> fut) throws IgniteCheckedException { + fut = fut.chain(new CX1<InternalFuture<byte[]>, byte[]>() { + @Override public byte[] applyx(InternalFuture<byte[]> fut) throws IgniteCheckedException { byte[] res = fut.get(); if (res == null) { GridFutureAdapter<byte[]> rmtReadFut = new GridFutureAdapter<>(ggfsCtx.kernalContext()); - IgniteFuture<byte[]> oldRmtReadFut = rmtReadFuts.putIfAbsent(key, rmtReadFut); + InternalFuture<byte[]> oldRmtReadFut = rmtReadFuts.putIfAbsent(key, rmtReadFut); if (oldRmtReadFut == null) { try { @@ -482,7 +482,7 @@ public class GridGgfsDataManager extends GridGgfsManager { * @param fileInfo File info of file opened to write. * @return Future that will be completed when all ack messages are received or when write failed. */ - public IgniteFuture<Boolean> writeStart(GridGgfsFileInfo fileInfo) { + public InternalFuture<Boolean> writeStart(GridGgfsFileInfo fileInfo) { WriteCompletionFuture fut = new WriteCompletionFuture(ggfsCtx.kernalContext(), fileInfo.id()); WriteCompletionFuture oldFut = pendingWrites.putIfAbsent(fileInfo.id(), fut); @@ -585,7 +585,7 @@ public class GridGgfsDataManager extends GridGgfsManager { * @param fileInfo File details to remove data for. * @return Delete future that will be completed when file is actually erased. */ - public IgniteFuture<Object> delete(GridGgfsFileInfo fileInfo) { + public InternalFuture<Object> delete(GridGgfsFileInfo fileInfo) { //assert validTxState(any); // Allow this method call for any transaction state. if (!fileInfo.isFile()) { @@ -1039,8 +1039,8 @@ public class GridGgfsDataManager extends GridGgfsManager { else { callGgfsLocalSafe(new GridPlainCallable<Object>() { @Override @Nullable public Object call() throws Exception { - storeBlocksAsync(blocks).listenAsync(new CI1<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> fut) { + storeBlocksAsync(blocks).listenAsync(new CI1<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> fut) { try { fut.get(); @@ -1074,7 +1074,7 @@ public class GridGgfsDataManager extends GridGgfsManager { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout); } - catch (IgniteFutureTimeoutException ignore) { + catch (InternalFutureTimeoutException ignore) { // Ignore. } @@ -1238,7 +1238,7 @@ public class GridGgfsDataManager extends GridGgfsManager { * @return Future that will be completed after put is done. */ @SuppressWarnings("unchecked") - private IgniteFuture<?> storeBlocksAsync(Map<GridGgfsBlockKey, byte[]> blocks) { + private InternalFuture<?> storeBlocksAsync(Map<GridGgfsBlockKey, byte[]> blocks) { assert !blocks.isEmpty(); if (dataCachePrj.ggfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { @@ -1246,7 +1246,7 @@ public class GridGgfsDataManager extends GridGgfsManager { try { ggfs.awaitDeletesAsync().get(trashPurgeTimeout); } - catch (IgniteFutureTimeoutException ignore) { + catch (InternalFutureTimeoutException ignore) { // Ignore. } @@ -1272,8 +1272,8 @@ public class GridGgfsDataManager extends GridGgfsManager { * @param blocksMsg Write request message. */ private void processBlocksMessage(final UUID nodeId, final GridGgfsBlocksMessage blocksMsg) { - storeBlocksAsync(blocksMsg.blocks()).listenAsync(new CI1<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> fut) { + storeBlocksAsync(blocksMsg.blocks()).listenAsync(new CI1<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> fut) { IgniteCheckedException err = null; try { @@ -1672,7 +1672,7 @@ public class GridGgfsDataManager extends GridGgfsManager { * @param info File info to delete. * @return Future which completes when entry is actually removed. */ - private IgniteFuture<Object> deleteAsync(GridGgfsFileInfo info) { + private InternalFuture<Object> deleteAsync(GridGgfsFileInfo info) { GridFutureAdapter<Object> fut = new GridFutureAdapter<>(ggfsCtx.kernalContext()); delReqs.offer(F.t(fut, info)); @@ -1681,7 +1681,7 @@ public class GridGgfsDataManager extends GridGgfsManager { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { try { while (!isCancelled()) { IgniteBiTuple<GridFutureAdapter<Object>, GridGgfsFileInfo> req = delReqs.take(); @@ -1712,7 +1712,7 @@ public class GridGgfsDataManager extends GridGgfsManager { block)); } } - catch (GridInterruptedException ignored) { + catch (InternalInterruptedException ignored) { // Ignore interruption during shutdown. } catch (IgniteCheckedException e) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteWorker.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteWorker.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteWorker.java index 21214b7..9d06b9e 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteWorker.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteWorker.java @@ -171,7 +171,7 @@ public class GridGgfsDeleteWorker extends GridGgfsThread { else break; } - catch (GridInterruptedException ignored) { + catch (InternalInterruptedException ignored) { // Ignore this exception while stopping. } catch (IgniteCheckedException e) { @@ -296,7 +296,7 @@ public class GridGgfsDeleteWorker extends GridGgfsThread { try { fut.get(); } - catch (IgniteFutureCancelledException ignore) { + catch (InternalFutureCancelledException ignore) { // This future can be cancelled only due to GGFS shutdown. cancelled = true; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java index 2e78702..cdf7bbf 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsEx.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.ggfs; import org.apache.ignite.*; import org.apache.ignite.fs.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.jetbrains.annotations.*; import java.net.*; @@ -93,7 +92,7 @@ public interface GridGgfsEx extends IgniteFs { * @return Future which will be completed when all entries existed in trash by the time of invocation are removed. * @throws IgniteCheckedException If failed. */ - public IgniteFuture<?> awaitDeletesAsync() throws IgniteCheckedException; + public InternalFuture<?> awaitDeletesAsync() throws IgniteCheckedException; /** * Gets client file system log directory. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java index a0a82fc..a97e47f 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileWorkerBatch.java @@ -159,7 +159,7 @@ public class GridGgfsFileWorkerBatch { catch (InterruptedException e) { Thread.currentThread().interrupt(); - throw new GridInterruptedException(e); + throw new InternalInterruptedException(e); } IgniteCheckedException err0 = err; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerManager.java index 5295f80..91fb098 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerManager.java @@ -384,7 +384,7 @@ public class GridGgfsFragmentizerManager extends GridGgfsManager { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { // Wait for all previous fragmentizer tasks to complete. syncStart(); @@ -402,7 +402,7 @@ public class GridGgfsFragmentizerManager extends GridGgfsManager { } } catch (IgniteCheckedException | IgniteException e) { - if (!X.hasCause(e, InterruptedException.class) && !X.hasCause(e, GridInterruptedException.class)) + if (!X.hasCause(e, InterruptedException.class) && !X.hasCause(e, InternalInterruptedException.class)) LT.warn(log, e, "Failed to get fragmentizer file info (will retry)."); else { if (log.isDebugEnabled()) @@ -718,7 +718,7 @@ public class GridGgfsFragmentizerManager extends GridGgfsManager { } /** {@inheritDoc} */ - @Override protected void body() throws InterruptedException, GridInterruptedException { + @Override protected void body() throws InterruptedException, InternalInterruptedException { while (!isCancelled()) { IgniteBiTuple<UUID, GridGgfsCommunicationMessage> req = msgs.take(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java index 44e110f..2bcfbd9 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java @@ -17,7 +17,6 @@ import org.apache.ignite.fs.*; import org.apache.ignite.fs.mapreduce.*; import org.apache.ignite.lang.*; import org.apache.ignite.resources.*; -import org.gridgain.grid.*; import org.gridgain.grid.cache.*; import org.gridgain.grid.cache.eviction.*; import org.gridgain.grid.cache.eviction.ggfs.*; @@ -1543,7 +1542,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * * @return Future. */ - IgniteFuture<?> formatAsync() throws IgniteCheckedException { + InternalFuture<?> formatAsync() throws IgniteCheckedException { IgniteUuid id = meta.softDelete(null, null, ROOT_ID); if (id == null) @@ -1569,7 +1568,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFuture<?> awaitDeletesAsync() throws IgniteCheckedException { + @Override public InternalFuture<?> awaitDeletesAsync() throws IgniteCheckedException { Collection<IgniteUuid> ids = meta.pendingDeletes(); if (!ids.isEmpty()) { @@ -1581,7 +1580,7 @@ public final class GridGgfsImpl implements GridGgfsEx { for (IgniteUuid id : ids) { GridFutureAdapter<Object> fut = new GridFutureAdapter<>(ggfsCtx.kernalContext()); - IgniteFuture<Object> oldFut = delFuts.putIfAbsent(id, fut); + InternalFuture<Object> oldFut = delFuts.putIfAbsent(id, fut); if (oldFut != null) resFut.add(oldFut); @@ -1701,7 +1700,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param arg Optional task argument. * @return Execution future. */ - <T, R> IgniteFuture<R> executeAsync(IgniteFsTask<T, R> task, @Nullable IgniteFsRecordResolver rslvr, + <T, R> InternalFuture<R> executeAsync(IgniteFsTask<T, R> task, @Nullable IgniteFsRecordResolver rslvr, Collection<IgniteFsPath> paths, @Nullable T arg) { return executeAsync(task, rslvr, paths, true, cfg.getMaximumTaskRangeLength(), arg); } @@ -1720,7 +1719,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param arg Optional task argument. * @return Execution future. */ - <T, R> IgniteFuture<R> executeAsync(IgniteFsTask<T, R> task, @Nullable IgniteFsRecordResolver rslvr, + <T, R> InternalFuture<R> executeAsync(IgniteFsTask<T, R> task, @Nullable IgniteFsRecordResolver rslvr, Collection<IgniteFsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute(task, new IgniteFsTaskArgsImpl<>(cfg.getName(), paths, rslvr, skipNonExistentFiles, maxRangeLen, arg)); @@ -1735,7 +1734,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param arg Optional task argument. * @return Execution future. */ - <T, R> IgniteFuture<R> executeAsync(Class<? extends IgniteFsTask<T, R>> taskCls, + <T, R> InternalFuture<R> executeAsync(Class<? extends IgniteFsTask<T, R>> taskCls, @Nullable IgniteFsRecordResolver rslvr, Collection<IgniteFsPath> paths, @Nullable T arg) { return executeAsync(taskCls, rslvr, paths, true, cfg.getMaximumTaskRangeLength(), arg); } @@ -1753,7 +1752,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param arg Optional task argument. * @return Execution future. */ - <T, R> IgniteFuture<R> executeAsync(Class<? extends IgniteFsTask<T, R>> taskCls, + <T, R> InternalFuture<R> executeAsync(Class<? extends IgniteFsTask<T, R>> taskCls, @Nullable IgniteFsRecordResolver rslvr, Collection<IgniteFsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) { return ggfsCtx.kernalContext().task().execute((Class<IgniteFsTask<T, R>>)taskCls, @@ -1828,7 +1827,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public <R> IgniteFuture<R> future() { + @Override public <R> InternalFuture<R> future() { throw new IllegalStateException("Asynchronous mode is not enabled."); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java index d34c4c8..809f938 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.ggfs; import org.apache.ignite.*; import org.apache.ignite.fs.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.typedef.internal.*; import org.jetbrains.annotations.*; @@ -52,13 +51,13 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { private long pos; /** Local cache. */ - private final Map<Long, IgniteFuture<byte[]>> locCache; + private final Map<Long, InternalFuture<byte[]>> locCache; /** Maximum local cache size. */ private final int maxLocCacheSize; /** Pending data read futures which were evicted from the local cache before completion. */ - private final Set<IgniteFuture<byte[]>> pendingFuts; + private final Set<InternalFuture<byte[]>> pendingFuts; /** Pending futures lock. */ private final Lock pendingFutsLock = new ReentrantLock(); @@ -273,7 +272,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { secReader.close(); // Ensuring local cache futures completion. - for (IgniteFuture<byte[]> fut : locCache.values()) { + for (InternalFuture<byte[]> fut : locCache.values()) { try { fut.get(); } @@ -420,7 +419,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { private byte[] block(long blockIdx) throws IOException, IgniteCheckedException { assert blockIdx >= 0; - IgniteFuture<byte[]> bytesFut = locCache.get(blockIdx); + InternalFuture<byte[]> bytesFut = locCache.get(blockIdx); if (bytesFut == null) { if (closed) @@ -475,18 +474,18 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { * @param idx Block index. * @param fut Future. */ - private void addLocalCacheFuture(long idx, IgniteFuture<byte[]> fut) { + private void addLocalCacheFuture(long idx, InternalFuture<byte[]> fut) { assert Thread.holdsLock(this); if (!locCache.containsKey(idx)) { if (locCache.size() == maxLocCacheSize) { - final IgniteFuture<byte[]> evictFut = locCache.remove(locCache.keySet().iterator().next()); + final InternalFuture<byte[]> evictFut = locCache.remove(locCache.keySet().iterator().next()); if (!evictFut.isDone()) { pendingFuts.add(evictFut); - evictFut.listenAsync(new IgniteInClosure<IgniteFuture<byte[]>>() { - @Override public void apply(IgniteFuture<byte[]> t) { + evictFut.listenAsync(new IgniteInClosure<InternalFuture<byte[]>>() { + @Override public void apply(InternalFuture<byte[]> t) { pendingFuts.remove(evictFut); pendingFutsLock.lock(); @@ -514,7 +513,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { * @return Requested data block or {@code null} if nothing found. * @throws IgniteCheckedException If failed. */ - @Nullable protected IgniteFuture<byte[]> dataBlock(GridGgfsFileInfo fileInfo, long blockIdx) throws IgniteCheckedException { + @Nullable protected InternalFuture<byte[]> dataBlock(GridGgfsFileInfo fileInfo, long blockIdx) throws IgniteCheckedException { return data.dataBlock(fileInfo, path, blockIdx, secReader); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java index 3b8c72b..eac3934 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java @@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.ggfs; import org.apache.ignite.*; import org.apache.ignite.fs.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.ggfs.common.*; import org.gridgain.grid.kernal.processors.closure.*; @@ -97,7 +96,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { } /** {@inheritDoc} */ - @Override public IgniteFuture<GridGgfsMessage> handleAsync(final GridGgfsClientSession ses, + @Override public InternalFuture<GridGgfsMessage> handleAsync(final GridGgfsClientSession ses, final GridGgfsMessage msg, DataInput in) { if (!mgmt) GridLicenseUseRegistry.onUsage(HADOOP, getClass()); @@ -109,7 +108,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { final GridGgfsIpcCommand cmd = msg.command(); - IgniteFuture<GridGgfsMessage> fut; + InternalFuture<GridGgfsMessage> fut; switch (cmd) { // Execute not-blocking command synchronously in worker thread. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90948e67/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java index 7ea2c03..cc13c89 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsMetaManager.java @@ -46,7 +46,7 @@ public class GridGgfsMetaManager extends GridGgfsManager { private GridCache<Object, Object> metaCache; /** */ - private IgniteFuture<?> metaCacheStartFut; + private InternalFuture<?> metaCacheStartFut; /** File ID to file info projection. */ private GridCacheProjectionEx<IgniteUuid, GridGgfsFileInfo> id2InfoPrj; @@ -127,7 +127,7 @@ public class GridGgfsMetaManager extends GridGgfsManager { try { U.join(delWorker0); } - catch (GridInterruptedException ignored) { + catch (InternalInterruptedException ignored) { // No-op. } } @@ -1663,12 +1663,12 @@ public class GridGgfsMetaManager extends GridGgfsManager { id2InfoPrj.transform(parentInfo.id(), new UpdateListing(path.name(), new GridGgfsListingEntry(newInfo), false)); - IgniteFuture<?> delFut = ggfsCtx.data().delete(oldInfo); + InternalFuture<?> delFut = ggfsCtx.data().delete(oldInfo); // Record PURGE event if needed. if (evts.isRecordable(EVT_GGFS_FILE_PURGED)) { - delFut.listenAsync(new CI1<IgniteFuture<?>>() { - @Override public void apply(IgniteFuture<?> t) { + delFut.listenAsync(new CI1<InternalFuture<?>>() { + @Override public void apply(InternalFuture<?> t) { try { t.get(); // Ensure delete succeeded.