Skip to content

Commit

Permalink
feat: NET_SERVER -> NET_CLIENT
Browse files Browse the repository at this point in the history
  • Loading branch information
laysakura committed Feb 16, 2022
1 parent eb071c2 commit 7c98620
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 36 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Here introduces "Command line mode" first to quickly grasp SpringQL usage.
#### Installation

```bash
$ cargo install springql-cmd
cargo install springql-cmd
```

#### Running demo
Expand Down Expand Up @@ -81,7 +81,7 @@ $ springql --output fst_trade_oracle.log
-> "timestamp" TIMESTAMP NOT NULL ROWTIME,
-> "ticker" TEXT NOT NULL,
-> "amount" INTEGER NOT NULL
-> ) SERVER NET_SERVER OPTIONS (
-> ) SERVER NET_CLIENT OPTIONS (
-> remote_port 17890
-> );
```
Expand Down Expand Up @@ -150,7 +150,7 @@ See [C client repository](https://github.com/SpringQL/SpringQL-client-c) for mor
#### Installation

```bash
$ cargo install springql-daemon
cargo install springql-daemon
```

**TBD** launch `sqringqld` via systemctl?
Expand Down
2 changes: 1 addition & 1 deletion springql-core/src/pipeline/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl StreamName {

impl SinkWriterName {
pub(crate) fn net_sink() -> Self {
Self::new("NET_SERVER_SINK".to_string())
Self::new("NET_CLIENT_SINK".to_string())
}

pub(crate) fn in_memory_queue_sink() -> Self {
Expand Down
4 changes: 2 additions & 2 deletions springql-core/src/sql_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ mod tests {

let sql = "
CREATE SOURCE READER tcp_source FOR st_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
REMOTE_PORT '17890'
);
";
Expand Down Expand Up @@ -238,7 +238,7 @@ mod tests {

let sql = "
CREATE SINK WRITER tcp_sink_trade FOR sink_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
REMOTE_PORT '17890'
);
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ impl PestParserImpl {
identity,
)?;
match typ.as_ref() {
"NET_SERVER" => Ok(SourceReaderType::Net),
"NET_CLIENT" => Ok(SourceReaderType::Net),
_ => Err(SpringError::Sql(anyhow!(
"Invalid source reader name: {}",
typ
Expand All @@ -1090,7 +1090,7 @@ impl PestParserImpl {
identity,
)?;
match typ.as_ref() {
"NET_SERVER" => Ok(SinkWriterType::Net),
"NET_CLIENT" => Ok(SinkWriterType::Net),
"IN_MEMORY_QUEUE" => Ok(SinkWriterType::InMemoryQueue),
_ => Err(SpringError::Sql(anyhow!(
"Invalid source reader name: {}",
Expand Down
10 changes: 5 additions & 5 deletions springql-core/tests/e2e_low_level_rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn test_e2e_source_sink() -> Result<()> {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -76,7 +76,7 @@ fn test_e2e_source_sink() -> Result<()> {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down Expand Up @@ -137,7 +137,7 @@ fn test_e2e_projection() -> Result<()> {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -149,7 +149,7 @@ fn test_e2e_projection() -> Result<()> {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down Expand Up @@ -232,7 +232,7 @@ fn test_e2e_pop_from_in_memory_queue() {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
8 changes: 4 additions & 4 deletions springql-core/tests/e2e_sampling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn test_e2e_sampling() -> Result<()> {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_sampled_trade_amount
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -100,7 +100,7 @@ fn test_e2e_sampling() -> Result<()> {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down Expand Up @@ -186,7 +186,7 @@ fn test_e2e_sampling_pump_insert_to_window_queue() -> Result<()> {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_sampled_trade_amount
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -198,7 +198,7 @@ fn test_e2e_sampling_pump_insert_to_window_queue() -> Result<()> {
format!(
"
CREATE SOURCE READER tcp_source_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
6 changes: 3 additions & 3 deletions springql-core/tests/feat_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn test_feat_left_outer_join() {
format!(
"
CREATE SINK WRITER tcp_sink_joined FOR sink_joined
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -124,7 +124,7 @@ fn test_feat_left_outer_join() {
format!(
"
CREATE SOURCE READER tcp_source_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -136,7 +136,7 @@ fn test_feat_left_outer_join() {
format!(
"
CREATE SOURCE READER tcp_source_city_temperature FOR source_city_temperature
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
8 changes: 4 additions & 4 deletions springql-core/tests/feat_numerical_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn test_feat_add_integer() {
format!(
"
CREATE SINK WRITER tcp_sink_1 FOR sink_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -61,7 +61,7 @@ fn test_feat_add_integer() {
format!(
"
CREATE SOURCE READER tcp_1 FOR source_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down Expand Up @@ -115,7 +115,7 @@ fn test_feat_add_float() {
format!(
"
CREATE SINK WRITER tcp_sink_1 FOR sink_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -127,7 +127,7 @@ fn test_feat_add_float() {
format!(
"
CREATE SOURCE READER tcp_1 FOR source_1
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
11 changes: 6 additions & 5 deletions springql-core/tests/feat_performance_metrics_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn test_performance_metrics_report_floor_time() {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -128,7 +128,7 @@ fn test_performance_metrics_report_floor_time() {
format!(
"
CREATE SOURCE READER tcp_source_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down Expand Up @@ -172,7 +172,8 @@ fn test_performance_metrics_report_floor_time() {
.iter()
.find_map(|body| {
body.queues.iter().find(|queue| {
queue.id == "pu_floor_time-source_trade" && queue.row_queue.as_ref().unwrap().num_rows > 0
queue.id == "pu_floor_time-source_trade"
&& queue.row_queue.as_ref().unwrap().num_rows > 0
})
})
.expect("at least 1 should exist (but in very rare case input queue is always empty)");
Expand Down Expand Up @@ -258,7 +259,7 @@ fn test_performance_metrics_report_sampling() {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_sampled_trade_amount
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -270,7 +271,7 @@ fn test_performance_metrics_report_sampling() {
format!(
"
CREATE SOURCE READER tcp_source_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
6 changes: 3 additions & 3 deletions springql-core/tests/feat_purger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn t(n_in_rows: u64, upper_limit_bytes: u64) {
format!(
"
CREATE SINK WRITER tcp_sink_joined FOR sink_joined
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -95,7 +95,7 @@ fn t(n_in_rows: u64, upper_limit_bytes: u64) {
format!(
"
CREATE SOURCE READER tcp_source_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -107,7 +107,7 @@ fn t(n_in_rows: u64, upper_limit_bytes: u64) {
format!(
"
CREATE SOURCE READER tcp_source_city_temperature FOR source_city_temperature
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
4 changes: 2 additions & 2 deletions springql-core/tests/feat_timestamp_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn test_feat_floor_time() {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -65,7 +65,7 @@ fn test_feat_floor_time() {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down
4 changes: 2 additions & 2 deletions springql-core/tests/feat_worker_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn t(worker_config: SpringWorkerConfig) {
format!(
"
CREATE SINK WRITER tcp_sink_trade FOR sink_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand All @@ -87,7 +87,7 @@ fn t(worker_config: SpringWorkerConfig) {
format!(
"
CREATE SOURCE READER tcp_trade FOR source_trade
TYPE NET_SERVER OPTIONS (
TYPE NET_CLIENT OPTIONS (
PROTOCOL 'TCP',
REMOTE_HOST '{remote_host}',
REMOTE_PORT '{remote_port}'
Expand Down

0 comments on commit 7c98620

Please sign in to comment.