[ASTERIXDB-2158] Remove AsterixException (step 1)
- user model changes: no
- storage format changes: no
- interface changes: replace AsterixException on signatures
Details:
This change is the first step towards removing AsterixException from
all interfaces.
Change-Id: I3e858576f39f671cbf5eb14adc7a22aab1335faf
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2135
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Murtadha Hubail <mhubail@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/base/ILangExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/base/ILangExpressionToPlanTranslator.java
index ca6710f..8e0214a 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/base/ILangExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/base/ILangExpressionToPlanTranslator.java
@@ -18,7 +18,6 @@
*/
package org.apache.asterix.algebra.base;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.lang.common.statement.Query;
import org.apache.asterix.translator.CompiledStatements.ICompiledDmlStatement;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -40,10 +39,9 @@
* the compiled dml statement (only for insert/delete).
* @return a logical query plan for the query.
* @throws AlgebricksException
- * @throws AsterixException
*/
public ILogicalPlan translate(Query query, String outputDatasetName, ICompiledDmlStatement stmt)
- throws AlgebricksException, AsterixException;
+ throws AlgebricksException;
/**
* Translates a load statement.
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
index f3f5581..160e909 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
@@ -26,7 +26,6 @@
import org.apache.asterix.aqlplus.parser.AQLPlusParser;
import org.apache.asterix.aqlplus.parser.ParseException;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.lang.common.base.Clause;
import org.apache.asterix.lang.common.struct.Identifier;
import org.apache.asterix.metadata.declared.MetadataProvider;
@@ -318,12 +317,7 @@
deepCopyVisitor.updatePrimaryKeys(context);
deepCopyVisitor.reset();
- ILogicalPlan plan;
- try {
- plan = translator.translate(clauses);
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
+ ILogicalPlan plan = translator.translate(clauses);
context.setVarCounter(counter.get());
ILogicalOperator outputOp = plan.getRoots().get(0).getValue();
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
index de47ff7..3b6a959 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
@@ -27,7 +27,6 @@
import org.apache.asterix.algebra.operators.CommitOperator;
import org.apache.asterix.common.config.DatasetConfig.DatasetType;
import org.apache.asterix.common.config.DatasetConfig.IndexType;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.lang.common.util.FunctionUtil;
import org.apache.asterix.metadata.declared.DataSource;
import org.apache.asterix.metadata.declared.DataSourceIndex;
@@ -227,34 +226,28 @@
* if the index is enforcing field types (For open indexes), We add a cast
* operator to ensure type safety
*/
- try {
- if (primaryIndexModificationOp.getOperation() == Kind.INSERT
- || primaryIndexModificationOp.getOperation() == Kind.UPSERT
- /* Actually, delete should not be here but it is now until issue
- * https://issues.apache.org/jira/browse/ASTERIXDB-1507
- * is solved
- */
- || primaryIndexModificationOp.getOperation() == Kind.DELETE) {
- injectFieldAccessesForIndexes(context, dataset, indexes, fieldVarsForNewRecord, recType, metaType,
- newRecordVar, newMetaVar, primaryIndexModificationOp, false);
- if (replicateOp != null) {
- context.computeAndSetTypeEnvironmentForOperator(replicateOp);
- }
+ if (primaryIndexModificationOp.getOperation() == Kind.INSERT
+ || primaryIndexModificationOp.getOperation() == Kind.UPSERT
+ /* Actually, delete should not be here but it is now until issue
+ * https://issues.apache.org/jira/browse/ASTERIXDB-1507
+ * is solved
+ */
+ || primaryIndexModificationOp.getOperation() == Kind.DELETE) {
+ injectFieldAccessesForIndexes(context, dataset, indexes, fieldVarsForNewRecord, recType, metaType,
+ newRecordVar, newMetaVar, primaryIndexModificationOp, false);
+ if (replicateOp != null) {
+ context.computeAndSetTypeEnvironmentForOperator(replicateOp);
}
- if (primaryIndexModificationOp.getOperation() == Kind.UPSERT
- /* Actually, delete should be here but it is not until issue
- * https://issues.apache.org/jira/browse/ASTERIXDB-1507
- * is solved
- */) {
- List<LogicalVariable> beforeOpMetaVars = primaryIndexModificationOp
- .getBeforeOpAdditionalNonFilteringVars();
- LogicalVariable beforeOpMetaVar = beforeOpMetaVars == null ? null : beforeOpMetaVars.get(0);
- currentTop = injectFieldAccessesForIndexes(context, dataset, indexes, fieldVarsForBeforeOperation,
- recType, metaType, primaryIndexModificationOp.getBeforeOpRecordVar(), beforeOpMetaVar,
- currentTop, true);
- }
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
+ }
+ if (primaryIndexModificationOp.getOperation() == Kind.UPSERT
+ /* Actually, delete should be here but it is not until issue
+ * https://issues.apache.org/jira/browse/ASTERIXDB-1507
+ * is solved
+ */) {
+ List<LogicalVariable> beforeOpMetaVars = primaryIndexModificationOp.getBeforeOpAdditionalNonFilteringVars();
+ LogicalVariable beforeOpMetaVar = beforeOpMetaVars == null ? null : beforeOpMetaVars.get(0);
+ currentTop = injectFieldAccessesForIndexes(context, dataset, indexes, fieldVarsForBeforeOperation, recType,
+ metaType, primaryIndexModificationOp.getBeforeOpRecordVar(), beforeOpMetaVar, currentTop, true);
}
// Iterate each secondary index and applying Index Update operations.
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java
index fcc2d8b..10630a5 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java
@@ -27,7 +27,6 @@
import org.apache.asterix.algebra.operators.physical.ExternalDataLookupPOperator;
import org.apache.asterix.common.config.DatasetConfig.DatasetType;
import org.apache.asterix.common.config.DatasetConfig.IndexType;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.external.indexing.IndexingConstants;
@@ -313,11 +312,7 @@
// Primary keys.
if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
//add primary keys
- try {
- appendExternalRecPrimaryKeys(dataset, dest);
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
+ appendExternalRecPrimaryKeys(dataset, dest);
} else {
dest.addAll(KeyFieldTypeUtil.getPartitoningKeyTypes(dataset, recordType, metaRecordType));
}
@@ -675,7 +670,7 @@
target.add(itemType);
}
- private static void appendExternalRecPrimaryKeys(Dataset dataset, List<Object> target) throws AsterixException {
+ private static void appendExternalRecPrimaryKeys(Dataset dataset, List<Object> target) throws AlgebricksException {
int numPrimaryKeys =
IndexingConstants.getRIDSize(((ExternalDatasetDetails) dataset.getDatasetDetails()).getProperties());
for (int i = 0; i < numPrimaryKeys; i++) {
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
index db6f985..414d464 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/AbstractLangTranslator.java
@@ -38,6 +38,7 @@
import org.apache.asterix.metadata.dataset.hints.DatasetHints;
import org.apache.asterix.metadata.entities.Dataverse;
import org.apache.asterix.metadata.utils.MetadataConstants;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -50,7 +51,7 @@
private static final Logger LOGGER = Logger.getLogger(AbstractLangTranslator.class.getName());
public void validateOperation(ICcApplicationContext appCtx, Dataverse defaultDataverse, Statement stmt)
- throws AsterixException {
+ throws AlgebricksException {
final IClusterStateManager clusterStateManager = appCtx.getClusterStateManager();
final IGlobalRecoveryManager globalRecoveryManager = appCtx.getGlobalRecoveryManager();
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
index e50c7ca..9edfddb 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/TypeTranslator.java
@@ -27,13 +27,12 @@
import org.apache.asterix.common.annotations.IRecordFieldDataGen;
import org.apache.asterix.common.annotations.RecordDataGenAnnotation;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.lang.common.expression.OrderedListTypeDefinition;
import org.apache.asterix.lang.common.expression.RecordTypeDefinition;
+import org.apache.asterix.lang.common.expression.RecordTypeDefinition.RecordKind;
import org.apache.asterix.lang.common.expression.TypeExpression;
import org.apache.asterix.lang.common.expression.TypeReferenceExpression;
import org.apache.asterix.lang.common.expression.UnorderedListTypeDefinition;
-import org.apache.asterix.lang.common.expression.RecordTypeDefinition.RecordKind;
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
import org.apache.asterix.metadata.entities.BuiltinTypeMap;
@@ -61,8 +60,7 @@
}
public static Map<TypeSignature, IAType> computeTypes(MetadataTransactionContext mdTxnCtx, TypeExpression typeExpr,
- String typeName, String typeDataverse, Map<TypeSignature, IAType> typeMap)
- throws AlgebricksException {
+ String typeName, String typeDataverse, Map<TypeSignature, IAType> typeMap) throws AlgebricksException {
Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes = new HashMap<>();
Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes = new HashMap<>();
Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences = new HashMap<>();
@@ -89,48 +87,43 @@
throw new AlgebricksException("Cannot redefine builtin type " + typeName + " .");
}
TypeSignature typeSignature = new TypeSignature(typeDataverse, typeName);
- try {
- switch (typeExpr.getTypeKind()) {
- case TYPEREFERENCE: {
- TypeReferenceExpression tre = (TypeReferenceExpression) typeExpr;
- IAType t = solveTypeReference(new TypeSignature(
- tre.getIdent().first == null ? typeDataverse : tre.getIdent().first.getValue(),
- tre.getIdent().second.getValue()), typeMap);
- if (t != null) {
- typeMap.put(typeSignature, t);
- } else {
- addIncompleteTopLevelTypeReference(tre, incompleteTopLevelTypeReferences,
- typeDataverse);
- }
- break;
+ switch (typeExpr.getTypeKind()) {
+ case TYPEREFERENCE: {
+ TypeReferenceExpression tre = (TypeReferenceExpression) typeExpr;
+ IAType t = solveTypeReference(new TypeSignature(
+ tre.getIdent().first == null ? typeDataverse : tre.getIdent().first.getValue(),
+ tre.getIdent().second.getValue()), typeMap);
+ if (t != null) {
+ typeMap.put(typeSignature, t);
+ } else {
+ addIncompleteTopLevelTypeReference(tre, incompleteTopLevelTypeReferences, typeDataverse);
}
- case RECORD: {
- RecordTypeDefinition rtd = (RecordTypeDefinition) typeExpr;
- ARecordType recType = computeRecordType(typeSignature, rtd, typeMap, incompleteFieldTypes,
- incompleteItemTypes, typeDataverse);
- typeMap.put(typeSignature, recType);
- break;
- }
- case ORDEREDLIST: {
- OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) typeExpr;
- AOrderedListType olType = computeOrderedListType(typeSignature, oltd, typeMap, incompleteItemTypes,
- incompleteFieldTypes, typeDataverse);
- typeMap.put(typeSignature, olType);
- break;
- }
- case UNORDEREDLIST: {
- UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) typeExpr;
- AUnorderedListType ulType = computeUnorderedListType(typeSignature, ultd, typeMap,
- incompleteItemTypes, incompleteFieldTypes, typeDataverse);
- typeMap.put(typeSignature, ulType);
- break;
- }
- default: {
- throw new IllegalStateException();
- }
+ break;
}
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
+ case RECORD: {
+ RecordTypeDefinition rtd = (RecordTypeDefinition) typeExpr;
+ ARecordType recType = computeRecordType(typeSignature, rtd, typeMap, incompleteFieldTypes,
+ incompleteItemTypes, typeDataverse);
+ typeMap.put(typeSignature, recType);
+ break;
+ }
+ case ORDEREDLIST: {
+ OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) typeExpr;
+ AOrderedListType olType = computeOrderedListType(typeSignature, oltd, typeMap, incompleteItemTypes,
+ incompleteFieldTypes, typeDataverse);
+ typeMap.put(typeSignature, olType);
+ break;
+ }
+ case UNORDEREDLIST: {
+ UnorderedListTypeDefinition ultd = (UnorderedListTypeDefinition) typeExpr;
+ AUnorderedListType ulType = computeUnorderedListType(typeSignature, ultd, typeMap, incompleteItemTypes,
+ incompleteFieldTypes, typeDataverse);
+ typeMap.put(typeSignature, ulType);
+ break;
+ }
+ default: {
+ throw new IllegalStateException();
+ }
}
}
@@ -204,7 +197,7 @@
private static AOrderedListType computeOrderedListType(TypeSignature typeSignature, OrderedListTypeDefinition oltd,
Map<TypeSignature, IAType> typeMap, Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, String defaultDataverse)
- throws AsterixException {
+ throws AlgebricksException {
TypeExpression tExpr = oltd.getItemTypeExpression();
String typeName = typeSignature != null ? typeSignature.getName() : null;
AOrderedListType aolt = new AOrderedListType(null, typeName);
@@ -216,7 +209,7 @@
UnorderedListTypeDefinition ultd, Map<TypeSignature, IAType> typeMap,
Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, String defaulDataverse)
- throws AsterixException {
+ throws AlgebricksException {
TypeExpression tExpr = ultd.getItemTypeExpression();
String typeName = typeSignature != null ? typeSignature.getName() : null;
AUnorderedListType ault = new AUnorderedListType(null, typeName);
@@ -227,7 +220,7 @@
private static void setCollectionItemType(TypeExpression tExpr, Map<TypeSignature, IAType> typeMap,
Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes,
Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes, AbstractCollectionType act,
- String defaultDataverse) throws AsterixException {
+ String defaultDataverse) throws AlgebricksException {
switch (tExpr.getTypeKind()) {
case ORDEREDLIST: {
OrderedListTypeDefinition oltd = (OrderedListTypeDefinition) tExpr;
@@ -327,7 +320,7 @@
private static ARecordType computeRecordType(TypeSignature typeSignature, RecordTypeDefinition rtd,
Map<TypeSignature, IAType> typeMap, Map<String, Map<ARecordType, List<Integer>>> incompleteFieldTypes,
Map<TypeSignature, List<AbstractCollectionType>> incompleteItemTypes, String defaultDataverse)
- throws AsterixException {
+ throws AlgebricksException {
List<String> names = rtd.getFieldNames();
int n = names.size();
String[] fldNames = new String[n];
@@ -337,8 +330,8 @@
fldNames[i++] = s;
}
boolean isOpen = rtd.getRecordKind() == RecordKind.OPEN;
- ARecordType recType = new ARecordType(typeSignature == null ? null : typeSignature.getName(), fldNames,
- fldTypes, isOpen);
+ ARecordType recType =
+ new ARecordType(typeSignature == null ? null : typeSignature.getName(), fldNames, fldTypes, isOpen);
List<IRecordFieldDataGen> fieldDataGen = rtd.getFieldDataGen();
if (fieldDataGen.size() == n) {
IRecordFieldDataGen[] rfdg = new IRecordFieldDataGen[n];
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
index d13a15d..ec0680f 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/active/ActiveNotificationHandler.java
@@ -33,7 +33,6 @@
import org.apache.asterix.active.IActiveNotificationHandler;
import org.apache.asterix.active.message.ActivePartitionMessage;
import org.apache.asterix.common.api.IMetadataLockManager;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.RuntimeDataException;
import org.apache.asterix.metadata.api.IActiveEntityController;
@@ -41,6 +40,7 @@
import org.apache.asterix.metadata.entities.Dataset;
import org.apache.asterix.metadata.utils.DatasetUtil;
import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.exceptions.HyracksException;
import org.apache.hyracks.api.job.IJobLifecycleListener;
@@ -226,7 +226,7 @@
}
public void suspend(MetadataProvider mdProvider)
- throws AsterixException, HyracksDataException, InterruptedException {
+ throws AlgebricksException, HyracksDataException, InterruptedException {
synchronized (this) {
if (suspended) {
throw new RuntimeDataException(ErrorCode.ACTIVE_EVENT_HANDLER_ALREADY_SUSPENDED);
@@ -256,7 +256,7 @@
}
public void resume(MetadataProvider mdProvider)
- throws AsterixException, HyracksDataException, InterruptedException {
+ throws HyracksDataException, InterruptedException {
LOGGER.log(level, "Resuming active events handler");
for (IActiveEntityEventsListener listener : entityEventListeners.values()) {
LOGGER.log(level, "Resuming " + listener.getEntityId());
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 e45df8b..d6457f2 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
@@ -1768,7 +1768,7 @@
String dataverseName = getActiveDataverse(stmtInsertUpsert.getDataverseName());
final IMetadataLocker locker = new IMetadataLocker() {
@Override
- public void lock() throws AsterixException {
+ public void lock() throws AlgebricksException {
MetadataLockUtil.insertDeleteUpsertBegin(lockManager, metadataProvider.getLocks(),
dataverseName + "." + stmtInsertUpsert.getDatasetName());
}
@@ -2307,9 +2307,9 @@
}
private interface IMetadataLocker {
- void lock() throws AsterixException;
+ void lock() throws AlgebricksException;
- void unlock() throws AsterixException;
+ void unlock() throws AlgebricksException;
}
private interface IResultPrinter {
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/ClusterLifecycleListener.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
index 84f841c..50fe65e 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
@@ -183,7 +183,7 @@
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Added NC at:" + node.getId());
}
- } catch (AsterixException e) {
+ } catch (Exception e) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Unable to add NC at:" + node.getId());
}
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/runtime/ClusterStateManagerTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/runtime/ClusterStateManagerTest.java
index 6c11139..1466088 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/runtime/ClusterStateManagerTest.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/runtime/ClusterStateManagerTest.java
@@ -35,6 +35,7 @@
import org.apache.asterix.runtime.transaction.ResourceIdManager;
import org.apache.asterix.runtime.utils.CcApplicationContext;
import org.apache.asterix.runtime.utils.ClusterStateManager;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.application.ICCServiceContext;
import org.apache.hyracks.api.config.IApplicationConfig;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -185,7 +186,7 @@
}
private void notifyNodeJoined(ClusterStateManager csm, String nodeId, int partitionId, boolean registerPartitions)
- throws HyracksException, AsterixException {
+ throws HyracksException, AlgebricksException {
csm.notifyNodeJoin(nodeId, Collections.emptyMap());
if (registerPartitions) {
csm.registerNodePartitions(nodeId, new ClusterPartition[] { new ClusterPartition(partitionId, nodeId, 0) });
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/active/TestEventsListener.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/active/TestEventsListener.java
index 5199b1c..1cedc96 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/active/TestEventsListener.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/active/TestEventsListener.java
@@ -30,13 +30,13 @@
import org.apache.asterix.app.active.ActiveEntityEventsListener;
import org.apache.asterix.common.api.IMetadataLockManager;
import org.apache.asterix.common.dataflow.ICcApplicationContext;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.metadata.LockList;
import org.apache.asterix.external.feed.watch.WaitForStateSubscriber;
import org.apache.asterix.metadata.declared.MetadataProvider;
import org.apache.asterix.metadata.entities.Dataset;
import org.apache.asterix.translator.IStatementExecutor;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.job.JobId;
@@ -110,7 +110,7 @@
try {
metadataProvider.getApplicationContext().getMetadataLockManager()
.acquireDatasetReadLock(metadataProvider.getLocks(), "Default.type");
- } catch (AsterixException e) {
+ } catch (AlgebricksException e) {
throw HyracksDataException.create(e);
}
failCompile(onStart);
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
index d1c3ce4..c0a4d80 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java
@@ -45,6 +45,7 @@
import org.apache.asterix.test.common.TestHelper;
import org.apache.asterix.test.runtime.HDFSCluster;
import org.apache.asterix.translator.IStatementExecutorFactory;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.junit.AfterClass;
import org.junit.Assume;
@@ -189,7 +190,7 @@
query, plan, provider, statementExecutorFactory, storageComponentProvider);
try {
asterix.compile(true, false, false, true, true, false, false);
- } catch (AsterixException e) {
+ } catch (AlgebricksException e) {
plan.close();
query.close();
throw new Exception("Compile ERROR for " + queryFile + ": " + e.getMessage(), e);
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IMetadataLockManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IMetadataLockManager.java
index 4408d84..bed9869 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IMetadataLockManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IMetadataLockManager.java
@@ -18,7 +18,6 @@
*/
package org.apache.asterix.common.api;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.metadata.LockList;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -31,10 +30,10 @@
* the lock list to add the new lock to
* @param dataverseName
* the dataverse name
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDataverseReadLock(LockList locks, String dataverseName) throws AsterixException;
+ void acquireDataverseReadLock(LockList locks, String dataverseName) throws AlgebricksException;
/**
* Acquire write lock on the dataverse
@@ -43,10 +42,10 @@
* the lock list to add the new lock to
* @param dataverseName
* the dataverse name
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDataverseWriteLock(LockList locks, String dataverseName) throws AsterixException;
+ void acquireDataverseWriteLock(LockList locks, String dataverseName) throws AlgebricksException;
/**
* Acquire read lock on the dataset (for queries)
@@ -55,10 +54,10 @@
* the lock list to add the new lock to
* @param datasetFullyQualifiedName
* the fully qualified name of the dataset
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDatasetReadLock(LockList locks, String datasetFullyQualifiedName) throws AsterixException;
+ void acquireDatasetReadLock(LockList locks, String datasetFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the dataset (for dataset create, dataset drop, and index drop)
@@ -67,10 +66,10 @@
* the lock list to add the new lock to
* @param datasetFullyQualifiedName
* the fully qualified name of the dataset
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDatasetWriteLock(LockList locks, String datasetFullyQualifiedName) throws AsterixException;
+ void acquireDatasetWriteLock(LockList locks, String datasetFullyQualifiedName) throws AlgebricksException;
/**
* Acquire modify lock on the dataset (for inserts, upserts, deletes) Mutually exclusive with create index lock
@@ -79,10 +78,10 @@
* the lock list to add the new lock to
* @param datasetFullyQualifiedName
* the fully qualified name of the dataset
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDatasetModifyLock(LockList locks, String datasetFullyQualifiedName) throws AsterixException;
+ void acquireDatasetModifyLock(LockList locks, String datasetFullyQualifiedName) throws AlgebricksException;
/**
* Acquire create index lock on the dataset (for index creation) Mutually exclusive with modify lock
@@ -91,10 +90,10 @@
* the lock list to add the new lock to
* @param datasetFullyQualifiedName
* the fully qualified name of the dataset
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDatasetCreateIndexLock(LockList locks, String datasetFullyQualifiedName) throws AsterixException;
+ void acquireDatasetCreateIndexLock(LockList locks, String datasetFullyQualifiedName) throws AlgebricksException;
/**
* Acquire exclusive modify lock on the dataset. only a single thread can acquire this lock and it is mutually
@@ -104,11 +103,11 @@
* the lock list to add the new lock to
* @param datasetFullyQualifiedName
* the fully qualified name of the dataset
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
void acquireDatasetExclusiveModificationLock(LockList locks, String datasetFullyQualifiedName)
- throws AsterixException;
+ throws AlgebricksException;
/**
* Acquire read lock on the function
@@ -117,10 +116,10 @@
* the lock list to add the new lock to
* @param functionFullyQualifiedName
* the fully qualified name of the function
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireFunctionReadLock(LockList locks, String functionFullyQualifiedName) throws AsterixException;
+ void acquireFunctionReadLock(LockList locks, String functionFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the function
@@ -129,10 +128,10 @@
* the lock list to add the new lock to
* @param functionFullyQualifiedName
* the fully qualified name of the function
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireFunctionWriteLock(LockList locks, String functionFullyQualifiedName) throws AsterixException;
+ void acquireFunctionWriteLock(LockList locks, String functionFullyQualifiedName) throws AlgebricksException;
/**
* Acquire read lock on the node group
@@ -141,10 +140,10 @@
* the lock list to add the new lock to
* @param nodeGroupName
* the name of the node group
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireNodeGroupReadLock(LockList locks, String nodeGroupName) throws AsterixException;
+ void acquireNodeGroupReadLock(LockList locks, String nodeGroupName) throws AlgebricksException;
/**
* Acquire write lock on the node group
@@ -153,10 +152,10 @@
* the lock list to add the new lock to
* @param nodeGroupName
* the name of the node group
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireNodeGroupWriteLock(LockList locks, String nodeGroupName) throws AsterixException;
+ void acquireNodeGroupWriteLock(LockList locks, String nodeGroupName) throws AlgebricksException;
/**
* Acquire read lock on the active entity
@@ -165,10 +164,10 @@
* the lock list to add the new lock to
* @param entityFullyQualifiedName
* the fully qualified name of the active entity
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireActiveEntityReadLock(LockList locks, String entityFullyQualifiedName) throws AsterixException;
+ void acquireActiveEntityReadLock(LockList locks, String entityFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the active entity
@@ -177,10 +176,10 @@
* the lock list to add the new lock to
* @param entityFullyQualifiedName
* the fully qualified name of the active entity
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireActiveEntityWriteLock(LockList locks, String entityFullyQualifiedName) throws AsterixException;
+ void acquireActiveEntityWriteLock(LockList locks, String entityFullyQualifiedName) throws AlgebricksException;
/**
* Acquire read lock on the feed policy
@@ -189,10 +188,10 @@
* the lock list to add the new lock to
* @param feedPolicyFullyQualifiedName
* the fully qualified name of the feed policy
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireFeedPolicyWriteLock(LockList locks, String feedPolicyFullyQualifiedName) throws AsterixException;
+ void acquireFeedPolicyWriteLock(LockList locks, String feedPolicyFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the feed policy
@@ -201,10 +200,10 @@
* the lock list to add the new lock to
* @param feedPolicyFullyQualifiedName
* the fully qualified name of the feed policy
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireFeedPolicyReadLock(LockList locks, String feedPolicyFullyQualifiedName) throws AsterixException;
+ void acquireFeedPolicyReadLock(LockList locks, String feedPolicyFullyQualifiedName) throws AlgebricksException;
/**
* Acquire read lock on the merge policy
@@ -213,10 +212,10 @@
* the lock list to add the new lock to
* @param mergePolicyFullyQualifiedName
* the fully qualified name of the merge policy
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireMergePolicyReadLock(LockList locks, String mergePolicyFullyQualifiedName) throws AsterixException;
+ void acquireMergePolicyReadLock(LockList locks, String mergePolicyFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the merge policy
@@ -225,10 +224,10 @@
* the lock list to add the new lock to
* @param mergePolicyFullyQualifiedName
* the fully qualified name of the merge policy
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireMergePolicyWriteLock(LockList locks, String mergePolicyFullyQualifiedName) throws AsterixException;
+ void acquireMergePolicyWriteLock(LockList locks, String mergePolicyFullyQualifiedName) throws AlgebricksException;
/**
* Acquire read lock on the data type
@@ -237,10 +236,10 @@
* the lock list to add the new lock to
* @param datatypeFullyQualifiedName
* the fully qualified name of the data type
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDataTypeReadLock(LockList locks, String datatypeFullyQualifiedName) throws AsterixException;
+ void acquireDataTypeReadLock(LockList locks, String datatypeFullyQualifiedName) throws AlgebricksException;
/**
* Acquire write lock on the data type
@@ -249,10 +248,10 @@
* the lock list to add the new lock to
* @param datatypeFullyQualifiedName
* the fully qualified name of the data type
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
- void acquireDataTypeWriteLock(LockList locks, String datatypeFullyQualifiedName) throws AsterixException;
+ void acquireDataTypeWriteLock(LockList locks, String datatypeFullyQualifiedName) throws AlgebricksException;
/**
* Acquire read lock on the extension entity
@@ -263,11 +262,11 @@
* the extension key
* @param extensionEntityFullyQualifiedName
* the fully qualified name of the extension entity
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
void acquireExtensionReadLock(LockList locks, String extension, String extensionEntityFullyQualifiedName)
- throws AsterixException;
+ throws AlgebricksException;
/**
* Acquire write lock on the extension entity
@@ -278,11 +277,11 @@
* the extension key
* @param extensionEntityFullyQualifiedName
* the fully qualified name of the extension entity
- * @throws AsterixException
+ * @throws AlgebricksException
* if lock couldn't be acquired
*/
void acquireExtensionWriteLock(LockList locks, String extension, String extensionEntityFullyQualifiedName)
- throws AsterixException;
+ throws AlgebricksException;
/**
* Upgrade a previously acquired exclusive modification lock on the dataset to a write lock
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/INcApplicationContext.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/INcApplicationContext.java
index 548907c..8afa66d 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/INcApplicationContext.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/INcApplicationContext.java
@@ -24,12 +24,12 @@
import org.apache.asterix.common.context.IStorageComponentProvider;
import org.apache.asterix.common.exceptions.ACIDException;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.replication.IRemoteRecoveryManager;
import org.apache.asterix.common.replication.IReplicaResourcesManager;
import org.apache.asterix.common.replication.IReplicationChannel;
import org.apache.asterix.common.replication.IReplicationManager;
import org.apache.asterix.common.transactions.ITransactionSubsystem;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.application.INCServiceContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.io.IIOManager;
@@ -68,7 +68,7 @@
ILSMOperationTracker getLSMBTreeOperationTracker(int datasetID);
- void initialize(boolean initialRun) throws IOException, ACIDException, AsterixException;
+ void initialize(boolean initialRun) throws IOException, ACIDException, AlgebricksException;
void setShuttingdown(boolean b);
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
index 3948ea6..7616aed 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
@@ -27,6 +27,7 @@
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.event.schema.cluster.Node;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.config.IOption;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.exceptions.HyracksException;
@@ -115,7 +116,7 @@
* @param nodePartitions
* @throws AsterixException
*/
- void registerNodePartitions(String nodeId, ClusterPartition[] nodePartitions) throws AsterixException;
+ void registerNodePartitions(String nodeId, ClusterPartition[] nodePartitions) throws AlgebricksException;
/**
* De-register the specified node's partitions from this cluster state manager
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IDataParserFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IDataParserFactory.java
index de104d4..b1c6428 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IDataParserFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IDataParserFactory.java
@@ -22,9 +22,9 @@
import java.util.List;
import java.util.Map;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.external.api.IExternalDataSourceFactory.DataSourceType;
import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
public interface IDataParserFactory extends Serializable {
@@ -34,7 +34,6 @@
* an instance of IDataParserFactory with RECORDS data source type must implement IRecordDataParserFactory
* <T>
* an instance of IDataParserFactory with STREAM data source type must implement IStreamDataParserFactory
- * @throws AsterixException
*/
public DataSourceType getDataSourceType();
@@ -44,7 +43,7 @@
*
* @param configuration
*/
- public void configure(Map<String, String> configuration) throws AsterixException;
+ public void configure(Map<String, String> configuration) throws AlgebricksException;
/**
* Set the record type expected to be produced by parsers created by this factory
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
index 2b5e248..ac474a5 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
@@ -26,7 +26,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.RuntimeDataException;
import org.apache.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
@@ -573,32 +572,27 @@
JList list = pointable.ordered() ? new JOrderedList(listType) : new JUnorderedList(listType);
IJObject listItem;
int index = 0;
- try {
- for (IVisitablePointable itemPointable : items) {
- IVisitablePointable itemTagPointable = itemTags.get(index);
- ATypeTag itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(itemTagPointable.getByteArray()[itemTagPointable.getStartOffset()]);
- IAType fieldType;
- fieldType = TypeTagUtil.getBuiltinTypeByTag(itemTypeTag);
- typeInfo.reset(fieldType, itemTypeTag);
- switch (itemTypeTag) {
- case OBJECT:
- listItem = pointableVisitor.visit((ARecordVisitablePointable) itemPointable, typeInfo);
- break;
- case MULTISET:
- case ARRAY:
- listItem = pointableVisitor.visit((AListVisitablePointable) itemPointable, typeInfo);
- break;
- case ANY:
- throw new RuntimeDataException(ErrorCode.LIBRARY_JOBJECT_ACCESSOR_CANNOT_PARSE_TYPE,
- listType.getTypeTag());
- default:
- listItem = pointableVisitor.visit((AFlatValuePointable) itemPointable, typeInfo);
- }
- list.add(listItem);
+ for (IVisitablePointable itemPointable : items) {
+ IVisitablePointable itemTagPointable = itemTags.get(index);
+ ATypeTag itemTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER
+ .deserialize(itemTagPointable.getByteArray()[itemTagPointable.getStartOffset()]);
+ final IAType fieldType = TypeTagUtil.getBuiltinTypeByTag(itemTypeTag);
+ typeInfo.reset(fieldType, itemTypeTag);
+ switch (itemTypeTag) {
+ case OBJECT:
+ listItem = pointableVisitor.visit((ARecordVisitablePointable) itemPointable, typeInfo);
+ break;
+ case MULTISET:
+ case ARRAY:
+ listItem = pointableVisitor.visit((AListVisitablePointable) itemPointable, typeInfo);
+ break;
+ case ANY:
+ throw new RuntimeDataException(ErrorCode.LIBRARY_JOBJECT_ACCESSOR_CANNOT_PARSE_TYPE,
+ listType.getTypeTag());
+ default:
+ listItem = pointableVisitor.visit((AFlatValuePointable) itemPointable, typeInfo);
}
- } catch (AsterixException exception) {
- throw HyracksDataException.create(exception);
+ list.add(listItem);
}
return list;
}
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RecordWithMetadataParserFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RecordWithMetadataParserFactory.java
index c7bf447..d34b5e0 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RecordWithMetadataParserFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/factory/RecordWithMetadataParserFactory.java
@@ -23,7 +23,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.external.api.IRecordDataParser;
import org.apache.asterix.external.api.IRecordDataParserFactory;
@@ -35,14 +34,15 @@
import org.apache.asterix.external.util.ExternalDataCompatibilityUtils;
import org.apache.asterix.external.util.ExternalDataConstants;
import org.apache.asterix.om.types.ARecordType;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
public class RecordWithMetadataParserFactory<I, O> implements IRecordDataParserFactory<I> {
private static final long serialVersionUID = 1L;
- private static final List<String> parserFormats = Collections
- .unmodifiableList(Arrays.asList("record-with-metadata"));
+ private static final List<String> parserFormats =
+ Collections.unmodifiableList(Arrays.asList("record-with-metadata"));
private ARecordType metaType;
private ARecordType recordType;
private IRecordDataParserFactory<O> recordParserFactory;
@@ -50,16 +50,16 @@
@SuppressWarnings("unchecked")
@Override
- public void configure(Map<String, String> configuration) throws AsterixException {
+ public void configure(Map<String, String> configuration) throws AlgebricksException {
// validate first
String recordFormat = configuration.get(ExternalDataConstants.KEY_RECORD_FORMAT);
if (recordFormat == null) {
- throw new AsterixException(ErrorCode.UNKNOWN_RECORD_FORMAT_FOR_META_PARSER,
+ throw AlgebricksException.create(ErrorCode.UNKNOWN_RECORD_FORMAT_FOR_META_PARSER,
ExternalDataConstants.KEY_FORMAT);
}
String format = configuration.get(ExternalDataConstants.KEY_FORMAT);
if (format == null) {
- throw new AsterixException(ErrorCode.UNKNOWN_RECORD_FORMAT_FOR_META_PARSER,
+ throw AlgebricksException.create(ErrorCode.UNKNOWN_RECORD_FORMAT_FOR_META_PARSER,
ExternalDataConstants.KEY_FORMAT);
}
// Create Parser Factory
diff --git a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
index 7284979..42f1f99 100644
--- a/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
+++ b/asterixdb/asterix-external-data/src/test/java/org/apache/asterix/external/parser/factory/TestRecordWithPKParserFactory.java
@@ -23,7 +23,6 @@
import java.util.Map;
import java.util.TreeMap;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.external.api.IRecordDataParser;
import org.apache.asterix.external.api.IRecordDataParserFactory;
import org.apache.asterix.external.input.record.RecordWithPK;
@@ -32,6 +31,7 @@
import org.apache.asterix.external.util.ExternalDataConstants;
import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.om.types.IAType;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -49,7 +49,7 @@
private int[][] pkIndexes;
@Override
- public void configure(Map<String, String> configuration) throws AsterixException {
+ public void configure(Map<String, String> configuration) throws AlgebricksException {
TreeMap<String, String> parserConf = new TreeMap<String, String>();
format = configuration.get(ExternalDataConstants.KEY_RECORD_FORMAT);
parserFormats.add(format);
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IClusterManager.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IClusterManager.java
index 4acd673..8459f70 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IClusterManager.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/api/IClusterManager.java
@@ -29,15 +29,15 @@
/**
* @param node
- * @throws AsterixException
+ * @throws Exception
*/
- public void addNode(ICcApplicationContext appCtx, Node node) throws AsterixException;
+ public void addNode(ICcApplicationContext appCtx, Node node) throws Exception;
/**
* @param node
- * @throws AsterixException
+ * @throws Exception
*/
- public void removeNode(Node node) throws AsterixException;
+ public void removeNode(Node node) throws Exception;
/**
* @param subscriber
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManager.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManager.java
index 1b4f5dc..c1c19a4 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManager.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManager.java
@@ -91,42 +91,36 @@
}
@Override
- public void addNode(ICcApplicationContext appCtx, Node node) throws AsterixException {
- try {
- Cluster cluster = ClusterProperties.INSTANCE.getCluster();
- List<Pattern> pattern = new ArrayList<>();
- String asterixInstanceName = appCtx.getMetadataProperties().getInstanceName();
- Patterns prepareNode = PatternCreator.INSTANCE.createPrepareNodePattern(asterixInstanceName,
- ClusterProperties.INSTANCE.getCluster(), node);
- cluster.getNode().add(node);
- client.submit(prepareNode);
+ public void addNode(ICcApplicationContext appCtx, Node node) throws Exception {
+ Cluster cluster = ClusterProperties.INSTANCE.getCluster();
+ List<Pattern> pattern = new ArrayList<>();
+ String asterixInstanceName = appCtx.getMetadataProperties().getInstanceName();
+ Patterns prepareNode = PatternCreator.INSTANCE.createPrepareNodePattern(asterixInstanceName,
+ ClusterProperties.INSTANCE.getCluster(), node);
+ cluster.getNode().add(node);
+ client.submit(prepareNode);
- ExternalProperties externalProps = appCtx.getExternalProperties();
- AsterixEventServiceUtil.poulateClusterEnvironmentProperties(cluster, externalProps.getCCJavaParams(),
- externalProps.getNCJavaParams());
+ ExternalProperties externalProps = appCtx.getExternalProperties();
+ AsterixEventServiceUtil.poulateClusterEnvironmentProperties(cluster, externalProps.getCCJavaParams(),
+ externalProps.getNCJavaParams());
- pattern.clear();
- String ccHost = cluster.getMasterNode().getClusterIp();
- String hostId = node.getId();
- String nodeControllerId = asterixInstanceName + "_" + node.getId();
- String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
- Pattern startNC =
- PatternCreator.INSTANCE.createNCStartPattern(ccHost, hostId, nodeControllerId, iodevices, false);
- pattern.add(startNC);
- Patterns startNCPattern = new Patterns(pattern);
- client.submit(startNCPattern);
+ pattern.clear();
+ String ccHost = cluster.getMasterNode().getClusterIp();
+ String hostId = node.getId();
+ String nodeControllerId = asterixInstanceName + "_" + node.getId();
+ String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
+ Pattern startNC =
+ PatternCreator.INSTANCE.createNCStartPattern(ccHost, hostId, nodeControllerId, iodevices, false);
+ pattern.add(startNC);
+ Patterns startNCPattern = new Patterns(pattern);
+ client.submit(startNCPattern);
- removeNode(cluster.getSubstituteNodes().getNode(), node);
+ removeNode(cluster.getSubstituteNodes().getNode(), node);
- AsterixInstance instance = lookupService.getAsterixInstance(cluster.getInstanceName());
- instance.getCluster().getNode().add(node);
- removeNode(instance.getCluster().getSubstituteNodes().getNode(), node);
- lookupService.updateAsterixInstance(instance);
-
- } catch (Exception e) {
- throw new AsterixException(e);
- }
-
+ AsterixInstance instance = lookupService.getAsterixInstance(cluster.getInstanceName());
+ instance.getCluster().getNode().add(node);
+ removeNode(instance.getCluster().getSubstituteNodes().getNode(), node);
+ lookupService.updateAsterixInstance(instance);
}
private void removeNode(List<Node> list, Node node) {
@@ -146,7 +140,7 @@
}
@Override
- public void removeNode(Node node) throws AsterixException {
+ public void removeNode(Node node) {
// to be implemented later.
}
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManagerProvider.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManagerProvider.java
index d11e70d..2b7c9df 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManagerProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/cluster/ClusterManagerProvider.java
@@ -58,12 +58,12 @@
}
private static class NoopClusterManager implements IClusterManager {
@Override
- public void addNode(ICcApplicationContext appCtx, Node node) throws AsterixException {
+ public void addNode(ICcApplicationContext appCtx, Node node) {
// no-op
}
@Override
- public void removeNode(Node node) throws AsterixException {
+ public void removeNode(Node node) {
// no-op
}
@@ -83,7 +83,7 @@
}
@Override
- public void notifyStartupCompleted() throws Exception {
+ public void notifyStartupCompleted() {
// no-op
}
}
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
index b13f4c2..91030bf 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
@@ -65,17 +65,13 @@
if (isPKAutoGenerated) {
// Since the key is auto-generated, we need to use another
// record type (possibly nested) which has all fields except the PK
- try {
- recType = getStrippedPKType(new LinkedList<>(partitioningKeys.get(0)), recType);
- } catch (AsterixException e) {
- throw new AlgebricksException(e);
- }
+ recType = getStrippedPKType(new LinkedList<>(partitioningKeys.get(0)), recType);
}
schemaTypes = new IAType[] { recType };
}
private ARecordType getStrippedPKType(List<String> partitioningKeys, ARecordType recType)
- throws AsterixException, HyracksDataException {
+ throws AlgebricksException, HyracksDataException {
List<String> fieldNames = new LinkedList<>();
List<IAType> fieldTypes = new LinkedList<>();
int j = 0;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
index 3f9c002..3de83eb 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
@@ -99,7 +99,7 @@
}
public static void validateFeed(Feed feed, MetadataTransactionContext mdTxnCtx, ICcApplicationContext appCtx)
- throws AsterixException {
+ throws AlgebricksException {
try {
String adapterName = feed.getAdapterName();
Map<String, String> configuration = feed.getAdapterConfiguration();
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/MetadataLockManager.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/MetadataLockManager.java
index 779fe2a..61bcbc7 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/MetadataLockManager.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/lock/MetadataLockManager.java
@@ -22,7 +22,6 @@
import java.util.function.Function;
import org.apache.asterix.common.api.IMetadataLockManager;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.metadata.IMetadataLock;
import org.apache.asterix.common.metadata.LockList;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -49,147 +48,149 @@
}
@Override
- public void acquireDataverseReadLock(LockList locks, String dataverseName) throws AsterixException {
+ public void acquireDataverseReadLock(LockList locks, String dataverseName) throws AlgebricksException {
String key = DATAVERSE_PREFIX + dataverseName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireDataverseWriteLock(LockList locks, String dataverseName) throws AsterixException {
+ public void acquireDataverseWriteLock(LockList locks, String dataverseName) throws AlgebricksException {
String key = DATAVERSE_PREFIX + dataverseName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireDatasetReadLock(LockList locks, String datasetName) throws AsterixException {
+ public void acquireDatasetReadLock(LockList locks, String datasetName) throws AlgebricksException {
String key = DATASET_PREFIX + datasetName;
DatasetLock lock = (DatasetLock) mdlocks.computeIfAbsent(key, DATASET_LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireDatasetWriteLock(LockList locks, String datasetName) throws AsterixException {
+ public void acquireDatasetWriteLock(LockList locks, String datasetName) throws AlgebricksException {
String key = DATASET_PREFIX + datasetName;
DatasetLock lock = (DatasetLock) mdlocks.computeIfAbsent(key, DATASET_LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireDatasetModifyLock(LockList locks, String datasetName) throws AsterixException {
+ public void acquireDatasetModifyLock(LockList locks, String datasetName) throws AlgebricksException {
String key = DATASET_PREFIX + datasetName;
DatasetLock lock = (DatasetLock) mdlocks.computeIfAbsent(key, DATASET_LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.MODIFY, lock);
}
@Override
- public void acquireDatasetCreateIndexLock(LockList locks, String datasetName) throws AsterixException {
+ public void acquireDatasetCreateIndexLock(LockList locks, String datasetName) throws AlgebricksException {
String dsKey = DATASET_PREFIX + datasetName;
DatasetLock lock = (DatasetLock) mdlocks.computeIfAbsent(dsKey, DATASET_LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.INDEX_BUILD, lock);
}
@Override
- public void acquireDatasetExclusiveModificationLock(LockList locks, String datasetName) throws AsterixException {
+ public void acquireDatasetExclusiveModificationLock(LockList locks, String datasetName) throws AlgebricksException {
String key = DATASET_PREFIX + datasetName;
DatasetLock lock = (DatasetLock) mdlocks.computeIfAbsent(key, DATASET_LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.EXCLUSIVE_MODIFY, lock);
}
@Override
- public void acquireFunctionReadLock(LockList locks, String functionName) throws AsterixException {
+ public void acquireFunctionReadLock(LockList locks, String functionName) throws AlgebricksException {
String key = FUNCTION_PREFIX + functionName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireFunctionWriteLock(LockList locks, String functionName) throws AsterixException {
+ public void acquireFunctionWriteLock(LockList locks, String functionName) throws AlgebricksException {
String key = FUNCTION_PREFIX + functionName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireNodeGroupReadLock(LockList locks, String nodeGroupName) throws AsterixException {
+ public void acquireNodeGroupReadLock(LockList locks, String nodeGroupName) throws AlgebricksException {
String key = NODE_GROUP_PREFIX + nodeGroupName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireNodeGroupWriteLock(LockList locks, String nodeGroupName) throws AsterixException {
+ public void acquireNodeGroupWriteLock(LockList locks, String nodeGroupName) throws AlgebricksException {
String key = NODE_GROUP_PREFIX + nodeGroupName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireActiveEntityReadLock(LockList locks, String entityName) throws AsterixException {
+ public void acquireActiveEntityReadLock(LockList locks, String entityName) throws AlgebricksException {
String key = ACTIVE_PREFIX + entityName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireActiveEntityWriteLock(LockList locks, String entityName) throws AsterixException {
+ public void acquireActiveEntityWriteLock(LockList locks, String entityName) throws AlgebricksException {
String key = ACTIVE_PREFIX + entityName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireFeedPolicyWriteLock(LockList locks, String feedPolicyName) throws AsterixException {
+ public void acquireFeedPolicyWriteLock(LockList locks, String feedPolicyName) throws AlgebricksException {
String key = FEED_POLICY_PREFIX + feedPolicyName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireFeedPolicyReadLock(LockList locks, String feedPolicyName) throws AsterixException {
+ public void acquireFeedPolicyReadLock(LockList locks, String feedPolicyName) throws AlgebricksException {
String key = FEED_POLICY_PREFIX + feedPolicyName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireMergePolicyReadLock(LockList locks, String mergePolicyName) throws AsterixException {
+ public void acquireMergePolicyReadLock(LockList locks, String mergePolicyName) throws AlgebricksException {
String key = MERGE_POLICY_PREFIX + mergePolicyName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireMergePolicyWriteLock(LockList locks, String mergePolicyName) throws AsterixException {
+ public void acquireMergePolicyWriteLock(LockList locks, String mergePolicyName) throws AlgebricksException {
String key = MERGE_POLICY_PREFIX + mergePolicyName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireDataTypeReadLock(LockList locks, String datatypeName) throws AsterixException {
+ public void acquireDataTypeReadLock(LockList locks, String datatypeName) throws AlgebricksException {
String key = DATATYPE_PREFIX + datatypeName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireDataTypeWriteLock(LockList locks, String datatypeName) throws AsterixException {
+ public void acquireDataTypeWriteLock(LockList locks, String datatypeName) throws AlgebricksException {
String key = DATATYPE_PREFIX + datatypeName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
}
@Override
- public void acquireExtensionReadLock(LockList locks, String extension, String entityName) throws AsterixException {
+ public void acquireExtensionReadLock(LockList locks, String extension, String entityName)
+ throws AlgebricksException {
String key = EXTENSION_PREFIX + extension + entityName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.READ, lock);
}
@Override
- public void acquireExtensionWriteLock(LockList locks, String extension, String entityName) throws AsterixException {
+ public void acquireExtensionWriteLock(LockList locks, String extension, String entityName)
+ throws AlgebricksException {
String key = EXTENSION_PREFIX + extension + entityName;
IMetadataLock lock = mdlocks.computeIfAbsent(key, LOCK_FUNCTION);
locks.add(IMetadataLock.Mode.WRITE, lock);
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/MetadataLockUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/MetadataLockUtil.java
index 4cf25f7..baac712 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/MetadataLockUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/MetadataLockUtil.java
@@ -19,8 +19,8 @@
package org.apache.asterix.metadata.utils;
import org.apache.asterix.common.api.IMetadataLockManager;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.metadata.LockList;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
public class MetadataLockUtil {
@@ -30,7 +30,7 @@
public static void createDatasetBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
String itemTypeDataverseName, String itemTypeFullyQualifiedName, String metaItemTypeDataverseName,
String metaItemTypeFullyQualifiedName, String nodeGroupName, String compactionPolicyName,
- String datasetFullyQualifiedName, boolean isDefaultCompactionPolicy) throws AsterixException {
+ String datasetFullyQualifiedName, boolean isDefaultCompactionPolicy) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
if (!dataverseName.equals(itemTypeDataverseName)) {
lockMgr.acquireDataverseReadLock(locks, itemTypeDataverseName);
@@ -54,113 +54,113 @@
}
public static void createIndexBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetCreateIndexLock(locks, datasetFullyQualifiedName);
}
public static void dropIndexBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetWriteLock(locks, datasetFullyQualifiedName);
}
public static void createTypeBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String itemTypeFullyQualifiedName) throws AsterixException {
+ String itemTypeFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDataTypeWriteLock(locks, itemTypeFullyQualifiedName);
}
public static void dropDatasetBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetWriteLock(locks, datasetFullyQualifiedName);
}
public static void dropTypeBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String dataTypeFullyQualifiedName) throws AsterixException {
+ String dataTypeFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDataTypeWriteLock(locks, dataTypeFullyQualifiedName);
}
public static void functionStatementBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String functionFullyQualifiedName) throws AsterixException {
+ String functionFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireFunctionWriteLock(locks, functionFullyQualifiedName);
}
public static void modifyDatasetBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetModifyLock(locks, datasetFullyQualifiedName);
}
public static void insertDeleteUpsertBegin(IMetadataLockManager lockMgr, LockList locks,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks,
MetadataUtil.getDataverseFromFullyQualifiedName(datasetFullyQualifiedName));
lockMgr.acquireDatasetModifyLock(locks, datasetFullyQualifiedName);
}
public static void dropFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String feedFullyQualifiedName) throws AsterixException {
+ String feedFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityWriteLock(locks, feedFullyQualifiedName);
}
public static void dropFeedPolicyBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String policyName) throws AsterixException {
+ String policyName) throws AlgebricksException {
lockMgr.acquireActiveEntityWriteLock(locks, policyName);
lockMgr.acquireDataverseReadLock(locks, dataverseName);
}
public static void startFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String feedName) throws AsterixException {
+ String feedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityReadLock(locks, feedName);
}
public static void stopFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String feedName) throws AsterixException {
+ String feedName) throws AlgebricksException {
// TODO: dataset lock?
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityReadLock(locks, feedName);
}
public static void createFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String feedFullyQualifiedName) throws AsterixException {
+ String feedFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityWriteLock(locks, feedFullyQualifiedName);
}
public static void connectFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName, String feedFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName, String feedFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityReadLock(locks, feedFullyQualifiedName);
lockMgr.acquireDatasetReadLock(locks, datasetFullyQualifiedName);
}
public static void createFeedPolicyBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String policyName) throws AsterixException {
+ String policyName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireFeedPolicyWriteLock(locks, policyName);
}
public static void disconnectFeedBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName, String feedFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName, String feedFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireActiveEntityReadLock(locks, feedFullyQualifiedName);
lockMgr.acquireDatasetReadLock(locks, datasetFullyQualifiedName);
}
public static void compactBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetReadLock(locks, datasetFullyQualifiedName);
}
public static void refreshDatasetBegin(IMetadataLockManager lockMgr, LockList locks, String dataverseName,
- String datasetFullyQualifiedName) throws AsterixException {
+ String datasetFullyQualifiedName) throws AlgebricksException {
lockMgr.acquireDataverseReadLock(locks, dataverseName);
lockMgr.acquireDatasetExclusiveModificationLock(locks, datasetFullyQualifiedName);
}
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryCorrelatedRTreeOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryCorrelatedRTreeOperationsHelper.java
index b663b42..9106193 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryCorrelatedRTreeOperationsHelper.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryCorrelatedRTreeOperationsHelper.java
@@ -155,7 +155,7 @@
}
@Override
- public JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException {
+ public JobSpecification buildLoadingJobSpec() throws AlgebricksException {
/***************************************************
* [ About PointMBR Optimization ]
* Instead of storing a MBR(4 doubles) for a point(2 doubles) in RTree leaf node,
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java
index 1726470..b11b527 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java
@@ -172,7 +172,7 @@
}
@Override
- public JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException {
+ public JobSpecification buildLoadingJobSpec() throws AlgebricksException {
/***************************************************
* [ About PointMBR Optimization ]
* Instead of storing a MBR(4 doubles) for a point(2 doubles) in RTree leaf node,
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
index df720f1..9307627 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
@@ -25,7 +25,6 @@
import java.util.List;
import org.apache.asterix.builders.OrderedListBuilder;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
import org.apache.asterix.om.base.AOrderedList;
import org.apache.asterix.om.base.IAObject;
@@ -97,7 +96,7 @@
}
AOrderedListType type = new AOrderedListType(currentItemType, "orderedlist");
return new AOrderedList(type, items);
- } catch (AsterixException | IOException e) {
+ } catch (IOException e) {
throw HyracksDataException.create(e);
}
}
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
index b9afeb0..438a9bf 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
@@ -36,6 +36,7 @@
import org.apache.asterix.om.types.IAType;
import org.apache.asterix.om.types.TypeTagUtil;
import org.apache.asterix.om.utils.NonTaggedFormatUtil;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
@@ -98,7 +99,7 @@
}
AUnorderedListType type = new AUnorderedListType(currentItemType, "unorderedlist");
return new AUnorderedList(type, items);
- } catch (AsterixException | IOException e) {
+ } catch (IOException e) {
throw HyracksDataException.create(e);
}
}
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/PointableAllocator.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/PointableAllocator.java
index 3322924..5f463e6 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/PointableAllocator.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/PointableAllocator.java
@@ -19,7 +19,6 @@
package org.apache.asterix.om.pointables;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.om.pointables.base.DefaultOpenFieldType;
import org.apache.asterix.om.pointables.base.IVisitablePointable;
import org.apache.asterix.om.types.AOrderedListType;
@@ -30,6 +29,7 @@
import org.apache.asterix.om.util.container.IObjectFactory;
import org.apache.asterix.om.util.container.IObjectPool;
import org.apache.asterix.om.util.container.ListObjectPool;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
/**
* This class is the ONLY place to create IVisitablePointable object instances,
@@ -95,7 +95,7 @@
* @param typeTag
* @return the pointable object
*/
- public IVisitablePointable allocateFieldValue(ATypeTag typeTag, byte[] b, int offset) throws AsterixException {
+ public IVisitablePointable allocateFieldValue(ATypeTag typeTag, byte[] b, int offset) throws HyracksDataException {
if (typeTag == null)
return flatValueAllocator.allocate(null);
else if (typeTag.equals(ATypeTag.OBJECT))
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
index 7a2efe0..114ff2b 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
@@ -190,7 +190,7 @@
}
public void getItemValue(AbstractCollectionType inputType, int index, DataOutput dOut)
- throws IOException, AsterixException {
+ throws IOException {
if (getType() != ATypeTag.ANY.serialize()) {
dOut.writeByte(getType());
}
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
index 0aa256f..af7e29f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
@@ -220,7 +220,7 @@
// -----------------------
public void getClosedFieldValue(ARecordType recordType, int fieldId, DataOutput dOut)
- throws IOException, AsterixException {
+ throws IOException {
if (isClosedFieldNull(recordType, fieldId)) {
dOut.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
} else if (isClosedFieldMissing(recordType, fieldId)) {
@@ -287,7 +287,7 @@
// -----------------------
public void getOpenFieldValue(ARecordType recordType, int fieldId, DataOutput dOut)
- throws IOException, AsterixException {
+ throws IOException {
dOut.write(bytes, getOpenFieldValueOffset(recordType, fieldId), getOpenFieldValueSize(recordType, fieldId));
}
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/TypeTagUtil.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/TypeTagUtil.java
index 5d91d2f..cfc1b55 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/TypeTagUtil.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/TypeTagUtil.java
@@ -18,13 +18,13 @@
*/
package org.apache.asterix.om.types;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.om.utils.RecordUtil;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
public class TypeTagUtil {
- public static IAType getBuiltinTypeByTag(ATypeTag typeTag) throws AsterixException {
+ public static IAType getBuiltinTypeByTag(ATypeTag typeTag) throws HyracksDataException {
switch (typeTag) {
case TINYINT:
return BuiltinType.AINT8;
@@ -89,7 +89,8 @@
case ARRAY:
return AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE;
default:
- throw new AsterixException("Typetag " + typeTag + " is not a built-in type");
+ // TODO(tillw) should be an internal error
+ throw new HyracksDataException("Typetag " + typeTag + " is not a built-in type");
}
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java
index 0c397f0..1faf75c 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/comparisons/DeepEqualAssessor.java
@@ -43,7 +43,7 @@
private final DeepEqualityVisitor equalityVisitor = new DeepEqualityVisitor();
public boolean isEqual(IVisitablePointable leftPointable, IVisitablePointable rightPointable)
- throws HyracksDataException, AsterixException {
+ throws HyracksDataException {
if (leftPointable == null || rightPointable == null) {
return false;
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java
index 5a293f3..df8fc75 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java
@@ -21,7 +21,6 @@
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.om.pointables.base.IVisitablePointable;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.EnumDeserializer;
@@ -41,8 +40,8 @@
*/
public class PointableHelper {
- private static final IBinaryComparator STRING_BINARY_COMPARATOR = PointableBinaryComparatorFactory.of(
- UTF8StringPointable.FACTORY).createBinaryComparator();
+ private static final IBinaryComparator STRING_BINARY_COMPARATOR =
+ PointableBinaryComparatorFactory.of(UTF8StringPointable.FACTORY).createBinaryComparator();
private final UTF8StringWriter utf8Writer;
public PointableHelper() {
@@ -112,7 +111,7 @@
* @param writeTag
* Specifying whether a tag for the string should also be written
*/
- public void serializeString(String str, IMutableValueStorage vs, boolean writeTag) throws AsterixException {
+ public void serializeString(String str, IMutableValueStorage vs, boolean writeTag) throws HyracksDataException {
vs.reset();
try {
DataOutput output = vs.getDataOutput();
@@ -121,7 +120,7 @@
}
utf8Writer.writeUTF8(str, output);
} catch (IOException e) {
- throw new AsterixException("Could not serialize " + str);
+ throw new HyracksDataException("Could not serialize " + str);
}
}
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java
index 72d2e69..2019b55 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldsEvalFactory.java
@@ -78,8 +78,6 @@
rfu.processRecord(recordPointable, recordType, out, 0);
} catch (IOException e) {
throw new HyracksDataException(e);
- } catch (AsterixException e) {
- throw new HyracksDataException(e);
}
result.set(resultStorage);
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
index 97a9ee0..71a8291 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordAddFieldsDescriptor.java
@@ -113,12 +113,8 @@
final ArrayBackedValueStorage fieldNamePointable = new ArrayBackedValueStorage();
final ArrayBackedValueStorage fieldValuePointer = new ArrayBackedValueStorage();
final PointableHelper pointableHelper = new PointableHelper();
- try {
- pointableHelper.serializeString("field-name", fieldNamePointable, true);
- pointableHelper.serializeString("field-value", fieldValuePointer, true);
- } catch (AsterixException e) {
- throw new HyracksDataException(e);
- }
+ pointableHelper.serializeString("field-name", fieldNamePointable, true);
+ pointableHelper.serializeString("field-value", fieldValuePointer, true);
return new IScalarEvaluator() {
public static final int TABLE_FRAME_SIZE = 32768; // the default 32k frame size
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java
index 6127c28..6c0eb06 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordFieldsUtil.java
@@ -82,7 +82,7 @@
private final static ARecordType openType = DefaultOpenFieldType.NESTED_OPEN_RECORD_TYPE;
public void processRecord(ARecordPointable recordAccessor, ARecordType recType, DataOutput out, int level)
- throws IOException, AsterixException {
+ throws IOException {
if (level == 0) {
// Resets pools for recycling objects before processing a top-level record.
resetPools();
@@ -176,7 +176,7 @@
}
public void addNameField(IValueReference nameArg, IARecordBuilder fieldRecordBuilder)
- throws HyracksDataException, AsterixException {
+ throws HyracksDataException {
ArrayBackedValueStorage fieldAbvs = getTempBuffer();
fieldAbvs.reset();
@@ -185,7 +185,7 @@
}
public void addFieldType(byte tagId, IARecordBuilder fieldRecordBuilder)
- throws HyracksDataException, AsterixException {
+ throws HyracksDataException {
ArrayBackedValueStorage fieldAbvs = getTempBuffer();
ArrayBackedValueStorage valueAbvs = getTempBuffer();
@@ -202,7 +202,7 @@
}
public void addIsOpenField(boolean isOpen, IARecordBuilder fieldRecordBuilder)
- throws HyracksDataException, AsterixException {
+ throws HyracksDataException {
ArrayBackedValueStorage fieldAbvs = getTempBuffer();
ArrayBackedValueStorage valueAbvs = getTempBuffer();
@@ -220,7 +220,7 @@
}
public void addListField(IValueReference listArg, IAType fieldType, IARecordBuilder fieldRecordBuilder, int level)
- throws AsterixException, IOException {
+ throws IOException {
ArrayBackedValueStorage fieldAbvs = getTempBuffer();
ArrayBackedValueStorage valueAbvs = getTempBuffer();
@@ -234,7 +234,7 @@
}
public void addNestedField(IValueReference recordArg, IAType fieldType, IARecordBuilder fieldRecordBuilder,
- int level) throws IOException, AsterixException {
+ int level) throws IOException {
ArrayBackedValueStorage fieldAbvs = getTempBuffer();
ArrayBackedValueStorage valueAbvs = getTempBuffer();
@@ -256,7 +256,7 @@
}
public void processListValue(IValueReference listArg, IAType fieldType, DataOutput out, int level)
- throws AsterixException, IOException {
+ throws IOException {
ArrayBackedValueStorage itemValue = getTempBuffer();
IARecordBuilder listRecordBuilder = getRecordBuilder();
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
index ce7ed6e..63b58ed 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordMergeDescriptor.java
@@ -24,7 +24,6 @@
import java.util.List;
import org.apache.asterix.builders.RecordBuilder;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.exceptions.RuntimeDataException;
import org.apache.asterix.om.functions.BuiltinFunctions;
@@ -132,7 +131,7 @@
try {
mergeFields(outRecType, rp0, rp1, true, 0);
rbStack.get(0).write(out, true);
- } catch (IOException | AsterixException e) {
+ } catch (IOException e) {
throw new HyracksDataException(e);
}
result.set(resultStorage);
@@ -140,7 +139,7 @@
private void mergeFields(ARecordType combinedType, ARecordVisitablePointable leftRecord,
ARecordVisitablePointable rightRecord, boolean openFromParent, int nestedLevel)
- throws IOException, AsterixException, HyracksDataException {
+ throws IOException {
if (rbStack.size() < (nestedLevel + 1)) {
rbStack.add(new RecordBuilder());
}
@@ -207,7 +206,7 @@
*/
private void addFieldToSubRecord(ARecordType combinedType, IVisitablePointable fieldNamePointable,
IVisitablePointable leftValue, IVisitablePointable rightValue, boolean openFromParent,
- int nestedLevel) throws IOException, AsterixException, HyracksDataException {
+ int nestedLevel) throws IOException {
runtimeRecordTypeInfo.reset(combinedType);
int pos = runtimeRecordTypeInfo.getFieldIndex(fieldNamePointable.getByteArray(),
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordRemoveFieldsEvalFactory.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordRemoveFieldsEvalFactory.java
index 2f55cd7..74f7259 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordRemoveFieldsEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/RecordRemoveFieldsEvalFactory.java
@@ -118,7 +118,7 @@
rbStack.clear();
processRecord(requiredRecType, recordPointable, listPointable, 0);
rbStack.get(0).write(out, true);
- } catch (IOException | AsterixException e) {
+ } catch (IOException e) {
throw new HyracksDataException(e);
}
result.set(resultStorage);
@@ -126,7 +126,7 @@
private void processRecord(ARecordType requiredType, ARecordVisitablePointable srp,
AListVisitablePointable inputList, int nestedLevel)
- throws IOException, AsterixException, HyracksDataException {
+ throws IOException {
if (rbStack.size() < (nestedLevel + 1)) {
rbStack.add(new RecordBuilder());
}
@@ -157,7 +157,7 @@
private void addKeptFieldToSubRecord(ARecordType requiredType, IVisitablePointable fieldNamePointable,
IVisitablePointable fieldValuePointable, IVisitablePointable fieldTypePointable,
AListVisitablePointable inputList, int nestedLevel)
- throws IOException, AsterixException, HyracksDataException {
+ throws IOException {
runtimeRecordTypeInfo.reset(requiredType);
int pos = runtimeRecordTypeInfo.getFieldIndex(fieldNamePointable.getByteArray(),
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
index 4664938..4855a27 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java
@@ -330,7 +330,7 @@
appender.write(writer, true);
}
- private void appendFilterToPrevTuple() throws IOException, AsterixException {
+ private void appendFilterToPrevTuple() throws IOException {
if (isFiltered) {
prevRecWithPKWithFilterValue.reset();
for (int i = 0; i < prevTuple.getFieldCount(); i++) {
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
index 855031e..0bd8b9e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
@@ -44,6 +44,7 @@
import org.apache.asterix.common.replication.IFaultToleranceStrategy;
import org.apache.asterix.common.transactions.IResourceIdManager;
import org.apache.asterix.runtime.transaction.ResourceIdManager;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.application.ICCServiceContext;
import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
@@ -86,7 +87,7 @@
ILibraryManager libraryManager, Supplier<IMetadataBootstrap> metadataBootstrapSupplier,
IGlobalRecoveryManager globalRecoveryManager, IFaultToleranceStrategy ftStrategy,
IJobLifecycleListener activeLifeCycleListener, IStorageComponentProvider storageComponentProvider,
- IMetadataLockManager mdLockManager) throws AsterixException, IOException {
+ IMetadataLockManager mdLockManager) throws AlgebricksException, IOException {
this.ccServiceCtx = ccServiceCtx;
this.hcc = hcc;
this.libraryManager = libraryManager;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
index ac83b71..10926e0 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
@@ -44,6 +44,7 @@
import org.apache.asterix.event.schema.cluster.Cluster;
import org.apache.asterix.event.schema.cluster.Node;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.config.IOption;
import org.apache.hyracks.api.config.Section;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -396,7 +397,7 @@
@Override
public synchronized void registerNodePartitions(String nodeId, ClusterPartition[] nodePartitions)
- throws AsterixException {
+ throws AlgebricksException {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Registering node partitions for node " + nodeId + ": " + Arrays.toString(nodePartitions));
}
diff --git a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/datagen/AdmDataGen.java b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/datagen/AdmDataGen.java
index 3b2d0ce..70bf864 100644
--- a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/datagen/AdmDataGen.java
+++ b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/datagen/AdmDataGen.java
@@ -937,7 +937,7 @@
this.outputDir = outputDir;
}
- public void init() throws IOException, ParseException, AsterixException, ACIDException, MetadataException,
+ public void init() throws IOException, ParseException, ACIDException,
AlgebricksException {
FileReader aql = new FileReader(schemaFile);
IParser parser = parserFactory.createParser(aql);
diff --git a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/translator/ADGenDmlTranslator.java b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/translator/ADGenDmlTranslator.java
index 94389b2..9d60995 100644
--- a/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/translator/ADGenDmlTranslator.java
+++ b/asterixdb/asterix-tools/src/test/java/org/apache/asterix/tools/translator/ADGenDmlTranslator.java
@@ -47,7 +47,7 @@
this.aqlStatements = aqlStatements;
}
- public void translate() throws AsterixException, MetadataException, AlgebricksException {
+ public void translate() throws AlgebricksException {
String defaultDataverse = getDefaultDataverse();
types = new HashMap<TypeSignature, IAType>();
typeDataGenMap = new HashMap<TypeSignature, TypeDataGen>();
diff --git a/asterixdb/asterix-transactions/pom.xml b/asterixdb/asterix-transactions/pom.xml
index 5c067e7..b7e1871 100644
--- a/asterixdb/asterix-transactions/pom.xml
+++ b/asterixdb/asterix-transactions/pom.xml
@@ -145,6 +145,10 @@
</dependency>
<dependency>
<groupId>org.apache.hyracks</groupId>
+ <artifactId>algebricks-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
<artifactId>algebricks-runtime</artifactId>
</dependency>
</dependencies>
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/transaction/DatasetIdFactory.java b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/transaction/DatasetIdFactory.java
index 7acefe9..ffc0268 100644
--- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/transaction/DatasetIdFactory.java
+++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/service/transaction/DatasetIdFactory.java
@@ -20,6 +20,7 @@
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
public class DatasetIdFactory {
private static int id = 0;
@@ -34,7 +35,7 @@
isInitialized = true;
}
- public static synchronized int generateDatasetId() throws AsterixException {
+ public static synchronized int generateDatasetId() throws AlgebricksException {
if (id == Integer.MAX_VALUE) {
throw new AsterixException(ErrorCode.DATASET_ID_EXHAUSTED);
}
diff --git a/asterixdb/asterix-yarn/pom.xml b/asterixdb/asterix-yarn/pom.xml
index 0a9fa17..5e67c8e 100644
--- a/asterixdb/asterix-yarn/pom.xml
+++ b/asterixdb/asterix-yarn/pom.xml
@@ -459,6 +459,10 @@
<artifactId>hyracks-control-cc</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>algebricks-common</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
</dependency>
diff --git a/asterixdb/asterix-yarn/src/main/java/org/apache/asterix/aoya/AsterixApplicationMaster.java b/asterixdb/asterix-yarn/src/main/java/org/apache/asterix/aoya/AsterixApplicationMaster.java
index 4a900e1..8aeb718 100644
--- a/asterixdb/asterix-yarn/src/main/java/org/apache/asterix/aoya/AsterixApplicationMaster.java
+++ b/asterixdb/asterix-yarn/src/main/java/org/apache/asterix/aoya/AsterixApplicationMaster.java
@@ -46,7 +46,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.asterix.common.config.GlobalConfig;
-import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.utils.StorageConstants;
import org.apache.asterix.event.schema.yarnCluster.Cluster;
import org.apache.asterix.event.schema.yarnCluster.MasterNode;
@@ -89,6 +88,7 @@
import org.apache.hadoop.yarn.exceptions.YarnException;
import org.apache.hadoop.yarn.util.ConverterUtils;
import org.apache.hadoop.yarn.util.Records;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@@ -383,7 +383,7 @@
LOG.info("Path suffix: " + instanceConfPath);
}
- public boolean init() throws ParseException, IOException, AsterixException, YarnException {
+ public boolean init() throws ParseException, IOException, AlgebricksException, YarnException {
try {
localizeDFSResources();
clusterDesc = Utils.parseYarnClusterConfig(CLUSTER_DESC_PATH);