-
Notifications
You must be signed in to change notification settings - Fork 2
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
ElasticSearch feature | patchroute refactoring -> elastic export -> data migration -> refactoring participant list #342
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ype to boolean type
…ynamic fields while fetching data from ES
…lds, finish serialize() method in ElasticSearch.java
…ove commented out code
…institute/ddp-study-manager into DDP-7121_refactor_participant_list
…TO classes, refactor code based on changes
…eldsMappingMigrator
…nused imports, refine classes, make code cleaner
…additional values
…he "realm" out of the for loop
…:broadinstitute/ddp-study-manager into DDP-7443_elastic_export_for_kit_requests
…ng KitRequestShipping
…odifying code for JSON_CONTAINS case
…ng test results
…ropert nested path
…or_kit_requests DDP_7443 | elastic export for kit requests
…thub.com/broadinstitute/ddp-study-manager into DDP-7121_participant_filter
gmakharat
approved these changes
Feb 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Things have done:
BasePatch
abstract class as a parent of different classes, which are serving common feature.BasePatch
to extract common code to avoid code duplication.BasePatch
to specify what children should do to patch data.BasePatch
.Exportable
interface for having an abstraction for exporting data and mappings to ElasticSearch.BaseExporter
(abstract class) andElasticExportAdapter
using "Adapter Design Pattern" to loose coupling from ElasticSearch API, which wraps all the necessary API-s from ElasticSearch library.ElasticExportAdapter
, these classes are:UpsertDataRequestPayload
andUpsertMappingRequestPayload
which are used byElasticExportAdapter
in order to make request to ElasticSearch.Generator
andCollector
abstractions in order to generate and collect data/mapping before making upsert request to ElasticSearch.Generator
andCollector
are:BaseGenerator
(abstract class),MappingGenerator
andSourceGenerator
which are responsible for generating and collecting either mapping or data.GeneratorPayload
forGenerator
classes which are used generating mapping/data.Processor
abstraction to process data before "upserting" to ElasticSearch to avoid replacing existing ElasticSearch data.Processor
is:CollectionProcessor
whose purpose is to work on data represented as "1 to many relationships".Parser
abstraction in order to parse text values to concrete types, it works for mapping and data as well.Parser
are:TypeParser
andValueParser
which are responsible for parsing types for mapping and parsing values for data.ExportFacade
class which uses "Facade Design Pattern" which is a front-facing protocol masking more underlying complexity and details of exporting to ElasticSearch.ExportFacadePayload
which is needed for transferring all the necessary data toExportFacade
Util
class for ElasticSearch which is responsible for providing only utility methods which do not have side effects (any connection to database, network or 3rd party vendor).BaseExporter
more generic by leaving only one method -export()
. Created 2 subclasses:ElasticDataExportAdapter
for exporting data andElasticMappingExportAdapter
for exporting mappings to ES. The subclasses use Adapter pattern in order to adapt to any occurring changes in ES API.Merger
with methodmerge
that helps us to merge different mappings into one final mapping,Merger
can be used for other cases as well.underscoresToCamelCase()
in Util.java which handles this issue.BaseMigrator
which works for both cases (one to one, one to many).BaseMigrator
uses following interfaces:Generator
andExportable
.BulkExportFacade
which provides a simple API and hides the complexity associated with exporting data to ES.BaseCollectionMigrator
which is a special case for classes which work on the data represented asone-to-many
relationships.Migrator
abstraction:KitRequestShippingMigrator
,MedicalRecordMigrator
,OncHistoryDetailsMigrator
,ParticipantDataMigrator
andParticipantMigrator
.Pub/Sub
functionality as a control unit to make it easier to trigger exporting existing data to ES.Pub/Sub
:taskType
=ELASTIC_EXPORT
,body
:{"study": "<study_name>", "isMigration": true}
ElasticSearch
based on existing filtering strategy.ElasticSearch
queries depending on operators.P.S code was written using pair programming with @gmakharat .