Skip to content
Permalink
Browse files
Coordinated change for extensible MetadataProvider
Change-Id: Id7df08806befad531ac071163993b38b25d57847
  • Loading branch information
Dmitry Lychagin committed Nov 19, 2019
1 parent 6e8a154 commit d01a64ed025c01c8abffb1331cf4d4462d7dfefd
Showing 6 changed files with 10 additions and 10 deletions.
@@ -236,17 +236,17 @@ public void handleCreateIndexStatement(MetadataProvider metadataProvider, Statem
MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
metadataProvider.getLocks().unlock();

metadataProvider = new MetadataProvider(appCtx, activeDataverse);
metadataProvider = MetadataProvider.create(appCtx, activeDataverse);
super.handleCreateIndexStatement(metadataProvider, stmt, hcc, requestParameters);

for (Channel channel : usages.first) {
metadataProvider = new MetadataProvider(appCtx, activeDataverse);
metadataProvider = MetadataProvider.create(appCtx, activeDataverse);
BADJobService.redeployJobSpec(channel.getChannelId(), channel.getChannelBody(), metadataProvider, this, hcc,
requestParameters, false);
metadataProvider.getLocks().unlock();
}
for (Procedure procedure : usages.second) {
metadataProvider = new MetadataProvider(appCtx, activeDataverse);
metadataProvider = MetadataProvider.create(appCtx, activeDataverse);
BADJobService.redeployJobSpec(procedure.getEntityId(), procedure.getBody(), metadataProvider, this, hcc,
requestParameters, false);
metadataProvider.getLocks().unlock();
@@ -303,7 +303,7 @@ protected void handleDataverseDropStatement(MetadataProvider metadataProvider, S
MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
metadataProvider.setMetadataTxnContext(mdTxnCtx);
DataverseName dvId = ((DataverseDropStatement) stmt).getDataverseName();
MetadataProvider tempMdProvider = new MetadataProvider(appCtx, metadataProvider.getDefaultDataverse());
MetadataProvider tempMdProvider = MetadataProvider.create(appCtx, metadataProvider.getDefaultDataverse());
tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
List<Channel> channels = BADLangExtension.getAllChannels(mdTxnCtx);
for (Channel channel : channels) {
@@ -130,7 +130,7 @@ public void handle(IHyracksClientConnection hcc, IStatementExecutor statementExe
}
}
//Create a metadata provider to use in nested jobs.
MetadataProvider tempMdProvider = new MetadataProvider(appCtx, metadataProvider.getDefaultDataverse());
MetadataProvider tempMdProvider = MetadataProvider.create(appCtx, metadataProvider.getDefaultDataverse());
tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
//Drop the Channel Datasets
//TODO: Need to find some way to handle if this fails.
@@ -178,7 +178,7 @@ public void handle(IHyracksClientConnection hcc, IStatementExecutor statementExe
RecordConstructor recordCon = new RecordConstructor(fb);
subscriptionTuple.setBody(recordCon);
subscriptionTuple.setVarCounter(varCounter);
MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
MetadataProvider tempMdProvider = MetadataProvider.create(metadataProvider.getApplicationContext(),
metadataProvider.getDefaultDataverse());
tempMdProvider.getConfig().putAll(metadataProvider.getConfig());

@@ -136,7 +136,7 @@ public void handle(IHyracksClientConnection hcc, IStatementExecutor statementExe
condition, varCounter);
SqlppDeleteRewriteVisitor visitor = new SqlppDeleteRewriteVisitor(metadataProvider);
delete.accept(visitor, null);
MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
MetadataProvider tempMdProvider = MetadataProvider.create(metadataProvider.getApplicationContext(),
metadataProvider.getDefaultDataverse());
tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
((QueryTranslator) statementExecutor).handleDeleteStatement(tempMdProvider, delete, hcc, false, null, null);
@@ -305,7 +305,7 @@ public void handle(IHyracksClientConnection hcc, IStatementExecutor statementExe
if (!push && MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, resultsTableName) != null) {
throw new AsterixException("The channel name:" + channelName + " is not available.");
}
MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
MetadataProvider tempMdProvider = MetadataProvider.create(metadataProvider.getApplicationContext(),
metadataProvider.getDefaultDataverse());
tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
final IResultSet resultSet = requestContext.getResultSet();
@@ -120,7 +120,7 @@ private void deployJobs(ICcApplicationContext appCtx, List<Channel> channels, Li
//Redeploy Jobs
for (Channel channel : channels) {
EntityId entityId = channel.getChannelId();
metadataProvider = new MetadataProvider(appCtx, MetadataBuiltinEntities.DEFAULT_DATAVERSE);
metadataProvider = MetadataProvider.create(appCtx, MetadataBuiltinEntities.DEFAULT_DATAVERSE);
DeployedJobSpecEventListener listener =
new DeployedJobSpecEventListener(appCtx, entityId, channel.getResultsDatasetName().equals("")
? PrecompiledType.PUSH_CHANNEL : PrecompiledType.CHANNEL);
@@ -144,7 +144,7 @@ hcc, new RequestParameters(requestReference, null, null, null, null, null, null,
}
for (Procedure procedure : procedures) {
EntityId entityId = procedure.getEntityId();
metadataProvider = new MetadataProvider(appCtx, MetadataBuiltinEntities.DEFAULT_DATAVERSE);
metadataProvider = MetadataProvider.create(appCtx, MetadataBuiltinEntities.DEFAULT_DATAVERSE);
metadataProvider.setWriterFactory(PrinterBasedWriterFactory.INSTANCE);
metadataProvider.setResultSerializerFactoryProvider(ResultSerializerFactoryProvider.INSTANCE);
DeployedJobSpecEventListener listener =

0 comments on commit d01a64e

Please sign in to comment.