@Override public IgfsEntryInfo onFailure(@Nullable Exception err) throws IgniteCheckedException { throw new IgniteCheckedException("Failed to synchronize path due to secondary file " + "system exception: " + path, err); } };
/** * Reassigns service to nodes. * * @param cfg Service configuration. * @param topVer Topology version. * @param oldTop Previous topology snapshot. * @throws IgniteCheckedException In case of an error. */ private Map<UUID, Integer> reassign(IgniteUuid srvcId, ServiceConfiguration cfg, AffinityTopologyVersion topVer, TreeMap<UUID, Integer> oldTop) throws IgniteCheckedException { try { Map<UUID, Integer> top = srvcProc.reassign(srvcId, cfg, topVer, oldTop); if (top.isEmpty()) throw new IgniteCheckedException("Failed to determine suitable nodes to deploy service."); if (log.isDebugEnabled()) log.debug("Calculated service assignment : [srvcId=" + srvcId + ", srvcTop=" + top + ']'); return top; } catch (Throwable e) { throw new IgniteCheckedException("Failed to calculate assignments for service, cfg=" + cfg, e); } }
/** {@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 Map<UUID, Integer> call() throws Exception { IgniteInternalCache<Object, Object> cache = ignite.context().cache().utilityCache(); if (cache == null) { List<ComputeJobContext> pendingCtxs = ((GridServiceProcessor)ignite.context().service()).pendingJobCtxs; synchronized (pendingCtxs) { // Double check cache reference after lock acqusition. cache = ignite.context().cache().utilityCache(); if (cache == null) { if (!waitedCacheInit) { log.debug("Utility cache hasn't been initialized yet. Waiting."); // waiting for a minute for cache initialization. jCtx.holdcc(60 * 1000); pendingCtxs.add(jCtx); waitedCacheInit = true; return null; } else { log.error("Failed to gather service topology. Utility " + "cache initialization is stuck."); throw new IgniteCheckedException("Failed to gather service topology. Utility " + "cache initialization is stuck."); } } } } return serviceTopology(cache, svcName); } }
/** {@inheritDoc} */ @Override public HadoopJobEx createJob(Class<? extends HadoopJobEx> jobCls, HadoopJobId jobId, IgniteLogger log, @Nullable String[] libNames, HadoopHelper helper) throws IgniteCheckedException { assert jobCls != null; try { Constructor<? extends HadoopJobEx> constructor = jobCls.getConstructor(HadoopJobId.class, HadoopDefaultJobInfo.class, IgniteLogger.class, String[].class, HadoopHelper.class); return constructor.newInstance(jobId, this, log, libNames, helper); } catch (Throwable t) { if (t instanceof Error) throw (Error)t; throw new IgniteCheckedException(t); } }
@Nullable public byte[] secondaryDataBlock(IgfsPath path, long blockIdx, IgfsSecondaryFileSystemPositionedReadable secReader, int blockSize) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Reading non-local data block in the secondary file system [path=" + path + ", blockIdx=" + blockIdx + ']'); throw new IgniteCheckedException("Failed to read data due to secondary file system " + "exception: " + e.getMessage(), e);
/** {@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 + ']'); }
/** * Retrieves UUID value from parameters map. * * @param key Key. * @param params Parameters map. * @return UUID value from parameters map or {@code null} if null or not exists. * @throws IgniteCheckedException If parsing failed. */ @Nullable private static UUID uuidValue(String key, Map<String, Object> params) throws IgniteCheckedException { assert key != null; String val = (String)params.get(key); try { return val == null ? null : UUID.fromString(val); } catch (NumberFormatException ignore) { throw new IgniteCheckedException("Failed to parse parameter of UUID type [" + key + "=" + val + "]"); } }
@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); } }
@Override public Boolean onFailure(@Nullable Exception err) throws IgniteCheckedException { U.error(log, "Path rename in DUAL mode failed [source=" + src + ", destination=" + dest + ']', err); throw new IgniteCheckedException("Failed to rename the path due to secondary file system " + "exception: " + src, err); } };
@Override public final boolean remove(@Nullable IgniteInternalTx tx, KeyCacheObject key) throws IgniteCheckedException { if (store != null) { if (log.isDebugEnabled()) log.debug(S.toString("Removing value from cache store", "key", key0, true)); throw new IgniteCheckedException(e); throw new IgniteCheckedException(new CacheWriterException(e)); if (log.isDebugEnabled()) log.debug(S.toString("Removed value from cache store", "key", key0, true));
/** {@inheritDoc} */ @Override public void onDeActivate(GridKernalContext kctx) { if (log.isDebugEnabled()) log.debug("DeActivate service processor [nodeId=" + ctx.localNodeId() + " topVer=" + ctx.discovery().topologyVersionEx() + " ]"); cancelFutures(depFuts, new IgniteCheckedException("Failed to deploy service, cluster in active.")); cancelFutures(undepFuts, new IgniteCheckedException("Failed to undeploy service, cluster in active.")); onKernalStop(true); }
/** * Complete user future with error. * * @param errMsg Error message. */ private static void completeWithError(@Nullable GridFutureAdapter<Boolean> userFut, String errMsg) { if (userFut != null) userFut.onDone(new IgniteCheckedException(errMsg)); }
/** {@inheritDoc} */ @Override protected AbstractReadFileHandle advanceSegment( @Nullable final AbstractReadFileHandle curWalSegment ) throws IgniteCheckedException { if (curWalSegment != null) curWalSegment.close(); // We are past the end marker. if (end != null && curWalSegmIdx + 1 > end.index()) return null; //stop iteration curWalSegmIdx++; boolean readArchive = canReadArchiveOrReserveWork(curWalSegmIdx); //lock during creation handle. ReadFileHandle nextHandle; try { FileDescriptor fd = segmentRouter.findSegment(curWalSegmIdx); if (log.isDebugEnabled()) log.debug("Reading next file [absIdx=" + curWalSegmIdx + ", file=" + fd.file.getAbsolutePath() + ']'); nextHandle = initReadHandle(fd, start != null && curWalSegmIdx == start.index() ? start : null); } catch (FileNotFoundException e) { if (readArchive) throw new IgniteCheckedException("Missing WAL segment in the archive", e); else nextHandle = null; } if (!readArchive) releaseWorkSegment(curWalSegmIdx); curRec = null; return nextHandle; }
if (log.isDebugEnabled()) log.debug("Initialized internal latch: " + internalLatch); throw new IgniteCheckedException("Internal latch has not been properly initialized.");
@Override public IgfsSecondaryInputStreamDescriptor onFailure(@Nullable Exception err) throws IgniteCheckedException { U.error(log, "File open in DUAL mode failed [path=" + path + ", bufferSize=" + bufSize + ']', err); throw new IgniteCheckedException("Failed to open the path due to secondary file system " + "exception: " + path, err); } };
@Nullable IgniteInternalTx tx, Map<? extends KeyCacheObject, IgniteBiTuple<? extends CacheObject, GridCacheVersion>> map ) throws IgniteCheckedException { EntriesView entries = new EntriesView(map); if (log.isDebugEnabled()) log.debug("Storing values in cache store [entries=" + entries + ']'); throw new IgniteCheckedException(e); if (log.isDebugEnabled()) log.debug("Stored value in cache store [entries=" + entries + ']');
if (log.isDebugEnabled()) log.debug("Initialized internal sync structure: " + sync); throw new IgniteCheckedException("Internal reentrant lock has not been properly initialized.");
/** {@inheritDoc} */ @Override protected boolean onDone(@Nullable Object res, @Nullable Throwable err, boolean cancel) { if (err == null && this.err != null) err = new IgniteCheckedException(this.err); return super.onDone(res, err, cancel); }