-
Notifications
You must be signed in to change notification settings - Fork 3
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
7 changed files
with
248 additions
and
43 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
47 changes: 47 additions & 0 deletions
47
cadio-core/src/main/java/kr/hakdang/cadio/core/domain/cluster/ClusterQueryCommanderArgs.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,47 @@ | ||
package kr.hakdang.cadio.core.domain.cluster; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* ClusterQueryCommanderArgs | ||
* | ||
* @author akageun | ||
* @since 2024-07-03 | ||
*/ | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ClusterQueryCommanderArgs { | ||
private String query; | ||
private String cursor; | ||
private int pageSize; | ||
private int timeoutSeconds; | ||
private boolean trace = false; | ||
|
||
@Builder | ||
public ClusterQueryCommanderArgs(String query, String cursor, Integer pageSize, Integer timeoutSeconds, boolean trace) { | ||
if (pageSize == null || pageSize <= 0) { | ||
pageSize = 50; | ||
} | ||
|
||
if (pageSize > 500) { | ||
throw new RuntimeException("pageSize 500 over"); | ||
} | ||
|
||
if (timeoutSeconds == null || timeoutSeconds <= 0) { | ||
timeoutSeconds = 3; //default 3 | ||
} | ||
|
||
if (timeoutSeconds > 60) { | ||
throw new RuntimeException("timeout 60 over"); | ||
} | ||
|
||
this.query = query; | ||
this.cursor = cursor; | ||
this.pageSize = pageSize; | ||
this.timeoutSeconds = timeoutSeconds; | ||
this.trace = trace; | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
cadio-web/src/main/java/kr/hakdang/cadio/web/route/cluster/query/ClusterQueryRequest.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,42 @@ | ||
package kr.hakdang.cadio.web.route.cluster.query; | ||
|
||
import kr.hakdang.cadio.core.domain.cluster.ClusterQueryCommanderArgs; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* ClusterQueryRequest | ||
* | ||
* @author akageun | ||
* @since 2024-07-03 | ||
*/ | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ClusterQueryRequest { | ||
private String query; | ||
private String cursor; | ||
private int pageSize; | ||
private int timeoutSeconds; | ||
private boolean trace = false; | ||
|
||
@Builder | ||
public ClusterQueryRequest(String query, String cursor, int pageSize, int timeoutSeconds, boolean trace) { | ||
this.query = query; | ||
this.cursor = cursor; | ||
this.pageSize = pageSize; | ||
this.timeoutSeconds = timeoutSeconds; | ||
this.trace = trace; | ||
} | ||
|
||
public ClusterQueryCommanderArgs makeArgs() { | ||
return ClusterQueryCommanderArgs.builder() | ||
.query(query) | ||
.cursor(cursor) | ||
.pageSize(pageSize) | ||
.timeoutSeconds(timeoutSeconds) | ||
.trace(trace) | ||
.build(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
cadio-web/src/main/java/kr/hakdang/cadio/web/route/cluster/query/ClusterQueryResponse.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,25 @@ | ||
package kr.hakdang.cadio.web.route.cluster.query; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* ClusterQueryResponse | ||
* | ||
* @author akageun | ||
* @since 2024-07-03 | ||
*/ | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ClusterQueryResponse { | ||
private boolean wasApplied; | ||
private List<String> columnNames; | ||
private List<Map<String, Object>> rows; | ||
private String nextToken; | ||
|
||
|
||
} |
Oops, something went wrong.