@SuppressWarnings("unchecked") @Override protected boolean nextResult(ResultItem result) { if (key == null) { key = new LongWritable(getCount()); } else { key.set(getCount()); } if (value == null) { value = (VALUEIN)ReflectionUtils.newInstance(valueClass, getConf()); } InternalUtilities.assignResultValue(valueClass, result, value); return true; }
@SuppressWarnings("unchecked") @Override public boolean nextKeyValue() throws IOException, InterruptedException { if (result != null && result.hasNext()) { if (key == null) { key = (KEYIN)ReflectionUtils.newInstance(keyClass, getConf()); } ResultItem item = result.next(); InternalUtilities.assignResultValue(keyClass, item, key); if (result.hasNext()) { if (value == null) { value = (VALUEIN)ReflectionUtils.newInstance(valueClass, getConf()); } item = result.next(); InternalUtilities.assignResultValue(valueClass, item, value); count++; return true; } } endOfResult(); return false; }
@SuppressWarnings("unchecked") @Override protected boolean nextResult(ResultItem result) { if (currentKey != null) { currentKey.setUri(result.getDocumentURI()); } else { currentKey = new DocumentURI(result.getDocumentURI()); } if (currentValue == null) { currentValue = (VALUEIN)ReflectionUtils.newInstance(valueClass, getConf()); } InternalUtilities.assignResultValue(valueClass, result, currentValue); return true; }