This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
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.
* add heartbeat detect * add for db ut * fix ut stop shell * fix db ut * add heartbeat count * add test for self increment jobid and getting job status by id * fix ut, fix proto * fix ut * fix ut
- Loading branch information
1 parent
6998d24
commit 6dcacc0
Showing
8 changed files
with
221 additions
and
78 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/main/java/com/antgroup/tugraph/service/HeartbeatService.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,5 @@ | ||
package com.antgroup.tugraph; | ||
|
||
public interface HeartbeatService { | ||
TuGraphDBManagement.HeartbeatResponse detectHeartbeat(TuGraphDBManagement.HeartbeatRequest request); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/antgroup/tugraph/service/HeartbeatServiceImpl.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,26 @@ | ||
package com.antgroup.tugraph; | ||
|
||
import com.baidu.cloud.starlight.springcloud.server.annotation.RpcService; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@RpcService | ||
@Slf4j | ||
public class HeartbeatServiceImpl implements HeartbeatService { | ||
|
||
@Override | ||
public TuGraphDBManagement.HeartbeatResponse detectHeartbeat(TuGraphDBManagement.HeartbeatRequest request) { | ||
log.info("get heartbeat request"); | ||
String reqMsg = request.getRequestMsg(); | ||
log.info(reqMsg); | ||
String respMsg = "This is a heartbeat response message."; | ||
int heartbeatCount = request.getHeartbeatCount(); | ||
TuGraphDBManagement.HeartbeatResponse.Builder respBuilder = | ||
TuGraphDBManagement.HeartbeatResponse | ||
.newBuilder(); | ||
respBuilder | ||
.setResponseMsg(respMsg) | ||
.setHeartbeatCount(heartbeatCount + 1); | ||
return respBuilder.build(); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Application Name | ||
spring.application.name=TuGraphDB Management | ||
spring.profiles.active=ut | ||
server.port=5071 | ||
# logging path | ||
logging.path=./logs | ||
|
||
starlight.server.enable = true | ||
starlight.server.port = 5091 | ||
|
||
spring.datasource.driver-class-name=org.sqlite.JDBC | ||
spring.datasource.url=jdbc:sqlite:tugraph_db_management_ut.db | ||
spring.main.allow-bean-definition-overriding=true | ||
|
Oops, something went wrong.