-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-2026: Remove Storm dependency from metron-common #1351
Conversation
|
@merrimanr - thanks for taking this on! These refactoring PR's can get pretty deep, and your work here is greatly appreciated. After a quick pass, I have a couple initial Q's/thoughts
I think that might organize things for us just a bit neater. |
|
The Sure I can move |
|
Actually we can't have 2 modules with the same name. Would it be |
# Conflicts: # metron-platform/metron-common/pom.xml
|
@merrimanr - I believe a module can be an aggregator, a parent, and a jar-producing pom. So you could still keep it as: It doesn't fit the layout of our other modules, however. What do you think of keeping metron-common by itself and creating another parent module for the streaming/platform code? e.g. |
|
@mmiklavc latest commit updates the module structure to match your suggestion. Let me know what you think. |
# Conflicts: # metron-platform/metron-enrichment/metron-enrichment-storm/src/main/java/org/apache/metron/enrichment/bolt/GenericEnrichmentBolt.java
| TestingServer testZkServer = new TestingServer(true); | ||
| this.zookeeperUrl = testZkServer.getConnectString(); | ||
| byte[] globalConfig = ConfigurationsUtils.readGlobalConfigFromFile(TestConstants.SAMPLE_CONFIG_PATH); | ||
| byte[] globalConfig = ConfigurationsUtils.readGlobalConfigFromFile("../" + TestConstants.SAMPLE_CONFIG_PATH); |
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 we make all of these relative paths changes a local test constant? We could probably spend more time to make this less brittle, but for now I think it's a reasonable compromise. See https://github.com/apache/metron/blob/master/metron-platform/metron-enrichment/metron-enrichment-storm/src/test/java/org/apache/metron/enrichment/integration/EnrichmentIntegrationTest.java#L94, for example.
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.
Done
| HdfsWriter writer = new HdfsWriter().withFileNameFormat(testFormat); | ||
| writer.init(new HashMap<String, String>(),createTopologyContext(), config); | ||
| writer.init(new HashMap<String, String>(), config); | ||
| writer.initFileNameFormat(createTopologyContext()); |
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.
Just for reference later - this is not part of the metron-common refactoring, but we should remove our Storm dependencies from the writer infrastructure as well.
|
@merrimanr Save for a small nit with the relative paths "../" duplicated in multiple places within individual tests, I think this is pretty solid. Also looks like a small conflict with metron-platform/pom.xml. Thanks for the effort on this! You mentioned doing some light testing. Considering the classpath issues we've recently worked through, do you think it's worth running through this test script before we bring this in? #1368 (comment) |
# Conflicts: # metron-platform/pom.xml
|
I will spin this up in full dev again and run through testing. |
|
I ran through the testing instructions again and everything worked as expected. |
|
@merrimanr - looks good. Just to confirm, did you run through the script from 1368? I'm +1 pending confirmation on that as we need to be extremely careful about regressions. |
|
I ran the tests again and did not notice any regressions. |
|
Cool, just to be clear, +1 stands - go ahead and merge this. |
Contributor Comments
This PR includes the necessary changes to move Storm-dependent code to a separate module. In most cases classes were moved unchanged with the exception of the package changing from
org.apache.metron.common.utils.*toorg.apache.metron.storm.common.utils.*. More complex changes are listed in the next section.Changes Included
org.ow2.asm:asm:5.0.3Maven dependency to metron-common pom file. This dependency was inherited from the Storm dependencies.RawMessageUtilandMetadataUtilclasses to separate Storm dependent code. TheMetadataUtil.extractMetadatamethod's purpose is to extract metadata from a tuple and should be in metron-storm-common while the other methods inMetadataUtilI believe are reusable and should be kept in metron-common. For now I movedRawMessageUtilto metron-storm-common and moved the method toRawMessageUtil.extractMetadata.TopologyContextparameter fromBulkMessageWriter.initand adjusted implementations to match.BulkMessageWriterimplementations did not useTopologyContextexcept forHdfsWriter. This class is tightly coupled to Storm dependencies and will likely need to be rewritten without them for other streaming platforms. In this PR, it's treated as a special case inBulkMessageWriterBoltwith theTopologyContextcall in a separateHdfsWritermethod.org.apache.metron.common.boltpackageMessageGetStrategyinterface and implementationsRawMessageUtilincluding theextractMetadatamethodTesting
I have done some basic testing in full dev. I've spun it up and made some basic assertions:
To test streaming enrichments in the enrichment topology:
enrichmentfield appears in the bro index.Outstanding Issues
MetadataUtilrefactor. Should we renameRawMessageUtilto something more appropriate? Should we reorganize that code differently?HdfsWriterapproach good enough? How else could we do this?metron-platform/metron-storm-commonthe right module for common Storm code?Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html:Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.