Skip to content
Snippets Groups Projects
lender.proto 972 B
Newer Older
wyang338's avatar
wyang338 committed
syntax="proto3";

message Empty{}

message BlockLocationsReq {
  string path = 1;
}

message BlockLocationsResp {
  map <string, int32> block_entries = 1;  // list of block locations
  string error = 2;
}

message CalcAvgLoanReq {
  int32 county_code = 1;
}

message CalcAvgLoanResp {
  int32 avg_loan = 1;
  string source = 2; // partitioned or unpartitioned?
  string error = 3;
}


message StatusString{
  string status= 1;
}

service Lender {
  //Load input.data from SQL server and upload it to HDFS
  rpc DbToHdfs (Empty) returns (StatusString);
  //Get the block locations of the Parquet file in HDFS
  rpc BlockLocations (BlockLocationsReq) returns (BlockLocationsResp);
  //Classify the data in input.data based on county_code, and save each county_code as a separate Parquet file.
  rpc PartitionByCounty (Empty) returns (StatusString);
  //Calculate the average loan amount for a given county_code
  rpc CalcAvgLoan (CalcAvgLoanReq) returns (CalcAvgLoanResp);
}