private void logQueueStatus() { LOG.info("{} undelivered, of which {} high-priority", nUndeliveredTasks, stalledHighPriorityTasks.size()); LOG.info("{} producers waiting, {} consumers waiting", highPriorityResponses.size(), nWaitingConsumers); LOG.info("{} total workers", workerCatalog.size()); }
if (waysByEndpoint.size() == 0) { return closedRings;
if (waysByEndpoint.size() == 0) { return true; // success
public void testTrimToSize() { ArrayListMultimap<String, Integer> multimap = ArrayListMultimap.create(); multimap.put("foo", 1); multimap.put("foo", 2); multimap.put("bar", 3); multimap.trimToSize(); assertEquals(3, multimap.size()); assertThat(multimap.get("foo")).containsExactly(1, 2).inOrder(); assertThat(multimap.get("bar")).contains(3); } }
private void createParentsString(StringBuilder theParentsBuilder, Long theConceptPid) { Validate.notNull(theConceptPid, "theConceptPid must not be null"); List<Long> parents = myChildToParentPidCache.get(theConceptPid); if (parents.contains(-1L)) { return; } else if (parents.isEmpty()) { Collection<Long> parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid); if (parentLinks.isEmpty()) { myChildToParentPidCache.put(theConceptPid, -1L); ourLog.info("Found {} parent concepts of concept {} (cache has {})", 0, theConceptPid, myChildToParentPidCache.size()); return; } else { for (Long next : parentLinks) { myChildToParentPidCache.put(theConceptPid, next); } int parentCount = myChildToParentPidCache.get(theConceptPid).size(); ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); } } for (Long nextParent : parents) { if (theParentsBuilder.length() > 0) { theParentsBuilder.append(' '); } theParentsBuilder.append(nextParent); createParentsString(theParentsBuilder, nextParent); } }
public int size(){ return registeredFunctions.size(); }
@Override public int size() { return attributes.size(); }
/** * Test for metadata presence * * @return true if there is a metadata entry */ public boolean hasMetaData() { return metadata.size() > 0; }
@Override public int size() { return edgeMultimap.size(); }
/** Returns a shallow copy of this record. */ public Record copy() { //return new Record(ArrayListMultimap.create(fields)); // adding fields later causes (slow) rehashing ArrayListMultimap<String,Object> copy = ArrayListMultimap.create(fields.size() + 16, 10); copy.putAll(fields); return new Record(copy); }
/** Returns a shallow copy of this record. */ public Record copy() { //return new Record(ArrayListMultimap.create(fields)); // adding fields later causes (slow) rehashing ArrayListMultimap<String,Object> copy = ArrayListMultimap.create(fields.size() + 16, 10); copy.putAll(fields); return new Record(copy); }
buffer.append("Registered ").append(descriptors.size()) .append(" descriptors."); try
@Override public void write(DataOutput out) throws IOException { // We write both the total number of edges and the number of unique // neighbors. out.writeInt(edgeMultimap.size()); out.writeInt(edgeMultimap.keys().size()); for (Map.Entry<I, E> edge : edgeMultimap.entries()) { edge.getKey().write(out); edge.getValue().write(out); } }
private void createParentsString(StringBuilder theParentsBuilder, Long theConceptPid) { Validate.notNull(theConceptPid, "theConceptPid must not be null"); List<Long> parents = myChildToParentPidCache.get(theConceptPid); if (parents.contains(-1L)) { return; } else if (parents.isEmpty()) { Collection<Long> parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid); if (parentLinks.isEmpty()) { myChildToParentPidCache.put(theConceptPid, -1L); ourLog.info("Found {} parent concepts of concept {} (cache has {})", 0, theConceptPid, myChildToParentPidCache.size()); return; } else { for (Long next : parentLinks) { myChildToParentPidCache.put(theConceptPid, next); } int parentCount = myChildToParentPidCache.get(theConceptPid).size(); ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); } } for (Long nextParent : parents) { if (theParentsBuilder.length() > 0) { theParentsBuilder.append(' '); } theParentsBuilder.append(nextParent); createParentsString(theParentsBuilder, nextParent); } }
public static int getMaximumForTier(int tier) { int ret = 0; if (tier > OrbRegistry.getTierMap().size() || tier < 0) return ret; for (ItemStack orbStack : OrbRegistry.getOrbsForTier(tier)) { BloodOrb orb = ((IBloodOrb) orbStack.getItem()).getOrb(orbStack); if (orb.getCapacity() > ret) ret = orb.getCapacity(); } return ret; }
if (fSimplePatternRules != null && fSimplePatternRules.size() > 0) { Iterator<IPatternMatcher<IExpr>> listIter = fSimplePatternRules.values().iterator(); IPatternMatcher<IExpr> elem;
/** * Core of {@link #serializeNBT()}. Doesn't set serializedTag. * * @return the serialized tag. */ private NBTTagCompound internalSerializeNBT() { NBTTagCompound compound = new NBTTagCompound(); if (!compileTimeModifiers.isEmpty()) { // Retrieve all modifier compounds ArrayList<NBTTagCompound> modifierList = new ArrayList<>(compileTimeModifiers.size()); compileTimeModifiers.forEach((op, modifier) -> { NBTTagCompound modifierCompound = new NBTTagCompound(); modifierCompound.setInteger("operation", modifier.getOperation().ordinal()); modifierCompound.setString("attribute", modifier.getAttribute().getNbtName()); FixedPointUtils.setFixedToNBT(modifierCompound, "modifier", modifier.getModifierFixed()); modifierList.add(modifierCompound); }); // Sort and store them NBTTagList attribs = sortModifierList(modifierList); compound.setTag("modifiers", attribs); } compound.setTag("extra", informationTag); compound.setString("primary_color", String.valueOf(primaryColor.getRGB())); compound.setString("secondary_color", String.valueOf(secondaryColor.getRGB())); if (childRing != null) compound.setTag("child_ring", this.childRing.serializeNBT()); if (module != null) compound.setString("module", module.getSubModuleID()); return compound; }
public void testTrimToSize() { ArrayListMultimap<String, Integer> multimap = ArrayListMultimap.create(); multimap.put("foo", 1); multimap.put("foo", 2); multimap.put("bar", 3); multimap.trimToSize(); assertEquals(3, multimap.size()); assertThat(multimap.get("foo")).containsExactly(1, 2).inOrder(); assertThat(multimap.get("bar")).contains(3); } }