public Builder addSymbolStatistics(Symbol symbol, SymbolStatsEstimate statistics) { symbolStatistics = symbolStatistics.plus(symbol, statistics); return this; }
public Builder addSymbolStatistics(Map<Symbol, SymbolStatsEstimate> symbolStatistics) { this.symbolStatistics = this.symbolStatistics.plusAll(symbolStatistics); return this; }
public Builder removeSymbolStatistics(Symbol symbol) { symbolStatistics = symbolStatistics.minus(symbol); return this; }
@Override public OrderedPSet<E> plus(E e) { if (contents.contains(e)) return this; return new OrderedPSet<E>(contents.plus(e), order.plus(e)); }
@Override public OrderedPSet<E> minus(Object e) { if (!contents.contains(e)) return this; return new OrderedPSet<E>(contents.minus(e), order.minus(e)); }
public Builder() { this(NaN, HashTreePMap.empty()); }
/** An empty explanation. */ public static Violation absent() { return create(ConsPStack.empty()); } }
public Set<Symbol> getSymbolsWithKnownStatistics() { return symbolStatistics.keySet(); }
@JsonCreator public PlanNodeStatsEstimate( @JsonProperty("outputRowCount") double outputRowCount, @JsonProperty("symbolStatistics") Map<Symbol, SymbolStatsEstimate> symbolStatistics) { this(outputRowCount, HashTreePMap.from(requireNonNull(symbolStatistics, "symbolStatistics is null"))); }
/** Creates an explanation with one step. */ public static Violation of(String reason) { return create(ConsPStack.singleton(reason)); }
@CheckReturnValue public HeldLockSet plus(GuardedByExpression lock) { return new HeldLockSet(locks.plus(lock)); }
@CheckReturnValue public HeldLockSet plusAll(Collection<GuardedByExpression> locks) { return new HeldLockSet(this.locks.plusAll(locks)); }
/** Adds a step. */ public Violation plus(String edge) { return create(path().plus(edge)); }
public SymbolStatsEstimate getSymbolStatistics(Symbol symbol) { return symbolStatistics.getOrDefault(symbol, SymbolStatsEstimate.unknown()); }
private HeldLockSet() { this(Empty.<GuardedByExpression>set()); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= this.path.hashCode(); return h; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ThreadSafety.Violation) { ThreadSafety.Violation that = (ThreadSafety.Violation) o; return (this.path.equals(that.path())); } return false; }
/** @return true if a violation was found */ public boolean isPresent() { return !path().isEmpty(); }
@Override public OrderedPSet<E> plus(E e) { if (contents.contains(e)) return this; return new OrderedPSet<E>(contents.plus(e), order.plus(e)); }
@Override public OrderedPSet<E> minus(Object e) { if (!contents.contains(e)) return this; return new OrderedPSet<E>(contents.minus(e), order.minus(e)); }