/** * Gets grid instance without waiting its initialization and not throwing any exception. * * @param locNodeId ID of local node the requested grid instance is managing. * @return Grid instance or {@code null}. */ public static IgniteKernal gridxx(UUID locNodeId) { IgniteNamedInstance dfltGrid0 = dfltGrid; if (dfltGrid0 != null) { IgniteKernal g = dfltGrid0.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } for (IgniteNamedInstance grid : grids.values()) { IgniteKernal g = grid.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } return null; }
/** * Gets a grid instance for given local node ID. Note that grid instance and local node have * one-to-one relationship where node has ID and instance has name of the grid to which * both grid instance and its node belong. Note also that caller of this method * should not assume that it will return the same instance every time. * * @param locNodeId ID of local node the requested grid instance is managing. * @return An instance of named grid. This method never returns * {@code null}. * @throws IgniteIllegalStateException Thrown if grid was not properly * initialized or grid instance was stopped or was not started. */ public static Ignite grid(UUID locNodeId) throws IgniteIllegalStateException { A.notNull(locNodeId, "locNodeId"); IgniteNamedInstance dfltGrid0 = dfltGrid; if (dfltGrid0 != null) { IgniteKernal g = dfltGrid0.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } for (IgniteNamedInstance grid : grids.values()) { IgniteKernal g = grid.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } throw new IgniteIllegalStateException("Grid instance with given local node ID was not properly " + "started or was stopped: " + locNodeId); }
IgniteDiagnosticPrepareContext ctx = new IgniteDiagnosticPrepareContext(node.getLocalNodeId());
IgniteKernal k = (IgniteKernal)g; info(">>>> Entries on node: " + k.getLocalNodeId());
/** * Checks job execution status. * * @param jobId Job ID. * @param complete Completion status. * @throws Exception If failed. */ private void checkStatus(HadoopJobId jobId, boolean complete) throws Exception { for (int i = 0; i < gridCount(); i++) { IgniteKernal kernal = (IgniteKernal)grid(i); Hadoop hadoop = kernal.hadoop(); HadoopJobStatus stat = hadoop.status(jobId); assert stat != null; IgniteInternalFuture<?> fut = hadoop.finishFuture(jobId); if (!complete) assertFalse(fut.isDone()); else { info("Waiting for status future completion on node [idx=" + i + ", nodeId=" + kernal.getLocalNodeId() + ']'); fut.get(); } } }
GridDhtPartitionMap pMap = remoteTop.partitionMap(true).get(((IgniteKernal)g).getLocalNodeId());
/** * Gets grid instance without waiting its initialization and not throwing any exception. * * @param locNodeId ID of local node the requested grid instance is managing. * @return Grid instance or {@code null}. */ public static IgniteKernal gridxx(UUID locNodeId) { IgniteNamedInstance dfltGrid0 = dfltGrid; if (dfltGrid0 != null) { IgniteKernal g = dfltGrid0.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } for (IgniteNamedInstance grid : grids.values()) { IgniteKernal g = grid.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } return null; }
/** * Gets a grid instance for given local node ID. Note that grid instance and local node have * one-to-one relationship where node has ID and instance has name of the grid to which * both grid instance and its node belong. Note also that caller of this method * should not assume that it will return the same instance every time. * * @param locNodeId ID of local node the requested grid instance is managing. * @return An instance of named grid. This method never returns * {@code null}. * @throws IgniteIllegalStateException Thrown if grid was not properly * initialized or grid instance was stopped or was not started. */ public static Ignite grid(UUID locNodeId) throws IgniteIllegalStateException { A.notNull(locNodeId, "locNodeId"); IgniteNamedInstance dfltGrid0 = dfltGrid; if (dfltGrid0 != null) { IgniteKernal g = dfltGrid0.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } for (IgniteNamedInstance grid : grids.values()) { IgniteKernal g = grid.grid(); if (g != null && g.getLocalNodeId().equals(locNodeId)) return g; } throw new IgniteIllegalStateException("Grid instance with given local node ID was not properly " + "started or was stopped: " + locNodeId); }