}
@Override
public boolean source(FlowProcess<JobConf> flowProcess,
SourceCall<Object[], RecordReader> sourceCall) throws IOException {
Tuple result = new Tuple();
Object key = sourceCall.getContext()[0];
Object value = sourceCall.getContext()[1];
boolean hasNext = sourceCall.getInput().next(key, value);
if (!hasNext) { return false; }
ImmutableBytesWritable keyWritable = (ImmutableBytesWritable) key;
Result row = (Result) value;
result.add(keyWritable.get());
for (int i = 0; i < this.familyNames.length; i++) {
String familyName = this.familyNames[i];
byte[] familyNameBytes = Bytes.toBytes(familyName);
Fields fields = this.valueFields[i];
for (int k = 0; k < fields.size(); k++) {
String fieldName = (String) fields.get(k);
byte[] fieldNameBytes = Bytes.toBytes(fieldName);
byte[] cellValue = row.getValue(familyNameBytes, fieldNameBytes);
result.add(cellValue);
}
}
sourceCall.getIncomingEntry().setTuple(result);