mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fail if field is not found
This commit is contained in:
@@ -239,6 +239,7 @@ public class PulsarConsumerOp implements PulsarOp {
|
||||
field = keyPart.getField(payloadRttTrackingField);
|
||||
} catch (AvroRuntimeException err) {
|
||||
// field is not in the key
|
||||
logger.error("Cannot find "+payloadRttTrackingField+" in key " + keyPart + ": " + err);
|
||||
}
|
||||
}
|
||||
// look into the Value
|
||||
@@ -248,8 +249,12 @@ public class PulsarConsumerOp implements PulsarOp {
|
||||
field = valuePart.getField(payloadRttTrackingField);
|
||||
} catch (AvroRuntimeException err) {
|
||||
// field is not in the value
|
||||
logger.error("Cannot find "+payloadRttTrackingField+" in value " + valuePart + ": " + err);
|
||||
}
|
||||
}
|
||||
if (field == null) {
|
||||
throw new RuntimeException("Cannot find field " + payloadRttTrackingField + " in " + keyValue.getKey() + " and " + keyValue.getValue());
|
||||
}
|
||||
} else {
|
||||
field = pulsarGenericRecord.getField(payloadRttTrackingField);
|
||||
}
|
||||
@@ -260,6 +265,8 @@ public class PulsarConsumerOp implements PulsarOp {
|
||||
} else {
|
||||
extractedSendTime = Long.valueOf(field.toString());
|
||||
}
|
||||
} else {
|
||||
logger.error("Cannot find " + payloadRttTrackingField + " in value " + pulsarGenericRecord);
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user