Search in sources :

Example 56 with IgniteUuid

use of org.apache.ignite.lang.IgniteUuid in project ignite by apache.

the class BinaryMarshallerSelfTest method testIgniteUuid.

/**
 * @throws Exception If failed.
 */
public void testIgniteUuid() throws Exception {
    IgniteUuid uuid = IgniteUuid.randomUuid();
    assertEquals(uuid, marshalUnmarshal(uuid));
}
Also used : IgniteUuid(org.apache.ignite.lang.IgniteUuid)

Example 57 with IgniteUuid

use of org.apache.ignite.lang.IgniteUuid in project ignite by apache.

the class IgfsUtils method readListingEntry.

/**
 * Read listing entry.
 *
 * @param in Reader.
 * @return Entry.
 */
@Nullable
public static IgfsListingEntry readListingEntry(BinaryRawReader in) {
    if (in.readBoolean()) {
        IgniteUuid id = BinaryUtils.readIgniteUuid(in);
        boolean dir = in.readBoolean();
        return new IgfsListingEntry(id, dir);
    } else
        return null;
}
Also used : IgniteUuid(org.apache.ignite.lang.IgniteUuid) Nullable(org.jetbrains.annotations.Nullable)

Example 58 with IgniteUuid

use of org.apache.ignite.lang.IgniteUuid in project ignite by apache.

the class GridRuntimeExceptionSelfTest method testMapFailed.

/**
 * @throws Exception If failed.
 */
public void testMapFailed() throws Exception {
    Ignite ignite = G.ignite(getTestIgniteInstanceName());
    ignite.compute().localDeployTask(GridTaskFailedTestTask.class, GridTaskFailedTestTask.class.getClassLoader());
    ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), GridTaskFailedTestTask.class.getName(), FailType.MAP);
    try {
        fut.get();
        assert false;
    } catch (IgniteException e) {
        info("Got expected grid exception: " + e);
    }
    IgniteUuid sesId = fut.getTaskSession().getId();
    // Query for correct events.
    List<Event> evts = ignite.events().remoteQuery(new TaskFailedEventFilter(sesId), 0);
    assert evts.size() == 1;
    info("Task failed event: " + evts.get(0));
}
Also used : IgniteException(org.apache.ignite.IgniteException) IgniteUuid(org.apache.ignite.lang.IgniteUuid) Event(org.apache.ignite.events.Event) TaskEvent(org.apache.ignite.events.TaskEvent) Ignite(org.apache.ignite.Ignite)

Example 59 with IgniteUuid

use of org.apache.ignite.lang.IgniteUuid in project ignite by apache.

the class GridRuntimeExceptionSelfTest method testReduceFailed.

/**
 * @throws Exception If failed.
 */
public void testReduceFailed() throws Exception {
    Ignite ignite = G.ignite(getTestIgniteInstanceName());
    ignite.compute().localDeployTask(GridTaskFailedTestTask.class, GridTaskFailedTestTask.class.getClassLoader());
    ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), GridTaskFailedTestTask.class.getName(), FailType.RESULT);
    try {
        fut.get();
        assert false;
    } catch (IgniteException e) {
        info("Got expected grid exception: " + e);
    }
    IgniteUuid sesId = fut.getTaskSession().getId();
    // Query for correct events.
    List<Event> evts = ignite.events().remoteQuery(new TaskFailedEventFilter(sesId), 0);
    assert evts.size() == 1;
    info("Task failed event: " + evts.get(0));
}
Also used : IgniteException(org.apache.ignite.IgniteException) IgniteUuid(org.apache.ignite.lang.IgniteUuid) Event(org.apache.ignite.events.Event) TaskEvent(org.apache.ignite.events.TaskEvent) Ignite(org.apache.ignite.Ignite)

Example 60 with IgniteUuid

use of org.apache.ignite.lang.IgniteUuid in project ignite by apache.

the class GridRuntimeExceptionSelfTest method testExecuteFailed.

/**
 * @throws Exception If failed.
 */
public void testExecuteFailed() throws Exception {
    Ignite ignite = G.ignite(getTestIgniteInstanceName());
    ignite.compute().localDeployTask(GridTaskFailedTestTask.class, GridTaskFailedTestTask.class.getClassLoader());
    ComputeTaskFuture<?> fut = executeAsync(ignite.compute(), GridTaskFailedTestTask.class.getName(), FailType.EXECUTE);
    try {
        fut.get();
        assert false;
    } catch (IgniteException e) {
        info("Got expected grid exception: " + e);
    }
    IgniteUuid sesId = fut.getTaskSession().getId();
    // Query for correct events.
    List<Event> evts = ignite.events().remoteQuery(new TaskFailedEventFilter(sesId), 0);
    info("Job failed event: " + evts.get(0));
    assert evts.size() == 1;
}
Also used : IgniteException(org.apache.ignite.IgniteException) IgniteUuid(org.apache.ignite.lang.IgniteUuid) Event(org.apache.ignite.events.Event) TaskEvent(org.apache.ignite.events.TaskEvent) Ignite(org.apache.ignite.Ignite)

Aggregations

IgniteUuid (org.apache.ignite.lang.IgniteUuid)107 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)25 UUID (java.util.UUID)23 IgniteException (org.apache.ignite.IgniteException)17 HashMap (java.util.HashMap)15 Map (java.util.Map)13 IgfsPath (org.apache.ignite.igfs.IgfsPath)11 ArrayList (java.util.ArrayList)10 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)10 GridNearTxLocal (org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal)10 ClusterNode (org.apache.ignite.cluster.ClusterNode)9 Nullable (org.jetbrains.annotations.Nullable)9 IgfsOutputStream (org.apache.ignite.igfs.IgfsOutputStream)7 HashSet (java.util.HashSet)6 TreeSet (java.util.TreeSet)6 CountDownLatch (java.util.concurrent.CountDownLatch)6 Ignite (org.apache.ignite.Ignite)6 IgfsException (org.apache.ignite.igfs.IgfsException)6 IgfsPathNotFoundException (org.apache.ignite.igfs.IgfsPathNotFoundException)6 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)5