Skip to content

Commit 7025dda

Browse files
WangTaoTheTonicrxin
authored andcommitted
Handle the vals that never used
In XORShiftRandom.scala, use val "million" instead of constant "1e6.toInt". Delete vals that never used in other files. Author: WangTao <[email protected]> Closes #565 from WangTaoTheTonic/master and squashes the following commits: 17cacfc [WangTao] Handle the unused assignment, method parameters and symbol inspected by Intellij IDEA 37b4090 [WangTao] Handle the vals that never used
1 parent b3d2ab6 commit 7025dda

File tree

7 files changed

+2
-8
lines changed

7 files changed

+2
-8
lines changed

core/src/main/scala/org/apache/spark/network/SecurityMessage.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ private[spark] class SecurityMessage() extends Logging {
106106
* @return BufferMessage
107107
*/
108108
def toBufferMessage: BufferMessage = {
109-
val startTime = System.currentTimeMillis
110109
val buffers = new ArrayBuffer[ByteBuffer]()
111110

112111
// 4 bytes for the length of the connectionId

core/src/main/scala/org/apache/spark/partial/GroupedMeanEvaluator.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ private[spark] class GroupedMeanEvaluator[T](totalOutputs: Int, confidence: Doub
6161
} else if (outputsMerged == 0) {
6262
new HashMap[T, BoundedDouble]
6363
} else {
64-
val p = outputsMerged.toDouble / totalOutputs
6564
val studentTCacher = new StudentTCacher(confidence)
6665
val result = new JHashMap[T, BoundedDouble](sums.size)
6766
val iter = sums.entrySet.iterator()

core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,9 @@ object BlockFetcherIterator {
118118
})
119119
bytesInFlight += req.size
120120
val sizeMap = req.blocks.toMap // so we can look up the size of each blockID
121-
val fetchStart = System.currentTimeMillis()
122121
val future = connectionManager.sendMessageReliably(cmId, blockMessageArray.toBufferMessage)
123122
future.onSuccess {
124123
case Some(message) => {
125-
val fetchDone = System.currentTimeMillis()
126124
val bufferMessage = message.asInstanceOf[BufferMessage]
127125
val blockMessageArray = BlockMessageArray.fromBufferMessage(bufferMessage)
128126
for (blockMessage <- blockMessageArray) {

core/src/main/scala/org/apache/spark/util/random/XORShiftRandom.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private[spark] object XORShiftRandom {
9191
val xorRand = new XORShiftRandom(seed)
9292

9393
// this is just to warm up the JIT - we're not timing anything
94-
timeIt(1e6.toInt) {
94+
timeIt(million) {
9595
javaRand.nextInt()
9696
xorRand.nextInt()
9797
}

examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public String toString() {
7575

7676
public static Tuple3<String, String, String> extractKey(String line) {
7777
Matcher m = apacheLogRegex.matcher(line);
78-
List<String> key = Collections.emptyList();
7978
if (m.find()) {
8079
String ip = m.group(1);
8180
String user = m.group(3);

examples/src/main/java/org/apache/spark/examples/JavaTC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public Tuple2<Integer, Integer> call(Tuple2<Integer, Integer> e) {
8585
}
8686
});
8787

88-
long oldCount = 0;
88+
long oldCount;
8989
long nextCount = tc.count();
9090
do {
9191
oldCount = nextCount;

examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.apache.spark.api.java.JavaRDD;
2424
import org.apache.spark.api.java.JavaSparkContext;
2525
import org.apache.spark.api.java.function.Function;
26-
import org.apache.spark.api.java.function.VoidFunction;
2726

2827
import org.apache.spark.sql.api.java.JavaSQLContext;
2928
import org.apache.spark.sql.api.java.JavaSchemaRDD;

0 commit comments

Comments
 (0)