RexXiong commented on code in PR #1002:
URL:
https://github.com/apache/incubator-celeborn/pull/1002#discussion_r1032165644
##########
client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java:
##########
@@ -1205,4 +1203,230 @@ private boolean connectFail(String message) {
|| (message.equals("Connection reset by peer"))
|| (message.startsWith("Failed to send RPC "));
}
+
+ @Override
+ public void pushDataHandShake(
+ String applicationId,
+ int shuffleId,
+ int mapId,
+ int attemptId,
+ int numPartitions,
+ int bufferSize,
+ PartitionLocation location)
+ throws IOException {
+ sendMessageInternal(
+ shuffleId,
+ mapId,
+ attemptId,
+ location,
+ () -> {
+ String shuffleKey = Utils.makeShuffleKey(applicationId, shuffleId);
+ logger.info(
+ "pushDataHandShake shuffleKey:{}, attemptId:{}, locationId:{}",
+ shuffleKey,
+ attemptId,
+ location.getUniqueId());
+ logger.debug("pushDataHandShake location:{}", location.toString());
+ TransportClient client =
+ dataClientFactory.createClient(location.getHost(),
location.getPushPort());
+ PushDataHandShake handShake =
+ new PushDataHandShake(
+ MASTER_MODE,
+ shuffleKey,
+ location.getUniqueId(),
+ attemptId,
+ numPartitions,
+ bufferSize);
+ client.sendRpcSync(handShake.toByteBuffer(),
conf.pushDataRpcTimeoutMs());
+ return null;
+ });
+ }
+
+ @Override
+ public Optional<PartitionLocation> regionStart(
+ String applicationId,
+ int shuffleId,
+ int mapId,
+ int attemptId,
+ PartitionLocation location,
+ int currentRegionIdx,
+ boolean isBroadcast)
+ throws IOException {
+ return sendMessageInternal(
+ shuffleId,
+ mapId,
+ attemptId,
+ location,
+ () -> {
+ String shuffleKey = Utils.makeShuffleKey(applicationId, shuffleId);
+ logger.info(
+ "regionStart shuffleKey:{}, attemptId:{}, locationId:{}",
+ shuffleKey,
+ attemptId,
+ location.getUniqueId());
+ logger.debug("regionStart location:{}", location.toString());
+ TransportClient client =
+ dataClientFactory.createClient(location.getHost(),
location.getPushPort());
+ RegionStart regionStart =
+ new RegionStart(
+ MASTER_MODE,
+ shuffleKey,
+ location.getUniqueId(),
+ attemptId,
+ currentRegionIdx,
+ isBroadcast);
+ ByteBuffer regionStartResponse =
+ client.sendRpcSync(regionStart.toByteBuffer(),
conf.pushDataRpcTimeoutMs());
+ if (regionStartResponse.hasRemaining()
+ && regionStartResponse.get() ==
StatusCode.HARD_SPLIT.getValue()) {
+ // if split then revive
+ PbChangeLocationResponse response =
Review Comment:
use PartitionSplit request instead revive request to get a new location
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]