@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (max == null || (result != null && ci.compare(max, result) < 0)) { max = result; } } }
@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (min == null || (result != null && ci.compare(min, result) > 0)) { min = result; } } }
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max;
@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (min == null || (result != null && ci.compare(min, result) > 0)) { min = result; } } }
@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (max == null || (result != null && ci.compare(max, result) < 0)) { max = result; } } }
@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (min == null || (result != null && ci.compare(min, result) > 0)) { min = result; } } }
@Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { if (resp.getFirstPartCount() > 0) { R result = getCellValueFromProto(ci, resp, 0); if (max == null || (result != null && ci.compare(max, result) < 0)) { max = result; } } }
@Override public <T, S> T getMax(ColumnInterpreter<T, S> ci, Scan scan) throws IOException { T temp; T max = null; InternalScanner scanner = ((RegionCoprocessorEnvironment) getEnvironment()) .getRegion().getScanner(scan); List<KeyValue> results = new ArrayList<KeyValue>(); byte[] colFamily = scan.getFamilies()[0]; byte[] qualifier = scan.getFamilyMap().get(colFamily).pollFirst(); // qualifier can be null. try { boolean hasMoreRows = false; do { hasMoreRows = scanner.next(results); for (KeyValue kv : results) { temp = ci.getValue(colFamily, qualifier, kv); max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max; } results.clear(); } while (hasMoreRows); } finally { scanner.close(); } log.info("Maximum from this region is " + ((RegionCoprocessorEnvironment) getEnvironment()).getRegion() .getRegionNameAsString() + ": " + max); return max; }
@Override public <T, S> T getMin(ColumnInterpreter<T, S> ci, Scan scan) throws IOException { T min = null; T temp; InternalScanner scanner = ((RegionCoprocessorEnvironment) getEnvironment()) .getRegion().getScanner(scan); List<KeyValue> results = new ArrayList<KeyValue>(); byte[] colFamily = scan.getFamilies()[0]; byte[] qualifier = scan.getFamilyMap().get(colFamily).pollFirst(); try { boolean hasMoreRows = false; do { hasMoreRows = scanner.next(results); for (KeyValue kv : results) { temp = ci.getValue(colFamily, qualifier, kv); min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min; } results.clear(); } while (hasMoreRows); } finally { scanner.close(); } log.info("Minimum from this region is " + ((RegionCoprocessorEnvironment) getEnvironment()).getRegion() .getRegionNameAsString() + ": " + min); return min; }
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); max = (max == null || (temp != null && ci.compare(temp, max) > 0)) ? temp : max;
for (int i = 0; i < listSize; i++) { temp = ci.getValue(colFamily, qualifier, results.get(i)); min = (min == null || (temp != null && ci.compare(temp, min) < 0)) ? temp : min;