@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof ResourceGroupGlobalProperties)) { return false; } ResourceGroupGlobalProperties that = (ResourceGroupGlobalProperties) other; return cpuQuotaPeriod.equals(that.cpuQuotaPeriod); }
public boolean sameConfig(ResourceGroupSpec other) { if (other == null) { return false; } return (name.equals(other.name) && softMemoryLimit.equals(other.softMemoryLimit) && maxQueued == other.maxQueued && softConcurrencyLimit.equals(other.softConcurrencyLimit) && hardConcurrencyLimit == other.hardConcurrencyLimit && schedulingPolicy.equals(other.schedulingPolicy) && schedulingWeight.equals(other.schedulingWeight) && jmxExport.equals(other.jmxExport) && softCpuLimit.equals(other.softCpuLimit) && hardCpuLimit.equals(other.hardCpuLimit)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ArgumentProperty other = (ArgumentProperty) obj; return this.argumentType == other.argumentType && this.nullConvention.equals(other.nullConvention) && this.lambdaInterface.equals(other.lambdaInterface); }
@Override public boolean equals(Object other) { if (other instanceof ChannelKey) { ChannelKey otherKey = (ChannelKey) other; return mAddress.equals(otherKey.mAddress) && mPlain == otherKey.mPlain && mKeepAliveTime.equals(otherKey.mKeepAliveTime) && mKeepAliveTimeout.equals(otherKey.mKeepAliveTimeout) && mFlowControlWindow.equals(otherKey.mFlowControlWindow) && mMaxInboundMessageSize.equals(otherKey.mMaxInboundMessageSize) && mChannelType.equals(otherKey.mChannelType) && mPoolKey == otherKey.mPoolKey && mEventLoopGroup.equals(otherKey.mEventLoopGroup); } return false; }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof ResourceGroupSpec)) { return false; } ResourceGroupSpec that = (ResourceGroupSpec) other; return (name.equals(that.name) && softMemoryLimit.equals(that.softMemoryLimit) && maxQueued == that.maxQueued && softConcurrencyLimit.equals(that.softConcurrencyLimit) && hardConcurrencyLimit == that.hardConcurrencyLimit && schedulingPolicy.equals(that.schedulingPolicy) && schedulingWeight.equals(that.schedulingWeight) && subGroups.equals(that.subGroups) && jmxExport.equals(that.jmxExport) && softCpuLimit.equals(that.softCpuLimit) && hardCpuLimit.equals(that.hardCpuLimit)); }
private static <T> boolean hasLocalOptimization(List<LocalProperty<T>> desiredLayout, List<Optional<LocalProperty<T>>> matchResult) { checkArgument(desiredLayout.size() == matchResult.size()); if (matchResult.isEmpty()) { return false; } // Optimizations can be applied if the first LocalProperty has been modified in the match in any way return !matchResult.get(0).equals(Optional.of(desiredLayout.get(0))); }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof SelectorSpec)) { return false; } SelectorSpec that = (SelectorSpec) other; return (group.equals(that.group) && userRegex.map(Pattern::pattern).equals(that.userRegex.map(Pattern::pattern)) && userRegex.map(Pattern::flags).equals(that.userRegex.map(Pattern::flags)) && sourceRegex.map(Pattern::pattern).equals(that.sourceRegex.map(Pattern::pattern))) && sourceRegex.map(Pattern::flags).equals(that.sourceRegex.map(Pattern::flags)) && queryType.equals(that.queryType) && clientTags.equals(that.clientTags); }
private StreamProperties( StreamDistribution distribution, Optional<? extends Iterable<Symbol>> partitioningColumns, boolean ordered, ActualProperties otherActualProperties) { this.distribution = requireNonNull(distribution, "distribution is null"); this.partitioningColumns = requireNonNull(partitioningColumns, "partitioningProperties is null") .map(ImmutableList::copyOf); checkArgument(distribution != SINGLE || this.partitioningColumns.equals(Optional.of(ImmutableList.of())), "Single stream must be partitioned on empty set"); checkArgument(distribution == SINGLE || !this.partitioningColumns.equals(Optional.of(ImmutableList.of())), "Multiple streams must not be partitioned on empty set"); this.ordered = ordered; checkArgument(!ordered || distribution == SINGLE, "Ordered must be a single stream"); this.otherActualProperties = otherActualProperties; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final DefaultPathMapping that = (DefaultPathMapping) o; return skeleton.equals(that.skeleton) && Arrays.equals(paramNameArray, that.paramNameArray); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ThriftTableLayoutHandle other = (ThriftTableLayoutHandle) o; return schemaName.equals(other.schemaName) && tableName.equals(other.tableName) && columns.equals(other.columns) && constraint.equals(other.constraint); }
public Scope process(Node node, Optional<Scope> scope) { Scope returnScope = super.process(node, scope); checkState(returnScope.getOuterQueryParent().equals(outerQueryScope), "result scope should have outer query scope equal with parameter outer query scope"); if (scope.isPresent()) { checkState(hasScopeAsLocalParent(returnScope, scope.get()), "return scope should have context scope as one of ancestors"); } return returnScope; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Use use = (Use) o; if (!catalog.equals(use.catalog)) { return false; } if (!schema.equals(use.schema)) { return false; } return true; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } State<?, ?> state = (State<?, ?>) o; if (pendingTransaction != null ? !pendingTransaction.equals(state.pendingTransaction) : state.pendingTransaction != null) { return false; } if (pendingCommitTransactions != null ? !pendingCommitTransactions.equals(state.pendingCommitTransactions) : state.pendingCommitTransactions != null) { return false; } return context != null ? context.equals(state.context) : state.context == null; }
@Override public Optional<PartitioningHandle> getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right) { Optional<ConnectorId> leftConnectorId = left.getConnectorId(); Optional<ConnectorId> rightConnectorId = right.getConnectorId(); if (!leftConnectorId.isPresent() || !rightConnectorId.isPresent() || !leftConnectorId.equals(rightConnectorId)) { return Optional.empty(); } if (!left.getTransactionHandle().equals(right.getTransactionHandle())) { return Optional.empty(); } ConnectorId connectorId = leftConnectorId.get(); CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId); ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId); Optional<ConnectorPartitioningHandle> commonHandle = metadata.getCommonPartitioningHandle(session.toConnectorSession(connectorId), left.getConnectorHandle(), right.getConnectorHandle()); return commonHandle.map(handle -> new PartitioningHandle(Optional.of(connectorId), left.getTransactionHandle(), handle)); }
private TypeCompatibility typeCompatibilityForRow(RowType firstType, RowType secondType) { List<Field> firstFields = firstType.getFields(); List<Field> secondFields = secondType.getFields(); if (firstFields.size() != secondFields.size()) { return TypeCompatibility.incompatible(); } ImmutableList.Builder<RowType.Field> fields = ImmutableList.builder(); boolean coercible = true; for (int i = 0; i < firstFields.size(); i++) { Type firstFieldType = firstFields.get(i).getType(); Type secondFieldType = secondFields.get(i).getType(); TypeCompatibility typeCompatibility = compatibility(firstFieldType, secondFieldType); if (!typeCompatibility.isCompatible()) { return TypeCompatibility.incompatible(); } Type commonParameterType = typeCompatibility.getCommonSuperType(); Optional<String> firstParameterName = firstFields.get(i).getName(); Optional<String> secondParameterName = secondFields.get(i).getName(); Optional<String> commonName = firstParameterName.equals(secondParameterName) ? firstParameterName : Optional.empty(); // ignore parameter name for coercible coercible &= typeCompatibility.isCoercible(); fields.add(new RowType.Field(commonName, commonParameterType)); } return TypeCompatibility.compatible(RowType.from(fields.build()), coercible); }
@Override public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); MarkDistinctNode markDistinctNode = (MarkDistinctNode) node; if (!markDistinctNode.getHashSymbol().equals(hashSymbol.map(alias -> alias.toSymbol(symbolAliases)))) { return NO_MATCH; } if (!ImmutableSet.copyOf(markDistinctNode.getDistinctSymbols()) .equals(distinctSymbols.stream().map(alias -> alias.toSymbol(symbolAliases)).collect(toImmutableSet()))) { return NO_MATCH; } return match(markerSymbol.toString(), markDistinctNode.getMarkerSymbol().toSymbolReference()); }
@Override public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); SpatialJoinNode joinNode = (SpatialJoinNode) node; if (!new ExpressionVerifier(symbolAliases).process(joinNode.getFilter(), filter)) { return NO_MATCH; } if (!joinNode.getKdbTree().equals(kdbTree)) { return NO_MATCH; } return match(); }
@Override public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); SemiJoinNode semiJoinNode = (SemiJoinNode) node; if (!(symbolAliases.get(sourceSymbolAlias).equals(semiJoinNode.getSourceJoinSymbol().toSymbolReference()) && symbolAliases.get(filteringSymbolAlias).equals(semiJoinNode.getFilteringSourceJoinSymbol().toSymbolReference()))) { return NO_MATCH; } if (distributionType.isPresent() && !distributionType.equals(semiJoinNode.getDistributionType())) { return NO_MATCH; } return match(outputAlias, semiJoinNode.getSemiJoinOutput().toSymbolReference()); }
@Override public Result apply(JoinNode joinNode, Captures captures, Context context) { Optional<Expression> filter = joinNode.getFilter().map(x -> rewriter.rewrite(x, context)); if (!joinNode.getFilter().equals(filter)) { return Result.ofPlanNode(new JoinNode( joinNode.getId(), joinNode.getType(), joinNode.getLeft(), joinNode.getRight(), joinNode.getCriteria(), joinNode.getOutputSymbols(), filter, joinNode.getLeftHashSymbol(), joinNode.getRightHashSymbol(), joinNode.getDistributionType())); } return Result.empty(); } }