public class RemoteFunctionRegistry extends Object implements AutoCloseable
UserBitShared.Registry under udf path
which contains information about all dynamically registered jars and their function signatures.
If connection is created for the first time, puts empty remote registry.
UNREGISTRATION - transient store, stores information under udf/unregister path.
udf/unregister path is persistent by itself but any child created will be transient.
Whenever user submits request to unregister jar, child path with jar name is created under this store.
This store also holds unregistration listener, which notifies all drill bits when child path is created,
so they can start local unregistration process.
JARS - transient store, stores information under udf/jars path.
udf/jars path is persistent by itself but any child created will be transient.
Servers as lock, not allowing to perform any action on the same time.
There two types of actions: RemoteFunctionRegistry.Action.REGISTRATION and RemoteFunctionRegistry.Action.UNREGISTRATION.
Before starting any action, users tries to create child path with jar name under this store
and if such path already exists, receives action being performed on that very jar.
When user finishes its action, he deletes child path with jar name.
There are three udf areas:
STAGING - area where user copies binary and source jars before starting registration process.
REGISTRY - area where registered jars are stored.
TMP - area where source and binary jars are backed up in unique folder during registration process.| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteFunctionRegistry.Action |
| Constructor and Description |
|---|
RemoteFunctionRegistry(TransientStoreListener unregistrationListener) |
| Modifier and Type | Method and Description |
|---|---|
String |
addToJars(String jar,
RemoteFunctionRegistry.Action action) |
void |
close() |
void |
finishUnregistration(String jar) |
org.apache.hadoop.fs.FileSystem |
getFs() |
UserBitShared.Registry |
getRegistry(DataChangeVersion version) |
org.apache.hadoop.fs.Path |
getRegistryArea() |
long |
getRegistryVersion()
Returns current remote function registry version.
|
int |
getRetryAttempts() |
org.apache.hadoop.fs.Path |
getStagingArea() |
org.apache.hadoop.fs.Path |
getTmpArea() |
boolean |
hasRegistry()
Report whether a remote registry exists.
|
void |
init(DrillConfig config,
PersistentStoreProvider storeProvider,
ClusterCoordinator coordinator) |
void |
removeFromJars(String jar) |
void |
submitForUnregistration(String jar) |
void |
updateRegistry(UserBitShared.Registry registryContent,
DataChangeVersion version) |
public RemoteFunctionRegistry(TransientStoreListener unregistrationListener)
public void init(DrillConfig config, PersistentStoreProvider storeProvider, ClusterCoordinator coordinator)
public long getRegistryVersion()
public boolean hasRegistry()
public UserBitShared.Registry getRegistry(DataChangeVersion version)
public void updateRegistry(UserBitShared.Registry registryContent, DataChangeVersion version) throws VersionMismatchException
VersionMismatchExceptionpublic void submitForUnregistration(String jar)
public void finishUnregistration(String jar)
public String addToJars(String jar, RemoteFunctionRegistry.Action action)
public void removeFromJars(String jar)
public int getRetryAttempts()
public org.apache.hadoop.fs.FileSystem getFs()
public org.apache.hadoop.fs.Path getRegistryArea()
public org.apache.hadoop.fs.Path getStagingArea()
public org.apache.hadoop.fs.Path getTmpArea()
public void close()
close in interface AutoCloseableCopyright © 2017 The Apache Software Foundation. All rights reserved.