Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.apache.calcite.DataContext;
import org.apache.calcite.adapter.java.AbstractQueryableTable;
import org.apache.calcite.adapter.java.JavaTypeFactory;
//import org.apache.calcite.adapter.jdbc.JdbcSchema;
import org.apache.calcite.adapter.jdbc.JdbcTableScan;
import org.apache.calcite.avatica.ColumnMetaData;
import org.apache.calcite.jdbc.CalciteConnection;
import org.apache.calcite.linq4j.Enumerable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.CollectionType;
import org.apache.commons.lang3.Validate;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -33,6 +32,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
* Utility methods that convert between Java objects and the on-disk representation used by {@link ObjectFileSink}.
Expand All @@ -59,7 +59,7 @@ private ObjectFileSerialization() {
* @throws IOException if serialization fails
*/
public static byte[] serializeChunk(Object[] chunk, int validLength, ObjectFileSerializationMode mode) throws IOException {
Validate.notNull(mode, "Serialization mode must be provided.");
Objects.requireNonNull(mode, "Serialization mode must be provided.");
switch (mode) {
case JSON:
return serializeJson(chunk, validLength);
Expand All @@ -83,7 +83,7 @@ public static byte[] serializeChunk(Object[] chunk, int validLength, ObjectFileS
public static List<Object> deserializeChunk(byte[] payload,
ObjectFileSerializationMode mode,
Class<?> elementType) throws IOException, ClassNotFoundException {
Validate.notNull(mode, "Serialization mode must be provided.");
Objects.requireNonNull(mode, "Serialization mode must be provided.");
switch (mode) {
case JSON:
return deserializeJson(payload, elementType);
Expand Down Expand Up @@ -127,7 +127,7 @@ private static byte[] serializeJson(Object[] chunk, int validLength) throws IOEx
}

private static List<Object> deserializeJson(byte[] payload, Class<?> elementType) throws IOException {
Validate.notNull(elementType, "Element type must be provided for JSON deserialization.");
Objects.requireNonNull(elementType, "Element type must be provided for JSON deserialization.");
CollectionType type = OBJECT_MAPPER.getTypeFactory()
.constructCollectionType(List.class, elementType);
List<?> list = OBJECT_MAPPER.readValue(payload, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.wayang.core.function.TransformationDescriptor;
import org.apache.wayang.core.optimizer.costs.DefaultLoadEstimator;
import org.apache.wayang.core.optimizer.costs.NestableLoadProfileEstimator;
import org.apache.wayang.core.plan.wayangplan.UnarySink;
import org.apache.wayang.core.types.DataSetType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

package org.apache.wayang.core.api.configuration;

import org.apache.commons.lang3.Validate;
import org.apache.wayang.core.api.Configuration;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* Implementation of {@link KeyValueProvider} that uses a {@link Map} to provide a value.
Expand Down Expand Up @@ -78,7 +78,7 @@ public MapBasedKeyValueProvider(KeyValueProvider<Key, Value> parent, Configurati

@Override
public Value tryToProvide(Key key, KeyValueProvider<Key, Value> requestee) {
Validate.notNull(key);
Objects.requireNonNull(key);
return this.storedValues.get(key);
}

Expand All @@ -92,7 +92,7 @@ protected void processParentEntry(Key key, Value value) {

@Override
public void set(Key key, Value value) {
Validate.notNull(key);
Objects.requireNonNull(key);
this.storedValues.put(key, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.apache.wayang.core.optimizer.cardinality;

import org.apache.commons.lang3.Validate;
import org.apache.wayang.core.api.Configuration;
import org.apache.wayang.core.optimizer.OptimizationContext;
import org.apache.wayang.core.plan.wayangplan.InputSlot;
Expand Down Expand Up @@ -106,9 +105,9 @@ public static CardinalityEstimationTraversal createPushTraversal(Collection<Inpu
Collection<InputSlot<?>> borderInputSlots,
Collection<Operator> sourceOperators,
Configuration configuration) {
Validate.notNull(inputSlots);
Validate.notNull(sourceOperators);
Validate.notNull(configuration);
Objects.requireNonNull(inputSlots);
Objects.requireNonNull(sourceOperators);
Objects.requireNonNull(configuration);

// Starting from the an output, find all required inputs.
return new Builder(inputSlots, borderInputSlots, sourceOperators, configuration).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@

package org.apache.wayang.core.optimizer.enumeration;

import org.apache.commons.lang3.Validate;
import org.apache.wayang.core.api.Configuration;
import org.apache.wayang.core.optimizer.OptimizationContext;
import org.apache.wayang.core.optimizer.ProbabilisticDoubleInterval;
import org.apache.wayang.core.optimizer.costs.TimeEstimate;
import org.apache.wayang.core.optimizer.costs.TimeToCostConverter;
import org.apache.wayang.core.optimizer.costs.DefaultEstimatableCost;
import org.apache.wayang.core.optimizer.costs.EstimatableCost;
import org.apache.wayang.core.plan.executionplan.Channel;
import org.apache.wayang.core.plan.executionplan.ExecutionTask;
Expand Down Expand Up @@ -516,7 +514,7 @@ public void addLoopImplementation(LoopSubplan loop, LoopImplementation loopImple
* to a further {@link ExecutionOperator} in the further plan enumeration process
*/
public Collection<ExecutionOperator> getInterfaceOperators() {
Validate.notNull(this.getPlanEnumeration());
Objects.requireNonNull(this.getPlanEnumeration());
final Set<OutputSlot> outputSlots = this.getPlanEnumeration().servingOutputSlots.stream()
.map(Tuple::getField0)
.distinct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;

/**
* Goes over a {@link WayangPlan} and isolates its loops.
Expand Down Expand Up @@ -114,7 +115,7 @@ private static Collection<InputSlot<?>> collectInboundInputs(LoopHeadOperator lo

// Sanity-check inputs of the loopHead.
for (InputSlot<?> inputSlot : loopHead.getLoopBodyInputs()) {
Validate.notNull(inputSlot.getOccupant(), "Loop body input %s is unconnected.", inputSlot);
Objects.requireNonNull(inputSlot.getOccupant(), "Loop body input " + inputSlot + " is unconnected.");
Validate.isTrue(loopBodyOperators.contains(inputSlot.getOccupant().getOwner()),
"Illegal input for loop head input %s.", inputSlot);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -91,7 +92,7 @@ public class ReflectionUtils {
* no such file could be determined.
*/
public static String getDeclaringJar(Object object) {
Validate.notNull(object);
Objects.requireNonNull(object);

return getDeclaringJar(object.getClass());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.apache.wayang.profiler.hardware;

import org.apache.commons.lang3.Validate;
import org.apache.wayang.core.util.Formats;
import org.apache.wayang.core.util.fs.FileSystem;
import org.apache.wayang.core.util.fs.FileSystems;
Expand All @@ -29,6 +28,7 @@
import java.io.OutputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Random;

/**
Expand All @@ -43,7 +43,7 @@ public class DiskProfiler {
public DiskProfiler(String testFileURl) {
this.testFileURl = testFileURl;
this.fs = FileSystems.getFileSystem(this.testFileURl).orElse(null);
Validate.notNull(this.fs);
Objects.requireNonNull(this.fs);
}

/**
Expand Down
Loading