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 <barneystinson@aliyun.com>

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
This commit is contained in:
WangTao 2014-04-29 22:07:20 -07:00 committed by Reynold Xin
parent b3d2ab6b35
commit 7025dda8fa
7 changed files with 2 additions and 8 deletions

View file

@ -106,7 +106,6 @@ private[spark] class SecurityMessage() extends Logging {
* @return BufferMessage
*/
def toBufferMessage: BufferMessage = {
val startTime = System.currentTimeMillis
val buffers = new ArrayBuffer[ByteBuffer]()
// 4 bytes for the length of the connectionId

View file

@ -61,7 +61,6 @@ private[spark] class GroupedMeanEvaluator[T](totalOutputs: Int, confidence: Doub
} else if (outputsMerged == 0) {
new HashMap[T, BoundedDouble]
} else {
val p = outputsMerged.toDouble / totalOutputs
val studentTCacher = new StudentTCacher(confidence)
val result = new JHashMap[T, BoundedDouble](sums.size)
val iter = sums.entrySet.iterator()

View file

@ -118,11 +118,9 @@ object BlockFetcherIterator {
})
bytesInFlight += req.size
val sizeMap = req.blocks.toMap // so we can look up the size of each blockID
val fetchStart = System.currentTimeMillis()
val future = connectionManager.sendMessageReliably(cmId, blockMessageArray.toBufferMessage)
future.onSuccess {
case Some(message) => {
val fetchDone = System.currentTimeMillis()
val bufferMessage = message.asInstanceOf[BufferMessage]
val blockMessageArray = BlockMessageArray.fromBufferMessage(bufferMessage)
for (blockMessage <- blockMessageArray) {

View file

@ -91,7 +91,7 @@ private[spark] object XORShiftRandom {
val xorRand = new XORShiftRandom(seed)
// this is just to warm up the JIT - we're not timing anything
timeIt(1e6.toInt) {
timeIt(million) {
javaRand.nextInt()
xorRand.nextInt()
}

View file

@ -75,7 +75,6 @@ public final class JavaLogQuery {
public static Tuple3<String, String, String> extractKey(String line) {
Matcher m = apacheLogRegex.matcher(line);
List<String> key = Collections.emptyList();
if (m.find()) {
String ip = m.group(1);
String user = m.group(3);

View file

@ -85,7 +85,7 @@ public final class JavaTC {
}
});
long oldCount = 0;
long oldCount;
long nextCount = tc.count();
do {
oldCount = nextCount;

View file

@ -23,7 +23,6 @@ import java.util.List;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.VoidFunction;
import org.apache.spark.sql.api.java.JavaSQLContext;
import org.apache.spark.sql.api.java.JavaSchemaRDD;