Refine search
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InstrumentationConfiguration that = (InstrumentationConfiguration) o; if (!classNameTranslations.equals(that.classNameTranslations)) return false; if (!classesToNotAcquire.equals(that.classesToNotAcquire)) return false; if (!instrumentedPackages.equals(that.instrumentedPackages)) return false; if (!instrumentedClasses.equals(that.instrumentedClasses)) return false; if (!interceptedMethods.equals(that.interceptedMethods)) return false; return true; }
private boolean paramEquals(Map<String, String[]> parameters) { boolean isSameParameters = _requestParameters.keySet().equals(parameters.keySet()); if (isSameParameters) { for (Map.Entry<String, String[]> entry : _requestParameters.entrySet()) { Set<String> param1 = new HashSet<>(Arrays.asList(entry.getValue())); Set<String> param2 = new HashSet<>(Arrays.asList(parameters.get(entry.getKey()))); if (!param1.equals(param2)) { return false; } } } return isSameParameters; }
for (TopologyDetails topo : topologies.getTopologies()) { String id = topo.getId(); Set<List<Integer>> allExecs = topoToExec.get(id); Set<List<Integer>> aliveExecs = topoToAliveExecutors.get(id); int numDesiredWorkers = topo.getNumWorkers(); int numAssignedWorkers = numUsedWorkers(topoToSchedAssignment.get(id)); if (allExecs == null || allExecs.isEmpty() || !allExecs.equals(aliveExecs) || numDesiredWorkers > numAssignedWorkers) { missingAssignmentTopologies.add(id); for (Entry<String, Map<WorkerSlot, WorkerResources>> uglyWorkerResources : cluster.getWorkerResourcesMap().entrySet()) { Map<WorkerSlot, WorkerResources> slotToResources = new HashMap<>(); for (Entry<WorkerSlot, WorkerResources> uglySlotToResources : uglyWorkerResources.getValue().entrySet()) { WorkerResources wr = uglySlotToResources.getValue(); slotToResources.put(uglySlotToResources.getKey(), wr);
String column = JdbcUtils.lookupColumnName(rsmd, index); String field = lowerCaseName(StringUtils.delete(column, " ")); PropertyDescriptor pd = (this.mappedFields != null ? this.mappedFields.get(field) : null); if (pd != null) { try { populatedProperties.add(pd.getName()); if (populatedProperties != null && !populatedProperties.equals(this.mappedProperties)) { throw new InvalidDataAccessApiUsageException("Given ResultSet does not contain all fields " + "necessary to populate object of class [" + this.mappedClass.getName() + "]: " +
this.partitionHandles = ImmutableList.copyOf(partitionHandles); checkArgument(splitSources.keySet().equals(ImmutableSet.copyOf(schedulingOrder))); partitionHandles.equals(ImmutableList.of(NOT_PARTITIONED)) != stageExecutionDescriptor.isStageGroupedExecution(), "PartitionHandles should be [NOT_PARTITIONED] if and only if all scan nodes use ungrouped execution strategy"); int nodeCount = nodes.size(); Optional<LifespanScheduler> groupedLifespanScheduler = Optional.empty(); for (PlanNodeId planNodeId : schedulingOrder) { SplitSource splitSource = splitSources.get(planNodeId); boolean groupedExecutionForScanNode = stageExecutionDescriptor.isScanGroupedExecution(planNodeId); SourceScheduler sourceScheduler = newSourcePartitionedSchedulerAsSourceScheduler(
public List<String> getGroupAuths(String[] groups) { this.lock.readLock().lock(); try { List<String> auths = EMPTY_LIST; Set<Integer> authOrdinals = getGroupAuthsAsOrdinals(groups); if (!authOrdinals.equals(EMPTY_SET)) { auths = new ArrayList<>(authOrdinals.size()); for (Integer authOrdinal : authOrdinals) { auths.add(ordinalVsLabels.get(authOrdinal)); } } return auths; } finally { this.lock.readLock().unlock(); } }
for (DiskRange mergedRange : mergedRanges) { LazyBufferLoader mergedRangeLazyLoader = new LazyBufferLoader(mergedRange); for (Entry<K, DiskRange> diskRangeEntry : diskRanges.entrySet()) { DiskRange diskRange = diskRangeEntry.getValue(); if (mergedRange.contains(diskRange)) { for (Entry<K, DiskRange> entry : diskRanges.entrySet()) { slices.put(entry.getKey(), new OrcDataSourceInput(getDiskRangeSlice(entry.getValue(), buffers).getInput(), entry.getValue().getLength())); verify(sliceStreams.keySet().equals(diskRanges.keySet())); return sliceStreams;
.getAllLocatorsInfo(); if (!allLocators.equals(locators)) { for (Map.Entry<Integer, Set<DistributionLocatorId>> entry : locators.entrySet()) { Set<DistributionLocatorId> existingValue = allLocators.putIfAbsent(entry.getKey(), new CopyOnWriteHashSet<DistributionLocatorId>(entry.getValue())); if (!localLocators.equals(entry.getValue())) { entry.getValue().removeAll(localLocators); for (DistributionLocatorId locator : entry.getValue()) { localLocators.add(locator); addServerLocator(entry.getKey(), locatorListener, locator); locatorListener.locatorJoined(entry.getKey(), locator, null);
@Test public void testEquals() { // TODO: reduce test runtime Set s1, s2; s1 = new CompactConcurrentHashSet2(); s2 = new HashSet(); for (int i = 0; i < 10000; i++) { int nexti = random.nextInt(RANGE); s1.add(nexti); s2.add(nexti); assertTrue("expected s1 and s2 to be equal", s1.equals(s2)); assertTrue("expected s1 and s2 to be equal", s2.equals(s1)); } assertTrue(s1.hashCode() != 0); s2 = new CompactConcurrentHashSet2(2); s2.addAll(s1); assertTrue("expected s1 and s2 to be equal", s1.equals(s2)); assertTrue("expected s1 and s2 to be equal", s2.equals(s1)); }
public MetricName metricInstance(MetricNameTemplate template, Map<String, String> tags) { // check to make sure that the runtime defined tags contain all the template tags. Set<String> runtimeTagKeys = new HashSet<>(tags.keySet()); runtimeTagKeys.addAll(config().tags().keySet()); Set<String> templateTagKeys = template.tags(); if (!runtimeTagKeys.equals(templateTagKeys)) { throw new IllegalArgumentException("For '" + template.name() + "', runtime-defined metric tags do not match the tags in the template. " + "Runtime = " + runtimeTagKeys.toString() + " Template = " + templateTagKeys.toString()); } return this.metricName(template.name(), template.group(), template.description(), tags); }
|| ((this.fixedPAttrs == null) != (other.getFixedPartitionAttributes() == null)) || (this.fixedPAttrs != null && !this.fixedPAttrs.equals(other.getFixedPartitionAttributes()))) { return false; for (int i = 0; i < otherPListeners.length; i++) { PartitionListener listener = otherPListeners[i]; otherListenerClassName.add(listener.getClass().getName()); thisListenerClassName.add(listener.getClass().getName()); if (!thisListenerClassName.equals(otherListenerClassName)) { return false;
/** * Determine if one or more replica sets has been added or removed since the prior state. * * @param priorState the prior state of the replica sets; may be null * @return {@code true} if the replica sets have changed since the prior state, or {@code false} otherwise */ public boolean haveChangedSince(ReplicaSets priorState) { if (priorState.replicaSetCount() != this.replicaSetCount()) { // At least one replica set has been added or removed ... return true; } if (this.replicaSetsByName.size() != priorState.replicaSetsByName.size()) { // The total number of replica sets hasn't changed, but the number of named replica sets has changed ... return true; } // We have the same number of named replica sets ... if (!this.replicaSetsByName.isEmpty()) { if (!this.replicaSetsByName.keySet().equals(priorState.replicaSetsByName.keySet())) { // The replica sets have different names ... return true; } // Otherwise, they have the same names and we don't care about the members ... } // None of the named replica sets has changed, so we have no choice to be compare the non-replica set members ... return this.nonReplicaSets.equals(priorState.nonReplicaSets) ? false : true; }
private boolean hasTheSameHttpParameter(Map<String, String[]> params1, Map<String, String[]> params2) { boolean isSameParameters = params1.keySet().equals(params2.keySet()); if (isSameParameters) { for (Map.Entry<String, String[]> entry : params1.entrySet()) { Set<String> values1 = new HashSet<>(Arrays.asList(entry.getValue())); Set<String> values2 = new HashSet<>(Arrays.asList(params2.get(entry.getKey()))); if (!values1.equals(values2)) { return false; } } } return isSameParameters; }
/** * Inspect the {@code expectedModel} to see if all elements in the * model appear and are equal. * @param mav the ModelAndView to test against (never {@code null}) * @param expectedModel the expected model */ public static void assertModelAttributeValues(ModelAndView mav, Map<String, Object> expectedModel) { Map<String, Object> model = mav.getModel(); if (!model.keySet().equals(expectedModel.keySet())) { StringBuilder sb = new StringBuilder("Keyset of expected model does not match.\n"); appendNonMatchingSetsErrorMessage(expectedModel.keySet(), model.keySet(), sb); fail(sb.toString()); } StringBuilder sb = new StringBuilder(); model.forEach((modelName, mavValue) -> { Object assertionValue = expectedModel.get(modelName); if (!assertionValue.equals(mavValue)) { sb.append("Value under name '").append(modelName).append("' differs, should have been '").append( assertionValue).append("' but was '").append(mavValue).append("'\n"); } }); if (sb.length() != 0) { sb.insert(0, "Values of expected model do not match.\n"); fail(sb.toString()); } }
LogItem throwLessLogItem = new LogItem(log.type, log.tag, log.msg, null); if (expectedLogs.contains(throwLessLogItem)) { observedLogs.add(throwLessLogItem); continue; observedTags.add(log.tag); continue; if (!expectedLogs.equals(observedLogs)) { throw new AssertionError( "Some expected logs were not printed." + observedLogs); if (!expectedTags.equals(observedTags) && !shouldIgnoreMissingLoggedTags) { throw new AssertionError( "Some expected tags were not printed. "