[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user asfgit closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user justinleet commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r126156447 --- Diff: metron-platform/metron-storm-kafka/src/main/java/org/apache/metron/storm/kafka/flux/SimpleStormKafkaBuilder.java --- @@ -176,16 +182,48 @@ public SimpleStormKafkaBuilder( MapkafkaProps , List fieldsConfiguration ) { +this(kafkaProps, toSubscription(topic), zkQuorum, fieldsConfiguration); + } + + /** + * Create an object with the specified properties and exposing the specified fields. + * @param kafkaProps The special kafka properties + * @param subscription The subscription to the kafka topic(s) + * @param zkQuorum The zookeeper quorum. We will use this to pull the brokers from this. + * @param fieldsConfiguration The fields to expose in the storm tuple emitted. + */ + public SimpleStormKafkaBuilder( Map kafkaProps +, Subscription subscription +, String zkQuorum +, List fieldsConfiguration +) + { super( getBootstrapServers(zkQuorum, kafkaProps) , createDeserializer(Optional.ofNullable((String)kafkaProps.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG)), DEFAULT_DESERIALIZER) , createDeserializer(Optional.ofNullable((String)kafkaProps.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG)), DEFAULT_DESERIALIZER) - , topic + , subscription ); setProp(kafkaProps); setRecordTranslator(new SpoutRecordTranslator<>(FieldsConfiguration.toList(fieldsConfiguration))); -this.topic = topic; } + + private static Subscription toSubscription(String topicOrSubscription) { +if (StringUtils.isEmpty(topicOrSubscription)) { + throw new IllegalStateException("Topic name is invalid: empty or null"); --- End diff -- Could you make this IllegalArgumentException? It also might be nice to include the value itself, because empty vs null seem like they could come up in different ways. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working,
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [x] Have you included steps or a guide to how the change may be verified and tested manually? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [x] Have you written or updated unit tests and or integration tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] 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: - [x] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella closed the pull request at: https://github.com/apache/metron/pull/621 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] 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? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [ ] 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](http://www.apache.org/legal/resolved.html#category-a)? - [ ] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123594763 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -52,6 +50,8 @@ public class ParserBolt extends ConfiguredParserBolt implements Serializable { + private static final int KEY_INDEX = 1; + private static final String METADATA_PREFIX = "metron.metadata."; --- End diff -- yeah, another good suggestion. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123524476 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -52,6 +50,8 @@ public class ParserBolt extends ConfiguredParserBolt implements Serializable { + private static final int KEY_INDEX = 1; + private static final String METADATA_PREFIX = "metron.metadata."; --- End diff -- This should somewhere in common. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella reopened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] 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? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [ ] 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](http://www.apache.org/legal/resolved.html#category-a)? - [ ] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data commit 26b0422d16c1e330bc2a5e39d7ae80b0837ac3a3
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123514965 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/topology/ParserTopologyBuilder.java --- @@ -132,7 +132,14 @@ public static TopologyBuilder build(String zookeeperUrl, if(securityProtocol.isPresent()) { kafkaSpoutConfigOptions.putIfAbsent("security.protocol", securityProtocol.get()); } -return SimpleStormKafkaBuilder.create(inputTopic, zkQuorum, Arrays.asList("value"), kafkaSpoutConfigOptions); +return SimpleStormKafkaBuilder.create( inputTopic --- End diff -- fine by me. :) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123514768 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/topology/ParserTopologyBuilder.java --- @@ -132,7 +132,14 @@ public static TopologyBuilder build(String zookeeperUrl, if(securityProtocol.isPresent()) { kafkaSpoutConfigOptions.putIfAbsent("security.protocol", securityProtocol.get()); } -return SimpleStormKafkaBuilder.create(inputTopic, zkQuorum, Arrays.asList("value"), kafkaSpoutConfigOptions); +return SimpleStormKafkaBuilder.create( inputTopic --- End diff -- metron.metadata --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123513501 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -129,18 +148,29 @@ public void execute(Tuple tuple) { boolean ackTuple = !writer.handleAck(); int numWritten = 0; if(sensorParserConfig != null) { +Mapmetadata = getMetadata(tuple, sensorParserConfig.readMetadata()); List fieldValidations = getConfigurations().getFieldValidations(); Optional messages = parser.parseOptional(originalMessage); for (JSONObject message : messages.orElse(Collections.emptyList())) { message.put(Constants.SENSOR_TYPE, getSensorType()); --- End diff -- Will the metadata in parsing be able to be used in enrichment? Can it stay metadata and just keep going along or does it have to be merged with the message? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123512990 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/topology/ParserTopologyBuilder.java --- @@ -132,7 +132,14 @@ public static TopologyBuilder build(String zookeeperUrl, if(securityProtocol.isPresent()) { kafkaSpoutConfigOptions.putIfAbsent("security.protocol", securityProtocol.get()); } -return SimpleStormKafkaBuilder.create(inputTopic, zkQuorum, Arrays.asList("value"), kafkaSpoutConfigOptions); +return SimpleStormKafkaBuilder.create( inputTopic --- End diff -- I think that prefixing the names of the metadata with `metadata.` would correct that, I think. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user cestella commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123512057 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -118,6 +116,27 @@ protected void initializeStellar() { StellarFunctions.initialize(stellarContext); } + private MapgetMetadata(Tuple t, boolean readMetadata) { +Map ret = new HashMap<>(); +if(!readMetadata) { + return ret; +} + ret.put(SimpleStormKafkaBuilder.FieldsConfiguration.TOPIC.getFieldName(), t.getString(2)); --- End diff -- The contract is that the value is the first element in the tuple, the key the 2nd element in the tuple and any metadata from the environment passed in after that. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123412506 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -118,6 +116,27 @@ protected void initializeStellar() { StellarFunctions.initialize(stellarContext); } + private MapgetMetadata(Tuple t, boolean readMetadata) { +Map ret = new HashMap<>(); +if(!readMetadata) { + return ret; +} --- End diff -- Why is this tied to Kafka? The ParserBolt is not, or was not before. The 'kafka-ness' of this should be abstracted away. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
Github user ottobackwards commented on a diff in the pull request: https://github.com/apache/metron/pull/621#discussion_r123411616 --- Diff: metron-platform/metron-parsers/src/main/java/org/apache/metron/parsers/bolt/ParserBolt.java --- @@ -118,6 +116,27 @@ protected void initializeStellar() { StellarFunctions.initialize(stellarContext); } + private MapgetMetadata(Tuple t, boolean readMetadata) { +Map ret = new HashMap<>(); +if(!readMetadata) { + return ret; +} + ret.put(SimpleStormKafkaBuilder.FieldsConfiguration.TOPIC.getFieldName(), t.getString(2)); --- End diff -- What are these magic numbers 2 and 1 ? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] metron pull request #621: METRON-1001: Allow metron to ingest parser metadat...
GitHub user cestella opened a pull request: https://github.com/apache/metron/pull/621 METRON-1001: Allow metron to ingest parser metadata along with data ## Contributor Comments Currently, we only ingest data in Metron. Often, there is valuable metadata constructed up-stream of Metron that is relevant to enrichment and cross-cuts many data formats. Take, for instance, a multi-tenancy case where multiple sources come in and you'd like to tag the data with the customer ID. In this case you're stuck finding ways to add the metadata to each data source's format. Rather than do that, we should allow metadata to be ingested along with the data associated with it. There are two sources of metadata relevant to support: * User defined metadata (e.g. customer IDs) * Environmental metadata (e.g. the kafka topic) In this PR, metadata can be expressed and passed into metron in two manners: * As a JSON Map in the key of the message (optional) * The kafka topic written. Metadata is exposed in two ways: * As stellar variables for Stellar field transformations * Optionally, automatically merged with the message Two properties were added to the parser config: * `mergeMetadata` - default false. If true, then metadata is merged with the message. * `readMetadata` - default false. If true, then user and environmental metadata are attempted to be read. Note: This is backwards compatible, so by default, unless specified, your parser topologies will function as before. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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: - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [x] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [x] 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? - [x] Have you ensured that the full suite of tests and checks have been executed in the root incubating-metron folder via: ``` mvn -q clean integration-test install && build_utils/verify_licenses.sh ``` - [ ] 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](http://www.apache.org/legal/resolved.html#category-a)? - [ ] 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`: ``` cd site-book mvn site ``` 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron METRON-1001 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/621.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #621 commit a4e85398e28f926682396d4828b7a6fdfbeefb33 Author: cstellaDate: 2017-06-21T19:59:52Z METRON-1001: Allow metron to ingest parser metadata along with data --- If your project is set up for it, you