Skip to content
Permalink
Browse files
Coordinated change to adopt multipart dataverse names
Change-Id: Ib9378478b416e2dc633801a560488fb490ef8596
  • Loading branch information
Dmitry Lychagin committed Nov 14, 2019
1 parent cc94d0f commit 6e8a15428fc6c225dfd944946da1570874869831
Showing 35 changed files with 352 additions and 367 deletions.
@@ -18,6 +18,8 @@
*/
package org.apache.asterix.bad;

import org.apache.asterix.common.metadata.DataverseName;

public interface BADConstants {
String SubscriptionId = "subscriptionId";
String BrokerName = "BrokerName";
@@ -41,7 +43,6 @@ public interface BADConstants {
String subscriptionEnding = "Subscriptions";
String resultsEnding = "Results";
String BAD_METADATA_EXTENSION_NAME = "BADMetadataExtension";
String BAD_DATAVERSE_NAME = "Metadata";
String Duration = "Duration";
String Function = "Function";
String FIELD_NAME_ARITY = "Arity";
@@ -99,7 +99,7 @@ public void run() {
}
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Job Failed to run for " + entityId.getExtensionName() + " "
+ entityId.getDataverse() + "." + entityId.getEntityName() + ".", e);
+ entityId.getDataverseName() + "." + entityId.getEntityName() + ".", e);
}
}
}, period, period, TimeUnit.MILLISECONDS);
@@ -113,7 +113,7 @@ public static boolean runDeployedJobSpecCheckPeriod(DeployedJobSpecId distribute
null, listener, null);
if (executionMilliseconds > period) {
LOGGER.log(Level.SEVERE,
"Periodic job for " + entityId.getExtensionName() + " " + entityId.getDataverse() + "."
"Periodic job for " + entityId.getExtensionName() + " " + entityId.getDataverseName() + "."
+ entityId.getEntityName() + " was unable to meet the required period of " + period
+ " milliseconds. Actually took " + executionMilliseconds + " execution will shutdown"
+ new Date());
@@ -147,8 +147,9 @@ public static long runDeployedJobSpec(DeployedJobSpecId distributedId, IHyracksC
}

LOGGER.log(Level.SEVERE,
"Deployed Job execution completed for " + entityId.getExtensionName() + " " + entityId.getDataverse()
+ "." + entityId.getEntityName() + ". Took " + executionMilliseconds + " milliseconds ");
"Deployed Job execution completed for " + entityId.getExtensionName() + " "
+ entityId.getDataverseName() + "." + entityId.getEntityName() + ". Took "
+ executionMilliseconds + " milliseconds ");

return executionMilliseconds;

@@ -282,7 +283,7 @@ private static JobSpecification compileProcedureJob(IStatementExecutor statement
} else if (procedureStatement.getKind() == Statement.Kind.QUERY) {
return compileQueryJob(statementExecutor, metadataProvider, hcc, (Query) procedureStatement);
} else {
SqlppDeleteRewriteVisitor visitor = new SqlppDeleteRewriteVisitor();
SqlppDeleteRewriteVisitor visitor = new SqlppDeleteRewriteVisitor(metadataProvider);
procedureStatement.accept(visitor, null);
return ((QueryTranslator) statementExecutor).handleDeleteStatement(metadataProvider, procedureStatement,
hcc, true, null, null);
@@ -33,6 +33,7 @@
import org.apache.asterix.bad.metadata.Procedure;
import org.apache.asterix.bad.metadata.ProcedureSearchKey;
import org.apache.asterix.common.api.ExtensionId;
import org.apache.asterix.common.metadata.DataverseName;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
@@ -67,7 +68,7 @@ public ExtensionKind getExtensionKind() {
return ExtensionKind.LANG;
}

public static Broker getBroker(MetadataTransactionContext mdTxnCtx, String dataverseName, String brokerName)
public static Broker getBroker(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName, String brokerName)
throws AlgebricksException {
BrokerSearchKey brokerSearchKey = new BrokerSearchKey(dataverseName, brokerName);
List<Broker> brokers = MetadataManager.INSTANCE.getEntities(mdTxnCtx, brokerSearchKey);
@@ -80,8 +81,8 @@ public static Broker getBroker(MetadataTransactionContext mdTxnCtx, String datav
}
}

public static Channel getChannel(MetadataTransactionContext mdTxnCtx, String dataverseName, String channelName)
throws AlgebricksException {
public static Channel getChannel(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName,
String channelName) throws AlgebricksException {
ChannelSearchKey channelSearchKey = new ChannelSearchKey(dataverseName, channelName);
List<Channel> channels = MetadataManager.INSTANCE.getEntities(mdTxnCtx, channelSearchKey);
if (channels.isEmpty()) {
@@ -93,7 +94,7 @@ public static Channel getChannel(MetadataTransactionContext mdTxnCtx, String dat
}
}

public static Procedure getProcedure(MetadataTransactionContext mdTxnCtx, String dataverseName,
public static Procedure getProcedure(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName,
String procedureName, String arity) throws AlgebricksException {
ProcedureSearchKey procedureSearchKey = new ProcedureSearchKey(dataverseName, procedureName, arity);
List<Procedure> procedures = MetadataManager.INSTANCE.getEntities(mdTxnCtx, procedureSearchKey);
@@ -106,7 +107,7 @@ public static Procedure getProcedure(MetadataTransactionContext mdTxnCtx, String
}
}

public static List<Broker> getBrokers(MetadataTransactionContext mdTxnCtx, String dataverseName)
public static List<Broker> getBrokers(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName)
throws AlgebricksException {
DataverseBrokersSearchKey brokerSearchKey = new DataverseBrokersSearchKey(dataverseName);
return MetadataManager.INSTANCE.getEntities(mdTxnCtx, brokerSearchKey);
@@ -117,13 +118,13 @@ public static List<Channel> getAllChannels(MetadataTransactionContext mdTxnCtx)
return MetadataManager.INSTANCE.getEntities(mdTxnCtx, channelSearchKey);
}

public static List<Channel> getChannels(MetadataTransactionContext mdTxnCtx, String dataverseName)
public static List<Channel> getChannels(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName)
throws AlgebricksException {
DataverseChannelsSearchKey channelSearchKey = new DataverseChannelsSearchKey(dataverseName);
return MetadataManager.INSTANCE.getEntities(mdTxnCtx, channelSearchKey);
}

public static List<Procedure> getProcedures(MetadataTransactionContext mdTxnCtx, String dataverseName)
public static List<Procedure> getProcedures(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName)
throws AlgebricksException {
DataverseProceduresSearchKey proceduresSearchKey = new DataverseProceduresSearchKey(dataverseName);
return MetadataManager.INSTANCE.getEntities(mdTxnCtx, proceduresSearchKey);

0 comments on commit 6e8a154

Please sign in to comment.