Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ public static String getCollectionName(String collectionID) {
}

/**
* Get the hostname for the given pillarID from the ReferenceSettings.
* Get the human-readable pillar name for the given pillarID from the ReferenceSettings.
*
* @param pillarID The pillarID for which the hostname is wanted.
* @return Returns the hostname for the given pillar ID.
* @param pillarID The pillarID for which the pillar name is wanted.
* @return Returns the pillar name for the given pillar ID.
*/
public static String getHostname(String pillarID) {
public static String getPillarName(String pillarID) {
PillarIntegrityDetails details = settings.getReferenceSettings().getIntegrityServiceSettings().getPillarIntegrityDetails();
if (details != null) {
for (PillarIntegrityDetails.PillarDetails d : details.getPillarDetails()) {
if (d.getPillarID().equals(pillarID)) {
return d.getPillarHostname();
return d.getPillarName();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
<PillarIntegrityDetails>
<PillarDetails>
<PillarID>Pillar1</PillarID>
<PillarHostname>test@kb.dk</PillarHostname>
<PillarName>Alpha</PillarName>
<PillarType>FILE</PillarType>
</PillarDetails>
</PillarIntegrityDetails>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@
<PillarIntegrityDetails>
<PillarDetails>
<PillarID>checksum-pillar</PillarID>
<PillarHostname>test1@kb.dk</PillarHostname>
<PillarName>Alpha</PillarName>
<PillarType>CHECKSUM</PillarType>
</PillarDetails>
<PillarDetails>
<PillarID>file1-pillar</PillarID>
<PillarHostname>test2@kb.dk</PillarHostname>
<PillarName>Beta</PillarName>
<PillarType>FILE</PillarType>
</PillarDetails>
<PillarDetails>
<PillarID>file2-pillar</PillarID>
<PillarHostname>test3@kb.dk</PillarHostname>
<PillarName>Gamma</PillarName>
<PillarType>FILE</PillarType>
</PillarDetails>
</PillarIntegrityDetails>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class PillarCollectionStat {
private final String pillarID;
private final String collectionID;
private final String pillarHostname;
private final String pillarName;
private final String pillarType;
private Long fileCount = 0L;
private Long dataSize = 0L;
Expand All @@ -40,19 +40,19 @@ public class PillarCollectionStat {
private Date statsTime;
private Date updateTime;

public PillarCollectionStat(String pillarID, String collectionID, String pillarHostname, String pillarType) {
public PillarCollectionStat(String pillarID, String collectionID, String pillarName, String pillarType) {
this.pillarID = pillarID;
this.collectionID = collectionID;
this.pillarHostname = pillarHostname;
this.pillarName = pillarName;
this.pillarType = pillarType;
}

public PillarCollectionStat(String pillarID, String collectionID, String pillarHostname, String pillarType, Long fileCount,
public PillarCollectionStat(String pillarID, String collectionID, String pillarName, String pillarType, Long fileCount,
Long dataSize, Long missingFiles, Long checksumErrors, Long missingChecksums, Long obsoleteChecksum,
Date statsTime, Date updateTime) {
this.pillarID = pillarID;
this.collectionID = collectionID;
this.pillarHostname = pillarHostname;
this.pillarName = pillarName;
this.pillarType = pillarType;
this.fileCount = fileCount;
this.dataSize = dataSize;
Expand All @@ -72,8 +72,8 @@ public String getCollectionID() {
return collectionID;
}

public String getPillarHostname() {
return pillarHostname;
public String getPillarName() {
return pillarName;
}

public String getPillarType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,10 @@ public List<PillarCollectionStat> getLatestPillarStats(String collectionID) {
Long obsoleteChecksums = dbResult.getLong("obsolete_checksums_count");
Date statsTime = null;
Date updateTime = null;
String pillarHostname = Objects.requireNonNullElse(SettingsUtils.getHostname(pillarID), "N/A");
String pillarName = Objects.requireNonNullElse(SettingsUtils.getPillarName(pillarID), "N/A");
String pillarType = (SettingsUtils.getPillarType(pillarID) != null) ?
Objects.requireNonNull(SettingsUtils.getPillarType(pillarID)).value() : "Unknown";
PillarCollectionStat p = new PillarCollectionStat(pillarID, collectionID, pillarHostname, pillarType, fileCount,
PillarCollectionStat p = new PillarCollectionStat(pillarID, collectionID, pillarName, pillarType, fileCount,
dataSize, missingFiles, checksumErrors, missingChecksums, obsoleteChecksums, statsTime, updateTime);
stats.add(p);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public StatisticsCollector(String collectionID) {
pillarCollectionStats = new HashMap<>();
List<String> pillars = SettingsUtils.getPillarIDsForCollection(collectionID);
for (String pillar : pillars) {
String pillarHostname = Objects.requireNonNullElse(SettingsUtils.getHostname(pillar), "N/A");
String pillarName = Objects.requireNonNullElse(SettingsUtils.getPillarName(pillar), "N/A");
PillarType pillarTypeObject = SettingsUtils.getPillarType(pillar);
String pillarType = (pillarTypeObject != null) ? pillarTypeObject.value() : "Unknown";
PillarCollectionStat ps = new PillarCollectionStat(pillar, collectionID, pillarHostname, pillarType);
PillarCollectionStat ps = new PillarCollectionStat(pillar, collectionID, pillarName, pillarType);
pillarCollectionStats.put(pillar, ps);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,18 @@ public String getIntegrityStatus(
}
for (String pillar : pillars) {
if (!stats.containsKey(pillar)) {
String pillarHostname = Objects.requireNonNullElse(SettingsUtils.getHostname(pillar), "N/A");
String pillarName = Objects.requireNonNullElse(SettingsUtils.getPillarName(pillar), "N/A");
PillarType pillarTypeObject = SettingsUtils.getPillarType(pillar);
String pillarType = pillarTypeObject != null ? pillarTypeObject.value() : null;
PillarCollectionStat emptyStat = new PillarCollectionStat(pillar, collectionID, pillarHostname, pillarType,
PillarCollectionStat emptyStat = new PillarCollectionStat(pillar, collectionID, pillarName, pillarType,
0L, 0L, 0L, 0L, 0L, 0L, new Date(0), new Date(0));
stats.put(pillar, emptyStat);
}
}
jg.writeStartArray();
for (PillarCollectionStat stat : stats.values()) {
writeIntegrityStatusObject(stat, jg);
log.debug("IntegrityStatus: Wrote hostname: " + stat.getPillarHostname() + " to pillar" + stat.getPillarID());
log.debug("IntegrityStatus: Wrote pillar name: " + stat.getPillarName() + " to pillar" + stat.getPillarID());
}
jg.writeEndArray();
jg.flush();
Expand Down Expand Up @@ -415,7 +415,7 @@ private StreamingOutput streamPartFromLatestReport(ReportPart part, String colle
private void writeIntegrityStatusObject(PillarCollectionStat stat, JsonGenerator jg) throws IOException {
jg.writeStartObject();
jg.writeObjectField("pillarID", stat.getPillarID());
jg.writeObjectField("pillarHostname", stat.getPillarHostname());
jg.writeObjectField("pillarName", stat.getPillarName());
jg.writeObjectField("pillarType", stat.getPillarType());
jg.writeObjectField("totalFileCount", stat.getFileCount());
jg.writeObjectField("missingFilesCount", stat.getMissingFiles());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
The consistency is already being checked by the scheduled job, so it setting is only for further
verifying the consistency when handling messages.
Default value is false.
This setting is only releavent for the FilePillar (since ChecksumPillars do not have the actual files).
This setting is only relevant for the FilePillar (since ChecksumPillars do not have the actual files).
</xs:documentation>
</xs:annotation>
</xs:element>
Expand All @@ -328,16 +328,34 @@
<xs:element name="PillarIntegrityDetails">
<xs:annotation>
<xs:documentation xml:lang="en">
The details of all the pillars used by integrity service to map pillar IDs to hostnames and pillar types.
The details of all the pillars used by integrity service to map pillar IDs to pillar names and pillar types.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="PillarDetails" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>
Details for a specific pillar in the repository.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="PillarID" type="xs:string"/>
<xs:element name="PillarHostname" type="xs:string"/>
<xs:element name="PillarID" type="xs:string">
<xs:annotation>
<xs:documentation>
The ID of the pillar, i.e. the ID used for communicating with the pillar
corresponding to the pillar's own 'PillarID' setting.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PillarName" type="xs:string">
<xs:annotation>
<xs:documentation>
The human-readable name for the pillar.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="PillarType"/>
</xs:sequence>
</xs:complexType>
Expand Down Expand Up @@ -793,7 +811,7 @@
<xs:element ref="PillarIntegrityDetails" minOccurs="0">
<xs:annotation xml:lang="en">
<xs:documentation>
The Integrity details of all the pillars. This includes the Pillar hostnames and Pillar types.
The Integrity details of all the pillars. This includes the Pillar names and Pillar types.
</xs:documentation>
</xs:annotation>
</xs:element>
Expand Down
27 changes: 14 additions & 13 deletions bitrepository-webclient/src/main/webapp/integrity-service.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2>Integrity service</h2>
<thead>
<tr>
<th>Pillar ID</th>
<th>Pillar Hostname</th>
<th>Pillar Name</th>
<th>Pillar Type</th>
<th>Total number of files</th>
<th>Number of missing files</th>
Expand Down Expand Up @@ -233,10 +233,11 @@ <h3 id="modalPagerLabel">Modal header</h3>
function getCellContext(id, type) {
var context = {};
context.url = integrityServiceUrl + "/integrity/IntegrityService/";
if (type == "Pillar Hostname") {
context.element = id + "-pillarHostname";

if(type == "Pillar Name") {
context.element = id + "-pillarName";
context.title = type + " on " + id;
context.member = "pillarHostname";
context.member = "pillarName";
} else if (type == "Pillar Type") {
context.element = id + "-pillarType";
context.title = type + " on " + id;
Expand Down Expand Up @@ -275,7 +276,7 @@ <h3 id="modalPagerLabel">Modal header</h3>
var html = "";
html += "<tr id=\"" + id + "-row\">";
html += "<td><div style=\"padding:5px\">" + id + "</div></td>";
html += "<td id=\"" + id + "-pillarHostname\"></td>";
html += "<td id=\"" + id + "-pillarName\"></td>";
html += "<td id=\"" + id + "-pillarType\"></td>";
html += "<td id=\"" + id + "-totalFileCount\"></td>";
html += "<td id=\"" + id + "-missingFiles\"></td>";
Expand All @@ -286,7 +287,7 @@ <h3 id="modalPagerLabel">Modal header</h3>
}

function updateCells(pillarID) {
updateStringCell(pillarID, "Pillar Hostname", pillars[pillarID].pillarHostname);
updateStringCell(pillarID, "Pillar Name", pillars[pillarID].pillarName);
updateStringCell(pillarID, "Pillar Type", pillars[pillarID].pillarType);
updateIntCell(pillarID, "Total files", pillars[pillarID].totalFileCount);
updateIntCell(pillarID, "Missing files", pillars[pillarID].missingFilesCount);
Expand Down Expand Up @@ -324,13 +325,13 @@ <h3 id="modalPagerLabel">Modal header</h3>
$("#integrity-status-table-body").append(makePillarRow(j[i].pillarID));
}
pillars[j[i].pillarID] = {
pillarHostname: j[i].pillarHostname,
pillarType: j[i].pillarType,
totalFileCount: j[i].totalFileCount,
missingFilesCount: j[i].missingFilesCount,
missingChecksumsCount: j[i].missingChecksumsCount,
obsoleteChecksumsCount: j[i].obsoleteChecksumsCount,
checksumErrorCount: j[i].checksumErrorCount
pillarName : j[i].pillarName,
pillarType : j[i].pillarType,
totalFileCount : j[i].totalFileCount,
missingFilesCount : j[i].missingFilesCount,
missingChecksumsCount : j[i].missingChecksumsCount,
obsoleteChecksumsCount : j[i].obsoleteChecksumsCount,
checksumErrorCount : j[i].checksumErrorCount
};
updateCells(j[i].pillarID);
}
Expand Down