return fmetaTable;
}
@Override
public boolean processRow(Result rowResult) throws IOException {
EntityGroupInfo info = getEntityGroupInfo(rowResult);
if (info == null) {
return true;
}
if (daughterEntityGroups.remove(info.getEntityGroupName())) {
return true; // we have already processed this row
}
if (info.isSplitParent()) {
/*
* we have found a parent entityGroup which was split. We have to ensure
* that it's daughters are seen by this scanner as well, so we block
* until they are added to the META table. Even though we are waiting
* for META entries, ACID semantics in HBase indicates that this scanner
* might not see the new rows. So we manually query the daughter rows
*/
PairOfSameType<EntityGroupInfo> daughters = EntityGroupInfo
.getDaughterEntityGroups(rowResult);
EntityGroupInfo splitA = daughters.getFirst();
EntityGroupInfo splitB = daughters.getSecond();
HTable fmetaTable = getFMetaTable();
long start = System.currentTimeMillis();
Result resultA = getEntityGroupResultBlocking(fmetaTable,
blockingTimeout, splitA.getEntityGroupName());
if (resultA != null) {
processRow(resultA);
daughterEntityGroups.add(splitA.getEntityGroupName());
} else {
throw new EnityGroupOfflineException("Split daughter entityGroup "
+ splitA.getEntityGroupNameAsString()
+ " cannot be found in META.");
}
long rem = blockingTimeout - (System.currentTimeMillis() - start);
Result resultB = getEntityGroupResultBlocking(fmetaTable, rem,
splitB.getEntityGroupName());
if (resultB != null) {
processRow(resultB);
daughterEntityGroups.add(splitB.getEntityGroupName());
} else {
throw new EnityGroupOfflineException("Split daughter entityGroup "
+ splitB.getEntityGroupNameAsString()
+ " cannot be found in META.");
}
}
return processRowInternal(rowResult);