use of org.apache.hadoop.hbase.regionserver.storefiletracker.InitializeStoreFileTrackerProcedure in project hbase by apache.
the class RollingUpgradeChore method isCompletelyMigrateSFT.
private boolean isCompletelyMigrateSFT(int concurrentCount) {
Iterator<InitializeStoreFileTrackerProcedure> iter = processingProcs.iterator();
while (iter.hasNext()) {
InitializeStoreFileTrackerProcedure proc = iter.next();
if (procedureExecutor.isFinished(proc.getProcId())) {
iter.remove();
}
}
// all procedures executed last time are completed.
if (!processingProcs.isEmpty()) {
return false;
}
Map<String, TableDescriptor> migrateSFTTables;
try {
migrateSFTTables = tableDescriptors.getAll().entrySet().stream().filter(entry -> {
TableDescriptor td = entry.getValue();
return StringUtils.isEmpty(td.getValue(StoreFileTrackerFactory.TRACKER_IMPL));
}).limit(concurrentCount).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
} catch (IOException e) {
LOG.warn("Failed to migrate StoreFileTracker", e);
return false;
}
if (migrateSFTTables.isEmpty()) {
LOG.info("There is no table to migrate StoreFileTracker!");
return true;
}
for (Map.Entry<String, TableDescriptor> entry : migrateSFTTables.entrySet()) {
TableDescriptor tableDescriptor = entry.getValue();
InitializeStoreFileTrackerProcedure proc = new InitializeStoreFileTrackerProcedure(procedureExecutor.getEnvironment(), tableDescriptor.getTableName());
procedureExecutor.submitProcedure(proc);
processingProcs.add(proc);
}
return false;
}
Aggregations