-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
320 additions
and
398 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
41 changes: 41 additions & 0 deletions
41
...ler-test/src/main/java/com/navercorp/pinpoint/profiler/test/AsyncDataSenderDelegator.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,41 @@ | ||
package com.navercorp.pinpoint.profiler.test; | ||
|
||
import com.navercorp.pinpoint.common.profiler.message.AsyncDataSender; | ||
import com.navercorp.pinpoint.common.profiler.message.DefaultResultResponse; | ||
import com.navercorp.pinpoint.common.profiler.message.EnhancedDataSender; | ||
import com.navercorp.pinpoint.common.profiler.message.ResultResponse; | ||
import com.navercorp.pinpoint.profiler.metadata.MetaDataType; | ||
|
||
import java.util.Objects; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class AsyncDataSenderDelegator implements AsyncDataSender<MetaDataType, ResultResponse> { | ||
|
||
private final EnhancedDataSender<MetaDataType> dataSender; | ||
|
||
private final ResultResponse success = new DefaultResultResponse(true, "success"); | ||
private final ResultResponse failed = new DefaultResultResponse(false, "failed"); | ||
|
||
public AsyncDataSenderDelegator(EnhancedDataSender<MetaDataType> dataSender) { | ||
this.dataSender = Objects.requireNonNull(dataSender, "dataSender"); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ResultResponse> request(MetaDataType data) { | ||
if (this.dataSender.request(data)) { | ||
return CompletableFuture.completedFuture(success); | ||
} else { | ||
return CompletableFuture.completedFuture(failed); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean send(MetaDataType data) { | ||
return this.dataSender.send(data); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
// empty | ||
} | ||
} |
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
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
34 changes: 0 additions & 34 deletions
34
...ler-test/src/main/java/com/navercorp/pinpoint/profiler/test/rpc/MockMessageConverter.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.