public int getSize() { return inflightEvents.size(); }
@MapFeature.Require(SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutDuplicateValuePreservesSize() { assertFalse(multimap().put(k0(), v0())); assertEquals(getNumElements(), multimap().size()); }
@CollectionSize.Require(SEVERAL) @MapFeature.Require(SUPPORTS_REMOVE) public void testValuesRemove() { resetContainer( Helpers.mapEntry(k0(), v0()), Helpers.mapEntry(k1(), v0()), Helpers.mapEntry(k0(), v3())); assertTrue(multimap().asMap().values().remove(Collections.singleton(v0()))); assertEquals(2, multimap().size()); assertEquals(Collections.singletonMap(k0(), Sets.newHashSet(v0(), v3())), multimap().asMap()); } }
log.info(String.format("Created %s workunits ", workUnitsMap.size())); log.info(String.format( "Bin packed work units. Initial work units: %d, packed work units: %d, max weight per bin: %d, " + "max work units per bin: %d.", workUnitsMap.size(), workUnits.size(), maxSizePerBin, maxWorkUnitsPerMultiWorkUnit)); return ImmutableList.copyOf(workUnits);
private StringBuilder getGeneralLockStats() { StringBuilder logString = new StringBuilder(); logString.append("Logging current state. Time = ").append(currentTimeMillis()).append("\n"); logString.append("isStandaloneServer = ").append(isStandaloneServer).append("\n"); logString.append("maxAllowedLockTimeout = ").append(maxAllowedLockTimeout).append("\n"); logString.append("maxAllowedClockDrift = ").append(maxAllowedClockDrift).append("\n"); logString.append("descriptorToLockMap.size = ").append(descriptorToLockMap.size()).append("\n"); logString.append("outstandingLockRequestMultimap.size = ").append(outstandingLockRequestMultimap.size()).append("\n"); logString.append("heldLocksTokenMap.size = ").append(heldLocksTokenMap.size()).append("\n"); logString.append("heldLocksGrantMap.size = ").append(heldLocksGrantMap.size()).append("\n"); logString.append("lockTokenReaperQueue.size = ").append(lockTokenReaperQueue.size()).append("\n"); logString.append("lockGrantReaperQueue.size = ").append(lockGrantReaperQueue.size()).append("\n"); logString.append("lockClientMultimap.size = ").append(lockClientMultimap.size()).append("\n"); logString.append("lockClientMultimap.size = ").append(lockClientMultimap.size()).append("\n"); return logString; }
private boolean finishCellIfNoRowsYet() { if (entries.size() == 0) { flushRowBuffer(); while (currentCellHasEntriesLeft()) { long timestamp = iterator.next().getLong(DbKvs.TIMESTAMP); entries.put(Cell.create(currentRow, currentCol), timestamp); } return true; } return false; }
public int size() { if(guavaMultiMap != null) return guavaMultiMap.size(); return hcMultiMap.size(); }
@Override public boolean isSubtractive() { if (this.indexNameToRemovals != null && this.indexNameToRemovals.size() > 0) { if (this.indexNameToAdditions == null || this.indexNameToAdditions.isEmpty()) { return true; } } return false; }
private boolean finishCellIfNoRowsYet() { if (entries.size() == 0) { flushRowBuffer(); while (currentCellHasEntriesLeft()) { long timestamp = iterator.next().getLong(DbKvs.TIMESTAMP); entries.put(Cell.create(currentRow, currentCol), timestamp); } return true; } return false; }
@Test public void itHasIncludesReferenceInContext() throws Exception { RenderResult renderResult = jinjava.renderForResult(Resources.toString(Resources.getResource("tags/includetag/include-tag-dependencies.html"), StandardCharsets.UTF_8), new HashMap<String, Object>()); SetMultimap<String, String> dependencies = renderResult.getContext().getDependencies(); assertThat(dependencies.size()).isEqualTo(2); assertThat(dependencies.get("coded_files")).isNotEmpty(); assertThat(dependencies.get("coded_files").contains("{% include \"tags/includetag/hello.html\" %}")); assertThat(dependencies.get("coded_files").contains("{% include \"tags/includetag/cat.html\" %}")); }
@Test public void itHasIncludesReferenceInContext() throws Exception { RenderResult renderResult = jinjava.renderForResult(Resources.toString(Resources.getResource("tags/includetag/include-tag-dependencies.html"), StandardCharsets.UTF_8), new HashMap<String, Object>()); SetMultimap<String, String> dependencies = renderResult.getContext().getDependencies(); assertThat(dependencies.size()).isEqualTo(2); assertThat(dependencies.get("coded_files")).isNotEmpty(); assertThat(dependencies.get("coded_files").contains("{% include \"tags/includetag/hello.html\" %}")); assertThat(dependencies.get("coded_files").contains("{% include \"tags/includetag/cat.html\" %}")); }
@Test public void itHasExtendsReferenceInContext() throws Exception { RenderResult renderResult = jinjava.renderForResult(locator.fixture("super-child.html"), new HashMap<String, Object>()); SetMultimap<String, String> dependencies = renderResult.getContext().getDependencies(); assertThat(dependencies.size()).isEqualTo(1); assertThat(dependencies.get("coded_files")).isNotEmpty(); assertThat(dependencies.get("coded_files").contains("super-base.html")); }
@MapFeature.Require(SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutDuplicateValuePreservesSize() { assertFalse(multimap().put(sampleKeys().e0, sampleValues().e0)); assertEquals(getNumElements(), multimap().size()); }
@MapFeature.Require(SUPPORTS_PUT) @CollectionSize.Require(absent = ZERO) public void testPutDuplicateValuePreservesSize() { assertFalse(multimap().put(k0(), v0())); assertEquals(getNumElements(), multimap().size()); }
@Test public void categorizeReferenceFileHtml() throws Exception { reader.categorizeReferenceFile(new GenListModuleReader.Reference(URI.create("file:///foo/bar/baz.html"), ATTR_FORMAT_VALUE_HTML)); assertEquals(1, reader.htmlSet.size()); assertEquals(0, reader.formatSet.size()); }
@Test public void categorizeReferenceFileImage() throws Exception { reader.categorizeReferenceFile(new GenListModuleReader.Reference(URI.create("file:///foo/bar/baz.jpg"), ATTR_FORMAT_VALUE_IMAGE)); assertEquals(0, reader.htmlSet.size()); assertEquals(1, reader.formatSet.size()); }
@CollectionSize.Require(SEVERAL) @MapFeature.Require(SUPPORTS_REMOVE) public void testValuesRemove() { resetContainer( Helpers.mapEntry(k0(), v0()), Helpers.mapEntry(k1(), v0()), Helpers.mapEntry(k0(), v3())); assertTrue(multimap().asMap().values().remove(Collections.singleton(v0()))); assertEquals(2, multimap().size()); assertEquals(Collections.singletonMap(k0(), Sets.newHashSet(v0(), v3())), multimap().asMap()); } }