forked from apache-spark-on-k8s/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolving a few of the initial comments while still preserving correc…
…tness of e2e tests
- Loading branch information
1 parent
c91574d
commit c2231a0
Showing
23 changed files
with
326 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RegisterShuffleIndex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.spark.network.shuffle.protocol; | ||
|
||
import com.google.common.base.Objects; | ||
import io.netty.buffer.ByteBuf; | ||
import org.apache.spark.network.protocol.Encoders; | ||
|
||
// Needed by ScalaDoc. See SPARK-7726 | ||
import static org.apache.spark.network.shuffle.protocol.BlockTransferMessage.Type; | ||
|
||
/** | ||
* Register shuffle index to the External Shuffle Service. | ||
*/ | ||
public class RegisterShuffleIndex extends BlockTransferMessage { | ||
public final String appId; | ||
public final int shuffleId; | ||
public final int mapId; | ||
|
||
public RegisterShuffleIndex( | ||
String appId, | ||
int shuffleId, | ||
int mapId) { | ||
this.appId = appId; | ||
this.shuffleId = shuffleId; | ||
this.mapId = mapId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
if (other != null && other instanceof UploadShufflePartitionStream) { | ||
UploadShufflePartitionStream o = (UploadShufflePartitionStream) other; | ||
return Objects.equal(appId, o.appId) | ||
&& shuffleId == o.shuffleId | ||
&& mapId == o.mapId; | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
protected Type type() { | ||
return Type.REGISTER_SHUFFLE_INDEX; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(appId, shuffleId, mapId); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return Objects.toStringHelper(this) | ||
.add("appId", appId) | ||
.add("shuffleId", shuffleId) | ||
.add("mapId", mapId) | ||
.toString(); | ||
} | ||
|
||
@Override | ||
public int encodedLength() { | ||
return Encoders.Strings.encodedLength(appId) + 4 + 4; | ||
} | ||
|
||
@Override | ||
public void encode(ByteBuf buf) { | ||
Encoders.Strings.encode(buf, appId); | ||
buf.writeInt(shuffleId); | ||
buf.writeInt(mapId); | ||
} | ||
|
||
public static RegisterShuffleIndex decode(ByteBuf buf) { | ||
String appId = Encoders.Strings.decode(buf); | ||
int shuffleId = buf.readInt(); | ||
int mapId = buf.readInt(); | ||
return new RegisterShuffleIndex(appId, shuffleId, mapId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.