use of com.emc.storageos.coordinator.client.model.DbConsistencyStatus in project coprhd-controller by CoprHD.
the class DbConsistencyChecker method checkObjectIndices.
/**
* Scan all the data object records, to find out the object record is existing
* but the related index is missing.
*
* @return The number of corrupted data
* @throws ConnectionException
*/
private int checkObjectIndices() throws ConnectionException {
CheckType checkType = CheckType.OBJECT_INDICES;
helper.logMessage(DbConsistencyCheckerHelper.MSG_OBJECT_INDICES_START, false, toConsole);
DbConsistencyStatus status = getStatusFromZk();
Collection<DataObjectType> resumeDataCfs = resumeFromWorkingPoint(checkType, status.getWorkingPoint());
CheckResult checkResult = new CheckResult();
for (DataObjectType dataCf : resumeDataCfs) {
helper.checkCFIndices(dataCf, toConsole, checkResult);
status = getStatusFromZk();
if (!toConsole && isCancelled(status)) {
cancel(status);
}
if (!toConsole) {
status.update(this.totalCount, checkType.name(), dataCf.getCF().getName(), checkResult.getTotal());
persistStatus(status);
}
}
String msg = String.format(DbConsistencyCheckerHelper.MSG_OBJECT_INDICES_END, resumeDataCfs.size(), checkResult.getTotal());
helper.logMessage(checkResult.toString(), false, toConsole);
helper.logMessage(msg, false, toConsole);
return checkResult.getTotal();
}
use of com.emc.storageos.coordinator.client.model.DbConsistencyStatus in project coprhd-controller by CoprHD.
the class DbConsistencyChecker method checkIndexObjects.
/**
* Scan all the indices and related data object records, to find out
* the index record is existing but the related data object records is missing.
*
* @return the number of the corrupted rows in the index CFs
* @throws ConnectionException
*/
private int checkIndexObjects() throws ConnectionException {
CheckType checkType = CheckType.INDEX_OBJECTS;
helper.logMessage(DbConsistencyCheckerHelper.MSG_INDEX_OBJECTS_START, false, toConsole);
DbConsistencyStatus status = getStatusFromZk();
Collection<IndexAndCf> resumeIdxCfs = resumeFromWorkingPoint(checkType, status.getWorkingPoint());
CheckResult checkResult = new CheckResult();
for (IndexAndCf indexAndCf : resumeIdxCfs) {
helper.checkIndexingCF(indexAndCf, toConsole, checkResult);
status = getStatusFromZk();
if (!toConsole && isCancelled(status)) {
cancel(status);
}
if (!toConsole) {
status.update(this.totalCount, checkType.name(), indexAndCf.generateKey(), checkResult.getTotal());
persistStatus(status);
}
}
String msg = String.format(DbConsistencyCheckerHelper.MSG_INDEX_OBJECTS_END, resumeIdxCfs.size(), checkResult.getTotal());
helper.logMessage(checkResult.toString(), false, toConsole);
helper.logMessage(msg, false, toConsole);
return checkResult.getTotal();
}
use of com.emc.storageos.coordinator.client.model.DbConsistencyStatus in project coprhd-controller by CoprHD.
the class DbConsistencyChecker method checkObjectId.
/**
* Find out all rows in DataObject CFs that can't be deserialized,
* such as such as object id cannot be converted to URI.
*
* @return number of the corrupted rows in data CFs
*/
private int checkObjectId() {
CheckType checkType = CheckType.OBJECT_ID;
helper.logMessage(DbConsistencyCheckerHelper.MSG_OBJECT_ID_START, false, toConsole);
DbConsistencyStatus status = getStatusFromZk();
Collection<DataObjectType> resumeDataCfs = resumeFromWorkingPoint(checkType, status.getWorkingPoint());
int totalIllegalCount = 0;
for (DataObjectType dataCf : resumeDataCfs) {
int illegalCount = helper.checkDataObject(dataCf, toConsole);
status = getStatusFromZk();
if (!toConsole && isCancelled(status)) {
cancel(status);
}
if (!toConsole) {
status.update(this.totalCount, checkType.name(), dataCf.getCF().getName(), illegalCount);
persistStatus(status);
}
totalIllegalCount += illegalCount;
}
String msg = String.format(DbConsistencyCheckerHelper.MSG_OBJECT_ID_END, resumeDataCfs.size(), totalIllegalCount);
helper.logMessage(msg, false, toConsole);
return totalIllegalCount;
}
use of com.emc.storageos.coordinator.client.model.DbConsistencyStatus in project coprhd-controller by CoprHD.
the class DbConsistencyService method getDbConsistencyStatus.
/**
* Get the status of db consistency check
* @brief Get the status of db consistency check
* @return DbConsistencyStatusRestRep the status of db consistency check
*/
@GET
@Path("consistency")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.RESTRICTED_SYSTEM_ADMIN })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public DbConsistencyStatusRestRep getDbConsistencyStatus() {
DbConsistencyStatus status = getStatusFromZk();
log.info("db consistency check status {}", status);
return toStatusRestRep(status);
}
use of com.emc.storageos.coordinator.client.model.DbConsistencyStatus in project coprhd-controller by CoprHD.
the class DbConsistencyJobConsumer method createStatusInZk.
private DbConsistencyStatus createStatusInZk() {
DbConsistencyStatus status = new DbConsistencyStatus();
status.init();
return status;
}
Aggregations