-
Notifications
You must be signed in to change notification settings - Fork 589
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
Feature/process batch v2 #10
Changes from all commits
d6fc322
31ef48d
b192596
90fe730
baad20d
0012e15
aa412f3
edfedcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"namespace": "coproc", | ||
"service_name": "supervisor", | ||
"includes": [ | ||
"coproc/types.h" | ||
], | ||
"js_include": "../../domain/generatedRpc/generatedClasses", | ||
"methods": [ | ||
{ | ||
"name": "process_batch", | ||
"input_type": "process_batch_request", | ||
"output_type": "process_batch_reply" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,19 +33,6 @@ | |
} | ||
] | ||
}, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't think it makes sense to check in generated code, it makes the PR bigger for no reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Umm I don't understand your comment, but I need to redefine this entity, for that reason I remove it but I create again after in the bottom file |
||
"className": "ProcessBatchRequest", | ||
"fields": [ | ||
{ | ||
"name": "npt", | ||
"type": "Ntp" | ||
}, | ||
{ | ||
"name": "recordBatch", | ||
"type": "RecordBatch" | ||
} | ||
] | ||
}, | ||
{ | ||
"className": "Ntp", | ||
"fields": [ | ||
|
@@ -72,7 +59,8 @@ | |
}, | ||
{ | ||
"name": "records", | ||
"type": "Array<Record>" | ||
"type": "Array<Record>", | ||
"size": "header.recordCount" | ||
} | ||
] | ||
}, | ||
|
@@ -130,6 +118,14 @@ | |
{ | ||
"name": "recordCount", | ||
"type": "int32" | ||
}, | ||
{ | ||
"name": "term", | ||
"type": "int64" | ||
}, | ||
{ | ||
"name": "isCompressed", | ||
"type": "int8" | ||
} | ||
] | ||
}, | ||
|
@@ -138,31 +134,31 @@ | |
"fields": [ | ||
{ | ||
"name": "length", | ||
"type": "varint" | ||
"type": "uint32" | ||
}, | ||
{ | ||
"name": "attributes", | ||
"type": "int8" | ||
}, | ||
{ | ||
"name": "timestampDelta", | ||
"type": "varint" | ||
"type": "int64" | ||
}, | ||
{ | ||
"name": "offsetDelta", | ||
"type": "varint" | ||
"type": "int32" | ||
}, | ||
{ | ||
"name": "keyLength", | ||
"type": "varint" | ||
"type": "int32" | ||
}, | ||
{ | ||
"name": "key", | ||
"type": "buffer" | ||
}, | ||
{ | ||
"name": "valueLen", | ||
"type": "varint" | ||
"type": "int32" | ||
}, | ||
{ | ||
"name": "value", | ||
|
@@ -194,6 +190,58 @@ | |
"type": "buffer" | ||
} | ||
] | ||
}, | ||
{ | ||
"className": "ProcessBatchRequestItem", | ||
"fields": [ | ||
{ | ||
"name": "coprocessorIds", | ||
"type": "Array<uint64>" | ||
}, | ||
{ | ||
"name": "ntp", | ||
"type": "Ntp" | ||
}, | ||
{ | ||
"name": "recordBatch", | ||
"type": "Array<RecordBatch>" | ||
} | ||
] | ||
}, | ||
{ | ||
"className": "ProcessBatchRequest", | ||
"fields": [ | ||
{ | ||
"name": "requests", | ||
"type": "Array<ProcessBatchRequestItem>" | ||
} | ||
] | ||
}, | ||
{ | ||
"className": "ProcessBatchReplyItem", | ||
"fields": [ | ||
{ | ||
"name": "coprocessorId", | ||
"type": "uint64" | ||
}, | ||
{ | ||
"name": "ntp", | ||
"type": "Ntp" | ||
}, | ||
{ | ||
"name": "resultRecordBatch", | ||
"type": "Array<RecordBatch>" | ||
} | ||
] | ||
}, | ||
{ | ||
"className": "ProcessBatchReply", | ||
"fields": [ | ||
{ | ||
"name": "result", | ||
"type": "Array<ProcessBatchReplyItem>" | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ export class SimpleTransform implements Coprocessor { | |
inputTopics: string[]; | ||
policyError: PolicyError; | ||
|
||
apply(record: RecordBatch): RecordBatch { | ||
apply = (record: RecordBatch): Map<string, RecordBatch> => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should have an explicit named type for topic, so the code is self documenting: Map<topic, RecordBatch> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good |
||
throw Error("processRecord isn't implemented yet"); | ||
} | ||
}; | ||
} |
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.
didn't we agree on deleting src/idl or maybe using symlinks?
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.
Yes, you're right, we agree to do that, but no in this series.