Skip to content

Commit

Permalink
Update some RPC message formats
Browse files Browse the repository at this point in the history
  • Loading branch information
zhekai-jiang committed May 9, 2023
1 parent 3f1c097 commit 4d0fe2f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
42 changes: 21 additions & 21 deletions src/main/protobuf/sudokubeRPC.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,20 @@ message DimensionBits {
repeated bool chosenBits = 2;
}

message CuboidDef {
repeated DimensionBits dimensions = 1;
}

message GetChosenCuboidsResponse {
message CuboidDef {
repeated DimensionBits dimensions = 1;
}
repeated CuboidDef cuboids = 1;
}

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

message ManuallyUpdateCuboidsArgs {
Expand Down Expand Up @@ -132,7 +133,12 @@ message GetRenameTimeResponse {
uint32 numTimeBits = 1;
bool isComplete = 2;
repeated bool filtersApplied = 3; //false-true for 0-1
repeated uint32 result = 4;
message ResultRow {
string timeRange = 1;
uint32 nullCount = 2;
uint32 notNullCount = 3;
}
repeated ResultRow resultRows = 4;
string renameTime = 5;
}

Expand Down Expand Up @@ -174,14 +180,12 @@ message SetSliceValuesArgs {
repeated bool isSelected = 1; // Whether each value on the page is selected
}

message FilterDef {
string dimensionName = 1;
string dimensionLevel = 2;
repeated string values = 3;
//may have to change to indexes of values
}

message GetFiltersResponse {
message FilterDef {
string dimensionName = 1;
string dimensionLevel = 2;
string values = 3;
}
repeated FilterDef filters = 1;
}

Expand All @@ -192,11 +196,10 @@ message QueryArgs {
}
repeated DimensionDef horizontal = 1;
repeated DimensionDef series = 2;
repeated FilterDef filters = 3;
string measure = 4;
string aggregation = 5;
string solver = 6;
bool isBatchMode = 7;
string measure = 3;
string aggregation = 4;
string solver = 5;
bool isBatchMode = 6;
uint32 preparedCuboidsPerPage = 8; //SBJ: Should it be part of different request?
}

Expand All @@ -208,9 +211,6 @@ message QueryStatistic {
string name = 1;
string value = 2;
}
message CuboidDef {
repeated DimensionBits dimensions = 1;
}
message QueryResponse {
uint32 cuboidsPageId = 1;
repeated CuboidDef cuboids = 2;
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/frontend/service/SudokubeServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SudokubeServiceImpl(implicit mat: Materializer) extends SudokubeService {
val bitsValues = bitsToBools(total, selectedBits)
DimensionBits("Dim" + i, bitsValues)
}
GetChosenCuboidsResponse.CuboidDef(dims)
CuboidDef(dims)
}
Future.successful(GetChosenCuboidsResponse(cubs.take(cubsInPage)))
}
Expand All @@ -101,7 +101,7 @@ class SudokubeServiceImpl(implicit mat: Materializer) extends SudokubeService {
DimensionBits("Dim" + i, bitsValues)
}
val isChosen = Random.nextBoolean()
GetAvailableCuboidsResponse.CuboidDef(dims, isChosen)
GetAvailableCuboidsResponse.ManualSelectionCuboidDef(dims, isChosen)
}
Future.successful(GetAvailableCuboidsResponse(cubs.take(cubsInPage)))
}
Expand Down Expand Up @@ -133,7 +133,7 @@ class SudokubeServiceImpl(implicit mat: Materializer) extends SudokubeService {
timeBits = 1
val isComplete = timeBits >= totalTimeBits
val bits = (0 until timeBits).map{i => Random.nextBoolean()}
val result = Array(0, 10, 20, 0)
val result = Array(GetRenameTimeResponse.ResultRow("0", 0, 10), GetRenameTimeResponse.ResultRow("1", 20, 0))
val string = if(isComplete) "Column Changed between X and Y" else ""
val response = GetRenameTimeResponse(timeBits, isComplete, bits, result, string)
Future.successful(response)
Expand All @@ -143,7 +143,7 @@ class SudokubeServiceImpl(implicit mat: Materializer) extends SudokubeService {
timeBits += 1
val isComplete = timeBits >= totalTimeBits
val bits = (0 until timeBits).map { i => Random.nextBoolean() }
val result = Array(0, 10, 20, 0)
val result = Array(GetRenameTimeResponse.ResultRow("0", 0, 10), GetRenameTimeResponse.ResultRow("1", 20, 0))
val string = if (isComplete) "Column Changed between X and Y" else ""
val response = GetRenameTimeResponse(timeBits, isComplete, bits, result, string)
Future.successful(response)
Expand Down

0 comments on commit 4d0fe2f

Please sign in to comment.