Skip to content
Closed
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,4 +20,4 @@
* these interfaces to pass functions to various Java API methods for Spark. Please visit Spark's
* Java programming guide for more details.
*/
package org.apache.spark.api.java.function;
package org.apache.spark.api.java.function;
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public long spill(long size, MemoryConsumer trigger) throws IOException {
final long spillSize = freeMemory();
inMemSorter.reset();
// Reset the in-memory sorter's pointer array only after freeing up the memory pages holding the
// records. Otherwise, if the task is over allocated memory, then without freeing the memory pages,
// we might not be able to get memory for the pointer array.
// records. Otherwise, if the task is over allocated memory, then without freeing the memory
// pages, we might not be able to get memory for the pointer array.
taskContext.taskMetrics().incMemoryBytesSpilled(spillSize);
return spillSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.spark.annotation.Private;
import org.apache.spark.unsafe.types.ByteArray;
import org.apache.spark.unsafe.types.UTF8String;
import org.apache.spark.util.Utils;

@Private
public class PrefixComparators {
Expand Down Expand Up @@ -69,7 +68,7 @@ public static long computePrefix(double value) {
* Provides radix sort parameters. Comparators implementing this also are indicating that the
* ordering they define is compatible with radix sort.
*/
public static abstract class RadixSortSupport extends PrefixComparator {
public abstract static class RadixSortSupport extends PrefixComparator {
/** @return Whether the sort should be descending in binary sort order. */
public abstract boolean sortDescending();

Expand All @@ -82,37 +81,37 @@ public static abstract class RadixSortSupport extends PrefixComparator {
//

public static final class UnsignedPrefixComparator extends RadixSortSupport {
@Override public final boolean sortDescending() { return false; }
@Override public final boolean sortSigned() { return false; }
@Override public boolean sortDescending() { return false; }
@Override public boolean sortSigned() { return false; }
@Override
public final int compare(long aPrefix, long bPrefix) {
public int compare(long aPrefix, long bPrefix) {
return UnsignedLongs.compare(aPrefix, bPrefix);
}
}

public static final class UnsignedPrefixComparatorDesc extends RadixSortSupport {
@Override public final boolean sortDescending() { return true; }
@Override public final boolean sortSigned() { return false; }
@Override public boolean sortDescending() { return true; }
@Override public boolean sortSigned() { return false; }
@Override
public final int compare(long bPrefix, long aPrefix) {
public int compare(long bPrefix, long aPrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't this be final?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it's definitely final. It's just RedundantModifier error since the class SignedPrefixComparator is already final.

return UnsignedLongs.compare(aPrefix, bPrefix);
}
}

public static final class SignedPrefixComparator extends RadixSortSupport {
@Override public final boolean sortDescending() { return false; }
@Override public final boolean sortSigned() { return true; }
@Override public boolean sortDescending() { return false; }
@Override public boolean sortSigned() { return true; }
@Override
public final int compare(long a, long b) {
public int compare(long a, long b) {
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
}

public static final class SignedPrefixComparatorDesc extends RadixSortSupport {
@Override public final boolean sortDescending() { return true; }
@Override public final boolean sortSigned() { return true; }
@Override public boolean sortDescending() { return true; }
@Override public boolean sortSigned() { return true; }
@Override
public final int compare(long b, long a) {
public int compare(long b, long a) {
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

package org.apache.spark.util.collection.unsafe.sort;

import org.apache.spark.unsafe.Platform;
import org.apache.spark.unsafe.array.LongArray;

Expand Down Expand Up @@ -227,7 +227,7 @@ private static long[][] getKeyPrefixArrayCounts(
}
return counts;
}

/**
* Specialization of sortAtByte() for key-prefix arrays.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public long spill(long size, MemoryConsumer trigger) throws IOException {
// written to disk. This also counts the space needed to store the sorter's pointer array.
inMemSorter.reset();
// Reset the in-memory sorter's pointer array only after freeing up the memory pages holding the
// records. Otherwise, if the task is over allocated memory, then without freeing the memory pages,
// we might not be able to get memory for the pointer array.
// records. Otherwise, if the task is over allocated memory, then without freeing the memory
// pages, we might not be able to get memory for the pointer array.

taskContext.taskMetrics().incMemoryBytesSpilled(spillSize);
totalSpillBytes += spillSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
* This package consist of these annotations, which are used project wide and are reflected in
* Scala and Java docs.
*/
package org.apache.spark.annotation;
package org.apache.spark.annotation;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark Java programming APIs.
*/
package org.apache.spark.api.java;
package org.apache.spark.api.java;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark's broadcast variables, used to broadcast immutable datasets to all nodes.
*/
package org.apache.spark.broadcast;
package org.apache.spark.broadcast;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Package for executor components used with various cluster managers.
*/
package org.apache.spark.executor;
package org.apache.spark.executor;
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/io/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* IO codecs used for compression.
*/
package org.apache.spark.io;
package org.apache.spark.io;
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/rdd/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Provides implementation's of various RDDs.
*/
package org.apache.spark.rdd;
package org.apache.spark.rdd;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark's DAG scheduler.
*/
package org.apache.spark.scheduler;
package org.apache.spark.scheduler;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark utilities.
*/
package org.apache.spark.util;
package org.apache.spark.util;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Utilities for random number generation.
*/
package org.apache.spark.util.random;
package org.apache.spark.util.random;
2 changes: 2 additions & 0 deletions dev/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<property name="message" value="No trailing whitespace allowed."/>
</module>

<module name="NewlineAtEndOfFile"/>

<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark streaming receiver for Flume.
*/
package org.apache.spark.streaming.flume;
package org.apache.spark.streaming.flume;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Kafka receiver for spark streaming.
*/
package org.apache.spark.streaming.kafka;
package org.apache.spark.streaming.kafka;
2 changes: 1 addition & 1 deletion external/kinesis-asl/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}:
log4j.logger.org.spark_project.jetty=WARN
log4j.logger.org.spark_project.jetty.util.component.AbstractLifeCycle=ERROR
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
* ALPHA COMPONENT
* GraphX is a graph processing framework built on top of Spark.
*/
package org.apache.spark.graphx;
package org.apache.spark.graphx;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Collections of utilities used by graphx.
*/
package org.apache.spark.graphx.util;
package org.apache.spark.graphx.util;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Spark's machine learning library.
*/
package org.apache.spark.mllib;
package org.apache.spark.mllib;
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public void runDT() {
for (String featureSubsetStrategy: RandomForestClassifier.supportedFeatureSubsetStrategies()) {
rf.setFeatureSubsetStrategy(featureSubsetStrategy);
}
String realStrategies[] = {".1", ".10", "0.10", "0.1", "0.9", "1.0"};
String[] realStrategies = {".1", ".10", "0.10", "0.1", "0.9", "1.0"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a rule for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That's ArrayTypeStyle rule.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come it hasn't failed it yet? are we not yet running the java linter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to @andrewor14 , java linter is turned off intentionally due to the overhead of maven.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we can bring it back someday if possible.

for (String strategy: realStrategies) {
rf.setFeatureSubsetStrategy(strategy);
}
String integerStrategies[] = {"1", "10", "100", "1000", "10000"};
String[] integerStrategies = {"1", "10", "100", "1000", "10000"};
for (String strategy: integerStrategies) {
rf.setFeatureSubsetStrategy(strategy);
}
String invalidStrategies[] = {"-.1", "-.10", "-0.10", ".0", "0.0", "1.1", "0"};
String[] invalidStrategies = {"-.1", "-.10", "-0.10", ".0", "0.0", "1.1", "0"};
for (String strategy: invalidStrategies) {
try {
rf.setFeatureSubsetStrategy(strategy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public void runDT() {
for (String featureSubsetStrategy: RandomForestRegressor.supportedFeatureSubsetStrategies()) {
rf.setFeatureSubsetStrategy(featureSubsetStrategy);
}
String realStrategies[] = {".1", ".10", "0.10", "0.1", "0.9", "1.0"};
String[] realStrategies = {".1", ".10", "0.10", "0.1", "0.9", "1.0"};
for (String strategy: realStrategies) {
rf.setFeatureSubsetStrategy(strategy);
}
String integerStrategies[] = {"1", "10", "100", "1000", "10000"};
String[] integerStrategies = {"1", "10", "100", "1000", "10000"};
for (String strategy: integerStrategies) {
rf.setFeatureSubsetStrategy(strategy);
}
String invalidStrategies[] = {"-.1", "-.10", "-0.10", ".0", "0.0", "1.1", "0"};
String[] invalidStrategies = {"-.1", "-.10", "-0.10", ".0", "0.0", "1.1", "0"};
for (String strategy: invalidStrategies) {
try {
rf.setFeatureSubsetStrategy(strategy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import static org.apache.parquet.hadoop.ParquetInputFormat.getFilter;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Java APIs for spark streaming.
*/
package org.apache.spark.streaming.api.java;
package org.apache.spark.streaming.api.java;
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
/**
* Various implementations of DStreams.
*/
package org.apache.spark.streaming.dstream;
package org.apache.spark.streaming.dstream;