bbeaudreault commented on a change in pull request #3532:
URL: https://github.com/apache/hbase/pull/3532#discussion_r686278794
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -7518,11 +7516,35 @@ void prepareGet(final Get get) throws IOException {
@Override
public List<Cell> get(Get get, boolean withCoprocessor) throws IOException {
- return get(get, withCoprocessor, HConstants.NO_NONCE, HConstants.NO_NONCE);
+ return getInternal(get, withCoprocessor, HConstants.NO_NONCE,
HConstants.NO_NONCE).getFirst();
}
- private List<Cell> get(Get get, boolean withCoprocessor, long nonceGroup,
long nonce)
- throws IOException {
+ private Result get(Get get, boolean withCoprocessor, long nonceGroup, long
nonce)
+ throws IOException {
+ Pair<List<Cell>, ScannerContext> result = getInternal(get,
withCoprocessor, nonceGroup, nonce);
+ boolean stale = this.getRegionInfo().getReplicaId() != 0;
+
+ return Result.create(
+ result.getFirst(),
+ get.isCheckExistenceOnly() ? !result.getFirst().isEmpty() : null,
+ stale,
+ result.getSecond().mayHaveMoreCellsInRow());
+ }
+
+ private Pair<List<Cell>, ScannerContext> getInternal(Get get, boolean
withCoprocessor, long nonceGroup, long nonce)
+ throws IOException {
+ ScannerContext scannerContext = ScannerContext.newBuilder()
Review comment:
With the new commit, I also removed the ScannerContext from the version
of `get` which just returns a `List<Cell>`. I probably shouldn't have included
it in the first place. It's odd to return a partial result with no way to
inform the client to that fact. I'm not sure in what context this method is
used, looks like just tests maybe if intellij isn't lying.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]