Refine search
@Override public KinesisMessageId getNextFailedMessageToRetry() { KinesisMessageId result = null; // return the first message to be retried from the set. It will return the message with the earliest retry time <= current time if (!retryMessageSet.isEmpty() ) { result = retryMessageSet.first(); if (!(retryTimes.get(result) <= System.nanoTime())) { result = null; } } LOG.debug("Returning {} to spout for retrying.", result); return result; }
@Override protected SortedSet<Integer> create(Integer[] elements) { SortedSet<Integer> set = nullCheckedTreeSet(elements); if (set.isEmpty()) { /* * The (tooLow + 1, tooHigh) arguments below would be invalid because tooLow would be * greater than tooHigh. */ return ContiguousSet.create(Range.openClosed(0, 1), DiscreteDomain.integers()).subSet(0, 1); } int tooHigh = set.last() + 1; int tooLow = set.first() - 1; set.add(tooHigh); set.add(tooLow); return checkedCreate(set).subSet(tooLow + 1, tooHigh); } }
if (inclusiveNSSet != null && !inclusiveNSSet.isEmpty()) { visiblyUtilized.addAll(inclusiveNSSet); visiblyUtilized.add(prefix); result.add(attribute); } else if (!(XML.equals(NName) && XML_LANG_URI.equals(NNodeValue)) && ns.addMapping(NName, NNodeValue, attribute) prefix = XMLNS; visiblyUtilized.add(prefix);
public Configuration(Set<Pipeline> pipelines) { if (pipelines.isEmpty()) { initialStage = extent[0] = extent[1] = 0; return; } pipelines.forEach(pipeline -> { // skip pipelines without any stages, they don't contribute any rules to run final SortedSet<Stage> stages = pipeline.stages(); if (stages.isEmpty()) { return; } extent[0] = Math.min(extent[0], stages.first().stage()); extent[1] = Math.max(extent[1], stages.last().stage()); stages.forEach(stage -> stageMultimap.put(stage.stage(), stage)); }); if (extent[0] == Integer.MIN_VALUE) { throw new IllegalArgumentException("First stage cannot be at " + Integer.MIN_VALUE); } // the stage before the first stage. initialStage = extent[0] - 1; }
public static String getFirstLocalNonLoopbackIpAddress() { SortedSet<String> addresses = new TreeSet<>(); for (NetworkInterface networkInterface : localInterfaces) { Enumeration<InetAddress> inetAddressEnumeration = networkInterface.getInetAddresses(); while (inetAddressEnumeration.hasMoreElements()) { InetAddress address = inetAddressEnumeration.nextElement(); if (!address.isLoopbackAddress() && !address.getHostAddress().contains(":")) { addresses.add(address.getHostAddress()); } } } if (addresses.isEmpty()) { throw new RuntimeException("Failed to get non-loopback local ip address!"); } return addresses.first(); }
private static String getFileName(String homePath, Pattern pattern) { File home = new File(homePath); SortedSet<String> files = Sets.newTreeSet(); if (home.exists() && home.isDirectory()) { File[] listFiles = home.listFiles(); if (listFiles != null) { for (File file : listFiles) { final Matcher matcher = pattern.matcher(file.getName()); if (matcher.matches()) { files.add(file.getAbsolutePath()); } } } } if (files.isEmpty()) { throw new RuntimeException("cannot find " + pattern.toString() + " in " + homePath); } else { return files.last(); } }
existingFeatures.addAll(s); LayoutFeature prevF = existingFeatures.isEmpty() ? null : existingFeatures.first(); for (LayoutFeature f : features) { final FeatureInfo info = f.getInfo(); if (info.getSpecialFeatures() != null) { for (LayoutFeature specialFeature : info.getSpecialFeatures()) { featureSet.add(specialFeature); featureSet.add(f); map.put(info.getLayoutVersion(), featureSet);
SortedSet<ReduceSinkOperator> semiJoinRsOps = new TreeSet<>(rsOpComp); semiJoinRsOps.addAll(map.keySet()); while (!semiJoinRsOps.isEmpty()) { semiJoinRsOpsNewIter.add(prevResult.rsOperator); if (LOG.isDebugEnabled()) { LOG.debug("Adding " + OperatorUtils.getOpNamePretty(prevResult.rsOperator) semiJoinRsOpsNewIter.add(rs); if (LOG.isDebugEnabled()) { LOG.debug("Adding " + OperatorUtils.getOpNamePretty(rs) + " for re-iteration");