public class SingletonManager extends Object
This class is intermediate solution to resource management. Ideally there would be no static state and AccumuloClients would own all of their state and clean it up on close. If AccumuloClient is not closable at inception, then it is harder to make it closable later. If AccumuloClient is not closable, then its hard to remove the static state. This class enables making AccumuloClient closable at inception so that static state can be removed later.
Modifier and Type | Class and Description |
---|---|
static class |
SingletonManager.Mode
These enums determine the behavior of the SingletonManager.
|
Constructor and Description |
---|
SingletonManager() |
Modifier and Type | Method and Description |
---|---|
static SingletonReservation |
getClientReservation()
This method should be called when creating Accumulo clients using the public API.
|
static SingletonManager.Mode |
getMode() |
static long |
getReservationCount() |
static void |
register(SingletonService service)
Register a static singleton that should be disabled and enabled as needed.
|
static void |
setMode(SingletonManager.Mode mode)
Change how singletons are managed.
|
public static void register(SingletonService service)
public static SingletonReservation getClientReservation()
SingletonReservation.noop()
instead. While a client holds a reservation, singleton
services are enabled.public static long getReservationCount()
public static void setMode(SingletonManager.Mode mode)
SingletonManager.Mode.CLIENT
public static SingletonManager.Mode getMode()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.