You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streams.apache.org by robdouglas <gi...@git.apache.org> on 2015/02/17 20:56:32 UTC

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

GitHub user robdouglas opened a pull request:

    https://github.com/apache/incubator-streams/pull/187

    STREAMS-288 | Removing default behavior where we scan the class path loo...

    ...king for any valid DateTimeFormats. Instead, this functionality has been moved to a secondary constructor where we can pass in a flag to specify whether or not we want this behavior.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robdouglas/incubator-streams STREAMS-288

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-streams/pull/187.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 #187
    
----
commit 7329bc25cb7562c3f67e846eb87a17b8c8298e17
Author: Robert Douglas <rd...@w2ogroup.com>
Date:   2015-02-17T19:54:26Z

    STREAMS-288 | Removing default behavior where we scan the class path looking for any valid DateTimeFormats. Instead, this functionality has been moved to a secondary constructor where we can pass in a flag to specify whether or not we want this behavior.

commit 4eb9a07cbf518fd97c4b477463c3d5f8f3eb1fe5
Author: Robert Douglas <rd...@w2ogroup.com>
Date:   2015-02-17T19:56:18Z

    STREAMS-288 | Deserializer initialization changes

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74760606
  
    working it - will push and PR as soon as tests pass


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas closed the pull request at:

    https://github.com/apache/incubator-streams/pull/187


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74764229
  
    https://github.com/apache/incubator-streams/pull/188



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74746842
  
    I suggest making the constructor protected.  That way external callers get an instance of the singleton via the getInstance() method and you are not scanning the classpath a ton of times.
    



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74746871
  
    @steveblackmon if the entire code base used getInstance() where appropriate then this wouldn't be as much of an issue. However, there are 34 instances in the code base where we're calling `new StreamsJacksonMapper()` which results in these gratuitous Reflections calls.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by smashew <gi...@git.apache.org>.
Github user smashew commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74741241
  
    :+1: no idea how this was merged. scanning the class path with each datum would be bad, let alone each datum for each iteration in the stream. wowza!
    
    I propose that we figure out a way to time tests to see if there is a significant performance degradation in on the integration tests to avoid this issue in the future.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74744716
  
    So this is just a performance concern? I agree that creating a new Mapper inside of a loop is obviously a bad idea.  That's why :
    
    public class StreamsJacksonMapper extends ObjectMapper {
    
        private static final StreamsJacksonMapper INSTANCE = new StreamsJacksonMapper();
    
        public static StreamsJacksonMapper getInstance(){    return INSTANCE;   }
    
    Get your mapper this way and only once and problem solved.
    
    I don't think the fact that bad implementations can get slow is a reason to make the default behavior worse, to make a call that should only happen once per jvm a bit faster.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74748109
  
    fair point.  i'll happily merge a PR that protects the constructor and refactors project source and tests to use the singleton.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by smashew <gi...@git.apache.org>.
Github user smashew commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74742070
  
    If you scan, you should only scan the classpath ONCE! Collect the classes that you want to use and never, ever, EVER scan the class-path, ever again.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by smashew <gi...@git.apache.org>.
Github user smashew commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74741753
  
    I mean, technically, this allevates the issue. 
    
    A better approach would be 
    
    private final static Class<? extends StreamsDateFormat> dtClazzes;
    
    static {
     // Load dtClazzes
    // Scanner slow stuff here... Put a LOGGER.info("") message to apologize to the user how long this will take and that you are sorry for the inconvenience. 
    }


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...

Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74752074
  
    I think that's a good call @steveblackmon. When do you think you'll be able to get around to that? If you've got some work built up then I can try and knock that out later today


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---