initial chunk of work on refactoring the gateway, syntatic gateway files names, commit points that include translog information

This commit is contained in:
kimchy 2010-08-23 15:28:12 +03:00
parent 62cc4d554a
commit b49d331c86
3 changed files with 8 additions and 3 deletions

View File

@ -167,8 +167,8 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem
if (logger.isDebugEnabled()) {
StringBuilder sb = new StringBuilder();
sb.append("recovery completed from ").append(shardGateway).append(", took [").append(timeValueMillis(recoveryStatus.time())).append("]\n");
sb.append(" index : total_size [").append(new ByteSizeValue(recoveryStatus.index().totalSize())).append("], took[").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("], took [").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("]\n");
sb.append(" : recovered_files [").append(recoveryStatus.index().numberOfFiles()).append("] with total_size [").append(new ByteSizeValue(recoveryStatus.index().reusedTotalSize())).append("], took [").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("]\n");
sb.append(" index : files [").append(recoveryStatus.index().numberOfFiles()).append("] with total_size [").append(new ByteSizeValue(recoveryStatus.index().totalSize())).append("], took[").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("], took [").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("]\n");
sb.append(" : recovered_files [").append(recoveryStatus.index().numberOfRecoveredFiles()).append("] with total_size [").append(new ByteSizeValue(recoveryStatus.index().reusedTotalSize())).append("], took [").append(TimeValue.timeValueMillis(recoveryStatus.index().time())).append("]\n");
sb.append(" : reusing_files [").append(recoveryStatus.index().numberOfReusedFiles()).append("] with total_size [").append(new ByteSizeValue(recoveryStatus.index().reusedTotalSize())).append("]\n");
sb.append(" translog : number_of_operations [").append(recoveryStatus.translog().currentTranslogOperations()).append("], took [").append(TimeValue.timeValueMillis(recoveryStatus.translog().time())).append("]");
logger.debug(sb.toString());

View File

@ -148,6 +148,10 @@ public class RecoveryStatus {
return numberOfFiles;
}
public int numberOfRecoveredFiles() {
return numberOfFiles - numberOfReusedFiles;
}
public long totalSize() {
return this.totalSize;
}

View File

@ -484,9 +484,10 @@ public abstract class BlobStoreIndexShardGateway extends AbstractIndexShardCompo
for (CommitPoint.FileInfo fileInfo : commitPoint.indexFiles()) {
StoreFileMetaData storeFile = store.metaData(fileInfo.physicalName());
if (storeFile != null && !storeFile.name().contains("segment") && storeFile.length() == fileInfo.length()) {
numberOfFiles++;
totalSize += storeFile.length();
numberOfReusedFiles++;
reusedTotalSize += storeFile.length();
totalSize += storeFile.length();
if (logger.isTraceEnabled()) {
logger.trace("not_recovering [{}], exists in local store and has same length [{}]", fileInfo.physicalName(), fileInfo.length());
}