Skip to content

Commit

Permalink
Synched with RustExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
amigin committed Feb 10, 2025
1 parent 9cc7bdc commit 17a869d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/db_operations/read/get_highest_row_and_below.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ pub async fn get_highest_row_and_below(
return Ok(ReadOperationResult::RowsArray(
json_array_writer.build().into_bytes(),
));
/*
let mut json_array_writer = JsonArrayWriter::new();
for db_row in db_rows {
json_array_writer.write_raw_element(db_row.data.as_ref());
}
return ReadOperationResult::RowsArray(json_array_writer.build());
*/
}

/*
Expand Down
6 changes: 3 additions & 3 deletions src/db_operations/read/rows/get_single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ use super::super::ReadOperationResult;

pub async fn get_single(
app: &Arc<AppContext>,
db_table: &Arc<DbTableWrapper>,
db_table_wrapper: &Arc<DbTableWrapper>,
partition_key: &String,
row_key: &String,
update_statistics: UpdateStatistics,
now: DateTimeAsMicroseconds,
) -> Result<ReadOperationResult, DbOperationError> {
super::super::super::check_app_states(app)?;

let table_data = db_table.data.read().await;
let table_data = db_table_wrapper.data.read().await;

let db_partition = table_data.get_partition(partition_key);

Expand All @@ -38,7 +38,7 @@ pub async fn get_single(

let db_row = db_row.unwrap();

update_statistics.update(db_table, db_partition, Some(db_row), now);
update_statistics.update(db_table_wrapper, db_partition, Some(db_row), now);

return Ok(ReadOperationResult::SingleRow(db_row.to_vec()));
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ async fn handle_request(
headers: None,
content_type: None,
content: payload,
set_cookies: None,
}
.into_ok_result(false)
.into();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async fn handle_request(
headers: None,
content_type: Some(WebContentType::Html),
content: content.into_bytes(),
set_cookies: None,
}
.into_ok_result(true)
.into()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async fn handle_request(
headers: None,
content_type: None,
content: result.into_bytes(),
set_cookies: None,
}
.into_ok_result(true)
.into()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ async fn handle_request(
headers: None,
content: format!("Migrated {} partitions", partitions_count).into_bytes(),
content_type: Some(WebContentType::Text),
set_cookies: None,
}
.into_ok_result(true)
}
3 changes: 3 additions & 0 deletions src/http_server/mappers/read_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ impl Into<HttpOkResult> for ReadOperationResult {
headers: None,
content,
content_type: Some(WebContentType::Json),
set_cookies: None,
};

HttpOkResult {
Expand All @@ -22,6 +23,7 @@ impl Into<HttpOkResult> for ReadOperationResult {
headers: None,
content,
content_type: Some(WebContentType::Json),
set_cookies: None,
};

HttpOkResult {
Expand All @@ -39,6 +41,7 @@ impl Into<HttpOkResult> for ReadOperationResult {
headers: None,
content: empty_array,
content_type: Some(WebContentType::Json),
set_cookies: None,
};

HttpOkResult {
Expand Down
1 change: 1 addition & 0 deletions src/http_server/mappers/write_operation_result_mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ impl Into<Result<HttpOkResult, HttpFailResult>> for WriteOperationResult {
headers: None,
content_type: Some(WebContentType::Json),
content: db_row.to_vec(),
set_cookies: None,
};

Ok(HttpOkResult {
Expand Down

0 comments on commit 17a869d

Please sign in to comment.