MCPcopy Create free account
hub / github.com/apache/nutch / runQuery

Method runQuery

src/java/org/apache/nutch/api/resources/DbResource.java:43–57  ·  view source on GitHub ↗
(DbFilter filter)

Source from the content-addressed store, hash-verified

41 SecurityContext securityContext;
42
43 @POST
44 @Consumes(MediaType.APPLICATION_JSON)
45 public DbQueryResult runQuery(DbFilter filter) {
46 SecurityUtils.allowOnlyAdmin(securityContext);
47 if (filter == null) {
48 throwBadRequestException("Filter cannot be null!");
49 }
50
51 DbQueryResult result = new DbQueryResult();
52 Iterator<Map<String, Object>> iterator = getReader().runQuery(filter);
53 while (iterator.hasNext()) {
54 result.addValue(iterator.next());
55 }
56 return result;
57 }
58
59 private DbReader getReader() {
60 String confId = ConfigResource.DEFAULT;

Callers

nothing calls this directly

Calls 6

allowOnlyAdminMethod · 0.95
getReaderMethod · 0.95
addValueMethod · 0.95
hasNextMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected