You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/05/07 15:04:58 UTC

[GitHub] [accumulo] milleruntime commented on a change in pull request #1148: Quick query

milleruntime commented on a change in pull request #1148: Quick query
URL: https://github.com/apache/accumulo/pull/1148#discussion_r281677564
 
 

 ##########
 File path: server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
 ##########
 @@ -221,6 +229,30 @@ long calculateCount() {
     }
   }
 
+  public Query fetchQuery(String tableName, Range range) {
+    if (tableName == null)
+      tableName = "test_ingest";
+    ServerContext context = getContext();
+    Query result = new Query();
+    long count = 0L;
+    log.info("MIKE query value = " + range);
+
+    try {
+      BatchScanner scanner = context.createBatchScanner(tableName, Authorizations.EMPTY);
+      ArrayList<Range> ranges = new ArrayList<>();
+      ranges.add(range);
+      scanner.setRanges(ranges);
+      for (Entry<Key, Value> entry : scanner) {
 
 Review comment:
   Yeah good point. We could force the user to put in a valid range or something else to prevent full table scan. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services