Skip to content

Commit

Permalink
WebUI: Change field names to lower_snake_case
Browse files Browse the repository at this point in the history
According to protobuf's guidelines: https://protobuf.dev/programming-guides/style/#message-field-names

And because camelCase will be lost and become all lowercase in the generated TypeScript/JavaScript code: protocolbuffers/protobuf-javascript#17
  • Loading branch information
zhekai-jiang committed May 10, 2023
1 parent 5292bad commit 379b0a0
Showing 1 changed file with 82 additions and 63 deletions.
145 changes: 82 additions & 63 deletions src/main/typescript/webui/protos/sudokubeRPC.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ service SudokubeService {
/* Query */
rpc selectDataCubeForQuery(SelectDataCubeArgs) returns (SelectDataCubeForQueryResponse);
rpc getValuesForSlice(GetSliceValuesArgs) returns (GetSliceValueResponse);
//Todo get and post filters
rpc setValuesForSlice(SetSliceValuesArgs) returns (Empty);
rpc getFilters(Empty) returns (GetFiltersResponse); // Currently applied filters
rpc startQuery(QueryArgs) returns (QueryResponse);
rpc continueQuery(Empty) returns (QueryResponse);
rpc getPreparedCuboids(GetPreparedCuboidsArgs) returns (GetPreparedCuboidsResponse); // for page change in cuboids table
}

message Empty {}
Expand All @@ -43,7 +45,7 @@ message SelectBaseCuboidArgs {
message SelectBaseCuboidResponse {
message Dimension {
string name = 1;
uint32 numBits = 2;
uint32 num_bits = 2;
}
repeated Dimension dimensions = 1;
}
Expand All @@ -55,48 +57,48 @@ message SelectMaterializationStrategyArgs {


message DimensionFilterCuboid {
string dimensionName = 1;
uint32 bitsFrom = 2;
uint32 bitsTo = 3;
string dimension_name = 1;
uint32 bits_from = 2;
uint32 bits_to = 3;
}

message DeleteSelectedCuboidArgs {
repeated uint32 cuboidIDsWithinPage = 1;
uint32 cuboid_id_within_page = 1;
}

message GetCuboidsArgs {//shared between GetChosenCuboids and GetAvailableCuboids
repeated DimensionFilterCuboid filters = 1;
uint32 requestedPageID = 2;
uint32 rowsPerPage = 3;
uint32 requested_page_id = 2;
uint32 rows_per_page = 3;
}

message EncodedDimensionBits {
string dimensionName = 1;
string chosenBits = 2; //in white/black squares
message DimensionBits {
string dimension_name = 1;
repeated bool chosen_bits = 2;
}

message CuboidDef {
repeated DimensionBits dimensions = 1;
}

message GetChosenCuboidsResponse {
message CuboidDef {
repeated EncodedDimensionBits dimensions = 1;
}
repeated CuboidDef cuboids = 1;
uint32 totalNumCuboids = 2; //SBJ: Do you really want this?
}

message GetAvailableCuboidsResponse {
message CuboidDef {
repeated EncodedDimensionBits dimensions = 1;
bool isChosen = 2;
message ManualSelectionCuboidDef {
repeated DimensionBits dimensions = 1;
bool is_chosen = 2;
}
repeated CuboidDef cuboids = 1;
repeated ManualSelectionCuboidDef cuboids = 1;
}

message ManuallyUpdateCuboidsArgs {
repeated bool isChosen = 1; //for all cuboids in the current page
repeated bool is_chosen = 1; //for all cuboids in the current page
}

message MaterializeArgs {
string cubeName = 1;
string cube_name = 1;
}

/** Explore and Transform Messages **/
Expand All @@ -109,7 +111,7 @@ message SelectDataCubeArgs {//shared between Explore and Query
string cube = 1;
}
message SelectDataCubeForExploreResponse {
repeated string dimNames = 1;
repeated string dim_names = 1;
}


Expand All @@ -120,95 +122,112 @@ message IsRenamedQueryArgs {

message IsRenamedQueryResponse {
repeated uint32 result = 1;
bool isRenamed = 2;
bool is_renamed = 2;
}


message GetRenameTimeArgs {
string dimensionName = 1;
string dimension_name = 1;
}
message GetRenameTimeResponse {
uint32 numTimeBits = 1;
bool isComplete = 2;
repeated bool filtersApplied = 3; //false-true for 0-1
repeated uint32 result = 4;
string renameTime = 5;
uint32 num_time_bits = 1;
bool is_complete = 2;
repeated bool filters_applied = 3; //false-true for 0-1
message ResultRow {
string time_range = 1;
uint32 null_count = 2;
uint32 not_null_count = 3;
}
repeated ResultRow result_rows = 4;
string rename_time = 5;
}

message MergeColumnDef {
string dim1 = 1;
string dim2 = 2;
string newdim = 3;
string new_dim = 3;
}

message TransformDimensionsArgs {
repeated MergeColumnDef cols = 1;
string newCubeName = 2;
string new_cube_name = 2;
}

/** Query messages **/
message SelectDataCubeForQueryResponse {
message DimHierarchy {
string dimName = 1;
uint32 numBits = 2;
string dim_name = 1;
uint32 num_bits = 2;
repeated string levels = 3;
}
repeated DimHierarchy dimensions = 1;
repeated string measures = 2;
}

message GetSliceValuesArgs {
string dimensionName = 1;
string dimensionLevel = 2;
string searchText = 3;
uint32 requestedPageId = 4;
uint32 numRowsInPage = 5;
string dimension_name = 1;
string dimension_level = 2;
string search_text = 3;
uint32 requested_page_id = 4;
uint32 num_rows_in_page = 5;
}

message GetSliceValueResponse {
repeated string values = 1;
}

//TODO get and post filters
message FilterDef {
string dimensionName = 1;
string dimensionLevel = 2;
repeated string values = 3;
//may have to change to indexes of values
message SetSliceValuesArgs {
repeated bool is_selected = 1; // Whether each value on the page is selected
}

message GetFiltersResponse {
message FilterDef {
string dimension_name = 1;
string dimension_level = 2;
string values = 3;
}
repeated FilterDef filters = 1;
}

message QueryArgs {
message DimensionDef {
string dimensionName = 1;
string dimensionLevel = 2;
string dimension_name = 1;
string dimension_level = 2;
}
repeated DimensionDef horizontal = 1;
repeated DimensionDef series = 2;
repeated FilterDef filters = 3;
string measure = 4;
string aggregation = 5;
string solver = 6;
bool isBatchMode = 7;
uint32 preparedCuboidsPerPage = 8; //SBJ: Should it be part of different request?
string measure = 3;
string aggregation = 4;
string solver = 5;
bool is_batch_mode = 6;
uint32 prepared_cuboids_per_page = 8; //SBJ: Should it be part of different request?
}

message XYpoint {
string X = 1; //should it be float with additional string label?
float Y = 2;
message XYPoint {
string x = 1; //should it be float with additional string label?
float y = 2;
}
message QueryStatistic {
string name = 1;
string value = 2;
}
message QueryResponse {
uint32 numPreparedCuboids = 1;
message CuboidDef {
repeated EncodedDimensionBits dimensions = 1;
}
uint32 cuboids_page_id = 1;
repeated CuboidDef cuboids = 2;
uint32 current_cuboid_id_within_page = 3;
message SeriesData {
string seriesName = 1;
repeated XYpoint data = 2;
string series_name = 1;
repeated XYPoint data = 2;
}
repeated SeriesData series = 3;
repeated QueryStatistic stats = 4;
repeated SeriesData series = 4;
repeated QueryStatistic stats = 5;
}

message GetPreparedCuboidsArgs {
uint32 requested_page_id = 1;
uint32 numRows_in_page = 2;
}

message GetPreparedCuboidsResponse {
repeated CuboidDef cuboids = 1;
}

0 comments on commit 379b0a0

Please sign in to comment.