Skip to content

Commit

Permalink
ignite-201 - Removed DataStructureRemovedException in favor of Illega…
Browse files Browse the repository at this point in the history
…lStateException.
  • Loading branch information
Dmitiry Setrakyan committed Feb 8, 2015
1 parent db5e5d3 commit 0a2125e
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 103 deletions.

This file was deleted.

Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.processors.cache.transactions.*;
Expand Down Expand Up @@ -333,11 +332,11 @@ public GridCacheAtomicLongImpl(String name, GridCacheInternalKey key,
/** /**
* Check removed flag. * Check removed flag.
* *
* @throws DataStructureRemovedException If removed. * @throws IllegalStateException If removed.
*/ */
private void checkRemoved() throws DataStructureRemovedException { private void checkRemoved() throws IllegalStateException {
if (rmvd) if (rmvd)
throw new DataStructureRemovedException("Atomic long was removed from cache: " + name); throw new IllegalStateException("Atomic long was removed from cache: " + name);
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.processors.cache.transactions.*;
Expand Down Expand Up @@ -291,11 +290,11 @@ private Callable<Boolean> internalCompareAndSet(final IgnitePredicate<T> expValP
/** /**
* Check removed status. * Check removed status.
* *
* @throws DataStructureRemovedException If removed. * @throws IllegalStateException If removed.
*/ */
private void checkRemoved() throws DataStructureRemovedException { private void checkRemoved() throws IllegalStateException {
if (rmvd) if (rmvd)
throw new DataStructureRemovedException("Atomic reference was removed from cache: " + name); throw new IllegalStateException("Atomic reference was removed from cache: " + name);
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.processors.cache.transactions.*;
Expand Down Expand Up @@ -388,11 +387,11 @@ private IgniteInternalFuture<Long> internalUpdateAsync(long l, @Nullable Callabl
/** /**
* Check removed status. * Check removed status.
* *
* @throws DataStructureRemovedException If removed. * @throws IllegalStateException If removed.
*/ */
private void checkRemoved() throws DataStructureRemovedException { private void checkRemoved() throws IllegalStateException {
if (rmvd) if (rmvd)
throw new DataStructureRemovedException("Sequence was removed from cache: " + name); throw new IllegalStateException("Sequence was removed from cache: " + name);
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.processors.cache.transactions.*;
Expand Down Expand Up @@ -366,11 +365,11 @@ private Object readResolve() throws ObjectStreamException {
/** /**
* Check removed status. * Check removed status.
* *
* @throws DataStructureRemovedException If removed. * @throws IllegalStateException If removed.
*/ */
private void checkRemoved() throws DataStructureRemovedException { private void checkRemoved() throws IllegalStateException {
if (rmvd) if (rmvd)
throw new DataStructureRemovedException("Atomic stamped was removed from cache: " + name); throw new IllegalStateException("Atomic stamped was removed from cache: " + name);
} }


/** {@inheritDoc} */ /** {@inheritDoc} */
Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.*;
Expand Down Expand Up @@ -419,7 +418,7 @@ static void removeKeys(
} }


/** /**
* Checks result of closure modifying queue header, throws {@link DataStructureRemovedException} * Checks result of closure modifying queue header, throws {@link IllegalStateException}
* if queue was removed. * if queue was removed.
* *
* @param idx Result of closure execution. * @param idx Result of closure execution.
Expand All @@ -430,7 +429,7 @@ protected final void checkRemoved(Long idx) {
} }


/** /**
* Checks queue state, throws {@link DataStructureRemovedException} if queue was removed. * Checks queue state, throws {@link IllegalStateException} if queue was removed.
* *
* @param hdr Queue hdr. * @param hdr Queue hdr.
*/ */
Expand All @@ -442,15 +441,15 @@ protected final void checkRemoved(@Nullable GridCacheQueueHeader hdr) {
/** /**
* Marks queue as removed. * Marks queue as removed.
* *
* @param throw0 If {@code true} then throws {@link DataStructureRemovedException}. * @param throw0 If {@code true} then throws {@link IllegalStateException}.
*/ */
public void onRemoved(boolean throw0) { public void onRemoved(boolean throw0) {
rmvd = true; rmvd = true;


releaseSemaphores(); releaseSemaphores();


if (throw0) if (throw0)
throw new DataStructureRemovedException("Queue has been removed from cache: " + this); throw new IllegalStateException("Queue has been removed from cache: " + this);
} }


/** /**
Expand Down
Expand Up @@ -22,7 +22,6 @@
import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*; import org.apache.ignite.cache.query.*;
import org.apache.ignite.cluster.*; import org.apache.ignite.cluster.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.query.*; import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.util.*; import org.apache.ignite.internal.util.*;
Expand Down Expand Up @@ -459,11 +458,11 @@ void removed(boolean rmvd) {
} }


/** /**
* Throws {@link DataStructureRemovedException} if set was removed. * Throws {@link IllegalStateException} if set was removed.
*/ */
private void checkRemoved() { private void checkRemoved() {
if (rmvd) if (rmvd)
throw new DataStructureRemovedException("Set has been removed from cache: " + this); throw new IllegalStateException("Set has been removed from cache: " + this);
} }


/** /**
Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.datastructures; package org.apache.ignite.internal.processors.datastructures;


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.*; import org.apache.ignite.internal.util.*;
Expand Down Expand Up @@ -512,7 +511,7 @@ public void blockOnRemove() {
*/ */
private void enterBusy() { private void enterBusy() {
if (!busyLock.enterBusy()) if (!busyLock.enterBusy())
throw new DataStructureRemovedException("Set has been removed from cache: " + delegate); throw new IllegalStateException("Set has been removed from cache: " + delegate);
} }


/** /**
Expand Down
Expand Up @@ -73,7 +73,7 @@ public IgniteBiTuple<V2, V1> swap() {
* *
* @return First value. * @return First value.
*/ */
@Nullable public V1 get1() { public V1 get1() {
return val1; return val1;
} }


Expand All @@ -82,7 +82,7 @@ public IgniteBiTuple<V2, V1> swap() {
* *
* @return Second value. * @return Second value.
*/ */
@Nullable public V2 get2() { public V2 get2() {
return val2; return val2;
} }


Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.datastructures; package org.apache.ignite.internal.processors.cache.datastructures;


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.datastructures.*;


import java.util.*; import java.util.*;


Expand Down Expand Up @@ -64,7 +63,7 @@ public void testPrepareAtomicReference() throws Exception {


fail(); fail();
} }
catch (DataStructureRemovedException e) { catch (IllegalStateException e) {
info("Caught expected exception: " + e.getMessage()); info("Caught expected exception: " + e.getMessage());
} }
} }
Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.datastructures; package org.apache.ignite.internal.processors.cache.datastructures;


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.datastructures.*;


import java.util.*; import java.util.*;


Expand Down Expand Up @@ -64,7 +63,7 @@ public void testPrepareAtomicStamped() throws Exception {


fail(); fail();
} }
catch (DataStructureRemovedException e) { catch (IllegalStateException e) {
info("Caught expected exception: " + e.getMessage()); info("Caught expected exception: " + e.getMessage());
} }
} }
Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
Expand Down Expand Up @@ -177,7 +176,7 @@ public void testTakeRemoveRotativeNodes() throws Exception {


return null; return null;
} }
}, DataStructureRemovedException.class, null); }, IllegalStateException.class, null);


info("Queue was removed: " + queue); info("Queue was removed: " + queue);


Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.datastructures.*; import org.apache.ignite.internal.processors.datastructures.*;
Expand Down Expand Up @@ -342,7 +341,7 @@ public void testRemove() throws Exception {


fail("Exception expected."); fail("Exception expected.");
} }
catch (DataStructureRemovedException e) { catch (IllegalStateException e) {
info("Caught expected exception: " + e); info("Caught expected exception: " + e);
} }
} }
Expand Down
Expand Up @@ -21,11 +21,10 @@
import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.processors.cache.query.*; import org.apache.ignite.internal.processors.cache.query.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*; import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.optimized.*; import org.apache.ignite.marshaller.optimized.*;
Expand Down Expand Up @@ -770,7 +769,7 @@ private void testCleanup(boolean collocated) throws Exception {
set.add(val.incrementAndGet()); set.add(val.incrementAndGet());
} }
} }
catch (DataStructureRemovedException e) { catch (IllegalStateException e) {
log.info("Set removed: " + e); log.info("Set removed: " + e);
} }


Expand Down Expand Up @@ -814,7 +813,7 @@ private void testCleanup(boolean collocated) throws Exception {


return null; return null;
} }
}, DataStructureRemovedException.class, null); }, IllegalStateException.class, null);
} }
} }


Expand Down
Expand Up @@ -19,7 +19,6 @@


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.datastructures.*;
import org.apache.ignite.transactions.*; import org.apache.ignite.transactions.*;


import java.util.*; import java.util.*;
Expand Down Expand Up @@ -91,7 +90,7 @@ public void testCreateRemove() throws Exception {


fail(); fail();
} }
catch (DataStructureRemovedException e) { catch (IllegalStateException e) {
info("Caught expected exception: " + e.getMessage()); info("Caught expected exception: " + e.getMessage());
} }
} }
Expand Down

0 comments on commit 0a2125e

Please sign in to comment.