/** {@inheritDoc} */ @Override public void onMessage(UUID nodeId, Object msg, byte plc) { assert nodeId != null; assert msg != null; if (log.isDebugEnabled()) log.debug("Received session attribute request message [msg=" + msg + ", nodeId=" + nodeId + ']'); processTaskSessionRequest(nodeId, (GridTaskSessionRequest)msg); } }
/** {@inheritDoc} */ @Nullable @Override public GridDeployment explicitDeploy(Class<?> cls, ClassLoader clsLdr) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Ignoring explicit deploy [cls=" + cls + ", clsLdr=" + clsLdr + ']'); return null; }
/** * Unregister MBean. */ private void unregisterMBean() { if (mbeanName == null) return; assert !U.IGNITE_MBEANS_DISABLED; try { ManagementFactory.getPlatformMBeanServer().unregisterMBean(mbeanName); if (log.isDebugEnabled()) log.debug("Unregistered MBean: " + mbeanName); } catch (JMException e) { U.error(log, "Failed to unregister MBean.", e); } }
@Override public void onEvent(Event evt) { assert evt.type() == EVT_NODE_FAILED || evt.type() == EVT_NODE_LEFT : "Unexpected event: " + evt; UUID id = ((DiscoveryEvent)evt).eventNode().id(); if (log.isDebugEnabled()) log.debug("Processing node departure: " + id); for (Map.Entry<IgniteUuid, CachedDeploymentInfo<K, V>> entry : deps.entrySet()) { CachedDeploymentInfo<K, V> d = entry.getValue(); if (log.isDebugEnabled()) log.debug("Examining cached info: " + d); if (d.senderId().equals(id) || d.removeParticipant(id)) { deps.remove(entry.getKey(), d); if (log.isDebugEnabled()) log.debug("Removed cached info [d=" + d + ", deps=" + deps + ']'); } } allParticipants.remove(id); } };
/** {@inheritDoc} */ @Override @Nullable protected IgniteInternalFuture<Boolean> addReader(long msgId, GridDhtCacheEntry cached, IgniteTxEntry entry, AffinityTopologyVersion topVer) { // Don't add local node as reader. if (entry.addReader() && !cctx.localNodeId().equals(nearNodeId)) { GridCacheContext cacheCtx = cached.context(); while (true) { try { return cached.addReader(nearNodeId, msgId, topVer); } catch (GridCacheEntryRemovedException ignore) { if (log.isDebugEnabled()) log.debug("Got removed entry when adding to DHT local transaction: " + cached); cached = cacheCtx.dht().entryExx(entry.key(), topVer); } } } return null; }
/** {@inheritDoc} */ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) { cancelFutures(new IgniteClientDisconnectedCheckedException(reconnectFut, "Client node disconnected.")); if (log.isDebugEnabled()) { log.debug("onDisconnected [rmtInfos=" + rmtInfos + ", locInfos=" + locInfos + ", clientInfos=" + clientInfos + ']'); } for (Map.Entry<UUID, RemoteRoutineInfo> e : rmtInfos.entrySet()) { RemoteRoutineInfo info = e.getValue(); if (!ctx.localNodeId().equals(info.nodeId) || info.autoUnsubscribe) unregisterRemote(e.getKey()); } for (LocalRoutineInfo routine : locInfos.values()) routine.hnd.onClientDisconnected(); rmtInfos.clear(); clientInfos.clear(); if (discoProtoVer == 2) routinesInfo.onClientDisconnected(locInfos.keySet()); if (log.isDebugEnabled()) { log.debug("after onDisconnected [rmtInfos=" + rmtInfos + ", locInfos=" + locInfos + ", clientInfos=" + clientInfos + ']'); } }
/** {@inheritDoc} */ @Override public boolean sendMessage(@Nullable UUID nodeId, Message msg, IgniteInClosure<IgniteException> c) throws IgniteCheckedException { try { // Node ID is never provided in asynchronous send mode. assert nodeId == null; ses.sendNoFuture(msg, c); } catch (IgniteCheckedException e) { if (log.isDebugEnabled()) log.debug("Failed to send message [client=" + this + ", err=" + e + ']'); if (e.getCause() instanceof IOException) { ses.close(); return true; } else throw new IgniteCheckedException("Failed to send message [client=" + this + ']', e); } return false; }
/** {@inheritDoc} */ @Override public void onDisconnected(GridNioSession ses, @Nullable Exception e) { if (log.isDebugEnabled()) log.debug("Closed connection for session: " + ses); if (e != null) U.error(log, "Session disconnected due to exception: " + ses, e); HadoopProcessDescriptor desc = ses.meta(PROCESS_META); if (desc != null) { HadoopCommunicationClient rmv = clients.remove(desc.processId()); if (rmv != null) rmv.forceClose(); } HadoopMessageListener lsnr0 = lsnr; if (lsnr0 != null) // Notify listener about connection close. lsnr0.onConnectionLost(desc); }
/** * @param maps Mappings. */ void addEntryMapping(@Nullable Collection<GridDistributedTxMapping> maps) { if (!F.isEmpty(maps)) { for (GridDistributedTxMapping map : maps) { ClusterNode primary = map.primary(); GridDistributedTxMapping m = mappings.get(primary.id()); if (m == null) { mappings.put(m = new GridDistributedTxMapping(primary)); if (map.explicitLock()) m.markExplicitLock(); } for (IgniteTxEntry entry : map.entries()) m.add(entry); } if (log.isDebugEnabled()) log.debug("Added mappings to transaction [locId=" + cctx.localNodeId() + ", mappings=" + maps + ", tx=" + this + ']'); } }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { assertParameter(histSize > 0, "metricsHistorySize > 0"); assertParameter(expireTime > 0, "metricsExpireTime > 0"); if (metrics.snapshotsQueues == null) throw new IgniteCheckedException("Invalid concurrency level configured " + "(is 'IGNITE_JOBS_METRICS_CONCURRENCY_LEVEL' system property properly set?)."); if (log.isDebugEnabled()) log.debug("Job metrics processor started [histSize=" + histSize + ", concurLvl=" + CONCURRENCY_LEVEL + ", expireTime=" + expireTime + ']'); }
/** */ void onResult() { if (msgLog.isDebugEnabled()) { msgLog.debug("DHT lock fut, mini future node left [txId=" + nearLockVer + ", dhtTxId=" + lockVer + ", inTx=" + inTx() + ", node=" + node.id() + ']'); } if (tx != null) tx.removeMapping(node.id()); onDone(true); }
for (T spi : spis) { if (spiMap.remove(spi) == null) { if (log.isDebugEnabled()) log.debug("Will not stop SPI since it has not been started by this manager: " + spi); if (log.isDebugEnabled()) log.debug("Stopping SPI: " + spi); if (log.isDebugEnabled()) log.debug("SPI module stopped OK: " + spi.getClass().getName()); throw new IgniteCheckedException("Failed to stop SPI: " + spi, e); U.error(log, "Failed to remove injected resources from SPI (ignoring): " + spi, e);
/** * @param nodeId Left node ID * @return {@code True} if node was in the list. */ @Override public synchronized boolean onNodeLeft(UUID nodeId) { for (IgniteInternalFuture<?> fut : futures()) { MiniFuture f = (MiniFuture)fut; if (f.node.id().equals(nodeId)) { if (log.isDebugEnabled()) log.debug("Found mini-future for left node [nodeId=" + nodeId + ", mini=" + f + ", fut=" + this + ']'); return f.onResult(null, newTopologyException(nodeId)); } } if (log.isDebugEnabled()) log.debug("Future does not have mapping for left node (ignoring) [nodeId=" + nodeId + ", fut=" + this + ']'); return false; }
/** * @param lsnr Listener to external collision events. */ public void setCollisionExternalListener(@Nullable CollisionExternalListener lsnr) { if (enabled()) { if (lsnr != null && !extLsnr.compareAndSet(null, lsnr)) assert false : "Collision external listener has already been set " + "(perhaps need to add support for multiple listeners)"; else if (log.isDebugEnabled()) log.debug("Successfully set external collision listener: " + lsnr); } }
/** * @param desc Process descriptor. * @return Client. * @throws IgniteCheckedException If failed. */ @Nullable protected HadoopCommunicationClient createNioClient(HadoopProcessDescriptor desc) throws IgniteCheckedException { assert desc != null; int shmemPort = desc.sharedMemoryPort(); // If remote node has shared memory server enabled and has the same set of MACs // then we are likely to run on the same host and shared memory communication could be tried. if (shmemPort != -1 && locProcDesc.parentNodeId().equals(desc.parentNodeId())) { try { return createShmemClient(desc, shmemPort); } catch (IgniteCheckedException e) { if (e.hasCause(IpcOutOfSystemResourcesException.class)) // Has cause or is itself the IpcOutOfSystemResourcesException. LT.warn(log, OUT_OF_RESOURCES_TCP_MSG); else if (log.isDebugEnabled()) log.debug("Failed to establish shared memory connection with local hadoop process: " + desc); } } return createTcpClient(desc); }
/** {@inheritDoc} */ @Override public void onConnectionLost(HadoopProcessDescriptor desc) { if (log.isDebugEnabled()) log.debug("Lost connection with remote process: " + desc); if (desc == null) U.warn(log, "Handshake failed."); else if (desc.processId().equals(nodeDesc.processId())) { log.warning("Child process lost connection with parent node (will terminate child process)."); shutdown(); terminate(); } } }
@Nullable private S3CheckpointData read(String key) throws IgniteCheckedException, AmazonClientException { assert !F.isEmpty(key); if (log.isDebugEnabled()) log.debug("Reading data from S3 [bucket=" + bucketName + ", key=" + key + ']'); throw new IgniteCheckedException("Failed to unmarshal S3CheckpointData [bucketName=" + bucketName + ", key=" + key + ']', e);
/** * Starts HTTP protocol if it exists on classpath. * * @throws IgniteCheckedException In case of error. */ private void startHttpProtocol() throws IgniteCheckedException { try { Class<?> cls = Class.forName(HTTP_PROTO_CLS); Constructor<?> ctor = cls.getConstructor(GridKernalContext.class); GridRestProtocol proto = (GridRestProtocol)ctor.newInstance(ctx); startProtocol(proto); } catch (ClassNotFoundException ignored) { if (log.isDebugEnabled()) log.debug("Failed to initialize HTTP REST protocol (consider adding ignite-rest-http " + "module to classpath)."); } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) { throw new IgniteCheckedException("Failed to initialize HTTP REST protocol.", e); } }
/** * @param node Node. * @param msg Message. */ protected final void processForceKeyResponse(ClusterNode node, GridDhtForceKeysResponse msg) { GridDhtForceKeysFuture<?, ?> f = forceKeyFuts.get(msg.futureId()); if (f != null) f.onResult(msg); else if (log.isDebugEnabled()) log.debug("Receive force key response for unknown future (is it duplicate?) [nodeId=" + node.id() + ", res=" + msg + ']'); } /**
/** {@inheritDoc} */ @Override public void setNodeAttributes(Map<String, Object> attrs, IgniteProductVersion ver) { assert locNodeAttrs == null; assert locNodeVer == null; if (log.isDebugEnabled()) { log.debug("Node attributes to set: " + attrs); log.debug("Node version to set: " + ver); } locNodeAttrs = attrs; locNodeVer = ver; }