You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/09/21 16:12:13 UTC

[GitHub] [accumulo] dlmarion opened a new issue #2280: SimpleTimer replacement is not a Singleton

dlmarion opened a new issue #2280:
URL: https://github.com/apache/accumulo/issues/2280


   ThreadPools.createGeneralScheduledExecutorService replaced SimpleTimer, but a new ThreadPoolExecutor is being created for each call instead of re-using a singleton ThreadPoolExecutor for that property.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] ctubbsii edited a comment on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
ctubbsii edited a comment on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-926658633


   Thanks for the clarification, @keith-turner ; my misunderstanding was based on how/when we use the various SingletonManager modes. In case it helps others looking at this, the best way to understand what singletons are being managed is to see which SingletonService objects are registered with the SingletonManager. (`grep -Rl SingletonManager.register **/*.java`)
   (FWIW, the actual management of registered singleton services within the SingletonManager is pretty simple and elegant. It's the mode switching lifecycle stuff, and knowing that you need to enable a singleton service before you can access certain classes' static methods/fields is the tricky/complicated part for me)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] milleruntime commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
milleruntime commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-924830839


   Your mention of singleton usage reminded me of a class @keith-turner created to manage static singletons, the `SingletonManager`. I don't know if it applies or not but I thought it was worth mentioning. https://github.com/apache/accumulo/blob/323bbea9a48930a6aa39546dc7f15943a1574e60/core/src/main/java/org/apache/accumulo/core/singletons/SingletonManager.java


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] milleruntime commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
milleruntime commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929606842


   @keith-turner or @ctubbsii do you know if there a ticket for this work?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] ctubbsii commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-925997443


   > Your mention of singleton usage reminded me of a class @keith-turner created to manage static singletons, the `SingletonManager`. I don't know if it applies or not but I thought it was worth mentioning. https://github.com/apache/accumulo/blob/323bbea9a48930a6aa39546dc7f15943a1574e60/core/src/main/java/org/apache/accumulo/core/singletons/SingletonManager.java
   
   The SingletonManager stuff is quite complicated. It's not intended to manage all singletons, but rather to manage closable singleton lifecycles, and I would argue against reusing it for more singletons. It's primary use case is for implementing a singleton lifecycle for the closeable AccumuloClient, when legacy Instance/Connector APIs are used, so we can clean up the internal AccumuloClient when there are no more legacy Instance/Connector objects in use. I anticipate the SingletonManager class and related complex code will be removed when we remove those deprecated APIs from our code base.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] ctubbsii commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929614358


   > @keith-turner or @ctubbsii do you know if there a ticket for this work?
   
   There is a general informal initiative spearheaded by some of us, reflected in our contributions, to try to remove our static resources in favor of managing resources with lifecycles. This was the basis of many decisions in 2.0, such as the creation of AccumuloClient, and before that, the creation of ClientContext and ServerContext. But, I do not think there is any specific tickets to complete the transition, for either the singletons managed by SingletonManager or for any other static resources elsewhere. It's mostly just a "adopt this principle and fix as we go" sort of thing, as far as I can tell.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] ctubbsii commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-926658633


   Thanks for the clarification, @keith-turner ; my misunderstanding was based on how/when we use the various SingletonManager modes. In case it helps others looking at this, the best way to understand what singletons are being managed is to see which SingletonService objects are registered with the SingletonManager. (`grep -Rl SingletonManager.register **/*.java`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] dlmarion closed issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
dlmarion closed issue #2280:
URL: https://github.com/apache/accumulo/issues/2280


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] keith-turner commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
keith-turner commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929635168


   > @keith-turner or @ctubbsii do you know if there a ticket for this work?
   
   Would probably make sense to open an issue for each thing that [registers with the singleton manager](https://github.com/apache/accumulo/blob/d4cb0ebacddcad11a520e87829714f3f67dc71d5/core/src/main/java/org/apache/accumulo/core/singletons/SingletonManager.java#L115) to explore moving it to client or server context.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] keith-turner commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
keith-turner commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-926331217


   > It's primary use case is for implementing a singleton lifecycle for the closeable AccumuloClient, when legacy Instance/Connector APIs are used, so we can clean up the internal AccumuloClient when there are no more legacy Instance/Connector objects in use. I anticipate the SingletonManager class and related complex code will be removed when we remove those deprecated APIs from our code base.
   
   That is not quite right. The Instance/Connector code could be removed and we would still need the singleton manager.  Its needed to manage singletons in the implementation that were never moved into the client context.  Once these singletons are moved into the client context we can remove the SingletonManager.  Instance/Connector does not prevent this from movement from happening, its just that no one has ever done the work.  If this work were done, I think it would be easy to refactor the Instance/Connector code to use a singleton client context object.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] keith-turner commented on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
keith-turner commented on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929635168


   > @keith-turner or @ctubbsii do you know if there a ticket for this work?
   
   Would probably make sense to open an issue for each thing that [registers with the singleton manager](https://github.com/apache/accumulo/blob/d4cb0ebacddcad11a520e87829714f3f67dc71d5/core/src/main/java/org/apache/accumulo/core/singletons/SingletonManager.java#L115) to explore moving it to client or server context.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] ctubbsii edited a comment on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
ctubbsii edited a comment on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929614358


   > @keith-turner or @ctubbsii do you know if there a ticket for this work?
   
   There is a general informal initiative spearheaded by some of us, reflected in our contributions, to try to remove our static resources in favor of managing resources with non-static objects with lifecycles. This was the basis of many decisions in 2.0, such as the creation of AccumuloClient, and before that, the creation of ClientContext and ServerContext. But, I do not think there is any specific tickets to complete the transition, for either the singletons managed by SingletonManager or for any other static resources elsewhere. It's mostly just a "adopt this principle and fix as we go" sort of thing, as far as I can tell.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo] milleruntime edited a comment on issue #2280: SimpleTimer replacement is not a Singleton

Posted by GitBox <gi...@apache.org>.
milleruntime edited a comment on issue #2280:
URL: https://github.com/apache/accumulo/issues/2280#issuecomment-929606842


   @keith-turner or @ctubbsii do you know if there a ticket for this work?
   
   Edit: I am refering to this work Keith mentioned:
   
   > The Instance/Connector code could be removed and we would still need the singleton manager. Its needed to manage singletons in the implementation that were never moved into the client context. Once these singletons are moved into the client context we can remove the SingletonManager. Instance/Connector does not prevent this from movement from happening, its just that no one has ever done the work. If this work were done, I think it would be easy to refactor the Instance/Connector code to use a singleton client context object.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org