Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-46919: Extend the http frontend of Qserv to support pushing CSV files in the multipart/form-data body #876

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

iagaponenko
Copy link
Contributor

No description provided.

@iagaponenko iagaponenko force-pushed the tickets/DM-46919 branch 6 times, most recently from ba72521 to f8b0c67 Compare November 9, 2024 05:57
Copy link
Contributor

@jgates108 jgates108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just minor comments.

types (numeric, etc.). Otherwise, an index creation request will fail.

``ascending`` : *number*
The required sorting order of the column in the index. It translates into ``ASC`` or ``DESC`` optiona
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optiona -> options

The required *base* name of the table where the index will be created.

``overlap`` : *number* := ``0``
The optional *overlap* flagg indicating a sub-type of the *chunk* table. The value should be one of the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flagg -> flag

``table`` : *string*
The name of the table for which the indexes are required to be collected.

The optional query parameyter is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameyter -> parameter

The optional query parameyter is

``overlap`` : *number* := ``0``
The optional *overlap* flagg indicating a sub-type of the *chunk* table. The value should be one of the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flagg -> flag

| "longitude_key" : "dec" | |
| } | **Note**: Attributes ``latitude_key`` and |
| | ``longitude_key`` were not provided. |
| | is allowed for the dependent tables. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is -> This is

* @param databaseName The name of the database to be verified.
* @throw http::Error if the name is too short, or it doesn't start with the required prefix.
*/
void verifyUserDatabaseName(std::string const& func, std::string const& databaseName) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be static.

* @param tableName The name of the table to be verified.
* @throw http::Error if the name is too short, or it starts with the reserved prefix.
*/
void verifyUserTableName(std::string const& func, std::string const& tableName) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be static.

// Some value of the parameters are still required by the Replication/Ingest system's API.
unsigned int defaultNumStripes = 340;
unsigned int defaultNumSubStripes = 3;
float defaultOverlap = 0.01667;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These appear to be placeholder values that aren't really used? It would be nice to get rid of them to prevent future confusion.

json data = json::object({{"database", databaseName},
{"num_stripes", ::defaultNumStripes},
{"num_sub_stripes", ::defaultNumSubStripes},
{"overlap", ::defaultOverlap}});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment at definition of these values leads me to believe they have no real effect here. Maybe they should have have values that indicate that? A replicated table effectively has 0 stripes, 0 substripes, and 0 overlap. If it's a partioned tables, these should be real values.

Request::Request(function<Result()> const& req, shared_ptr<ResultQueue> resultQueue)
: _req(req), _resultQueue(resultQueue) {}

void Request::operator()() { _resultQueue->push(_req()); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a minor complaint about operator()(). It can be very difficult to find all instances where it is called when the ide isn't doing a good job. grep "()" generates vast numbers of false positives.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

…tted requests

The new version of the class allows sending file attachments in the streaming mode,
along with parts.
The rafactoring prepares ground for introducing another implementation
of the REST API for ingesting tables in the "multi-part/form" body.
The new intermediate base class will prevent code duplication
after adding the second module.
Refactored the command line application qserv-czar-http to use Boost options
for command line parsing. Extended the integration test scripts and the configuration
file accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants