[NO ISSUE][COMP] Pass request parameters to CREATE FUNCTION
- user model changes: no
- storage format changes: no
- interface changes: yes
Details:
Does what it says on the box.
Change-Id: I7cd2185a5e085ed3c9c38e1e0d0b1ad3efdf26c4
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/10345
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@uci.edu>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 233a678..0a88832 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -367,13 +367,13 @@
handleAdapterDropStatement(metadataProvider, stmt);
break;
case CREATE_FUNCTION:
- handleCreateFunctionStatement(metadataProvider, stmt, stmtRewriter);
+ handleCreateFunctionStatement(metadataProvider, stmt, stmtRewriter, requestParameters);
break;
case FUNCTION_DROP:
handleFunctionDropStatement(metadataProvider, stmt);
break;
case CREATE_LIBRARY:
- handleCreateLibraryStatement(metadataProvider, stmt, hcc);
+ handleCreateLibraryStatement(metadataProvider, stmt, hcc, requestParameters);
break;
case LIBRARY_DROP:
handleLibraryDropStatement(metadataProvider, stmt, hcc);
@@ -2000,7 +2000,7 @@
}
public void handleCreateFunctionStatement(MetadataProvider metadataProvider, Statement stmt,
- IStatementRewriter stmtRewriter) throws Exception {
+ IStatementRewriter stmtRewriter, IRequestParameters requestParameters) throws Exception {
CreateFunctionStatement cfs = (CreateFunctionStatement) stmt;
FunctionSignature signature = cfs.getFunctionSignature();
metadataProvider.validateDatabaseObjectName(signature.getDataverseName(), signature.getName(),
@@ -2019,7 +2019,7 @@
lockUtil.createFunctionBegin(lockManager, metadataProvider.getLocks(), dataverseName, signature.getName(),
libraryDataverseName, libraryName);
try {
- doCreateFunction(metadataProvider, cfs, signature, stmtRewriter);
+ doCreateFunction(metadataProvider, cfs, signature, stmtRewriter, requestParameters);
} finally {
metadataProvider.getLocks().unlock();
metadataProvider.setDefaultDataverse(activeDataverse);
@@ -2027,7 +2027,8 @@
}
protected void doCreateFunction(MetadataProvider metadataProvider, CreateFunctionStatement cfs,
- FunctionSignature functionSignature, IStatementRewriter stmtRewriter) throws Exception {
+ FunctionSignature functionSignature, IStatementRewriter stmtRewriter, IRequestParameters requestParameters)
+ throws Exception {
DataverseName dataverseName = functionSignature.getDataverseName();
SourceLocation sourceLoc = cfs.getSourceLocation();
MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
@@ -2420,21 +2421,22 @@
}
protected void handleCreateLibraryStatement(MetadataProvider metadataProvider, Statement stmt,
- IHyracksClientConnection hcc) throws Exception {
+ IHyracksClientConnection hcc, IRequestParameters requestParameters) throws Exception {
CreateLibraryStatement cls = (CreateLibraryStatement) stmt;
DataverseName dataverseName = getActiveDataverseName(cls.getDataverseName());
String libraryName = cls.getLibraryName();
String libraryHash = cls.getHash();
lockUtil.createLibraryBegin(lockManager, metadataProvider.getLocks(), dataverseName, libraryName);
try {
- doCreateLibrary(metadataProvider, dataverseName, libraryName, libraryHash, cls, hcc);
+ doCreateLibrary(metadataProvider, dataverseName, libraryName, libraryHash, cls, hcc, requestParameters);
} finally {
metadataProvider.getLocks().unlock();
}
}
- private void doCreateLibrary(MetadataProvider metadataProvider, DataverseName dataverseName, String libraryName,
- String libraryHash, CreateLibraryStatement cls, IHyracksClientConnection hcc) throws Exception {
+ protected void doCreateLibrary(MetadataProvider metadataProvider, DataverseName dataverseName, String libraryName,
+ String libraryHash, CreateLibraryStatement cls, IHyracksClientConnection hcc,
+ IRequestParameters requestParameters) throws Exception {
JobUtils.ProgressState progress = ProgressState.NO_PROGRESS;
boolean prepareJobSuccessful = false;
JobSpecification abortJobSpec = null;