Skip to content
Snippets Groups Projects
Commit b1745b31 authored by Mosharaf Chowdhury's avatar Mosharaf Chowdhury
Browse files

Removed an unnecessary byte array in the middle. Probabaly will have to bring...

Removed an unnecessary byte array in the middle. Probabaly will have to bring it back if we do block level data movement.
parent 3a671ce9
No related branches found
No related tags found
No related merge requests found
......@@ -146,8 +146,6 @@ class LocalFileShuffle[K, V, C] extends Shuffle[K, V, C] with Logging {
private var oosSource: ObjectOutputStream = null
private var oisSource: ObjectInputStream = null
private var byteArray: Array[Byte] = null
private var receptionSucceeded = false
override def run: Unit = {
......@@ -187,21 +185,9 @@ class LocalFileShuffle[K, V, C] extends Shuffle[K, V, C] with Logging {
// Receive the file
if (requestedFileLen != -1) {
byteArray = new Array[Byte] (requestedFileLen)
var bytesRead = isSource.read (byteArray, 0, byteArray.length)
var alreadyRead = bytesRead
while (alreadyRead < requestedFileLen) {
bytesRead = isSource.read(byteArray, alreadyRead,
(byteArray.length - alreadyRead))
if(bytesRead > 0) {
alreadyRead = alreadyRead + bytesRead
}
}
// Now add this to combiners
val inputStream = new ObjectInputStream (
new ByteArrayInputStream(byteArray))
// Add this to combiners
val inputStream = new ObjectInputStream (isSource)
try{
while (true) {
val (k, c) = inputStream.readObject.asInstanceOf[(K, C)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment