inspector: max number of md records

This commit is contained in:
Michele Artini 2021-02-23 09:33:37 +01:00
parent 8b2efcf378
commit bc49f6e280
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@ -26,6 +27,9 @@ public class MDInspectorController {
private static final Logger log = LoggerFactory.getLogger(MDInspectorController.class);
@Value("${dhp.mdstore-manager.inspector.records.max}")
private Long MAX_MD_RECORDS;
@RequestMapping("/mdrecords/{id}/{limit}")
public String mdstoreInspector(final ModelMap map, @PathVariable final String id, @PathVariable final long limit) throws MDStoreManagerException {
@ -57,7 +61,7 @@ public class MDInspectorController {
map.addAttribute("lastUpdate", ver.getLastUpdate());
map.addAttribute("size", ver.getSize());
map.addAttribute("limit", limit);
map.addAttribute("limit", Math.min(limit, MAX_MD_RECORDS));
if (md.getCurrentVersion().equals(ver.getId())) {
map.addAttribute("status", "current");

View File

@ -27,3 +27,5 @@ logging.level.io.swagger.models.parameters.AbstractSerializableParameter = error
dhp.mdstore-manager.hadoop.cluster = MOCK
dhp.mdstore-manager.hdfs.base-path = /data/dnet.dev/mdstore
dhp.mdstore-manager.hadoop.user = dnet.dev
dhp.mdstore-manager.inspector.records.max = 1000