Class ExecutableManager
- java.lang.Object
-
- org.apache.iotdb.commons.executable.ExecutableManager
-
- Direct Known Subclasses:
TriggerExecutableManager,UDFExecutableManager
public class ExecutableManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringINSTALL_DIRprotected java.lang.StringlibRootprotected java.util.concurrent.atomic.AtomicLongrequestCounterprotected java.lang.StringtemporaryLibRoot
-
Constructor Summary
Constructors Constructor Description ExecutableManager(java.lang.String temporaryLibRoot, java.lang.String libRoot)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFileToExtLibDir(java.lang.String filePath)java.lang.StringgetDirStringUnderLibRootByName(java.lang.String name)java.lang.StringgetDirStringUnderTempRootByRequestId(long requestId)java.io.FilegetDirUnderLibRootByName(java.lang.String name)java.io.FilegetDirUnderTempRootByRequestId(long requestId)java.lang.StringgetFileStringUnderInstallByName(java.lang.String name)java.lang.StringgetFileStringUnderLibRootByName(java.lang.String name)java.io.FilegetFileUnderLibRootByName(java.lang.String name)java.lang.StringgetInstallDir()java.lang.StringgetLibRoot()java.lang.StringgetTemporaryLibRoot()booleanhasFileUnderInstallDir(java.lang.String fileName)booleanhasFileUnderLibRoot(java.lang.String fileName)booleanhasFileUnderTemporaryRoot(java.lang.String fileName)voidmoveFileUnderTempRootToExtLibDir(ExecutableResource resource, java.lang.String name)java.lang.StringreadTextFromFileUnderTemporaryRoot(java.lang.String fileName)voidremoveFileUnderLibRoot(java.lang.String fileName)voidremoveFileUnderTemporaryRoot(java.lang.String fileName)ExecutableResourcerequest(java.util.List<java.lang.String> uris)voidsaveTextAsFileUnderTemporaryRoot(java.lang.String text, java.lang.String fileName)protected voidsaveToDir(java.nio.ByteBuffer byteBuffer, java.lang.String destination)voidsaveToInstallDir(java.nio.ByteBuffer byteBuffer, java.lang.String fileName)voidsaveToLibDir(java.nio.ByteBuffer byteBuffer, java.lang.String fileName)static java.nio.ByteBuffertransferToBytebuffer(java.lang.String filePath)
-
-
-
Field Detail
-
INSTALL_DIR
protected static final java.lang.String INSTALL_DIR
- See Also:
- Constant Field Values
-
temporaryLibRoot
protected final java.lang.String temporaryLibRoot
-
libRoot
protected final java.lang.String libRoot
-
requestCounter
protected final java.util.concurrent.atomic.AtomicLong requestCounter
-
-
Method Detail
-
request
public ExecutableResource request(java.util.List<java.lang.String> uris) throws java.net.URISyntaxException, java.io.IOException
- Throws:
java.net.URISyntaxExceptionjava.io.IOException
-
moveFileUnderTempRootToExtLibDir
public void moveFileUnderTempRootToExtLibDir(ExecutableResource resource, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
copyFileToExtLibDir
public void copyFileToExtLibDir(java.lang.String filePath) throws java.io.IOException- Throws:
java.io.IOException
-
removeFileUnderLibRoot
public void removeFileUnderLibRoot(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
hasFileUnderLibRoot
public boolean hasFileUnderLibRoot(java.lang.String fileName)
-
hasFileUnderInstallDir
public boolean hasFileUnderInstallDir(java.lang.String fileName)
-
hasFileUnderTemporaryRoot
public boolean hasFileUnderTemporaryRoot(java.lang.String fileName)
-
saveTextAsFileUnderTemporaryRoot
public void saveTextAsFileUnderTemporaryRoot(java.lang.String text, java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
removeFileUnderTemporaryRoot
public void removeFileUnderTemporaryRoot(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
readTextFromFileUnderTemporaryRoot
public java.lang.String readTextFromFileUnderTemporaryRoot(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
getDirUnderTempRootByRequestId
public java.io.File getDirUnderTempRootByRequestId(long requestId)
-
getDirStringUnderTempRootByRequestId
public java.lang.String getDirStringUnderTempRootByRequestId(long requestId)
-
getDirUnderLibRootByName
public java.io.File getDirUnderLibRootByName(java.lang.String name)
-
getDirStringUnderLibRootByName
public java.lang.String getDirStringUnderLibRootByName(java.lang.String name)
-
getFileUnderLibRootByName
public java.io.File getFileUnderLibRootByName(java.lang.String name)
-
getFileStringUnderLibRootByName
public java.lang.String getFileStringUnderLibRootByName(java.lang.String name)
-
getFileStringUnderInstallByName
public java.lang.String getFileStringUnderInstallByName(java.lang.String name)
-
transferToBytebuffer
public static java.nio.ByteBuffer transferToBytebuffer(java.lang.String filePath) throws java.io.IOException- Throws:
java.io.IOException
-
saveToDir
protected void saveToDir(java.nio.ByteBuffer byteBuffer, java.lang.String destination) throws java.io.IOException- Throws:
java.io.IOException
-
saveToLibDir
public void saveToLibDir(java.nio.ByteBuffer byteBuffer, java.lang.String fileName) throws java.io.IOException- Parameters:
byteBuffer- filefileName- The name of the file. Absolute Path will be libRoot + File_Separator + fileName- Throws:
java.io.IOException
-
saveToInstallDir
public void saveToInstallDir(java.nio.ByteBuffer byteBuffer, java.lang.String fileName) throws java.io.IOException- Parameters:
byteBuffer- filefileName- Absolute Path will be libRoot + File_Separator + INSTALL_DIR + File.separator + fileName- Throws:
java.io.IOException
-
getTemporaryLibRoot
public java.lang.String getTemporaryLibRoot()
-
getLibRoot
public java.lang.String getLibRoot()
-
getInstallDir
public java.lang.String getInstallDir()
-
-