-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event logs for Model #874
Event logs for Model #874
Conversation
} | ||
|
||
@Override | ||
public ConverterHandler supplyReadConverterHandler( | ||
ModelConfig config) | ||
{ | ||
return new JsonReadConverterHandler(JsonModelConfig.class.cast(config), supplyCatalog); | ||
return new JsonReadConverterHandler(JsonModelConfig.class.cast(config), context, supplyCatalog); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are passing context, then we no longer need to pass supplyCatalog as it is available via context, agree?
EngineContext context) | ||
{ | ||
this.jsonModelTypeId = context.supplyTypeId(JsonModel.NAME); | ||
this.validationFailureEventId = context.supplyEventId("model.json.validation.failure"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Events should be named for past tense as they already happened, so ...validation.failed
, not ...validation.failure
.
{ | ||
enum JsonModelEventType (uint8) | ||
{ | ||
VALIDATION_FAILURE (1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Events should be named for past tense as they already happened, so VALIDATION_FAILED
, not VALIDATION_FAILURE
.
@@ -448,7 +448,8 @@ public void writeEntryStart( | |||
logFile.appendBytes(buffer, index, length); | |||
}; | |||
OctetsFW value = key.value(); | |||
int converted = convertKey.convert(value.buffer(), value.offset(), value.sizeof(), writeKey); | |||
int converted = convertKey.convert(context.supplyTraceId(), bindingId, value.buffer(), value.offset(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the traceId be passed in via the method call instead?
@@ -526,7 +527,8 @@ public void writeEntryContinue( | |||
|
|||
if ((flags & FLAGS_FIN) != 0x00 && (entryFlags & CACHE_ENTRY_FLAGS_ABORTED) == 0x00) | |||
{ | |||
int converted = convertValue.convert(logFile.buffer(), valueMark.value, valueLength, consumeConverted); | |||
int converted = convertValue.convert(context.supplyTraceId(), bindingId, logFile.buffer(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the traceId be passed in via the method call instead?
@@ -703,7 +707,8 @@ public int writeProduceEntryStart( | |||
logFile.appendBytes(buffer, index, length); | |||
}; | |||
|
|||
converted = convertKey.convert(value.buffer(), value.offset(), value.sizeof(), writeKey); | |||
converted = convertKey.convert(context.supplyTraceId(), bindingId, value.buffer(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the traceId be passed in via the method call instead?
@@ -773,7 +780,8 @@ public int writeProduceEntryContinue( | |||
final int valueLength = valueLimit.value - valueMark.value; | |||
if ((flags & FLAGS_FIN) != 0x00) | |||
{ | |||
converted = convertValue.convert(logFile.buffer(), valueMark.value, valueLength, consumeConverted); | |||
converted = convertValue.convert(context.supplyTraceId(), bindingId, logFile.buffer(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the traceId be passed in via the method call instead?
@@ -4967,7 +4967,8 @@ private boolean validContent( | |||
OctetsFW payload) | |||
{ | |||
return contentType == null || | |||
contentType.validate(payload.buffer(), payload.offset(), payload.sizeof(), ValueConsumer.NOP); | |||
contentType.validate(supplyTraceId.getAsLong(), routedId, payload.buffer(), payload.offset(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the traceId be passed in via the method call instead?
fixes: #887