Refine search
for (Iterator<Map.Entry<String, List<TopicPartition>>> it = currentAssignment.entrySet().iterator(); it.hasNext();) { Map.Entry<String, List<TopicPartition>> entry = it.next(); if (!subscriptions.containsKey(entry.getKey())) { } else { for (Iterator<TopicPartition> partitionIter = entry.getValue().iterator(); partitionIter.hasNext();) { TopicPartition partition = partitionIter.next(); if (!partition2AllPotentialConsumers.containsKey(partition)) { TreeSet<String> sortedCurrentSubscriptions = new TreeSet<>(new SubscriptionComparator(currentAssignment)); sortedCurrentSubscriptions.addAll(currentAssignment.keySet());
@Override public ConsumerRunningInfo consumerRunningInfo() { ConsumerRunningInfo info = new ConsumerRunningInfo(); Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer); prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly)); prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize())); prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp)); info.setProperties(prop); Set<SubscriptionData> subSet = this.subscriptions(); info.getSubscriptionSet().addAll(subSet); Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator(); while (it.hasNext()) { Entry<MessageQueue, ProcessQueue> next = it.next(); MessageQueue mq = next.getKey(); ProcessQueue pq = next.getValue(); ProcessQueueInfo pqinfo = new ProcessQueueInfo(); pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE)); pq.fillProcessQueueInfo(pqinfo); info.getMqTable().put(mq, pqinfo); } for (SubscriptionData sd : subSet) { ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic()); info.getStatusTable().put(sd.getTopic(), consumeStatus); } return info; }
@Test public void testUnionForTwoLists() { int[] docIds1 = new int[]{2, 3, 10, 15, 16, 28}; int[] docIds2 = new int[]{3, 6, 8, 20, 28}; TreeSet<Integer> treeSet = new TreeSet<>(); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds1))); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds2))); Iterator<Integer> expectedIterator = treeSet.iterator(); List<BaseFilterOperator> operators = new ArrayList<>(); operators.add(new TestFilterOperator(docIds1)); operators.add(new TestFilterOperator(docIds2)); OrFilterOperator orOperator = new OrFilterOperator(operators); BlockDocIdIterator iterator = orOperator.nextBlock().getBlockDocIdSet().iterator(); int docId; while ((docId = iterator.next()) != Constants.EOF) { Assert.assertEquals(docId, expectedIterator.next().intValue()); } }
TreeSet<String> thisAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); thisAttributes.addAll(getParameters().keySet()); TreeSet<String> otherAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); otherAttributes.addAll(other.getParameters().keySet()); Iterator<String> thisAttributesIterator = thisAttributes.iterator(); Iterator<String> otherAttributesIterator = otherAttributes.iterator(); while (thisAttributesIterator.hasNext()) { String thisAttribute = thisAttributesIterator.next(); String otherAttribute = otherAttributesIterator.next(); comp = thisAttribute.compareToIgnoreCase(otherAttribute); if (comp != 0) {
@Override public ConsumerRunningInfo consumerRunningInfo() { ConsumerRunningInfo info = new ConsumerRunningInfo(); Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer); prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly)); prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE, String.valueOf(this.consumeMessageService.getCorePoolSize())); prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP, String.valueOf(this.consumerStartTimestamp)); info.setProperties(prop); Set<SubscriptionData> subSet = this.subscriptions(); info.getSubscriptionSet().addAll(subSet); Iterator<Entry<MessageQueue, ProcessQueue>> it = this.rebalanceImpl.getProcessQueueTable().entrySet().iterator(); while (it.hasNext()) { Entry<MessageQueue, ProcessQueue> next = it.next(); MessageQueue mq = next.getKey(); ProcessQueue pq = next.getValue(); ProcessQueueInfo pqinfo = new ProcessQueueInfo(); pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE)); pq.fillProcessQueueInfo(pqinfo); info.getMqTable().put(mq, pqinfo); } for (SubscriptionData sd : subSet) { ConsumeStatus consumeStatus = this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(), sd.getTopic()); info.getStatusTable().put(sd.getTopic(), consumeStatus); } return info; }
@Test public void testUnionForThreeLists() { int[] docIds1 = new int[]{2, 3, 6, 10, 15, 16, 28}; int[] docIds2 = new int[]{3, 6, 8, 20, 28}; int[] docIds3 = new int[]{1, 2, 3, 6, 30}; TreeSet<Integer> treeSet = new TreeSet<>(); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds1))); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds2))); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds3))); Iterator<Integer> expectedIterator = treeSet.iterator(); List<BaseFilterOperator> operators = new ArrayList<>(); operators.add(new TestFilterOperator(docIds1)); operators.add(new TestFilterOperator(docIds2)); operators.add(new TestFilterOperator(docIds3)); OrFilterOperator orOperator = new OrFilterOperator(operators); BlockDocIdIterator iterator = orOperator.nextBlock().getBlockDocIdSet().iterator(); int docId; while ((docId = iterator.next()) != Constants.EOF) { Assert.assertEquals(docId, expectedIterator.next().intValue()); } }
while (itCluster.hasNext()) { Map.Entry<String, Set<String>> next = itCluster.next(); String clusterName = next.getKey(); TreeSet<String> brokerNameSet = new TreeSet<String>(); brokerNameSet.addAll(next.getValue()); while (itAddr.hasNext()) { Map.Entry<Long, String> next1 = itAddr.next(); long inTotalYest = 0; long outTotalYest = 0; if (itCluster.hasNext()) { System.out.printf("");
endRequest); workingIt = workingSet.iterator(); while (workingIt.hasNext()) { workingIt.next(); workingIt.remove(); while (workingIt.hasNext()) { workingIt.next().adjustPosition(adjustment); workingIt = workingSet.iterator(); dp = null; if (workingIt.hasNext()) { dp = workingIt.next(); this.iniPositions.addAll(this.newPositions); this.newPositions.clear(); } catch (IOException e) {
@Test public void testComplex() { int[] docIds1 = new int[]{2, 3, 6, 10, 15, 16, 28}; int[] docIds2 = new int[]{3, 6, 8, 20, 28}; int[] docIds3 = new int[]{1, 2, 3, 6, 30}; TreeSet<Integer> treeSet = new TreeSet<>(); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds1))); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds2))); treeSet.addAll(Arrays.asList(ArrayUtils.toObject(docIds3))); Iterator<Integer> expectedIterator = treeSet.iterator(); List<BaseFilterOperator> childOperators = new ArrayList<>(); childOperators.add(new TestFilterOperator(docIds1)); childOperators.add(new TestFilterOperator(docIds2)); OrFilterOperator childOrOperator = new OrFilterOperator(childOperators); List<BaseFilterOperator> operators = new ArrayList<>(); operators.add(childOrOperator); operators.add(new TestFilterOperator(docIds3)); OrFilterOperator orOperator = new OrFilterOperator(operators); BlockDocIdIterator iterator = orOperator.nextBlock().getBlockDocIdSet().iterator(); int docId; while ((docId = iterator.next()) != Constants.EOF) { Assert.assertEquals(docId, expectedIterator.next().intValue()); } } }
while (itCluster.hasNext()) { Map.Entry<String, Set<String>> next = itCluster.next(); String clusterName = next.getKey(); TreeSet<String> brokerNameSet = new TreeSet<String>(); brokerNameSet.addAll(next.getValue()); while (itAddr.hasNext()) { Map.Entry<Long, String> next1 = itAddr.next(); double in = 0; double out = 0; if (itCluster.hasNext()) { System.out.printf("");
@Override public String getCurrentExecutionYearBeginDate() { if (registration.isInMobilityState()) { return readCurrentExecutionYear().getBeginDateYearMonthDay().toLocalDate().toString("dd-MM-yyyy"); } StudentCurricularPlan lastStudentCurricularPlan = registration.getLastStudentCurricularPlan(); TreeSet<Enrolment> orderedEnrolmentSet = new TreeSet<Enrolment>(Collections.reverseOrder(CurriculumModule.COMPARATOR_BY_CREATION_DATE)); orderedEnrolmentSet.addAll(lastStudentCurricularPlan.getEnrolmentsByExecutionYear(readCurrentExecutionYear())); return orderedEnrolmentSet.isEmpty() ? "" : orderedEnrolmentSet.iterator().next().getCreationDateDateTime().toLocalDate() .toString("dd-MM-yyyy"); }
TreeSet<String> thisAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); thisAttributes.addAll(getParameters().keySet()); TreeSet<String> otherAttributes = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); otherAttributes.addAll(other.getParameters().keySet()); Iterator<String> thisAttributesIterator = thisAttributes.iterator(); Iterator<String> otherAttributesIterator = otherAttributes.iterator(); while (thisAttributesIterator.hasNext()) { String thisAttribute = thisAttributesIterator.next(); String otherAttribute = otherAttributesIterator.next(); comp = thisAttribute.compareToIgnoreCase(otherAttribute); if (comp != 0) {
TreeSet rSet = new TreeSet(new RegionComparator()); rSet.addAll(this.cache.rootRegions()); Iterator it = rSet.iterator(); while (it.hasNext()) { Region root = (Region) it.next(); Assert.assertTrue(root instanceof LocalRegion); if (root instanceof PartitionedRegion) { TreeSet rColSet = new TreeSet(new RegionComparator()); rColSet.addAll(colocatedChildRegions); Iterator colIter = rColSet.iterator(); while (colIter.hasNext()) { Region root = (Region) colIter.next(); Assert.assertTrue(root instanceof LocalRegion); if (root instanceof PartitionedRegion) {
public static Set<Entry<String, ?>> getSharedPreferenceEntriesSorted(SharedPreferences preferences) { TreeSet<Entry<String, ?>> entries = new TreeSet<>(new Comparator<Entry<String, ?>>() { @Override public int compare(Entry<String, ?> lhs, Entry<String, ?> rhs) { return lhs.getKey().compareTo(rhs.getKey()); } }); entries.addAll(preferences.getAll().entrySet()); return entries; }
tx.store(metadata.page, metadataMarshaller, true); final TreeSet<Integer> gcCandidateSet = new TreeSet<>(); if (cleanup) { final TreeSet<Integer> completeFileSet = new TreeSet<>(journal.getFileMap().keySet()); gcCandidateSet.addAll(completeFileSet); while (iter.hasNext()) { Entry<String, Location> subscription = iter.next(); int dataFileId = subscription.getValue().getDataFileId(); while (candidates.hasNext()) { Integer candidate = candidates.next(); Set<Integer> referencedFileIds = metadata.ackMessageFileMap.get(candidate); if (referencedFileIds != null) {