public class AsyncLocalizer extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected long |
cacheTargetSize |
protected ConcurrentHashMap<String,ConcurrentHashMap<String,LocalizedResource>> |
userArchives |
protected ConcurrentHashMap<String,ConcurrentHashMap<String,LocalizedResource>> |
userFiles |
Constructor and Description |
---|
AsyncLocalizer(Map<String,Object> conf,
StormMetricsRegistry metricsRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected ClientBlobStore |
getClientBlobStore() |
void |
recoverRunningTopology(LocalAssignment currentAssignment,
int port,
BlobChangingCallback cb)
Do everything needed to recover the state in the AsyncLocalizer for a running topology.
|
void |
releaseSlotFor(LocalAssignment assignment,
int port)
Remove this assignment/port as blocking resources from being cleaned up.
|
CompletableFuture<Void> |
requestDownloadTopologyBlobs(LocalAssignment assignment,
int port,
BlobChangingCallback cb)
Request that all of the blobs necessary for this topology be downloaded.
|
void |
start()
Start any background threads needed.
|
protected final ConcurrentHashMap<String,ConcurrentHashMap<String,LocalizedResource>> userFiles
protected final ConcurrentHashMap<String,ConcurrentHashMap<String,LocalizedResource>> userArchives
protected long cacheTargetSize
public AsyncLocalizer(Map<String,Object> conf, StormMetricsRegistry metricsRegistry) throws IOException
IOException
public CompletableFuture<Void> requestDownloadTopologyBlobs(LocalAssignment assignment, int port, BlobChangingCallback cb) throws IOException
assignment
- the assignment that needs the blobsport
- the port the assignment is a part ofcb
- a callback for when the blobs change. This is only for blobs that are tied to the lifetime of the worker.IOException
- if there was an error while trying doing it.public void start()
public void close() throws InterruptedException
close
in interface AutoCloseable
InterruptedException
public void recoverRunningTopology(LocalAssignment currentAssignment, int port, BlobChangingCallback cb) throws IOException
currentAssignment
- the assignment for the topology.port
- the port the assignment is on.cb
- a callback for when the blobs are updated. This will only be for blobs that indicate that if they change
the worker should be restarted.IOException
- on any error trying to recover the state.public void releaseSlotFor(LocalAssignment assignment, int port) throws IOException
assignment
- the assignment the resources are forport
- the port the topology is running onIOException
- on any errorprotected ClientBlobStore getClientBlobStore()
Copyright © 2023 The Apache Software Foundation. All rights reserved.