-
Notifications
You must be signed in to change notification settings - Fork 0
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
Read project and collection from fabric metadata section #13
base: master
Are you sure you want to change the base?
Conversation
Thanks for the commit. It looks like some tests are failing because of this error:
Also I added a review comment to the PR. Once the tests are fixed and the issue in the PR comment is solved, I will merge the PR. |
Thanks @buremba, Fixed all testcases. Please check. |
} | ||
catch (Throwable e) { | ||
log.error(e, "Error while parsing record"); | ||
continue; | ||
} | ||
|
||
if (!whiteListCollections.apply(collection)) { | ||
if (!whiteListCollections.apply(project + collection)) { |
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.
project + collection
is expensive since we're calling this for each record and String instances are immutable. We can add project field to RecordData
and also whiteListCollections
can be Predicate<RecordData>
, that was is more reliable and efficient IMO.
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.
What to do with recorddata.date? that will never match.
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.
We use recorddata.date
in order to determine whether the record is historical or realtime. Please see dayOfRecord
variable in this file.
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.
I meant If whiteListCollections
is Predicate<RecordData>
then whiteListCollections.apply(curRecordData) would give false because of curRecordData.date.
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.
whiteListCollections
should not actually do anything with curRecordData.date
, it can return true
or false
based on curRecordDate.collection
and curRecordDate.project
. Inside the predicate, it can check whether they are whilelisted or not.
@RameshByndoor looks cool, thanks! Could you please take a look my comment review? |
92d06ee
to
3935bbf
Compare
with this we will be having full support for fabric document structure.
project and collection will be read from "metadata" section of fabric.
& WHITELIST will be project+collection to avoid collection name clashes.