You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.*/packageorg.apache.wayang.api.serialization.mixinsimportcom.fasterxml.jackson.annotation.{JsonCreator, JsonProperty, JsonSubTypes, JsonTypeInfo, JsonTypeName}
importorg.apache.wayang.core.api.Configurationimportorg.apache.wayang.core.function.FunctionDescriptorimportorg.apache.wayang.core.function.FunctionDescriptor.SerializableToDoubleBiFunctionimportorg.apache.wayang.core.optimizer.cardinality.{AggregatingCardinalityEstimator, CardinalityEstimate, DefaultCardinalityEstimator, FallbackCardinalityEstimator, FixedSizeCardinalityEstimator, SwitchForwardCardinalityEstimator}
importorg.apache.wayang.core.optimizer.costs.{ConstantLoadProfileEstimator, DefaultEstimatableCost, DefaultLoadEstimator, IntervalLoadEstimator, LoadEstimator, NestableLoadProfileEstimator}
objectEstimatorMixIns {
@JsonTypeInfo(use =JsonTypeInfo.Id.NAME, include =JsonTypeInfo.As.PROPERTY, property ="@type")
@JsonSubTypes(Array(
newJsonSubTypes.Type(value =classOf[DefaultLoadEstimator], name ="DefaultLoadEstimator"),
newJsonSubTypes.Type(value =classOf[IntervalLoadEstimator], name ="IntervalLoadEstimator"),
))
abstractclassLoadEstimatorMixIn {
}
abstractclassDefaultLoadEstimatorMixIn {
@JsonCreatordefthis(@JsonProperty("numInputs") numInputs: Int,
@JsonProperty("numOutputs") numOutputs: Int,
@JsonProperty("correctnessProbability") correctnessProbability: Double,
@JsonProperty("nullCardinalityReplacement") nullCardinalityReplacement: CardinalityEstimate,
@JsonProperty("singlePointFunction") singlePointFunction: LoadEstimator.SinglePointEstimationFunction) = {
this()
}
}
abstractclassCardinalityEstimateMixIn {
@JsonCreatordefthis(@JsonProperty("lowerEstimate") lowerEstimate: Long,
@JsonProperty("upperEstimate") upperEstimate: Long,
@JsonProperty("correctnessProb") correctnessProb: Double,
@JsonProperty("isOverride") isOverride: Boolean) = {
this()
}
}
abstractclassProbabilisticDoubleIntervalMixIn {
@JsonCreatordefthis(@JsonProperty("lowerEstimate") lowerEstimate: Double,
@JsonProperty("upperEstimate") upperEstimate: Double,
@JsonProperty("correctnessProb") correctnessProb: Double,
@JsonProperty("isOverride") isOverride: Boolean) = {
this()
}
}
@JsonTypeInfo(use =JsonTypeInfo.Id.NAME, include =JsonTypeInfo.As.PROPERTY, property ="@type")
@JsonSubTypes(Array(
newJsonSubTypes.Type(value =classOf[ConstantLoadProfileEstimator], name ="ConstantLoadProfileEstimator"),
newJsonSubTypes.Type(value =classOf[NestableLoadProfileEstimator], name ="NestableLoadProfileEstimator"),
))
abstractclassLoadProfileEstimatorMixIn {
}
@JsonTypeName("nestableLoadProfileEstimator")
abstractclassNestableLoadProfileEstimatorMixIn {
@JsonCreatordefthis (@JsonProperty("cpuLoadEstimator") cpuLoadEstimator : LoadEstimator,
@JsonProperty("ramLoadEstimator") ramLoadEstimator: LoadEstimator,
@JsonProperty("diskLoadEstimator") diskLoadEstimator: LoadEstimator,
@JsonProperty("networkLoadEstimator") networkLoadEstimator: LoadEstimator,
@JsonProperty("resourceUtilizationEstimator") resourceUtilizationEstimator: SerializableToDoubleBiFunction[Array[Long], Array[Long]],
@JsonProperty("overheadMillis") overheadMillis: Long,
@JsonProperty("configurationKey") configurationKey: String
) = {
this()
}
}
@JsonTypeInfo(use =JsonTypeInfo.Id.NAME, include =JsonTypeInfo.As.PROPERTY, property ="@type")
@JsonSubTypes(Array(
newJsonSubTypes.Type(value =classOf[AggregatingCardinalityEstimator], name ="AggregatingCardinalityEstimator"),
newJsonSubTypes.Type(value =classOf[DefaultCardinalityEstimator], name ="DefaultCardinalityEstimator"),
newJsonSubTypes.Type(value =classOf[FallbackCardinalityEstimator], name ="FallbackCardinalityEstimator"),
newJsonSubTypes.Type(value =classOf[FixedSizeCardinalityEstimator], name ="FixedSizeCardinalityEstimator"),
newJsonSubTypes.Type(value =classOf[SwitchForwardCardinalityEstimator], name ="SwitchForwardCardinalityEstimator"),
))
abstractclassCardinalityEstimatorMixIn {
}
abstractclassDefaultCardinalityEstimatorMixIn {
@JsonCreatordefthis(@JsonProperty("certaintyProb") certaintyProb: Double,
@JsonProperty("numInputs") numInputs: Int,
@JsonProperty("isAllowMoreInputs") isAllowMoreInputs: Boolean,
@JsonProperty("singlePointEstimator") singlePointEstimator: FunctionDescriptor.SerializableToLongBiFunction[Array[Long], Configuration]) = {
this()
}
}
// TODO: Add more estimator mixins@JsonTypeInfo(use =JsonTypeInfo.Id.NAME, include =JsonTypeInfo.As.PROPERTY, property ="@type")
@JsonSubTypes(Array(
newJsonSubTypes.Type(value =classOf[DefaultEstimatableCost], name ="DefaultEstimatableCost"),
))
abstractclassEstimatableCostMixIn {
}
}
1437c126d1770530f7402862f101b2128fd92629
The text was updated successfully, but these errors were encountered:
Add more estimator mixins
incubator-wayang/wayang-api/wayang-api-scala-java/src/main/scala/org/apache/wayang/api/serialization/mixins/EstimatorMixIns.scala
Line 115 in b67b404
1437c126d1770530f7402862f101b2128fd92629
The text was updated successfully, but these errors were encountered: