You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Mete Atamel (Created) (JIRA)" <ji...@apache.org> on 2012/02/23 16:18:49 UTC

[jira] [Created] (JCR-3243) RepositoryStatistics should be more flexible

RepositoryStatistics should be more flexible
--------------------------------------------

                 Key: JCR-3243
                 URL: https://issues.apache.org/jira/browse/JCR-3243
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-api, jackrabbit-core
            Reporter: Mete Atamel
            Priority: Minor


Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 

I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mete Atamel updated JCR-3243:
-----------------------------

    Status: Patch Available  (was: Open)

Patch attached.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227407#comment-13227407 ] 

Mete Atamel commented on JCR-3243:
----------------------------------

Can I have someone review and apply this patch please?
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243-4.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mete Atamel updated JCR-3243:
-----------------------------

    Attachment: JCR-3243.patch

Here's the proposed fix with the least amount of changes I could come up with. I basically tried to eliminate Type enum and use String instead whenever I could.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221007#comment-13221007 ] 

Mete Atamel commented on JCR-3243:
----------------------------------

Thanks for the feedback. Regarding getType method, yes, definitely, it makes more sense as a static method on Type enum. Regarding the iterator though, I'm not sure how to solve that, that's why I kind of left it the way it is. The problem is that the returned iterator has the following signature: "Entry<Type, TimeSeries>". As you know, with the changes, now we can have String as type and I cannot return those String based types from this iterator. I can change the iterator's signature to "Entry<String, TimeSeries>" and that would enable me to return all the entries but then I'd be changing a public method. So, I'm not sure which one is worse: return some of the values from the iterator or change a public method.  
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mete Atamel updated JCR-3243:
-----------------------------

    Attachment: JCR-3243-3.patch

One last minor tweak to the patch.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Jukka Zitting (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227413#comment-13227413 ] 

Jukka Zitting commented on JCR-3243:
------------------------------------

+1 Looks good to me.

Regarding "RepositoryStatisticsImpl implements Iterable"; since that's only in jackrabbit-core, I'd consider it an implementation detail that we can change without problems if there's a reason to do so. Only the interfaces in jackrabbit-api need to remain strictly backwards-compatible.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243-4.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mete Atamel updated JCR-3243:
-----------------------------

    Attachment: JCR-3243-4.patch

The final patch that includes suggestions from Alex and a JUnit test for the iterator.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243-4.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Marcel Reutegger (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-3243:
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
           Status: Resolved  (was: Patch Available)

Latest patch looks good.

Applied it in revision 1299655.

I also added a TestAll suite to include it the test run.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>             Fix For: 2.5
>
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243-4.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Mete Atamel (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mete Atamel updated JCR-3243:
-----------------------------

    Attachment: JCR-3243-2.patch

A slightly improved version of the patch
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Alex Parvulescu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221031#comment-13221031 ] 

Alex Parvulescu commented on JCR-3243:
--------------------------------------

> So, I'm not sure which one is worse: return some of the values from the iterator or change a public method.
I'd definitely choose correctness :)

In my view if this patch goes into jr, it should not introduce unexpected behavior.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3243) RepositoryStatistics should be more flexible

Posted by "Alex Parvulescu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220994#comment-13220994 ] 

Alex Parvulescu commented on JCR-3243:
--------------------------------------

Good work Mete!

There is still something I believe the patch did not address yet: RepositoryStatisticsImpl implements Iterable.
This contract implies that if I call #iterator() I'll get back all the existing entries.
I would expect that if I define a custom entry, it should still be returned in the #iterator() call, otherwise some consumers of the api will not be able to see all the existing TimeSeries.

Another minor issue is a method in the RepositoryStatisticsImpl: private Type getType(String type)
I think this would be better located in the Type enum, as RepositoryStatisticsImpl doesn't really need to deal with identifying a Type by its name.

I find it interesting that there are no unit tests in the patch. One test case could very well be the #iterator() problem described earlier.
                
> RepositoryStatistics should be more flexible
> --------------------------------------------
>
>                 Key: JCR-3243
>                 URL: https://issues.apache.org/jira/browse/JCR-3243
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-api, jackrabbit-core
>            Reporter: Mete Atamel
>            Priority: Minor
>         Attachments: JCR-3243-2.patch, JCR-3243-3.patch, JCR-3243.patch
>
>
> Right now, Jackrabbit reports TimeSeries for things like BUNDLE_READ_COUNTER, BUNDLE_WRITE_COUNTER, etc. but there is no way to extend Jackrabbit and report TimeSeries for additional properties. That's because the type of TimeSeries are defined in RepositoryStatistics class as Type enum. Enums in Java cannot be extended which limits to TimeSeries to the Types defined in RepositoryStatistics. 
> I suggest that RepositoryStatistics is improved to allow additional TimeSeries. One approach is to define an additional RepositoryStatistics#getType(String) method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira