Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYurongSu committed May 24, 2024
1 parent ff61b62 commit 863d12d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private void doTransfer(final PipeConfigRegionWritePlanEvent pipeConfigRegionWri
PipeTransferConfigPlanReq.toTPipeTransferReq(
pipeConfigRegionWritePlanEvent.getConfigPhysicalPlan()));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down Expand Up @@ -202,7 +201,6 @@ private void doTransfer(final PipeConfigRegionSnapshotEvent snapshotEvent)
snapshotEvent.getFileType(),
snapshotEvent.toSealTypeString()));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ protected void doTransfer(final PipeSchemaRegionWritePlanEvent pipeSchemaRegionW
compressIfNeeded(
PipeTransferPlanNodeReq.toTPipeTransferReq(
pipeSchemaRegionWritePlanEvent.getPlanNode()));

rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ private void doTransfer(Pair<TEndPoint, PipeEventBatch> endPointAndBatch) {
try {
final TPipeTransferReq req = compressIfNeeded(batchToTransfer.toTPipeTransferReq());
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down Expand Up @@ -246,9 +245,7 @@ private void doTransfer(
: compressIfNeeded(
PipeTransferTabletBinaryReq.toTPipeTransferReq(
pipeInsertNodeTabletInsertionEvent.getByteBuffer()));

rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
if (clientAndStatus != null) {
Expand Down Expand Up @@ -308,7 +305,6 @@ private void doTransfer(final PipeRawTabletInsertionEvent pipeRawTabletInsertion
pipeRawTabletInsertionEvent.convertToTablet(),
pipeRawTabletInsertionEvent.isAligned()));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down Expand Up @@ -369,7 +365,6 @@ private void doTransfer(final PipeTsFileInsertionEvent pipeTsFileInsertionEvent)
PipeTransferTsFileSealWithModReq.toTPipeTransferReq(
modFile.getName(), modFile.length(), tsFile.getName(), tsFile.length()));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand All @@ -386,7 +381,6 @@ private void doTransfer(final PipeTsFileInsertionEvent pipeTsFileInsertionEvent)
compressIfNeeded(
PipeTransferTsFileSealReq.toTPipeTransferReq(tsFile.getName(), tsFile.length()));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ private void doTransfer(final PipeSchemaRegionSnapshotEvent snapshotEvent)
Objects.nonNull(tagLogSnapshotFile) ? tagLogSnapshotFile.length() : 0,
snapshotEvent.getDatabaseName(),
snapshotEvent.toSealTypeString()));

rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp = clientAndStatus.getLeft().pipeTransfer(req);
} catch (final Exception e) {
clientAndStatus.setRight(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ protected void transferFilePieces(
? getTransferMultiFilePieceReq(file.getName(), position, payLoad)
: getTransferSingleFilePieceReq(file.getName(), position, payLoad));
rateLimitIfNeeded(clientAndStatus.getLeft().getEndPoint(), req.getBody().length);

resp =
PipeTransferFilePieceResp.fromTPipeTransferResp(
clientAndStatus.getLeft().pipeTransfer(req));
Expand Down

0 comments on commit 863d12d

Please sign in to comment.