[ https://issues.apache.org/jira/browse/HBASE-18097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16029861#comment-16029861 ]
Enis Soztutar commented on HBASE-18097: --------------------------------------- bq. The first part for saving 1 RPC request is already implemented as a part of HBASE-17508, where the scannerId is set to -1 whenever results are not left in region. Maybe change the title to focus on the second part then. Protobuf repeated fields in proto-2 encoding will not use extra bytes for the array representation (unless packed=true). However, you are right that, for every row in the ScanResponse object, we are setting a bool in the repeated field like this: {code} 2017-05-23 18:06:42,133 TRACE [B.fifo.QRpcServer.handler=9,queue=1,port=16020] ipc.RpcServer: callId: 384494 service: ClientService methodName: Scan size: 33 connection: <some_ip> param: scanner_id: 12244464 number_of_rows: 100 close_scanner: false next_call_seq: 384492 client_handles_partials: true client_handles_heartbeats: true renew: false connection: <some_ip>, response cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 cells_per_result: 5 scanner_id: 12244464 more_results: true ttl: 60000 stale: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false partial_flag_per_result: false more_results_in_region: true heartbeat_message: false queueTime: 0 processingTime: 1 totalTime: 1 {code} The array of {{partial_flag_per_result}} is a waste of bandwidth space. > Client can save 1 RPC call for CloseScannerRequest > -------------------------------------------------- > > Key: HBASE-18097 > URL: https://issues.apache.org/jira/browse/HBASE-18097 > Project: HBase > Issue Type: Improvement > Reporter: Karan Mehta > > Starting version 1.3, HBase automatically closes scanner on server side > whenever the results are exhausted and corresponding bits are set in the > {{ScanResponse}} proto returned to the client. We can use that info to > eliminate the closeScanRequest RPC call, thereby saving 1 RPC per region per > scan. This can be particularly useful for tables with more regions. > Also, currently the {{ScanResponse}} proto sends out 1 bit per {{Result}} > that it has embeds inside the {{CellScanner}} to indicate if it is partial or > not. > {code} > // In every RPC response there should be at most a single partial result. > Furthermore, if > // there is a partial result, it is guaranteed to be in the last position > of the array. > {code} > According to client, only the last result can be partial, thus this repeated > bool can be converted to a bool, thus reducing overhead of serialization and > deserialization of the array. This will break wire compatibility therefore > this is something to look for in upcoming versions. -- This message was sent by Atlassian JIRA (v6.3.15#6346)