public final class BuckGlobalState extends Object implements Closeable
BuckGlobalState contains all the global state of Buck which is kept between invocations
of Buck commands, like caches, global per-process objects, etc. Individual caches here can be
hooked to Watchman for proper invalidation.
This state is uniformly invalidated on major changes, like configuration changes, so it is
essential all in-proc caches to contain in this class for proper invalidation. If caches need to
be kept between configuration changes, a custom logic should reside in BuckGlobalStateLifecycleManager
All Graph Engine caches are required to be kept here.
public TypeCoercerFactory getTypeCoercerFactory()
public VersionedTargetGraphCache getVersionedTargetGraphCache()
public ActionGraphCache getActionGraphCache()
public com.google.common.collect.ImmutableList<ProjectFileHashCache> getFileHashCaches()
public com.google.common.cache.LoadingCache<Path,DirectoryListCache> getDirectoryListCaches()
public com.google.common.cache.LoadingCache<Path,BuildFileManifestCache> getBuildFileManifestCaches()
public com.google.common.cache.LoadingCache<Path,FileTreeCache> getFileTreeCaches()
public KnownRuleTypesProvider getKnownRuleTypesProvider()
public ConcurrentMap<String,WorkerProcessPool> getPersistentWorkerPools()
public RuleKeyCacheRecycler<RuleKey> getDefaultRuleKeyFactoryCacheRecycler()
public DaemonicParserState getDaemonicParserState()
public void interruptOnClientExit(Thread threadToInterrupt)
public void watchFileSystem(BuckEventBus eventBus, WatchmanWatcher watchmanWatcher, WatchmanWatcher.FreshInstanceAction watchmanFreshInstanceAction) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic com.google.common.eventbus.EventBus getFileEventBus()
public com.google.common.collect.ImmutableMap<AbsPath,WatchmanCursor> getWatchmanCursor()
public boolean getUsesWatchman()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic long getUptime()