if (!adminClient.describeConsumerGroup(groupId).consumers().get().isEmpty()) { throw new IllegalStateException("Consumer group '" + groupId + "' is still active. " + "Make sure to stop all running application instances before running the reset tool.");
@Override public boolean hasNext() { return !l.isEmpty(); }
@Override public boolean hasNext() { return !l.isEmpty(); }
if (rewrites.size() == 1 && rewrites.get(0).getLeft().isEmpty()) { return rewrites.get(0).getRight().substituteAndEvaluate(substitution, context);
/** * goes down the path on the subject to find the rewrite place, does the substitution, and reconstructs the term * on its way up */ private Term buildRHS(Term subject, Substitution<Variable, Term> substitution, scala.collection.immutable.List<Pair<Integer, Integer>> path, Term rhs, TermContext context) { if (path.isEmpty()) { return rhs.substituteAndEvaluate(substitution, context); } else { if (subject instanceof KItem) { KItem kItemSubject = (KItem) subject; List<Term> newContents = new ArrayList<>(((KList) kItemSubject.kList()).getContents()); //noinspection RedundantCast newContents.set(path.head().getLeft(), buildRHS(newContents.get(path.head().getLeft()), substitution, (scala.collection.immutable.List<Pair<Integer, Integer>>) path.tail(), rhs, context)); return KItem.of(kItemSubject.kLabel(), KList.concatenate(newContents), context.global()).applyAnywhereRules(context); } else if (subject instanceof BuiltinList) { BuiltinList builtinListSubject = (BuiltinList) subject; List<Term> newContents = new ArrayList<>(builtinListSubject.children); //noinspection RedundantCast newContents.set(path.head().getLeft(), buildRHS(newContents.get(path.head().getLeft()), substitution, (scala.collection.immutable.List<Pair<Integer, Integer>>) path.tail(), rhs, context)); return BuiltinList .builder(builtinListSubject.sort, builtinListSubject.operatorKLabel, builtinListSubject.unitKLabel, builtinListSubject.globalContext()) .addAll(newContents) .build(); } else { throw new AssertionError("unexpected rewrite in subject: " + subject); } } }
/** * Creates a new `Spool` of given `elems`. */ @SuppressWarnings("unchecked") public static <T> Spool<T> newSpool(Collection<T> elems) { List<T> buffer = (List<T>)List.empty(); for (T item : elems) { buffer = buffer.$colon$colon(item); } Spool<T> result = (Spool<T>)EMPTY; while(!buffer.isEmpty()){ result = new Spool.Cons<T>(buffer.head(), Future.value(result)); buffer = (List<T>)buffer.tail(); } return result; }
private Map<String, ApiListing> processControllers(Set<Class<?>> controllerClasses) { //Loop over end points (controllers) for (Class<?> controllerClass : controllerClasses) { if (ApiDocumentationController.class.isAssignableFrom(controllerClass)) { continue; } Set<Method> requestMappingMethods = AnnotationUtils.getAnnotatedMethods(controllerClass, RequestMapping.class); ApiListing apiListing = processControllerApi(controllerClass); String description = ""; Api controllerApi = controllerClass.getAnnotation(Api.class); if (controllerApi != null) { description = controllerApi.description(); } if (apiListing.apis().size() == 0) { apiListing = processMethods(requestMappingMethods, controllerClass, apiListing, description); } //Allow for multiple controllers having the same resource path. ApiListing existingApiListing = apiListingMap.get(apiListing.resourcePath()); if (existingApiListing != null) { apiListing = ApiListingUtil.mergeApiListing(existingApiListing, apiListing); } // controllers without any operations are excluded from the apiListingMap list if (apiListing.apis() != null && !apiListing.apis().isEmpty()) { apiListingMap.put(apiListing.resourcePath(), apiListing); } } return apiListingMap; }
/** * Creates a new `Spool` of given `elems`. */ @SuppressWarnings("unchecked") public static <T> Spool<T> newSpool(Collection<T> elems) { List<T> buffer = (List<T>)List.empty(); for (T item : elems) { buffer = buffer.$colon$colon(item); } Spool<T> result = (Spool<T>)EMPTY; while(!buffer.isEmpty()){ result = new Spool.Cons<T>(buffer.head(), Future.value(result)); buffer = (List<T>)buffer.tail(); } return result; }
if(consumers.isEmpty()){ System.out.println("Consumer group ["+group+"] does not exist or is rebalancing."); return null;
if (!route.targets().isEmpty()) { Delivery delivery = new Delivery(); delivery.message_$eq(new RawMessage(publish.payload()));