cosmetic changes
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
index e8f48a6..3b50edc 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/base/LogicalExpressionDeepCopyVisitor.java
@@ -40,7 +40,8 @@
private final Map<LogicalVariable, LogicalVariable> inVarMapping;
private final Map<LogicalVariable, LogicalVariable> outVarMapping;
- public LogicalExpressionDeepCopyVisitor(Counter counter, Map<LogicalVariable, LogicalVariable> inVarMapping, Map<LogicalVariable, LogicalVariable> variableMapping) {
+ public LogicalExpressionDeepCopyVisitor(Counter counter, Map<LogicalVariable, LogicalVariable> inVarMapping,
+ Map<LogicalVariable, LogicalVariable> variableMapping) {
this.counter = counter;
this.inVarMapping = inVarMapping;
this.outVarMapping = variableMapping;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
index 66ae216..7d95978 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/IndexSearchPOperator.java
@@ -68,7 +68,7 @@
}
return keyIndexes;
}
-
+
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op,
IPhysicalPropertiesVector reqdByParent) {
if (requiresBroadcast) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
index 7fc9bcf..10848e8 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/jobgen/AqlLogicalExpressionJobGen.java
@@ -143,7 +143,7 @@
IFunctionDescriptor fd = null;
if (!(expr.getFunctionInfo() instanceof IExternalFunctionInfo)) {
AqlMetadataProvider mp = (AqlMetadataProvider) context.getMetadataProvider();
- IDataFormat format = FormatUtils.getDefaultFormat();
+ IDataFormat format = FormatUtils.getDefaultFormat();
fd = format.resolveFunction(expr, env);
} else {
try {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/handle/IHandle.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/handle/IHandle.java
index 4506654..405f966 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/handle/IHandle.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/handle/IHandle.java
@@ -15,17 +15,16 @@
package edu.uci.ics.asterix.optimizer.handle;
/**
- *
* A handle is a way of accessing an ADM instance or a collection of ADM
* instances nested within another ADM instance.
*
* @author Nicola
- *
*/
public interface IHandle {
public enum HandleType {
- FIELD_INDEX_AND_TYPE, FIELD_NAME
+ FIELD_INDEX_AND_TYPE,
+ FIELD_NAME
}
public HandleType getHandleType();
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
index bf18cdb..05051de 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/AsterixInlineVariablesRule.java
@@ -18,7 +18,7 @@
import edu.uci.ics.hyracks.algebricks.rewriter.rules.InlineVariablesRule;
public class AsterixInlineVariablesRule extends InlineVariablesRule {
-
+
public AsterixInlineVariablesRule() {
// Do not inline field accesses because doing so would interfere with our access method rewrites.
// TODO: For now we must also exclude record constructor functions to avoid breaking our type casting rules
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ByNameToByHandleFieldAccessRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ByNameToByHandleFieldAccessRule.java
index 575490b..69b23f0 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ByNameToByHandleFieldAccessRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ByNameToByHandleFieldAccessRule.java
@@ -75,7 +75,7 @@
AssignOperator assignVar = new AssignOperator(varArray, exprArray);
x = new VariableReferenceExpression(var1);
assignVar.getInputs().add(opUnder);
- opUnder = new MutableObject<ILogicalOperator>(assignVar);
+ opUnder = new MutableObject<ILogicalOperator>(assignVar);
}
// let $t := type-of(x)
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CancelUnnestWithNestedListifyRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CancelUnnestWithNestedListifyRule.java
index 5dd5d27..6e5cb02 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CancelUnnestWithNestedListifyRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CancelUnnestWithNestedListifyRule.java
@@ -271,7 +271,7 @@
raggOp.setPhysicalOperator(raggPOp);
raggOp.getInputs().add(nestedPlanRoot.getInputs().get(0));
gby.getNestedPlans().get(0).getRoots().set(0, new MutableObject<ILogicalOperator>(raggOp));
-
+
opRef.setValue(nestedAssign);
context.computeAndSetTypeEnvironmentForOperator(nestedAssign);
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CountVarToCountOneRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CountVarToCountOneRule.java
index 60eb974..4148aca 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CountVarToCountOneRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/CountVarToCountOneRule.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.optimizer.rules;
-
import org.apache.commons.lang3.mutable.Mutable;
import edu.uci.ics.asterix.om.base.AInt64;
@@ -43,7 +42,8 @@
// It is only for a group-by having just one aggregate which is a count.
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.GROUP) {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractDistinctByExpressionsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractDistinctByExpressionsRule.java
index f2a8a27..cef3d4c 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractDistinctByExpressionsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractDistinctByExpressionsRule.java
@@ -43,7 +43,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.DISTINCT) {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractOrderExpressionsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractOrderExpressionsRule.java
index 962d48c..dfac43c 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractOrderExpressionsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ExtractOrderExpressionsRule.java
@@ -14,8 +14,6 @@
*/
package edu.uci.ics.asterix.optimizer.rules;
-
-
import org.apache.commons.lang3.mutable.Mutable;
import edu.uci.ics.asterix.optimizer.base.AnalysisUtil;
@@ -33,7 +31,7 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.OrderOperator.IOrder;
import edu.uci.ics.hyracks.algebricks.rewriter.rules.AbstractExtractExprRule;
-public class ExtractOrderExpressionsRule extends AbstractExtractExprRule {
+public class ExtractOrderExpressionsRule extends AbstractExtractExprRule {
@Override
public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) {
@@ -41,7 +39,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.ORDER) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FeedScanCollectionToUnnest.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FeedScanCollectionToUnnest.java
index 3940ed3..cbbe8a9 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FeedScanCollectionToUnnest.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/FeedScanCollectionToUnnest.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.optimizer.rules;
-
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceMaterializationForInsertWithSelfScanRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceMaterializationForInsertWithSelfScanRule.java
index dd65d94..98488f1 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceMaterializationForInsertWithSelfScanRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceMaterializationForInsertWithSelfScanRule.java
@@ -106,7 +106,7 @@
DataSourceScanOperator dataSourceScanOp = (DataSourceScanOperator) descendantOp;
AqlDataSource ds = (AqlDataSource) dataSourceScanOp.getDataSource();
if (ds.getDatasourceType() != AqlDataSourceType.FEED) {
- if ( ((DatasetDataSource)ds).getDataset().getDatasetName().compareTo(insertDatasetName) == 0) {
+ if (((DatasetDataSource) ds).getDataset().getDatasetName().compareTo(insertDatasetName) == 0) {
return true;
}
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
index dc8d741..f2ca7d3 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceSecondaryIndexInsertDeleteRule.java
@@ -172,7 +172,8 @@
project.getInputs().add(new MutableObject<ILogicalOperator>(currentTop));
context.computeAndSetTypeEnvironmentForOperator(project);
context.computeAndSetTypeEnvironmentForOperator(assign);
- if (index.getIndexType() == IndexType.BTREE || index.getIndexType() == IndexType.SINGLE_PARTITION_WORD_INVIX
+ if (index.getIndexType() == IndexType.BTREE
+ || index.getIndexType() == IndexType.SINGLE_PARTITION_WORD_INVIX
|| index.getIndexType() == IndexType.SINGLE_PARTITION_NGRAM_INVIX
|| index.getIndexType() == IndexType.LENGTH_PARTITIONED_WORD_INVIX
|| index.getIndexType() == IndexType.LENGTH_PARTITIONED_NGRAM_INVIX) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceTransactionCommitByAssignOpRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceTransactionCommitByAssignOpRule.java
index df6ed18..41eb883 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceTransactionCommitByAssignOpRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/IntroduceTransactionCommitByAssignOpRule.java
@@ -62,7 +62,7 @@
//set the input of the new assign-operator to the input of the select-operator.
assignOperator.getInputs().add(childOfSelect);
-
+
//set the result value of the assign-operator to the condition of the select-operator
selectOperator.getCondition().setValue(new VariableReferenceExpression(v));//scalarFunctionCallExpression);
selectOperator.getInputs().set(0, new MutableObject<ILogicalOperator>(assignOperator));
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/LoadRecordFieldsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/LoadRecordFieldsRule.java
index e44112e..ac6a690 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/LoadRecordFieldsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/LoadRecordFieldsRule.java
@@ -218,7 +218,6 @@
}
/**
- *
* Pushes one field-access assignment above toPushThroughChildRef
*
* @param toPush
@@ -234,17 +233,11 @@
}
/**
- *
* Rewrite
- *
* assign $x := field-access($y, "field")
- *
* assign $y := record-constructor { "field": Expr, ... }
- *
* into
- *
* assign $x := Expr
- *
* assign $y := record-constructor { "field": Expr, ... }
*
* @param toPush
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/NestGroupByRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/NestGroupByRule.java
index 4203891..ac2e682 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/NestGroupByRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/NestGroupByRule.java
@@ -48,7 +48,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.SUBPLAN) {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PullPositionalVariableFromUnnestRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PullPositionalVariableFromUnnestRule.java
index 004e221..d4abefe 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PullPositionalVariableFromUnnestRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PullPositionalVariableFromUnnestRule.java
@@ -43,7 +43,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
if (op.getOperatorTag() != LogicalOperatorTag.UNNEST) {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushGroupByThroughProduct.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushGroupByThroughProduct.java
index 4e3f460..af59445 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushGroupByThroughProduct.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushGroupByThroughProduct.java
@@ -41,12 +41,12 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil;
import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-
-
public class PushGroupByThroughProduct implements IAlgebraicRewriteRule {
private enum PushTestResult {
- FALSE, TRUE, REPEATED_DECORS
+ FALSE,
+ TRUE,
+ REPEATED_DECORS
}
@Override
@@ -55,7 +55,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op1 = (AbstractLogicalOperator) opRef.getValue();
if (op1.getOperatorTag() != LogicalOperatorTag.GROUP) {
return false;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushProperJoinThroughProduct.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushProperJoinThroughProduct.java
index de44eba..2892d89 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushProperJoinThroughProduct.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushProperJoinThroughProduct.java
@@ -43,7 +43,8 @@
}
@Override
- public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+ throws AlgebricksException {
AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
LogicalOperatorTag tag1 = op.getOperatorTag();
if (tag1 != LogicalOperatorTag.INNERJOIN && tag1 != LogicalOperatorTag.LEFTOUTERJOIN) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java
index b339103..18ea39e 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/PushSimilarityFunctionsBelowJoin.java
@@ -30,25 +30,22 @@
* a join (which may blow up the cardinality).
* Also, this rule may help to enable other rules such as common subexpression elimination, again to reduce
* the number of calls to expensive similarity functions.
- *
* Example:
- *
* Before plan:
* assign [$$10] <- [funcA(funcB(simFuncX($$3, $$4)))]
- * join (some condition)
- * join_branch_0 where $$3 and $$4 are not live
- * ...
- * join_branch_1 where $$3 and $$4 are live
- * ...
- *
+ * join (some condition)
+ * join_branch_0 where $$3 and $$4 are not live
+ * ...
+ * join_branch_1 where $$3 and $$4 are live
+ * ...
* After plan:
* assign [$$10] <- [funcA(funcB($$11))]
- * join (some condition)
- * join_branch_0 where $$3 and $$4 are not live
- * ...
- * join_branch_1 where $$3 and $$4 are live
- * assign[$$11] <- [simFuncX($$3, $$4)]
- * ...
+ * join (some condition)
+ * join_branch_0 where $$3 and $$4 are not live
+ * ...
+ * join_branch_1 where $$3 and $$4 are live
+ * assign[$$11] <- [simFuncX($$3, $$4)]
+ * ...
*/
public class PushSimilarityFunctionsBelowJoin extends PushFunctionsBelowJoin {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveRedundantListifyRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveRedundantListifyRule.java
index 51511aa..f42c983 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveRedundantListifyRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/RemoveRedundantListifyRule.java
@@ -68,7 +68,7 @@
}
@Override
- public boolean rewritePre( Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+ public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
// apply it only at the top of the plan
ILogicalOperator op = opRef.getValue();
if (context.checkIfInDontApplySet(this, op)) {
@@ -86,7 +86,7 @@
if (op.hasNestedPlans()) {
AbstractOperatorWithNestedPlans aonp = (AbstractOperatorWithNestedPlans) op;
for (ILogicalPlan p : aonp.getNestedPlans()) {
- for ( Mutable<ILogicalOperator> r : p.getRoots()) {
+ for (Mutable<ILogicalOperator> r : p.getRoots()) {
if (applyRuleDown(r, varSet, context)) {
changed = true;
}
@@ -94,7 +94,7 @@
}
}
}
- for ( Mutable<ILogicalOperator> i : op.getInputs()) {
+ for (Mutable<ILogicalOperator> i : op.getInputs()) {
if (applyRuleDown(i, varSet, context)) {
changed = true;
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java
index 32b2f59..5c42555 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SimilarityCheckRule.java
@@ -244,52 +244,56 @@
AsterixConstantValue constVal, AbstractFunctionCallExpression funcExpr) {
// Remember args from original similarity function to add them to the similarity-check function later.
ArrayList<Mutable<ILogicalExpression>> similarityArgs = null;
- ScalarFunctionCallExpression simCheckFuncExpr = null;
+ ScalarFunctionCallExpression simCheckFuncExpr = null;
// Look for jaccard function call, and GE or GT.
if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.SIMILARITY_JACCARD) {
IAObject jaccThresh;
- if (normFuncIdent == AlgebricksBuiltinFunctions.GE) {
+ if (normFuncIdent == AlgebricksBuiltinFunctions.GE) {
if (constVal.getObject() instanceof AFloat) {
- jaccThresh = constVal.getObject();
+ jaccThresh = constVal.getObject();
} else {
- jaccThresh = new AFloat((float)((ADouble) constVal.getObject()).getDoubleValue());
+ jaccThresh = new AFloat((float) ((ADouble) constVal.getObject()).getDoubleValue());
}
} else if (normFuncIdent == AlgebricksBuiltinFunctions.GT) {
- float threshVal = 0.0f;
+ float threshVal = 0.0f;
if (constVal.getObject() instanceof AFloat) {
threshVal = ((AFloat) constVal.getObject()).getFloatValue();
} else {
- threshVal = (float)((ADouble) constVal.getObject()).getDoubleValue();
+ threshVal = (float) ((ADouble) constVal.getObject()).getDoubleValue();
}
float f = threshVal + Float.MIN_VALUE;
- if (f > 1.0f) f = 1.0f;
+ if (f > 1.0f)
+ f = 1.0f;
jaccThresh = new AFloat(f);
} else {
return null;
}
similarityArgs = new ArrayList<Mutable<ILogicalExpression>>();
similarityArgs.addAll(funcExpr.getArguments());
- similarityArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(jaccThresh))));
+ similarityArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ jaccThresh))));
simCheckFuncExpr = new ScalarFunctionCallExpression(
FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.SIMILARITY_JACCARD_CHECK), similarityArgs);
}
// Look for edit-distance function call, and LE or LT.
- if(funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.EDIT_DISTANCE) {
+ if (funcExpr.getFunctionIdentifier() == AsterixBuiltinFunctions.EDIT_DISTANCE) {
AInt32 aInt = (AInt32) constVal.getObject();
AInt32 edThresh;
if (normFuncIdent == AlgebricksBuiltinFunctions.LE) {
edThresh = aInt;
} else if (normFuncIdent == AlgebricksBuiltinFunctions.LT) {
int ed = aInt.getIntegerValue() - 1;
- if (ed < 0) ed = 0;
+ if (ed < 0)
+ ed = 0;
edThresh = new AInt32(ed);
} else {
return null;
}
similarityArgs = new ArrayList<Mutable<ILogicalExpression>>();
similarityArgs.addAll(funcExpr.getArguments());
- similarityArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(edThresh))));
+ similarityArgs.add(new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+ edThresh))));
simCheckFuncExpr = new ScalarFunctionCallExpression(
FunctionUtils.getFunctionInfo(AsterixBuiltinFunctions.EDIT_DISTANCE_CHECK), similarityArgs);
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
index d4c00e4..6b68b7f 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java
@@ -132,7 +132,7 @@
Iterator<Map.Entry<Index, List<Integer>>> it = analysisCtx.indexExprs.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Index, List<Integer>> entry = it.next();
- Index index = entry.getKey();
+ Index index = entry.getKey();
boolean allUsed = true;
int lastFieldMatched = -1;
for (int i = 0; i < index.getKeyFieldNames().size(); i++) {
@@ -266,8 +266,8 @@
return true;
}
- protected void fillAllIndexExprs(OptimizableOperatorSubTree subTree,
- AccessMethodAnalysisContext analysisCtx) throws AlgebricksException {
+ protected void fillAllIndexExprs(OptimizableOperatorSubTree subTree, AccessMethodAnalysisContext analysisCtx)
+ throws AlgebricksException {
for (int optFuncExprIndex = 0; optFuncExprIndex < analysisCtx.matchedFuncExprs.size(); optFuncExprIndex++) {
IOptimizableFuncExpr optFuncExpr = analysisCtx.matchedFuncExprs.get(optFuncExprIndex);
// Try to match variables from optFuncExpr to assigns.
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
index ab0fd79..fc0c562 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/AccessMethodUtils.java
@@ -149,7 +149,7 @@
switch (index.getIndexType()) {
case BTREE:
case SINGLE_PARTITION_WORD_INVIX:
- case SINGLE_PARTITION_NGRAM_INVIX:
+ case SINGLE_PARTITION_NGRAM_INVIX:
case LENGTH_PARTITIONED_WORD_INVIX:
case LENGTH_PARTITIONED_NGRAM_INVIX: {
return index.getKeyFieldNames().size();
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
index 507a085..5ec9702 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IOptimizableFuncExpr.java
@@ -25,16 +25,26 @@
*/
public interface IOptimizableFuncExpr {
public AbstractFunctionCallExpression getFuncExpr();
+
public int getNumLogicalVars();
+
public int getNumConstantVals();
+
public LogicalVariable getLogicalVar(int index);
+
public void setFieldName(int index, String fieldName);
+
public String getFieldName(int index);
+
public void setOptimizableSubTree(int index, OptimizableOperatorSubTree subTree);
+
public OptimizableOperatorSubTree getOperatorSubTree(int index);
+
public IAlgebricksConstantValue getConstantVal(int index);
-
+
public int findLogicalVar(LogicalVariable var);
+
public int findFieldName(String fieldName);
+
public void substituteVar(LogicalVariable original, LogicalVariable substitution);
}
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
index b1e0a46..8790c7c 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceJoinAccessMethodRule.java
@@ -37,27 +37,22 @@
/**
* This rule optimizes a join with secondary indexes into an indexed nested-loop join.
- *
* Matches the following operator pattern:
* (join) <-- (select)? <-- (assign)+ <-- (datasource scan)
- * <-- (select)? <-- (assign)+ <-- (datasource scan)
- *
- * Replaces the above pattern with the following simplified plan:
+ * <-- (select)? <-- (assign)+ <-- (datasource scan)
+ * Replaces the above pattern with the following simplified plan:
* (select) <-- (assign) <-- (btree search) <-- (sort) <-- (unnest(index search)) <-- (assign) <-- (datasource scan)
* The sort is optional, and some access methods may choose not to sort.
- *
* Note that for some index-based optimizations we do not remove the triggering
* condition from the join, since the secondary index may only act as a filter, and the
* final verification must still be done with the original join condition.
- *
- * The basic outline of this rule is:
- * 1. Match operator pattern.
- * 2. Analyze join condition to see if there are optimizable functions (delegated to IAccessMethods).
- * 3. Check metadata to see if there are applicable indexes.
+ * The basic outline of this rule is:
+ * 1. Match operator pattern.
+ * 2. Analyze join condition to see if there are optimizable functions (delegated to IAccessMethods).
+ * 3. Check metadata to see if there are applicable indexes.
* 4. Choose an index to apply (for now only a single index will be chosen).
* 5. Rewrite plan using index (delegated to IAccessMethods).
- *
- * TODO (Alex): Currently this rule requires a data scan on both inputs of the join. I should generalize the pattern
+ * TODO (Alex): Currently this rule requires a data scan on both inputs of the join. I should generalize the pattern
* to accept any subtree on one side, as long as the other side has a datasource scan.
*/
public class IntroduceJoinAccessMethodRule extends AbstractIntroduceAccessMethodRule {
@@ -73,7 +68,7 @@
static {
registerAccessMethod(BTreeAccessMethod.INSTANCE, accessMethods);
registerAccessMethod(RTreeAccessMethod.INSTANCE, accessMethods);
- registerAccessMethod(InvertedIndexAccessMethod.INSTANCE, accessMethods);
+ registerAccessMethod(InvertedIndexAccessMethod.INSTANCE, accessMethods);
}
@Override
@@ -133,7 +128,7 @@
boolean res = chosenIndex.first.applyJoinPlanTransformation(joinRef, leftSubTree, rightSubTree,
chosenIndex.second, analysisCtx, context);
if (res) {
- OperatorPropertiesUtil.typeOpRec(opRef, context);
+ OperatorPropertiesUtil.typeOpRec(opRef, context);
}
context.addToDontApplySet(this, join);
return res;
@@ -170,7 +165,7 @@
public Map<FunctionIdentifier, List<IAccessMethod>> getAccessMethods() {
return accessMethods;
}
-
+
private void clear() {
joinRef = null;
join = null;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
index d71c5ef..f712c23 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java
@@ -39,7 +39,6 @@
* This rule optimizes simple selections with secondary or primary indexes. The use of an
* index is expressed as an unnest-map over an index-search function which will be
* replaced with the appropriate embodiment during codegen.
- *
* Matches the following operator patterns:
* Standard secondary index pattern:
* There must be at least one assign, but there may be more, e.g., when matching similarity-jaccard-check().
@@ -47,22 +46,18 @@
* Primary index lookup pattern:
* Since no assign is necessary to get the primary key fields (they are already stored fields in the BTree tuples).
* (select) <-- (datasource scan)
- *
* Replaces the above patterns with this plan:
* (select) <-- (assign) <-- (btree search) <-- (sort) <-- (unnest-map(index search)) <-- (assign)
* The sort is optional, and some access methods implementations may choose not to sort.
- *
* Note that for some index-based optimizations we do not remove the triggering
* condition from the select, since the index may only acts as a filter, and the
* final verification must still be done with the original select condition.
- *
- * The basic outline of this rule is:
- * 1. Match operator pattern.
- * 2. Analyze select condition to see if there are optimizable functions (delegated to IAccessMethods).
- * 3. Check metadata to see if there are applicable indexes.
+ * The basic outline of this rule is:
+ * 1. Match operator pattern.
+ * 2. Analyze select condition to see if there are optimizable functions (delegated to IAccessMethods).
+ * 3. Check metadata to see if there are applicable indexes.
* 4. Choose an index to apply (for now only a single index will be chosen).
* 5. Rewrite plan using index (delegated to IAccessMethods).
- *
*/
public class IntroduceSelectAccessMethodRule extends AbstractIntroduceAccessMethodRule {
@@ -149,7 +144,7 @@
public Map<FunctionIdentifier, List<IAccessMethod>> getAccessMethods() {
return accessMethods;
}
-
+
private void clear() {
selectRef = null;
select = null;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
index 3ebde07..f1b93fe 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/OptimizableFuncExpr.java
@@ -23,63 +23,65 @@
* number of constant args, variable args and field names.
*/
public class OptimizableFuncExpr implements IOptimizableFuncExpr {
- protected final AbstractFunctionCallExpression funcExpr;
+ protected final AbstractFunctionCallExpression funcExpr;
protected final LogicalVariable[] logicalVars;
protected final String[] fieldNames;
protected final OptimizableOperatorSubTree[] subTrees;
protected final IAlgebricksConstantValue[] constantVals;
-
- public OptimizableFuncExpr(AbstractFunctionCallExpression funcExpr, LogicalVariable[] logicalVars, IAlgebricksConstantValue[] constantVals) {
- this.funcExpr = funcExpr;
- this.logicalVars = logicalVars;
- this.constantVals = constantVals;
- this.fieldNames = new String[logicalVars.length];
- this.subTrees = new OptimizableOperatorSubTree[logicalVars.length];
+
+ public OptimizableFuncExpr(AbstractFunctionCallExpression funcExpr, LogicalVariable[] logicalVars,
+ IAlgebricksConstantValue[] constantVals) {
+ this.funcExpr = funcExpr;
+ this.logicalVars = logicalVars;
+ this.constantVals = constantVals;
+ this.fieldNames = new String[logicalVars.length];
+ this.subTrees = new OptimizableOperatorSubTree[logicalVars.length];
}
-
+
// Special, more convenient c'tor for simple binary functions.
- public OptimizableFuncExpr(AbstractFunctionCallExpression funcExpr, LogicalVariable logicalVar, IAlgebricksConstantValue constantVal) {
- this.funcExpr = funcExpr;
- this.logicalVars = new LogicalVariable[] { logicalVar };
- this.constantVals = new IAlgebricksConstantValue[] { constantVal };
- this.fieldNames = new String[logicalVars.length];
- this.subTrees = new OptimizableOperatorSubTree[logicalVars.length];
+ public OptimizableFuncExpr(AbstractFunctionCallExpression funcExpr, LogicalVariable logicalVar,
+ IAlgebricksConstantValue constantVal) {
+ this.funcExpr = funcExpr;
+ this.logicalVars = new LogicalVariable[] { logicalVar };
+ this.constantVals = new IAlgebricksConstantValue[] { constantVal };
+ this.fieldNames = new String[logicalVars.length];
+ this.subTrees = new OptimizableOperatorSubTree[logicalVars.length];
}
-
- @Override
- public AbstractFunctionCallExpression getFuncExpr() {
- return funcExpr;
- }
-
- @Override
- public int getNumLogicalVars() {
- return logicalVars.length;
- }
-
- @Override
- public int getNumConstantVals() {
- return constantVals.length;
- }
-
- @Override
- public LogicalVariable getLogicalVar(int index) {
- return logicalVars[index];
- }
-
- @Override
- public void setFieldName(int index, String fieldName) {
- fieldNames[index] = fieldName;
- }
-
- @Override
- public String getFieldName(int index) {
- return fieldNames[index];
- }
-
- @Override
- public IAlgebricksConstantValue getConstantVal(int index) {
- return constantVals[index];
- }
+
+ @Override
+ public AbstractFunctionCallExpression getFuncExpr() {
+ return funcExpr;
+ }
+
+ @Override
+ public int getNumLogicalVars() {
+ return logicalVars.length;
+ }
+
+ @Override
+ public int getNumConstantVals() {
+ return constantVals.length;
+ }
+
+ @Override
+ public LogicalVariable getLogicalVar(int index) {
+ return logicalVars[index];
+ }
+
+ @Override
+ public void setFieldName(int index, String fieldName) {
+ fieldNames[index] = fieldName;
+ }
+
+ @Override
+ public String getFieldName(int index) {
+ return fieldNames[index];
+ }
+
+ @Override
+ public IAlgebricksConstantValue getConstantVal(int index) {
+ return constantVals[index];
+ }
@Override
public int findLogicalVar(LogicalVariable var) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/ConstantHelper.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/ConstantHelper.java
index 88276d0..998bc2d 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/ConstantHelper.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/ConstantHelper.java
@@ -50,7 +50,7 @@
}
case LONG: {
LongIntegerLiteral il = (LongIntegerLiteral) valLiteral;
- return new AInt64(il.getValue());
+ return new AInt64(il.getValue());
}
case NULL: {
return ANull.NULL;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
index 60b0cd6..232a125 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
@@ -220,8 +220,7 @@
}
- edu.uci.ics.asterix.common.transactions.JobId asterixJobId = JobIdFactory
- .generateJobId();
+ edu.uci.ics.asterix.common.transactions.JobId asterixJobId = JobIdFactory.generateJobId();
queryMetadataProvider.setJobId(asterixJobId);
AqlExpressionToPlanTranslator t = new AqlExpressionToPlanTranslator(queryMetadataProvider, varCounter,
outputDatasetName, statement);
@@ -265,7 +264,6 @@
OptimizationConfUtil.getPhysicalOptimizationConfig().setFrameSize(frameSize);
OptimizationConfUtil.getPhysicalOptimizationConfig().setMaxFramesExternalSort(sortFrameLimit);
OptimizationConfUtil.getPhysicalOptimizationConfig().setMaxFramesHybridHash(joinFrameLimit);
-
HeuristicCompilerFactoryBuilder builder = new HeuristicCompilerFactoryBuilder(
AqlOptimizationContextFactory.INSTANCE);
@@ -280,7 +278,6 @@
builder.setExpressionTypeComputer(AqlExpressionTypeComputer.INSTANCE);
builder.setNullableTypeComputer(AqlNullableTypeComputer.INSTANCE);
-
ICompiler compiler = compilerFactory.createCompiler(plan, queryMetadataProvider, t.getVarCounter());
if (pc.isOptimize()) {
compiler.optimize();
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/FeedDataProviderServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/FeedDataProviderServlet.java
index 437a2c9..463ce01 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/FeedDataProviderServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/FeedDataProviderServlet.java
@@ -88,7 +88,7 @@
.getActiveFeeds(ctx, dataverseName, datasetName);
FeedConnectionId feedId = new FeedConnectionId(dataverseName, feedName, datasetName);
FeedActivity activity = MetadataManager.INSTANCE.getRecentActivityOnFeedConnection(ctx, feedId, null);
- switch(activity.getActivityType()){
+ switch (activity.getActivityType()) {
case FEED_BEGIN:
Map<String, String> activityDetails = activity.getFeedActivityDetails();
String ingestLocations = activityDetails.get(FeedActivityDetails.INGEST_LOCATIONS);
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
index a0acd44..052e526 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -990,7 +990,7 @@
}
}
}
-
+
//#. prepare jobs to drop the datatset and the indexes in NC
List<Index> indexes = MetadataManager.INSTANCE.getDatasetIndexes(mdTxnCtx, dataverseName, datasetName);
for (int j = 0; j < indexes.size(); j++) {
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterLifecycleListener.java b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
index 0dab8dd..950afe4 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterLifecycleListener.java
@@ -106,7 +106,6 @@
}
}
-
private void updateProgress(ClusterEventType eventType, Set<String> nodeIds) {
List<IClusterManagementWorkResponse> completedResponses = new ArrayList<IClusterManagementWorkResponse>();
boolean isComplete = false;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterWorkExecutor.java b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterWorkExecutor.java
index 172a0ec..77581c7 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterWorkExecutor.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/ClusterWorkExecutor.java
@@ -37,8 +37,7 @@
public ClusterWorkExecutor(LinkedBlockingQueue<Set<IClusterManagementWork>> inbox) {
this.inbox = inbox;
}
-
-
+
@Override
public void run() {
while (true) {
@@ -85,7 +84,6 @@
}
}
}
-
} catch (InterruptedException e) {
if (LOGGER.isLoggable(Level.SEVERE)) {
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java
index 1900fa3..ad60843 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java
@@ -206,7 +206,7 @@
/**
* Read the template file which is stored as a resource and return its content. If the file does not exist or is
* not readable return the default template string.
- *
+ *
* @param path
* The path to the resource template file
* @param defaultTemplate
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java
index 95eefa0..6b41e25 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/AbstractExpression.java
@@ -20,20 +20,20 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
public abstract class AbstractExpression implements Expression {
- protected List<IExpressionAnnotation> hints;
-
- public void addHint(IExpressionAnnotation hint) {
- if (hints == null) {
- hints = new ArrayList<IExpressionAnnotation>();
- }
- hints.add(hint);
+ protected List<IExpressionAnnotation> hints;
+
+ public void addHint(IExpressionAnnotation hint) {
+ if (hints == null) {
+ hints = new ArrayList<IExpressionAnnotation>();
+ }
+ hints.add(hint);
}
-
+
public boolean hasHints() {
- return hints != null;
+ return hints != null;
}
-
+
public List<IExpressionAnnotation> getHints() {
- return hints;
+ return hints;
}
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Literal.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Literal.java
index ad00112..566481e 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Literal.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/base/Literal.java
@@ -34,28 +34,28 @@
}
abstract public Object getValue();
-
+
abstract public Type getLiteralType();
public String getStringValue() {
return getValue().toString();
- }
-
+ }
+
@Override
public int hashCode() {
return getValue().hashCode();
- }
+ }
public boolean equals(Object obj) {
if (!(obj instanceof Literal)) {
return false;
}
- Literal literal = (Literal)obj;
+ Literal literal = (Literal) obj;
return getValue().equals(literal.getValue());
- }
-
+ }
+
@Override
public String toString() {
return getStringValue();
- }
+ }
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
index c9d4d59..b8538b8 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/Query.java
@@ -21,39 +21,37 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
public class Query implements Statement {
- private Expression body;
- private int varCounter;
+ private Expression body;
+ private int varCounter;
- public Expression getBody() {
- return body;
- }
+ public Expression getBody() {
+ return body;
+ }
- public void setBody(Expression body) {
- this.body = body;
- }
+ public void setBody(Expression body) {
+ this.body = body;
+ }
- public int getVarCounter() {
- return varCounter;
- }
+ public int getVarCounter() {
+ return varCounter;
+ }
- public void setVarCounter(int varCounter) {
- this.varCounter = varCounter;
- }
+ public void setVarCounter(int varCounter) {
+ this.varCounter = varCounter;
+ }
- @Override
- public Kind getKind() {
- return Kind.QUERY;
- }
+ @Override
+ public Kind getKind() {
+ return Kind.QUERY;
+ }
- @Override
- public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T step)
- throws AsterixException {
- visitor.visit(this, step);
- }
+ @Override
+ public <T> void accept(IAqlVisitorWithVoidReturn<T> visitor, T step) throws AsterixException {
+ visitor.visit(this, step);
+ }
- @Override
- public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg)
- throws AsterixException {
- return visitor.visitQuery(this, arg);
- }
+ @Override
+ public <R, T> R accept(IAqlExpressionVisitor<R, T> visitor, T arg) throws AsterixException {
+ return visitor.visitQuery(this, arg);
+ }
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
index 22b63fa..255f40b 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/AQLPrintVisitor.java
@@ -84,517 +84,471 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
public class AQLPrintVisitor implements IAqlVisitorWithVoidReturn<Integer> {
- // private int level =0;
- private final PrintWriter out;
+ // private int level =0;
+ private final PrintWriter out;
- public AQLPrintVisitor() {
- out = new PrintWriter(System.out);
- }
+ public AQLPrintVisitor() {
+ out = new PrintWriter(System.out);
+ }
- public AQLPrintVisitor(PrintWriter out) {
- this.out = out;
- }
+ public AQLPrintVisitor(PrintWriter out) {
+ this.out = out;
+ }
- private String skip(int step) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < step; i++)
- sb.append(" ");
- return sb.toString();
- }
+ private String skip(int step) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < step; i++)
+ sb.append(" ");
+ return sb.toString();
+ }
- @Override
- public void visit(Query q, Integer step) throws AsterixException {
- if (q.getBody() != null) {
- out.println("Query:");
- q.getBody().accept(this, step);
- } else {
- out.println("No query.");
- }
- }
+ @Override
+ public void visit(Query q, Integer step) throws AsterixException {
+ if (q.getBody() != null) {
+ out.println("Query:");
+ q.getBody().accept(this, step);
+ } else {
+ out.println("No query.");
+ }
+ }
- @Override
- public void visit(LiteralExpr l, Integer step) {
- Literal lc = l.getValue();
- if (lc.getLiteralType().equals(Literal.Type.TRUE)
- || lc.getLiteralType().equals(Literal.Type.FALSE)
- || lc.getLiteralType().equals(Literal.Type.NULL)) {
- out.println(skip(step) + "LiteralExpr ["
- + l.getValue().getLiteralType() + "]");
- } else {
- out.println(skip(step) + "LiteralExpr ["
- + l.getValue().getLiteralType() + "] ["
- + l.getValue().getStringValue() + "] ");
- }
- }
+ @Override
+ public void visit(LiteralExpr l, Integer step) {
+ Literal lc = l.getValue();
+ if (lc.getLiteralType().equals(Literal.Type.TRUE) || lc.getLiteralType().equals(Literal.Type.FALSE)
+ || lc.getLiteralType().equals(Literal.Type.NULL)) {
+ out.println(skip(step) + "LiteralExpr [" + l.getValue().getLiteralType() + "]");
+ } else {
+ out.println(skip(step) + "LiteralExpr [" + l.getValue().getLiteralType() + "] ["
+ + l.getValue().getStringValue() + "] ");
+ }
+ }
- @Override
- public void visit(VariableExpr v, Integer step) {
- out.println(skip(step) + "Variable [ Name=" + v.getVar().getValue()
- + " Id=" + v.getVar().getId() + " ]");
- }
+ @Override
+ public void visit(VariableExpr v, Integer step) {
+ out.println(skip(step) + "Variable [ Name=" + v.getVar().getValue() + " Id=" + v.getVar().getId() + " ]");
+ }
- @Override
- public void visit(ListConstructor lc, Integer step) throws AsterixException {
- boolean ordered = false;
- if (lc.getType().equals(ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR)) {
- ordered = true;
- }
+ @Override
+ public void visit(ListConstructor lc, Integer step) throws AsterixException {
+ boolean ordered = false;
+ if (lc.getType().equals(ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR)) {
+ ordered = true;
+ }
- out.println(skip(step)
- + (ordered == true ? "OrderedListConstructor "
- : "UnorderedListConstructor ") + "[");
- for (Expression e : lc.getExprList()) {
- e.accept(this, step + 1);
- }
- out.println(skip(step) + "]");
- }
+ out.println(skip(step) + (ordered == true ? "OrderedListConstructor " : "UnorderedListConstructor ") + "[");
+ for (Expression e : lc.getExprList()) {
+ e.accept(this, step + 1);
+ }
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(RecordConstructor rc, Integer step)
- throws AsterixException {
- out.println(skip(step) + "RecordConstructor [");
- // fbList accept visitor
- for (FieldBinding fb : rc.getFbList()) {
- out.println(skip(step + 1) + "(");
- fb.getLeftExpr().accept(this, step + 2);
- out.println(skip(step + 2) + ":");
- fb.getRightExpr().accept(this, step + 2);
- out.println(skip(step + 1) + ")");
- }
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(RecordConstructor rc, Integer step) throws AsterixException {
+ out.println(skip(step) + "RecordConstructor [");
+ // fbList accept visitor
+ for (FieldBinding fb : rc.getFbList()) {
+ out.println(skip(step + 1) + "(");
+ fb.getLeftExpr().accept(this, step + 2);
+ out.println(skip(step + 2) + ":");
+ fb.getRightExpr().accept(this, step + 2);
+ out.println(skip(step + 1) + ")");
+ }
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(CallExpr pf, Integer step) throws AsterixException {
- out.println(skip(step) + "FunctionCall "
- + pf.getFunctionSignature().toString() + "[");
- for (Expression expr : pf.getExprList()) {
- expr.accept(this, step + 1);
- }
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(CallExpr pf, Integer step) throws AsterixException {
+ out.println(skip(step) + "FunctionCall " + pf.getFunctionSignature().toString() + "[");
+ for (Expression expr : pf.getExprList()) {
+ expr.accept(this, step + 1);
+ }
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(OperatorExpr ifbo, Integer step) throws AsterixException {
- List<Expression> exprList = ifbo.getExprList();
- List<OperatorType> opList = ifbo.getOpList();
- if (ifbo.isCurrentop()) {
- out.println(skip(step) + "OperatorExpr [");
- exprList.get(0).accept(this, step + 1);
- for (int i = 1; i < exprList.size(); i++) {
- out.println(skip(step + 1) + opList.get(i - 1));
- exprList.get(i).accept(this, step + 1);
- }
- out.println(skip(step) + "]");
- } else {
- exprList.get(0).accept(this, step);
- }
+ @Override
+ public void visit(OperatorExpr ifbo, Integer step) throws AsterixException {
+ List<Expression> exprList = ifbo.getExprList();
+ List<OperatorType> opList = ifbo.getOpList();
+ if (ifbo.isCurrentop()) {
+ out.println(skip(step) + "OperatorExpr [");
+ exprList.get(0).accept(this, step + 1);
+ for (int i = 1; i < exprList.size(); i++) {
+ out.println(skip(step + 1) + opList.get(i - 1));
+ exprList.get(i).accept(this, step + 1);
+ }
+ out.println(skip(step) + "]");
+ } else {
+ exprList.get(0).accept(this, step);
+ }
- }
+ }
- @Override
- public void visit(IfExpr ifexpr, Integer step) throws AsterixException {
- out.println(skip(step) + "IfExpr [");
- out.println(skip(step + 1) + "Condition:");
- ifexpr.getCondExpr().accept(this, step + 2);
- out.println(skip(step + 1) + "Then:");
- ifexpr.getThenExpr().accept(this, step + 2);
- out.println(skip(step + 1) + "Else:");
- ifexpr.getElseExpr().accept(this, step + 2);
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(IfExpr ifexpr, Integer step) throws AsterixException {
+ out.println(skip(step) + "IfExpr [");
+ out.println(skip(step + 1) + "Condition:");
+ ifexpr.getCondExpr().accept(this, step + 2);
+ out.println(skip(step + 1) + "Then:");
+ ifexpr.getThenExpr().accept(this, step + 2);
+ out.println(skip(step + 1) + "Else:");
+ ifexpr.getElseExpr().accept(this, step + 2);
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(FLWOGRExpression flwor, Integer step)
- throws AsterixException {
- out.println(skip(step) + "FLWOGR [");
- for (Clause cl : flwor.getClauseList()) {
- cl.accept(this, step + 1);
- }
- out.println(skip(step + 1) + "Return");
- flwor.getReturnExpr().accept(this, step + 2);
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(FLWOGRExpression flwor, Integer step) throws AsterixException {
+ out.println(skip(step) + "FLWOGR [");
+ for (Clause cl : flwor.getClauseList()) {
+ cl.accept(this, step + 1);
+ }
+ out.println(skip(step + 1) + "Return");
+ flwor.getReturnExpr().accept(this, step + 2);
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(QuantifiedExpression qe, Integer step)
- throws AsterixException {
- out.println(skip(step) + "QuantifiedExpression " + qe.getQuantifier()
- + " [");
- // quantifiedList accept visitor
- for (QuantifiedPair pair : qe.getQuantifiedList()) {
- out.print(skip(step + 1) + "[");
- pair.getVarExpr().accept(this, 0);
- out.println(skip(step + 1) + "In");
- pair.getExpr().accept(this, step + 2);
- out.println(skip(step + 1) + "]");
- }
- out.println(skip(step + 1) + "Satifies [");
- qe.getSatisfiesExpr().accept(this, step + 2);
- out.println(skip(step + 1) + "]");// for satifies
- out.println(skip(step) + "]");// for quantifiedExpr
- }
+ @Override
+ public void visit(QuantifiedExpression qe, Integer step) throws AsterixException {
+ out.println(skip(step) + "QuantifiedExpression " + qe.getQuantifier() + " [");
+ // quantifiedList accept visitor
+ for (QuantifiedPair pair : qe.getQuantifiedList()) {
+ out.print(skip(step + 1) + "[");
+ pair.getVarExpr().accept(this, 0);
+ out.println(skip(step + 1) + "In");
+ pair.getExpr().accept(this, step + 2);
+ out.println(skip(step + 1) + "]");
+ }
+ out.println(skip(step + 1) + "Satifies [");
+ qe.getSatisfiesExpr().accept(this, step + 2);
+ out.println(skip(step + 1) + "]");// for satifies
+ out.println(skip(step) + "]");// for quantifiedExpr
+ }
- @Override
- public void visit(ForClause fc, Integer step) throws AsterixException {
- out.print(skip(step) + "For ");
- fc.getVarExpr().accept(this, 0);
- out.println(skip(step + 1) + "In ");
- fc.getInExpr().accept(this, step + 1);
- }
+ @Override
+ public void visit(ForClause fc, Integer step) throws AsterixException {
+ out.print(skip(step) + "For ");
+ fc.getVarExpr().accept(this, 0);
+ out.println(skip(step + 1) + "In ");
+ fc.getInExpr().accept(this, step + 1);
+ }
- @Override
- public void visit(LetClause lc, Integer step) throws AsterixException {
- out.print(skip(step) + "Let ");
- lc.getVarExpr().accept(this, 0);
- out.println(skip(step + 1) + ":= ");
- lc.getBindingExpr().accept(this, step + 1);
- }
+ @Override
+ public void visit(LetClause lc, Integer step) throws AsterixException {
+ out.print(skip(step) + "Let ");
+ lc.getVarExpr().accept(this, 0);
+ out.println(skip(step + 1) + ":= ");
+ lc.getBindingExpr().accept(this, step + 1);
+ }
- @Override
- public void visit(WhereClause wc, Integer step) throws AsterixException {
- out.println(skip(step) + "Where ");
- wc.getWhereExpr().accept(this, step + 1);
- }
+ @Override
+ public void visit(WhereClause wc, Integer step) throws AsterixException {
+ out.println(skip(step) + "Where ");
+ wc.getWhereExpr().accept(this, step + 1);
+ }
- @Override
- public void visit(OrderbyClause oc, Integer step) throws AsterixException {
- out.println(skip(step) + "Orderby");
- List<OrderModifier> mlist = oc.getModifierList();
- List<Expression> list = oc.getOrderbyList();
- for (int i = 0; i < list.size(); i++) {
- list.get(i).accept(this, step + 1);
- out.println(skip(step + 1) + mlist.get(i).toString());
- }
- out.println(skip(step));
- }
+ @Override
+ public void visit(OrderbyClause oc, Integer step) throws AsterixException {
+ out.println(skip(step) + "Orderby");
+ List<OrderModifier> mlist = oc.getModifierList();
+ List<Expression> list = oc.getOrderbyList();
+ for (int i = 0; i < list.size(); i++) {
+ list.get(i).accept(this, step + 1);
+ out.println(skip(step + 1) + mlist.get(i).toString());
+ }
+ out.println(skip(step));
+ }
- @Override
- public void visit(GroupbyClause gc, Integer step) throws AsterixException {
- out.println(skip(step) + "Groupby");
- for (GbyVariableExpressionPair pair : gc.getGbyPairList()) {
+ @Override
+ public void visit(GroupbyClause gc, Integer step) throws AsterixException {
+ out.println(skip(step) + "Groupby");
+ for (GbyVariableExpressionPair pair : gc.getGbyPairList()) {
- if (pair.getVar() != null) {
- pair.getVar().accept(this, step + 1);
- out.println(skip(step + 1) + ":=");
- }
+ if (pair.getVar() != null) {
+ pair.getVar().accept(this, step + 1);
+ out.println(skip(step + 1) + ":=");
+ }
- pair.getExpr().accept(this, step + 1);
- }
- if (!gc.getDecorPairList().isEmpty()) {
- out.println(skip(step + 1) + "Decor");
- for (GbyVariableExpressionPair pair : gc.getDecorPairList()) {
- if (pair.getVar() != null) {
- pair.getVar().accept(this, step + 1);
- out.println(skip(step + 1) + ":=");
- }
- pair.getExpr().accept(this, step + 1);
- }
- }
- out.println(skip(step + 1) + "With");
- for (VariableExpr exp : gc.getWithVarList()) {
- exp.accept(this, step + 1);
- }
- out.println(skip(step));
- }
+ pair.getExpr().accept(this, step + 1);
+ }
+ if (!gc.getDecorPairList().isEmpty()) {
+ out.println(skip(step + 1) + "Decor");
+ for (GbyVariableExpressionPair pair : gc.getDecorPairList()) {
+ if (pair.getVar() != null) {
+ pair.getVar().accept(this, step + 1);
+ out.println(skip(step + 1) + ":=");
+ }
+ pair.getExpr().accept(this, step + 1);
+ }
+ }
+ out.println(skip(step + 1) + "With");
+ for (VariableExpr exp : gc.getWithVarList()) {
+ exp.accept(this, step + 1);
+ }
+ out.println(skip(step));
+ }
- @Override
- public void visit(LimitClause lc, Integer step) throws AsterixException {
- out.println(skip(step) + "Limit");
- lc.getLimitExpr().accept(this, step + 1);
- if (lc.getOffset() != null) {
- out.println(skip(step + 1) + "Offset");
- lc.getOffset().accept(this, step + 2);
- }
- }
+ @Override
+ public void visit(LimitClause lc, Integer step) throws AsterixException {
+ out.println(skip(step) + "Limit");
+ lc.getLimitExpr().accept(this, step + 1);
+ if (lc.getOffset() != null) {
+ out.println(skip(step + 1) + "Offset");
+ lc.getOffset().accept(this, step + 2);
+ }
+ }
- @Override
- public void visit(FunctionDecl fd, Integer step) throws AsterixException {
- out.println(skip(step) + "FunctionDecl " + fd.getSignature().getName()
- + "(" + fd.getParamList().toString() + ") {");
- fd.getFuncBody().accept(this, step + 1);
- out.println(skip(step) + "}");
- out.println();
- }
+ @Override
+ public void visit(FunctionDecl fd, Integer step) throws AsterixException {
+ out.println(skip(step) + "FunctionDecl " + fd.getSignature().getName() + "(" + fd.getParamList().toString()
+ + ") {");
+ fd.getFuncBody().accept(this, step + 1);
+ out.println(skip(step) + "}");
+ out.println();
+ }
- @Override
- public void visit(UnaryExpr u, Integer step) throws AsterixException {
- if (u.getSign() != null) {
- out.print(skip(step) + u.getSign() + " ");
- u.getExpr().accept(this, 0);
- } else
- u.getExpr().accept(this, step);
- }
+ @Override
+ public void visit(UnaryExpr u, Integer step) throws AsterixException {
+ if (u.getSign() != null) {
+ out.print(skip(step) + u.getSign() + " ");
+ u.getExpr().accept(this, 0);
+ } else
+ u.getExpr().accept(this, step);
+ }
- @Override
- public void visit(FieldAccessor fa, Integer step) throws AsterixException {
- out.println(skip(step) + "FieldAccessor [");
- fa.getExpr().accept(this, step + 1);
- out.println(skip(step + 1) + "Field="
- + ((FieldAccessor) fa).getIdent().getValue());
- out.println(skip(step) + "]");
+ @Override
+ public void visit(FieldAccessor fa, Integer step) throws AsterixException {
+ out.println(skip(step) + "FieldAccessor [");
+ fa.getExpr().accept(this, step + 1);
+ out.println(skip(step + 1) + "Field=" + ((FieldAccessor) fa).getIdent().getValue());
+ out.println(skip(step) + "]");
- }
+ }
- @Override
- public void visit(IndexAccessor fa, Integer step) throws AsterixException {
- out.println(skip(step) + "IndexAccessor [");
- fa.getExpr().accept(this, step + 1);
- out.print(skip(step + 1) + "Index: ");
- out.println((((IndexAccessor) fa).isAny() ? "ANY"
- : ((IndexAccessor) fa).getIndex()));
+ @Override
+ public void visit(IndexAccessor fa, Integer step) throws AsterixException {
+ out.println(skip(step) + "IndexAccessor [");
+ fa.getExpr().accept(this, step + 1);
+ out.print(skip(step + 1) + "Index: ");
+ out.println((((IndexAccessor) fa).isAny() ? "ANY" : ((IndexAccessor) fa).getIndex()));
- out.println(skip(step) + "]");
+ out.println(skip(step) + "]");
- }
+ }
- @Override
- public void visit(TypeDecl t, Integer step) throws AsterixException {
- out.println(skip(step) + "TypeDecl " + t.getIdent() + " [");
- t.getTypeDef().accept(this, step + 1);
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(TypeDecl t, Integer step) throws AsterixException {
+ out.println(skip(step) + "TypeDecl " + t.getIdent() + " [");
+ t.getTypeDef().accept(this, step + 1);
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(TypeReferenceExpression t, Integer arg)
- throws AsterixException {
- out.print(t.getIdent());
- }
+ @Override
+ public void visit(TypeReferenceExpression t, Integer arg) throws AsterixException {
+ out.print(t.getIdent());
+ }
- @Override
- public void visit(RecordTypeDefinition r, Integer step)
- throws AsterixException {
- if (r.getRecordKind() == RecordKind.CLOSED) {
- out.print(skip(step) + "closed ");
- } else {
- out.print(skip(step) + "open ");
- }
- out.println("RecordType {");
- Iterator<String> nameIter = r.getFieldNames().iterator();
- Iterator<TypeExpression> typeIter = r.getFieldTypes().iterator();
- Iterator<Boolean> isnullableIter = r.getNullableFields().iterator();
- boolean first = true;
- while (nameIter.hasNext()) {
- if (first) {
- first = false;
- } else {
- out.println(",");
- }
- String name = nameIter.next();
- TypeExpression texp = typeIter.next();
- Boolean isNullable = isnullableIter.next();
- out.print(skip(step + 1) + name + " : ");
- texp.accept(this, step + 2);
- if (isNullable) {
- out.print("?");
- }
- }
- out.println();
- out.println(skip(step) + "}");
- }
+ @Override
+ public void visit(RecordTypeDefinition r, Integer step) throws AsterixException {
+ if (r.getRecordKind() == RecordKind.CLOSED) {
+ out.print(skip(step) + "closed ");
+ } else {
+ out.print(skip(step) + "open ");
+ }
+ out.println("RecordType {");
+ Iterator<String> nameIter = r.getFieldNames().iterator();
+ Iterator<TypeExpression> typeIter = r.getFieldTypes().iterator();
+ Iterator<Boolean> isnullableIter = r.getNullableFields().iterator();
+ boolean first = true;
+ while (nameIter.hasNext()) {
+ if (first) {
+ first = false;
+ } else {
+ out.println(",");
+ }
+ String name = nameIter.next();
+ TypeExpression texp = typeIter.next();
+ Boolean isNullable = isnullableIter.next();
+ out.print(skip(step + 1) + name + " : ");
+ texp.accept(this, step + 2);
+ if (isNullable) {
+ out.print("?");
+ }
+ }
+ out.println();
+ out.println(skip(step) + "}");
+ }
- @Override
- public void visit(OrderedListTypeDefinition x, Integer step)
- throws AsterixException {
- out.print("OrderedList [");
- x.getItemTypeExpression().accept(this, step + 2);
- out.println("]");
- }
+ @Override
+ public void visit(OrderedListTypeDefinition x, Integer step) throws AsterixException {
+ out.print("OrderedList [");
+ x.getItemTypeExpression().accept(this, step + 2);
+ out.println("]");
+ }
- @Override
- public void visit(UnorderedListTypeDefinition x, Integer step)
- throws AsterixException {
- out.print("UnorderedList <");
- x.getItemTypeExpression().accept(this, step + 2);
- out.println(">");
- }
+ @Override
+ public void visit(UnorderedListTypeDefinition x, Integer step) throws AsterixException {
+ out.print("UnorderedList <");
+ x.getItemTypeExpression().accept(this, step + 2);
+ out.println(">");
+ }
- @Override
- public void visit(DatasetDecl dd, Integer step) throws AsterixException {
- if (dd.getDatasetType() == DatasetType.INTERNAL) {
- out.println(skip(step)
- + "DatasetDecl"
- + dd.getName()
- + "("
- + dd.getItemTypeName()
- + ")"
- + " partitioned by "
- + ((InternalDetailsDecl) dd.getDatasetDetailsDecl())
- .getPartitioningExprs());
- } else if (dd.getDatasetType() == DatasetType.EXTERNAL) {
- out.println(skip(step) + "DatasetDecl" + dd.getName() + "("
- + dd.getItemTypeName() + ")" + "is an external dataset");
- }
- }
+ @Override
+ public void visit(DatasetDecl dd, Integer step) throws AsterixException {
+ if (dd.getDatasetType() == DatasetType.INTERNAL) {
+ out.println(skip(step) + "DatasetDecl" + dd.getName() + "(" + dd.getItemTypeName() + ")"
+ + " partitioned by " + ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getPartitioningExprs());
+ } else if (dd.getDatasetType() == DatasetType.EXTERNAL) {
+ out.println(skip(step) + "DatasetDecl" + dd.getName() + "(" + dd.getItemTypeName() + ")"
+ + "is an external dataset");
+ }
+ }
- @Override
- public void visit(DataverseDecl dv, Integer step) throws AsterixException {
- out.println(skip(step) + "DataverseUse " + dv.getDataverseName());
- }
+ @Override
+ public void visit(DataverseDecl dv, Integer step) throws AsterixException {
+ out.println(skip(step) + "DataverseUse " + dv.getDataverseName());
+ }
- @Override
- public void visit(NodegroupDecl ngd, Integer step) throws AsterixException {
- out.println(skip(step) + "Nodegroup " + ngd.getNodeControllerNames());
- }
+ @Override
+ public void visit(NodegroupDecl ngd, Integer step) throws AsterixException {
+ out.println(skip(step) + "Nodegroup " + ngd.getNodeControllerNames());
+ }
- @Override
- public void visit(LoadFromFileStatement stmtLoad, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(LoadFromFileStatement stmtLoad, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(DropStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(DropStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(WriteStatement ws, Integer step) throws AsterixException {
- out.print(skip(step) + "WriteOutputTo " + ws.getNcName() + ":"
- + ws.getFileName());
- if (ws.getWriterClassName() != null) {
- out.print(" using " + ws.getWriterClassName());
- }
- out.println();
- }
+ @Override
+ public void visit(WriteStatement ws, Integer step) throws AsterixException {
+ out.print(skip(step) + "WriteOutputTo " + ws.getNcName() + ":" + ws.getFileName());
+ if (ws.getWriterClassName() != null) {
+ out.print(" using " + ws.getWriterClassName());
+ }
+ out.println();
+ }
- @Override
- public void visit(SetStatement ss, Integer step) throws AsterixException {
- out.println(skip(step) + "Set " + ss.getPropName() + "="
- + ss.getPropValue());
- }
+ @Override
+ public void visit(SetStatement ss, Integer step) throws AsterixException {
+ out.println(skip(step) + "Set " + ss.getPropName() + "=" + ss.getPropValue());
+ }
- @Override
- public void visit(CreateIndexStatement cis, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(CreateIndexStatement cis, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(DisconnectFeedStatement ss, Integer step)
- throws AsterixException {
- out.println(skip(step) + skip(step) + ss.getFeedName() + skip(step)
- + ss.getDatasetName());
- }
+ @Override
+ public void visit(DisconnectFeedStatement ss, Integer step) throws AsterixException {
+ out.println(skip(step) + skip(step) + ss.getFeedName() + skip(step) + ss.getDatasetName());
+ }
- @Override
- public void visit(UnionExpr u, Integer step) throws AsterixException {
- out.println(skip(step) + "Union [");
- for (Expression expr : u.getExprs()) {
- expr.accept(this, step + 1);
- }
- out.println(skip(step) + "]");
- }
+ @Override
+ public void visit(UnionExpr u, Integer step) throws AsterixException {
+ out.println(skip(step) + "Union [");
+ for (Expression expr : u.getExprs()) {
+ expr.accept(this, step + 1);
+ }
+ out.println(skip(step) + "]");
+ }
- @Override
- public void visit(DistinctClause dc, Integer step) throws AsterixException {
- out.print(skip(step) + "Distinct ");
- for (Expression expr : dc.getDistinctByExpr())
- expr.accept(this, step + 1);
- }
+ @Override
+ public void visit(DistinctClause dc, Integer step) throws AsterixException {
+ out.print(skip(step) + "Distinct ");
+ for (Expression expr : dc.getDistinctByExpr())
+ expr.accept(this, step + 1);
+ }
- @Override
- public void visit(InsertStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(InsertStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(DeleteStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(DeleteStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(UpdateStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(UpdateStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(UpdateClause updateClause, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(UpdateClause updateClause, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(CreateDataverseStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- }
+ @Override
+ public void visit(CreateDataverseStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ }
- @Override
- public void visit(IndexDropStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- }
+ @Override
+ public void visit(IndexDropStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ }
- @Override
- public void visit(NodeGroupDropStatement deleteStatement, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- }
+ @Override
+ public void visit(NodeGroupDropStatement deleteStatement, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ }
- @Override
- public void visit(DataverseDropStatement deleteStatement, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- }
+ @Override
+ public void visit(DataverseDropStatement deleteStatement, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ }
- @Override
- public void visit(TypeDropStatement deleteStatement, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- }
+ @Override
+ public void visit(TypeDropStatement deleteStatement, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ }
- @Override
- public void visit(CreateFunctionStatement cfs, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(CreateFunctionStatement cfs, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(FunctionDropStatement fds, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(FunctionDropStatement fds, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(CreateFeedStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(CreateFeedStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(ConnectFeedStatement stmtDel, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(ConnectFeedStatement stmtDel, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(FeedDropStatement stmt, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(FeedDropStatement stmt, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
- @Override
- public void visit(CompactStatement fds, Integer arg)
- throws AsterixException {
- // TODO Auto-generated method stub
+ @Override
+ public void visit(CompactStatement fds, Integer arg) throws AsterixException {
+ // TODO Auto-generated method stub
- }
+ }
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
index 4077cb6..864f077 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/expression/visitor/IAqlExpressionVisitor.java
@@ -69,128 +69,106 @@
public interface IAqlExpressionVisitor<R, T> {
- R visitQuery(Query q, T arg) throws AsterixException;
+ R visitQuery(Query q, T arg) throws AsterixException;
- R visitFunctionDecl(FunctionDecl fd, T arg) throws AsterixException;
+ R visitFunctionDecl(FunctionDecl fd, T arg) throws AsterixException;
- R visitTypeDecl(TypeDecl td, T arg) throws AsterixException;
+ R visitTypeDecl(TypeDecl td, T arg) throws AsterixException;
- R visitNodegroupDecl(NodegroupDecl ngd, T arg) throws AsterixException;
+ R visitNodegroupDecl(NodegroupDecl ngd, T arg) throws AsterixException;
- R visitDatasetDecl(DatasetDecl dd, T arg) throws AsterixException;
+ R visitDatasetDecl(DatasetDecl dd, T arg) throws AsterixException;
- R visitLoadFromFileStatement(LoadFromFileStatement stmtLoad, T arg)
- throws AsterixException;
+ R visitLoadFromFileStatement(LoadFromFileStatement stmtLoad, T arg) throws AsterixException;
- R visitDropStatement(DropStatement del, T arg) throws AsterixException;
+ R visitDropStatement(DropStatement del, T arg) throws AsterixException;
- R visitInsertStatement(InsertStatement insert, T arg)
- throws AsterixException;
+ R visitInsertStatement(InsertStatement insert, T arg) throws AsterixException;
- R visitDeleteStatement(DeleteStatement del, T arg) throws AsterixException;
+ R visitDeleteStatement(DeleteStatement del, T arg) throws AsterixException;
- R visitUpdateStatement(UpdateStatement update, T arg)
- throws AsterixException;
+ R visitUpdateStatement(UpdateStatement update, T arg) throws AsterixException;
- R visitUpdateClause(UpdateClause del, T arg) throws AsterixException;
+ R visitUpdateClause(UpdateClause del, T arg) throws AsterixException;
- R visitTypeReferenceExpression(TypeReferenceExpression tre, T arg)
- throws AsterixException;
+ R visitTypeReferenceExpression(TypeReferenceExpression tre, T arg) throws AsterixException;
- R visitRecordTypeDefiniton(RecordTypeDefinition tre, T arg)
- throws AsterixException;
+ R visitRecordTypeDefiniton(RecordTypeDefinition tre, T arg) throws AsterixException;
- R visitOrderedListTypeDefiniton(OrderedListTypeDefinition olte, T arg)
- throws AsterixException;
+ R visitOrderedListTypeDefiniton(OrderedListTypeDefinition olte, T arg) throws AsterixException;
- R visitUnorderedListTypeDefiniton(UnorderedListTypeDefinition ulte, T arg)
- throws AsterixException;
+ R visitUnorderedListTypeDefiniton(UnorderedListTypeDefinition ulte, T arg) throws AsterixException;
- R visitLiteralExpr(LiteralExpr l, T arg) throws AsterixException;
+ R visitLiteralExpr(LiteralExpr l, T arg) throws AsterixException;
- R visitVariableExpr(VariableExpr v, T arg) throws AsterixException;
+ R visitVariableExpr(VariableExpr v, T arg) throws AsterixException;
- R visitListConstructor(ListConstructor lc, T arg) throws AsterixException;
+ R visitListConstructor(ListConstructor lc, T arg) throws AsterixException;
- R visitRecordConstructor(RecordConstructor rc, T arg)
- throws AsterixException;
+ R visitRecordConstructor(RecordConstructor rc, T arg) throws AsterixException;
- R visitOperatorExpr(OperatorExpr ifbo, T arg) throws AsterixException;
+ R visitOperatorExpr(OperatorExpr ifbo, T arg) throws AsterixException;
- R visitFieldAccessor(FieldAccessor fa, T arg) throws AsterixException;
+ R visitFieldAccessor(FieldAccessor fa, T arg) throws AsterixException;
- R visitIndexAccessor(IndexAccessor ia, T arg) throws AsterixException;
+ R visitIndexAccessor(IndexAccessor ia, T arg) throws AsterixException;
- R visitIfExpr(IfExpr ifexpr, T arg) throws AsterixException;
+ R visitIfExpr(IfExpr ifexpr, T arg) throws AsterixException;
- R visitFlworExpression(FLWOGRExpression flwor, T arg)
- throws AsterixException;
+ R visitFlworExpression(FLWOGRExpression flwor, T arg) throws AsterixException;
- R visitQuantifiedExpression(QuantifiedExpression qe, T arg)
- throws AsterixException;
+ R visitQuantifiedExpression(QuantifiedExpression qe, T arg) throws AsterixException;
- R visitForClause(ForClause fc, T arg) throws AsterixException;
+ R visitForClause(ForClause fc, T arg) throws AsterixException;
- R visitLetClause(LetClause lc, T arg) throws AsterixException;
+ R visitLetClause(LetClause lc, T arg) throws AsterixException;
- R visitWhereClause(WhereClause wc, T arg) throws AsterixException;
+ R visitWhereClause(WhereClause wc, T arg) throws AsterixException;
- R visitOrderbyClause(OrderbyClause oc, T arg) throws AsterixException;
+ R visitOrderbyClause(OrderbyClause oc, T arg) throws AsterixException;
- R visitGroupbyClause(GroupbyClause gc, T arg) throws AsterixException;
+ R visitGroupbyClause(GroupbyClause gc, T arg) throws AsterixException;
- R visitLimitClause(LimitClause lc, T arg) throws AsterixException;
+ R visitLimitClause(LimitClause lc, T arg) throws AsterixException;
- R visitDistinctClause(DistinctClause dc, T arg) throws AsterixException;
+ R visitDistinctClause(DistinctClause dc, T arg) throws AsterixException;
- R visitUnaryExpr(UnaryExpr u, T arg) throws AsterixException;
+ R visitUnaryExpr(UnaryExpr u, T arg) throws AsterixException;
- R visitUnionExpr(UnionExpr u, T arg) throws AsterixException;
+ R visitUnionExpr(UnionExpr u, T arg) throws AsterixException;
- R visitCreateIndexStatement(CreateIndexStatement cis, T arg)
- throws AsterixException;
+ R visitCreateIndexStatement(CreateIndexStatement cis, T arg) throws AsterixException;
- R visitCreateDataverseStatement(CreateDataverseStatement del, T arg)
- throws AsterixException;
+ R visitCreateDataverseStatement(CreateDataverseStatement del, T arg) throws AsterixException;
- R visitIndexDropStatement(IndexDropStatement del, T arg)
- throws AsterixException;
+ R visitIndexDropStatement(IndexDropStatement del, T arg) throws AsterixException;
- R visitNodeGroupDropStatement(NodeGroupDropStatement del, T arg)
- throws AsterixException;
+ R visitNodeGroupDropStatement(NodeGroupDropStatement del, T arg) throws AsterixException;
- R visitDataverseDropStatement(DataverseDropStatement del, T arg)
- throws AsterixException;
+ R visitDataverseDropStatement(DataverseDropStatement del, T arg) throws AsterixException;
- R visitTypeDropStatement(TypeDropStatement del, T arg)
- throws AsterixException;
+ R visitTypeDropStatement(TypeDropStatement del, T arg) throws AsterixException;
- R visitWriteStatement(WriteStatement ws, T arg) throws AsterixException;
+ R visitWriteStatement(WriteStatement ws, T arg) throws AsterixException;
- R visitSetStatement(SetStatement ss, T arg) throws AsterixException;
+ R visitSetStatement(SetStatement ss, T arg) throws AsterixException;
- R visitDisconnectFeedStatement(DisconnectFeedStatement del, T arg)
- throws AsterixException;
+ R visitDisconnectFeedStatement(DisconnectFeedStatement del, T arg) throws AsterixException;
- R visitConnectFeedStatement(ConnectFeedStatement del, T arg)
- throws AsterixException;
+ R visitConnectFeedStatement(ConnectFeedStatement del, T arg) throws AsterixException;
- R visitCreateFeedStatement(CreateFeedStatement del, T arg)
- throws AsterixException;
+ R visitCreateFeedStatement(CreateFeedStatement del, T arg) throws AsterixException;
- R visitDropFeedStatement(FeedDropStatement del, T arg)
- throws AsterixException;
+ R visitDropFeedStatement(FeedDropStatement del, T arg) throws AsterixException;
- R visitCallExpr(CallExpr pf, T arg) throws AsterixException;
+ R visitCallExpr(CallExpr pf, T arg) throws AsterixException;
- R visitDataverseDecl(DataverseDecl dv, T arg) throws AsterixException;
+ R visitDataverseDecl(DataverseDecl dv, T arg) throws AsterixException;
- R visit(CreateFunctionStatement cfs, T arg) throws AsterixException;
+ R visit(CreateFunctionStatement cfs, T arg) throws AsterixException;
- R visitFunctionDropStatement(FunctionDropStatement del, T arg)
- throws AsterixException;
+ R visitFunctionDropStatement(FunctionDropStatement del, T arg) throws AsterixException;
- R visitCompactStatement(CompactStatement del, T arg)
- throws AsterixException;
+ R visitCompactStatement(CompactStatement del, T arg) throws AsterixException;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/DoubleLiteral.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/DoubleLiteral.java
index 542208a..ca21424 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/DoubleLiteral.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/DoubleLiteral.java
@@ -28,12 +28,11 @@
this.value = value;
}
- @Override
+ @Override
public Double getValue() {
return value;
}
-
public void setValue(Double value) {
this.value = value;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/FloatLiteral.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/FloatLiteral.java
index 07d6641..6ecdae8 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/FloatLiteral.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/FloatLiteral.java
@@ -33,7 +33,6 @@
return value;
}
-
public void setValue(Float value) {
this.value = value;
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/NullLiteral.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/NullLiteral.java
index 36942bb..5429e2f 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/NullLiteral.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/literal/NullLiteral.java
@@ -51,5 +51,5 @@
@Override
public Object getValue() {
return null;
- }
+ }
}
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
index 246e665..b1c4c5d 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/parser/ScopeChecker.java
@@ -162,8 +162,8 @@
public String extractFragment(int beginLine, int beginColumn, int endLine, int endColumn) {
StringBuilder extract = new StringBuilder();
- extract.append(inputLines[beginLine - 1].trim().length() > 1 ? inputLines[beginLine - 1].trim().substring(beginColumn)
- : "");
+ extract.append(inputLines[beginLine - 1].trim().length() > 1 ? inputLines[beginLine - 1].trim().substring(
+ beginColumn) : "");
for (int i = beginLine + 1; i < endLine; i++) {
extract.append("\n");
extract.append(inputLines[i - 1]);
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
index d0a4ed4..248bcd2 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
@@ -94,555 +94,487 @@
public final class AqlRewriter {
- private final Query topExpr;
- private final List<FunctionDecl> declaredFunctions;
- private final AqlRewritingContext context;
- private final MetadataTransactionContext mdTxnCtx;
- private final AqlMetadataProvider metadataProvider;
+ private final Query topExpr;
+ private final List<FunctionDecl> declaredFunctions;
+ private final AqlRewritingContext context;
+ private final MetadataTransactionContext mdTxnCtx;
+ private final AqlMetadataProvider metadataProvider;
- private enum DfsColor {
- WHITE, GRAY, BLACK
- }
+ private enum DfsColor {
+ WHITE,
+ GRAY,
+ BLACK
+ }
- public AqlRewriter(List<FunctionDecl> declaredFunctions, Query topExpr,
- AqlMetadataProvider metadataProvider) {
- this.topExpr = topExpr;
- context = new AqlRewritingContext(topExpr.getVarCounter());
- this.declaredFunctions = declaredFunctions;
- this.mdTxnCtx = metadataProvider.getMetadataTxnContext();
- this.metadataProvider = metadataProvider;
- }
+ public AqlRewriter(List<FunctionDecl> declaredFunctions, Query topExpr, AqlMetadataProvider metadataProvider) {
+ this.topExpr = topExpr;
+ context = new AqlRewritingContext(topExpr.getVarCounter());
+ this.declaredFunctions = declaredFunctions;
+ this.mdTxnCtx = metadataProvider.getMetadataTxnContext();
+ this.metadataProvider = metadataProvider;
+ }
- public Query getExpr() {
- return topExpr;
- }
+ public Query getExpr() {
+ return topExpr;
+ }
- public int getVarCounter() {
- return context.getVarCounter();
- }
+ public int getVarCounter() {
+ return context.getVarCounter();
+ }
- public void rewrite() throws AsterixException {
- wrapInLets();
- inlineDeclaredUdfs();
- }
+ public void rewrite() throws AsterixException {
+ wrapInLets();
+ inlineDeclaredUdfs();
+ }
- private void wrapInLets() {
- // If the top expression of the main statement is not a FLWOR, it wraps
- // it into a let clause.
- if (topExpr == null) {
- return;
- }
- Expression body = topExpr.getBody();
- if (body.getKind() != Kind.FLWOGR_EXPRESSION) {
- VarIdentifier var = context.newVariable();
- VariableExpr v = new VariableExpr(var);
- LetClause c1 = new LetClause(v, body);
- ArrayList<Clause> clauseList = new ArrayList<Clause>(1);
- clauseList.add(c1);
- FLWOGRExpression newBody = new FLWOGRExpression(clauseList,
- new VariableExpr(var));
- topExpr.setBody(newBody);
- }
- }
+ private void wrapInLets() {
+ // If the top expression of the main statement is not a FLWOR, it wraps
+ // it into a let clause.
+ if (topExpr == null) {
+ return;
+ }
+ Expression body = topExpr.getBody();
+ if (body.getKind() != Kind.FLWOGR_EXPRESSION) {
+ VarIdentifier var = context.newVariable();
+ VariableExpr v = new VariableExpr(var);
+ LetClause c1 = new LetClause(v, body);
+ ArrayList<Clause> clauseList = new ArrayList<Clause>(1);
+ clauseList.add(c1);
+ FLWOGRExpression newBody = new FLWOGRExpression(clauseList, new VariableExpr(var));
+ topExpr.setBody(newBody);
+ }
+ }
- private void inlineDeclaredUdfs() throws AsterixException {
- if (topExpr == null) {
- return;
- }
- List<FunctionSignature> funIds = new ArrayList<FunctionSignature>();
- for (FunctionDecl fdecl : declaredFunctions) {
- funIds.add(fdecl.getSignature());
- }
+ private void inlineDeclaredUdfs() throws AsterixException {
+ if (topExpr == null) {
+ return;
+ }
+ List<FunctionSignature> funIds = new ArrayList<FunctionSignature>();
+ for (FunctionDecl fdecl : declaredFunctions) {
+ funIds.add(fdecl.getSignature());
+ }
- List<FunctionDecl> otherFDecls = new ArrayList<FunctionDecl>();
- buildOtherUdfs(topExpr.getBody(), otherFDecls, funIds);
- declaredFunctions.addAll(otherFDecls);
- if (!declaredFunctions.isEmpty()) {
- InlineUdfsVisitor visitor = new InlineUdfsVisitor(context);
- while (topExpr.accept(visitor, declaredFunctions)) {
- // loop until no more changes
- }
- }
- declaredFunctions.removeAll(otherFDecls);
- }
+ List<FunctionDecl> otherFDecls = new ArrayList<FunctionDecl>();
+ buildOtherUdfs(topExpr.getBody(), otherFDecls, funIds);
+ declaredFunctions.addAll(otherFDecls);
+ if (!declaredFunctions.isEmpty()) {
+ InlineUdfsVisitor visitor = new InlineUdfsVisitor(context);
+ while (topExpr.accept(visitor, declaredFunctions)) {
+ // loop until no more changes
+ }
+ }
+ declaredFunctions.removeAll(otherFDecls);
+ }
- private void buildOtherUdfs(Expression expression,
- List<FunctionDecl> functionDecls,
- List<FunctionSignature> declaredFunctions) throws AsterixException {
- if (expression == null) {
- return;
- }
- String value = metadataProvider.getConfig().get(
- FunctionUtils.IMPORT_PRIVATE_FUNCTIONS);
- boolean includePrivateFunctions = (value != null) ? Boolean
- .valueOf(value.toLowerCase()) : false;
- Set<FunctionSignature> functionCalls = getFunctionCalls(expression);
- for (FunctionSignature signature : functionCalls) {
+ private void buildOtherUdfs(Expression expression, List<FunctionDecl> functionDecls,
+ List<FunctionSignature> declaredFunctions) throws AsterixException {
+ if (expression == null) {
+ return;
+ }
+ String value = metadataProvider.getConfig().get(FunctionUtils.IMPORT_PRIVATE_FUNCTIONS);
+ boolean includePrivateFunctions = (value != null) ? Boolean.valueOf(value.toLowerCase()) : false;
+ Set<FunctionSignature> functionCalls = getFunctionCalls(expression);
+ for (FunctionSignature signature : functionCalls) {
- if (declaredFunctions != null
- && declaredFunctions.contains(signature)) {
- continue;
- }
+ if (declaredFunctions != null && declaredFunctions.contains(signature)) {
+ continue;
+ }
- Function function = lookupUserDefinedFunctionDecl(signature);
- if (function == null) {
- if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(
- signature, includePrivateFunctions)) {
- continue;
- }
- StringBuilder messageBuilder = new StringBuilder();
- if (functionDecls.size() > 0) {
- messageBuilder.append(" function "
- + functionDecls.get(functionDecls.size() - 1)
- .getSignature() + " depends upon function "
- + signature + " which is undefined");
- } else {
- messageBuilder.append(" function " + signature
- + " is undefined ");
- }
- throw new AsterixException(messageBuilder.toString());
- }
+ Function function = lookupUserDefinedFunctionDecl(signature);
+ if (function == null) {
+ if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(signature, includePrivateFunctions)) {
+ continue;
+ }
+ StringBuilder messageBuilder = new StringBuilder();
+ if (functionDecls.size() > 0) {
+ messageBuilder.append(" function " + functionDecls.get(functionDecls.size() - 1).getSignature()
+ + " depends upon function " + signature + " which is undefined");
+ } else {
+ messageBuilder.append(" function " + signature + " is undefined ");
+ }
+ throw new AsterixException(messageBuilder.toString());
+ }
- if (function.getLanguage().equalsIgnoreCase(Function.LANGUAGE_AQL)) {
- FunctionDecl functionDecl = FunctionUtils
- .getFunctionDecl(function);
- if (functionDecl != null) {
- if (functionDecls.contains(functionDecl)) {
- throw new AsterixException(
- "ERROR:Recursive invocation "
- + functionDecls.get(
- functionDecls.size() - 1)
- .getSignature() + " <==> "
- + functionDecl.getSignature());
- }
- functionDecls.add(functionDecl);
- buildOtherUdfs(functionDecl.getFuncBody(), functionDecls,
- declaredFunctions);
- }
- }
- }
+ if (function.getLanguage().equalsIgnoreCase(Function.LANGUAGE_AQL)) {
+ FunctionDecl functionDecl = FunctionUtils.getFunctionDecl(function);
+ if (functionDecl != null) {
+ if (functionDecls.contains(functionDecl)) {
+ throw new AsterixException("ERROR:Recursive invocation "
+ + functionDecls.get(functionDecls.size() - 1).getSignature() + " <==> "
+ + functionDecl.getSignature());
+ }
+ functionDecls.add(functionDecl);
+ buildOtherUdfs(functionDecl.getFuncBody(), functionDecls, declaredFunctions);
+ }
+ }
+ }
- }
+ }
- private Function lookupUserDefinedFunctionDecl(FunctionSignature signature)
- throws AsterixException {
- if (signature.getNamespace() == null) {
- return null;
- }
- return MetadataManager.INSTANCE.getFunction(mdTxnCtx, signature);
- }
+ private Function lookupUserDefinedFunctionDecl(FunctionSignature signature) throws AsterixException {
+ if (signature.getNamespace() == null) {
+ return null;
+ }
+ return MetadataManager.INSTANCE.getFunction(mdTxnCtx, signature);
+ }
- private Set<FunctionSignature> getFunctionCalls(Expression expression)
- throws AsterixException {
- Map<AsterixFunction, DfsColor> color = new HashMap<AsterixFunction, DfsColor>();
- Map<AsterixFunction, List<AsterixFunction>> arcs = new HashMap<AsterixFunction, List<AsterixFunction>>();
- GatherFunctionCalls gfc = new GatherFunctionCalls();
- expression.accept(gfc, null);
- return gfc.getCalls();
- }
+ private Set<FunctionSignature> getFunctionCalls(Expression expression) throws AsterixException {
+ Map<AsterixFunction, DfsColor> color = new HashMap<AsterixFunction, DfsColor>();
+ Map<AsterixFunction, List<AsterixFunction>> arcs = new HashMap<AsterixFunction, List<AsterixFunction>>();
+ GatherFunctionCalls gfc = new GatherFunctionCalls();
+ expression.accept(gfc, null);
+ return gfc.getCalls();
+ }
- private static class GatherFunctionCalls implements
- IAqlExpressionVisitor<Void, Void> {
+ private static class GatherFunctionCalls implements IAqlExpressionVisitor<Void, Void> {
- private final Set<FunctionSignature> calls = new HashSet<FunctionSignature>();
+ private final Set<FunctionSignature> calls = new HashSet<FunctionSignature>();
- public GatherFunctionCalls() {
- }
+ public GatherFunctionCalls() {
+ }
- @Override
- public Void visitCallExpr(CallExpr pf, Void arg)
- throws AsterixException {
- calls.add(pf.getFunctionSignature());
- for (Expression e : pf.getExprList()) {
- e.accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitCallExpr(CallExpr pf, Void arg) throws AsterixException {
+ calls.add(pf.getFunctionSignature());
+ for (Expression e : pf.getExprList()) {
+ e.accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitCreateIndexStatement(CreateIndexStatement cis, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitCreateIndexStatement(CreateIndexStatement cis, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDataverseDecl(DataverseDecl dv, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDataverseDecl(DataverseDecl dv, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDeleteStatement(DeleteStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDeleteStatement(DeleteStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDistinctClause(DistinctClause dc, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDistinctClause(DistinctClause dc, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDropStatement(DropStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDropStatement(DropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDatasetDecl(DatasetDecl dd, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDatasetDecl(DatasetDecl dd, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitFieldAccessor(FieldAccessor fa, Void arg)
- throws AsterixException {
- fa.getExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitFieldAccessor(FieldAccessor fa, Void arg) throws AsterixException {
+ fa.getExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitFlworExpression(FLWOGRExpression flwor, Void arg)
- throws AsterixException {
- for (Clause c : flwor.getClauseList()) {
- c.accept(this, arg);
- }
- flwor.getReturnExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitFlworExpression(FLWOGRExpression flwor, Void arg) throws AsterixException {
+ for (Clause c : flwor.getClauseList()) {
+ c.accept(this, arg);
+ }
+ flwor.getReturnExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitForClause(ForClause fc, Void arg)
- throws AsterixException {
- fc.getInExpr().accept(this, arg);
- if (fc.getPosVarExpr() != null) {
- fc.getPosVarExpr().accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitForClause(ForClause fc, Void arg) throws AsterixException {
+ fc.getInExpr().accept(this, arg);
+ if (fc.getPosVarExpr() != null) {
+ fc.getPosVarExpr().accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitFunctionDecl(FunctionDecl fd, Void arg)
- throws AsterixException {
- fd.getFuncBody().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitFunctionDecl(FunctionDecl fd, Void arg) throws AsterixException {
+ fd.getFuncBody().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitGroupbyClause(GroupbyClause gc, Void arg)
- throws AsterixException {
- for (GbyVariableExpressionPair p : gc.getGbyPairList()) {
- p.getExpr().accept(this, arg);
- }
- for (GbyVariableExpressionPair p : gc.getDecorPairList()) {
- p.getExpr().accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitGroupbyClause(GroupbyClause gc, Void arg) throws AsterixException {
+ for (GbyVariableExpressionPair p : gc.getGbyPairList()) {
+ p.getExpr().accept(this, arg);
+ }
+ for (GbyVariableExpressionPair p : gc.getDecorPairList()) {
+ p.getExpr().accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitIfExpr(IfExpr ifexpr, Void arg)
- throws AsterixException {
- ifexpr.getCondExpr().accept(this, arg);
- ifexpr.getThenExpr().accept(this, arg);
- ifexpr.getElseExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitIfExpr(IfExpr ifexpr, Void arg) throws AsterixException {
+ ifexpr.getCondExpr().accept(this, arg);
+ ifexpr.getThenExpr().accept(this, arg);
+ ifexpr.getElseExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitIndexAccessor(IndexAccessor ia, Void arg)
- throws AsterixException {
- ia.getExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitIndexAccessor(IndexAccessor ia, Void arg) throws AsterixException {
+ ia.getExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitInsertStatement(InsertStatement insert, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitInsertStatement(InsertStatement insert, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitLetClause(LetClause lc, Void arg)
- throws AsterixException {
- lc.getBindingExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitLetClause(LetClause lc, Void arg) throws AsterixException {
+ lc.getBindingExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitLimitClause(LimitClause lc, Void arg)
- throws AsterixException {
- lc.getLimitExpr().accept(this, arg);
- if (lc.getOffset() != null) {
- lc.getOffset().accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitLimitClause(LimitClause lc, Void arg) throws AsterixException {
+ lc.getLimitExpr().accept(this, arg);
+ if (lc.getOffset() != null) {
+ lc.getOffset().accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitListConstructor(ListConstructor lc, Void arg)
- throws AsterixException {
- for (Expression e : lc.getExprList()) {
- e.accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitListConstructor(ListConstructor lc, Void arg) throws AsterixException {
+ for (Expression e : lc.getExprList()) {
+ e.accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitLiteralExpr(LiteralExpr l, Void arg)
- throws AsterixException {
- // do nothing
- return null;
- }
+ @Override
+ public Void visitLiteralExpr(LiteralExpr l, Void arg) throws AsterixException {
+ // do nothing
+ return null;
+ }
- @Override
- public Void visitLoadFromFileStatement(LoadFromFileStatement stmtLoad,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitLoadFromFileStatement(LoadFromFileStatement stmtLoad, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitNodegroupDecl(NodegroupDecl ngd, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitNodegroupDecl(NodegroupDecl ngd, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitOperatorExpr(OperatorExpr op, Void arg)
- throws AsterixException {
- for (Expression e : op.getExprList()) {
- e.accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitOperatorExpr(OperatorExpr op, Void arg) throws AsterixException {
+ for (Expression e : op.getExprList()) {
+ e.accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitOrderbyClause(OrderbyClause oc, Void arg)
- throws AsterixException {
- for (Expression e : oc.getOrderbyList()) {
- e.accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitOrderbyClause(OrderbyClause oc, Void arg) throws AsterixException {
+ for (Expression e : oc.getOrderbyList()) {
+ e.accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitOrderedListTypeDefiniton(
- OrderedListTypeDefinition olte, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitOrderedListTypeDefiniton(OrderedListTypeDefinition olte, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitQuantifiedExpression(QuantifiedExpression qe, Void arg)
- throws AsterixException {
- for (QuantifiedPair qp : qe.getQuantifiedList()) {
- qp.getExpr().accept(this, arg);
- }
- qe.getSatisfiesExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitQuantifiedExpression(QuantifiedExpression qe, Void arg) throws AsterixException {
+ for (QuantifiedPair qp : qe.getQuantifiedList()) {
+ qp.getExpr().accept(this, arg);
+ }
+ qe.getSatisfiesExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitQuery(Query q, Void arg) throws AsterixException {
- q.getBody().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitQuery(Query q, Void arg) throws AsterixException {
+ q.getBody().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitRecordConstructor(RecordConstructor rc, Void arg)
- throws AsterixException {
- for (FieldBinding fb : rc.getFbList()) {
- fb.getLeftExpr().accept(this, arg);
- fb.getRightExpr().accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitRecordConstructor(RecordConstructor rc, Void arg) throws AsterixException {
+ for (FieldBinding fb : rc.getFbList()) {
+ fb.getLeftExpr().accept(this, arg);
+ fb.getRightExpr().accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitRecordTypeDefiniton(RecordTypeDefinition tre, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitRecordTypeDefiniton(RecordTypeDefinition tre, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitSetStatement(SetStatement ss, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitSetStatement(SetStatement ss, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitTypeDecl(TypeDecl td, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitTypeDecl(TypeDecl td, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitTypeReferenceExpression(TypeReferenceExpression tre,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitTypeReferenceExpression(TypeReferenceExpression tre, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitUnaryExpr(UnaryExpr u, Void arg)
- throws AsterixException {
- u.getExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitUnaryExpr(UnaryExpr u, Void arg) throws AsterixException {
+ u.getExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitUnionExpr(UnionExpr u, Void arg)
- throws AsterixException {
- for (Expression e : u.getExprs()) {
- e.accept(this, arg);
- }
- return null;
- }
+ @Override
+ public Void visitUnionExpr(UnionExpr u, Void arg) throws AsterixException {
+ for (Expression e : u.getExprs()) {
+ e.accept(this, arg);
+ }
+ return null;
+ }
- @Override
- public Void visitUnorderedListTypeDefiniton(
- UnorderedListTypeDefinition ulte, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitUnorderedListTypeDefiniton(UnorderedListTypeDefinition ulte, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitUpdateClause(UpdateClause del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitUpdateClause(UpdateClause del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitUpdateStatement(UpdateStatement update, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitUpdateStatement(UpdateStatement update, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitVariableExpr(VariableExpr v, Void arg)
- throws AsterixException {
- // do nothing
- return null;
- }
+ @Override
+ public Void visitVariableExpr(VariableExpr v, Void arg) throws AsterixException {
+ // do nothing
+ return null;
+ }
- @Override
- public Void visitWhereClause(WhereClause wc, Void arg)
- throws AsterixException {
- wc.getWhereExpr().accept(this, arg);
- return null;
- }
+ @Override
+ public Void visitWhereClause(WhereClause wc, Void arg) throws AsterixException {
+ wc.getWhereExpr().accept(this, arg);
+ return null;
+ }
- @Override
- public Void visitWriteStatement(WriteStatement ws, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitWriteStatement(WriteStatement ws, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- public Set<FunctionSignature> getCalls() {
- return calls;
- }
+ public Set<FunctionSignature> getCalls() {
+ return calls;
+ }
- @Override
- public Void visitCreateDataverseStatement(CreateDataverseStatement del,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitCreateDataverseStatement(CreateDataverseStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitIndexDropStatement(IndexDropStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitIndexDropStatement(IndexDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitNodeGroupDropStatement(NodeGroupDropStatement del,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitNodeGroupDropStatement(NodeGroupDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDataverseDropStatement(DataverseDropStatement del,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDataverseDropStatement(DataverseDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitTypeDropStatement(TypeDropStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitTypeDropStatement(TypeDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDisconnectFeedStatement(DisconnectFeedStatement del,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDisconnectFeedStatement(DisconnectFeedStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visit(CreateFunctionStatement cfs, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visit(CreateFunctionStatement cfs, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitFunctionDropStatement(FunctionDropStatement del,
- Void arg) throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitFunctionDropStatement(FunctionDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitCreateFeedStatement(CreateFeedStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitCreateFeedStatement(CreateFeedStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitConnectFeedStatement(ConnectFeedStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitConnectFeedStatement(ConnectFeedStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitDropFeedStatement(FeedDropStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitDropFeedStatement(FeedDropStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public Void visitCompactStatement(CompactStatement del, Void arg)
- throws AsterixException {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public Void visitCompactStatement(CompactStatement del, Void arg) throws AsterixException {
+ // TODO Auto-generated method stub
+ return null;
+ }
- }
+ }
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
index 26ed19b..3480bd8 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
@@ -63,7 +63,7 @@
public void deinitialize() throws HyracksDataException;
public double getBloomFilterFalsePositiveRate();
-
+
public List<IVirtualBufferCache> getVirtualBufferCaches(int datasetID);
public IFeedManager getFeedManager();
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixContextInfo.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixContextInfo.java
index db636de..8171d22 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixContextInfo.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixContextInfo.java
@@ -25,5 +25,4 @@
*/
public ICCApplicationContext getCCApplicationContext();
-
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
index 978577a..992d43f 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
@@ -25,7 +25,7 @@
private static final int TXN_LOG_BUFFER_PAGESIZE_DEFAULT = (128 << 10); // 128KB
private static final String TXN_LOG_PARTITIONSIZE_KEY = "txn.log.partitionsize";
- private static final long TXN_LOG_PARTITIONSIZE_DEFAULT = ((long)2 << 30); // 2GB
+ private static final long TXN_LOG_PARTITIONSIZE_DEFAULT = ((long) 2 << 30); // 2GB
private static final String TXN_LOG_CHECKPOINT_LSNTHRESHOLD_KEY = "txn.log.checkpoint.lsnthreshold";
private static final int TXN_LOG_CHECKPOINT_LSNTHRESHOLD_DEFAULT = (64 << 20); // 64M
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/IAsterixPropertiesProvider.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/IAsterixPropertiesProvider.java
index fc6539c..e696519 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/IAsterixPropertiesProvider.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/IAsterixPropertiesProvider.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.common.config;
-
public interface IAsterixPropertiesProvider {
public AsterixStorageProperties getStorageProperties();
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/ITransactionSubsystemProvider.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/ITransactionSubsystemProvider.java
index 27751e3..f0137ba 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/ITransactionSubsystemProvider.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/ITransactionSubsystemProvider.java
@@ -20,6 +20,6 @@
import edu.uci.ics.asterix.common.transactions.ITransactionSubsystem;
import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
-public interface ITransactionSubsystemProvider extends Serializable{
+public interface ITransactionSubsystemProvider extends Serializable {
public ITransactionSubsystem getTransactionSubsystem(IHyracksTaskContext ctx);
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/TransactionSubsystemProvider.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/TransactionSubsystemProvider.java
index 0e8e117..ef8dd85 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/TransactionSubsystemProvider.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/TransactionSubsystemProvider.java
@@ -27,8 +27,8 @@
public class TransactionSubsystemProvider implements ITransactionSubsystemProvider {
@Override
public ITransactionSubsystem getTransactionSubsystem(IHyracksTaskContext ctx) {
- IAsterixAppRuntimeContext runtimeCtx = (IAsterixAppRuntimeContext) ctx.getJobletContext().getApplicationContext()
- .getApplicationObject();
+ IAsterixAppRuntimeContext runtimeCtx = (IAsterixAppRuntimeContext) ctx.getJobletContext()
+ .getApplicationContext().getApplicationObject();
return runtimeCtx.getTransactionSubsystem();
}
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/exceptions/ACIDException.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/exceptions/ACIDException.java
index 857ddd5..16b62f8 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/exceptions/ACIDException.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/exceptions/ACIDException.java
@@ -56,7 +56,7 @@
public ACIDException(String message) {
super(message);
}
-
+
public ACIDException(Throwable cause) {
super(cause);
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/feeds/FeedRuntimeManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/feeds/FeedRuntimeManager.java
index 92aa4ee..a68f6b8 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/feeds/FeedRuntimeManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/feeds/FeedRuntimeManager.java
@@ -107,7 +107,7 @@
feedRuntimes.put(runtimeId, feedRuntime);
}
- public void deregisterFeedRuntime(FeedRuntimeId runtimeId) {
+ public void deregisterFeedRuntime(FeedRuntimeId runtimeId) {
feedRuntimes.remove(runtimeId);
if (feedRuntimes.isEmpty()) {
synchronized (this) {
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
index 4e05048..56d0a4b 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
@@ -19,10 +19,10 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
public class FunctionSignature implements Serializable {
- private String namespace;
- private String name;
- private int arity;
- private String rep;
+ private String namespace;
+ private String name;
+ private int arity;
+ private String rep;
public FunctionSignature(String namespace, String name, int arity) {
this.namespace = namespace;
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/AbstractOperationCallback.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/AbstractOperationCallback.java
index c549e7d..77cc489 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/AbstractOperationCallback.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/AbstractOperationCallback.java
@@ -45,7 +45,7 @@
MurmurHash128Bit.hash3_x64_128(tuple, primaryKeyFields, SEED, longHashes);
return Math.abs((int) longHashes[0]);
}
-
+
public void resetLocalNumActiveOperations() {
transactorLocalNumActiveOperations.set(0);
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ILockManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ILockManager.java
index a752afa..cff2c92 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ILockManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ILockManager.java
@@ -64,10 +64,9 @@
* @param txnContext
* @throws ACIDException
* TODO
- * @return
+ * @return
*/
- public void unlock(DatasetId datasetId, int entityHashValue, ITransactionContext txnContext)
- throws ACIDException;
+ public void unlock(DatasetId datasetId, int entityHashValue, ITransactionContext txnContext) throws ACIDException;
/**
* Call to lock and unlock a specific resource in a specific lock mode
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/IRecoveryManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/IRecoveryManager.java
index 6d2f3cb..6af5ebf 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/IRecoveryManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/IRecoveryManager.java
@@ -33,7 +33,7 @@
HEALTHY,
CORRUPTED
}
-
+
public class ResourceType {
public static final byte LSM_BTREE = 0;
public static final byte LSM_RTREE = 1;
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ITransactionManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ITransactionManager.java
index ffd4cc2..b4bb354 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ITransactionManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/ITransactionManager.java
@@ -52,7 +52,8 @@
*
* @param jobId
* a unique value for the transaction id.
- * @param createIfNotExist TODO
+ * @param createIfNotExist
+ * TODO
* @return
* @throws ACIDException
*/
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/JobId.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/JobId.java
index a08924d..f329e28 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/JobId.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/JobId.java
@@ -50,7 +50,7 @@
return "JID:" + id;
}
- public void setId(int jobId) {
- id = jobId;
- }
+ public void setId(int jobId) {
+ id = jobId;
+ }
}
\ No newline at end of file
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/MutableLong.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/MutableLong.java
index 4480aba..1fd913f 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/MutableLong.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/MutableLong.java
@@ -17,14 +17,13 @@
public class MutableLong {
private long val;
-
public MutableLong() {
}
-
+
public MutableLong(long val) {
this.val = val;
}
-
+
public void set(long val) {
this.val = val;
}
@@ -32,10 +31,10 @@
public long get() {
return val;
}
-
+
@Override
public int hashCode() {
- return (int)val;
+ return (int) val;
}
@Override
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/ANameSchema.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/ANameSchema.java
index a34b1d4..b809745 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/ANameSchema.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/ANameSchema.java
@@ -12,14 +12,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.common.utils;
-
-/*
- * Author: Guangqiang Li
- * Created on Nov 30, 2009
- */
-public class ANameSchema {
- public static final int LOCALNAME_PROPERTY = 0;
- public static final int URI = 1;
- public static final int NODE_TYPE = 2;
-}
+package edu.uci.ics.asterix.common.utils;
+
+/*
+ * Author: Guangqiang Li
+ * Created on Nov 30, 2009
+ */
+public class ANameSchema {
+ public static final int LOCALNAME_PROPERTY = 0;
+ public static final int URI = 1;
+ public static final int NODE_TYPE = 2;
+}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
index 17e85b2..e2228c1 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/utils/UTF8CharSequence.java
@@ -19,73 +19,71 @@
public class UTF8CharSequence implements CharSequence {
- private int start;
- private int len;
- private char[] buf;
+ private int start;
+ private int len;
+ private char[] buf;
- public UTF8CharSequence(IValueReference valueRef, int start) {
- reset(valueRef, start);
- }
+ public UTF8CharSequence(IValueReference valueRef, int start) {
+ reset(valueRef, start);
+ }
- public UTF8CharSequence() {
- }
+ public UTF8CharSequence() {
+ }
- @Override
- public char charAt(int index) {
- if (index >= len || index < 0) {
- throw new IndexOutOfBoundsException("No index " + index
- + " for string of length " + len);
- }
- return buf[index];
- }
+ @Override
+ public char charAt(int index) {
+ if (index >= len || index < 0) {
+ throw new IndexOutOfBoundsException("No index " + index + " for string of length " + len);
+ }
+ return buf[index];
+ }
- @Override
- public int length() {
- return len;
- }
+ @Override
+ public int length() {
+ return len;
+ }
- @Override
- public CharSequence subSequence(int start, int end) {
- UTF8CharSequence carSeq = new UTF8CharSequence();
- carSeq.len = end - start;
- if (end != start) {
- carSeq.buf = new char[carSeq.len];
- System.arraycopy(buf, start, carSeq.buf, 0, carSeq.len);
- }
- return carSeq;
- }
+ @Override
+ public CharSequence subSequence(int start, int end) {
+ UTF8CharSequence carSeq = new UTF8CharSequence();
+ carSeq.len = end - start;
+ if (end != start) {
+ carSeq.buf = new char[carSeq.len];
+ System.arraycopy(buf, start, carSeq.buf, 0, carSeq.len);
+ }
+ return carSeq;
+ }
- public void reset(IValueReference valueRef, int start) {
- this.start = start;
- resetLength(valueRef);
- if (buf == null || buf.length < len) {
- buf = new char[len];
- }
- int sStart = start + 2;
- int c = 0;
- int i = 0;
- byte[] bytes = valueRef.getByteArray();
- while (c < len) {
- buf[i++] = UTF8StringPointable.charAt(bytes, sStart + c);
- c += UTF8StringPointable.charSize(bytes, sStart + c);
- }
+ public void reset(IValueReference valueRef, int start) {
+ this.start = start;
+ resetLength(valueRef);
+ if (buf == null || buf.length < len) {
+ buf = new char[len];
+ }
+ int sStart = start + 2;
+ int c = 0;
+ int i = 0;
+ byte[] bytes = valueRef.getByteArray();
+ while (c < len) {
+ buf[i++] = UTF8StringPointable.charAt(bytes, sStart + c);
+ c += UTF8StringPointable.charSize(bytes, sStart + c);
+ }
- }
+ }
- private void resetLength(IValueReference valueRef) {
- this.len = UTF8StringPointable.getUTFLength(valueRef.getByteArray(),
- start);
- }
+ private void resetLength(IValueReference valueRef) {
+ this.len = UTF8StringPointable.getUTFLength(valueRef.getByteArray(), start);
+ }
- @Override
- public String toString() {
- StringBuffer bf = new StringBuffer();
- if (buf != null) {
- for (int i = 0; i < buf.length; i++) {
- bf.append(buf[i]);
- }
- }
- return new String(bf);
- }
+ @Override
+ public String toString() {
+ StringBuffer bf = new StringBuffer();
+ if (buf != null) {
+ for (int i = 0; i < buf.length; i++) {
+ bf.append(buf[i]);
+ }
+ }
+ return new String(bf);
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/ClusterInfo.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/ClusterInfo.java
index 5a3649f..6b2ee32 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/ClusterInfo.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/ClusterInfo.java
@@ -18,9 +18,9 @@
public class ClusterInfo {
- List<NodeInfo> nodes;
+ List<NodeInfo> nodes;
- public ClusterInfo(List<NodeInfo> nodes) {
- this.nodes = nodes;
- }
+ public ClusterInfo(List<NodeInfo> nodes) {
+ this.nodes = nodes;
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/NodeInfo.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/NodeInfo.java
index c51bae3..b2992b6 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/NodeInfo.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/api/NodeInfo.java
@@ -16,19 +16,19 @@
public class NodeInfo {
- private final String id;
- private final String ip;
+ private final String id;
+ private final String ip;
- public NodeInfo(String id, String ip) {
- this.id = id;
- this.ip = ip;
- }
+ public NodeInfo(String id, String ip) {
+ this.id = id;
+ this.ip = ip;
+ }
- public String getId() {
- return id;
- }
+ public String getId() {
+ return id;
+ }
- public String getIp() {
- return ip;
- }
+ public String getIp() {
+ return ip;
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/driver/EventConfig.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/driver/EventConfig.java
index c86dfae..f9590c0 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/driver/EventConfig.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/driver/EventConfig.java
@@ -18,19 +18,19 @@
public class EventConfig {
- @Option(name = "-h", required = false, usage = "Help")
- public boolean help = false;
+ @Option(name = "-h", required = false, usage = "Help")
+ public boolean help = false;
- @Option(name = "-d", required = false, usage = "Show the execution on a timeline")
- public boolean dryRun = false;
+ @Option(name = "-d", required = false, usage = "Show the execution on a timeline")
+ public boolean dryRun = false;
- @Option(name = "-s", required = false, usage = "Seed for randomization")
- public int seed = -1;
+ @Option(name = "-s", required = false, usage = "Seed for randomization")
+ public int seed = -1;
- @Option(name = "-c", required = true, usage = "Path to cluster configuration (REQUIRED)")
- public String clusterPath;
+ @Option(name = "-c", required = true, usage = "Path to cluster configuration (REQUIRED)")
+ public String clusterPath;
- @Option(name = "-p", required = true, usage = "Path to pattern configuration (REQUIRED)")
- public String patternPath;
+ @Option(name = "-p", required = true, usage = "Path to pattern configuration (REQUIRED)")
+ public String patternPath;
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/error/VerificationUtil.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/error/VerificationUtil.java
index b329171..3ab2809 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/error/VerificationUtil.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/error/VerificationUtil.java
@@ -29,107 +29,98 @@
public class VerificationUtil {
- private static final String VERIFY_SCRIPT_PATH = AsterixEventService
- .getEventHome()
- + File.separator
- + "scripts"
- + File.separator
- + "verify.sh";
+ private static final String VERIFY_SCRIPT_PATH = AsterixEventService.getEventHome() + File.separator + "scripts"
+ + File.separator + "verify.sh";
- public static AsterixRuntimeState getAsterixRuntimeState(
- AsterixInstance instance) throws Exception {
+ public static AsterixRuntimeState getAsterixRuntimeState(AsterixInstance instance) throws Exception {
- Cluster cluster = instance.getCluster();
- List<String> args = new ArrayList<String>();
- args.add(instance.getName());
- args.add(instance.getCluster().getMasterNode().getClusterIp());
- for (Node node : cluster.getNode()) {
- args.add(node.getClusterIp());
- args.add(instance.getName() + "_" + node.getId());
- }
- Thread.sleep(2000);
- String output = AsterixEventServiceUtil.executeLocalScript(
- VERIFY_SCRIPT_PATH, args);
- boolean ccRunning = true;
- List<String> failedNCs = new ArrayList<String>();
- String[] infoFields;
- ProcessInfo pInfo;
- List<ProcessInfo> processes = new ArrayList<ProcessInfo>();
+ Cluster cluster = instance.getCluster();
+ List<String> args = new ArrayList<String>();
+ args.add(instance.getName());
+ args.add(instance.getCluster().getMasterNode().getClusterIp());
+ for (Node node : cluster.getNode()) {
+ args.add(node.getClusterIp());
+ args.add(instance.getName() + "_" + node.getId());
+ }
+ Thread.sleep(2000);
+ String output = AsterixEventServiceUtil.executeLocalScript(VERIFY_SCRIPT_PATH, args);
+ boolean ccRunning = true;
+ List<String> failedNCs = new ArrayList<String>();
+ String[] infoFields;
+ ProcessInfo pInfo;
+ List<ProcessInfo> processes = new ArrayList<ProcessInfo>();
- for (String line : output.split("\n")) {
- String nodeid = null;
- infoFields = line.split(":");
- try {
- int pid = Integer.parseInt(infoFields[3]);
- if (infoFields[0].equals("NC")) {
- nodeid = infoFields[2].split("_")[1];
- } else {
- nodeid = instance.getCluster().getMasterNode().getId();
- }
- pInfo = new ProcessInfo(infoFields[0], infoFields[1], nodeid,
- pid);
- processes.add(pInfo);
- } catch (Exception e) {
- if (infoFields[0].equalsIgnoreCase("CC")) {
- ccRunning = false;
- } else {
- failedNCs.add(infoFields[1]);
- }
- }
- }
- return new AsterixRuntimeState(processes, failedNCs, ccRunning);
- }
+ for (String line : output.split("\n")) {
+ String nodeid = null;
+ infoFields = line.split(":");
+ try {
+ int pid = Integer.parseInt(infoFields[3]);
+ if (infoFields[0].equals("NC")) {
+ nodeid = infoFields[2].split("_")[1];
+ } else {
+ nodeid = instance.getCluster().getMasterNode().getId();
+ }
+ pInfo = new ProcessInfo(infoFields[0], infoFields[1], nodeid, pid);
+ processes.add(pInfo);
+ } catch (Exception e) {
+ if (infoFields[0].equalsIgnoreCase("CC")) {
+ ccRunning = false;
+ } else {
+ failedNCs.add(infoFields[1]);
+ }
+ }
+ }
+ return new AsterixRuntimeState(processes, failedNCs, ccRunning);
+ }
- public static void updateInstanceWithRuntimeDescription(
- AsterixInstance instance, AsterixRuntimeState state,
- boolean expectedRunning) {
- StringBuffer summary = new StringBuffer();
- if (expectedRunning) {
- if (!state.isCcRunning()) {
- summary.append("Cluster Controller not running at "
- + instance.getCluster().getMasterNode().getId() + "\n");
- instance.setState(State.UNUSABLE);
- }
- if (state.getFailedNCs() != null && !state.getFailedNCs().isEmpty()) {
- summary.append("Node Controller not running at the following nodes"
- + "\n");
- for (String failedNC : state.getFailedNCs()) {
- summary.append(failedNC + "\n");
- }
- // instance.setState(State.UNUSABLE);
- }
- if (!(instance.getState().equals(State.UNUSABLE))) {
- instance.setState(State.ACTIVE);
- }
- } else {
- if (state.getProcesses() != null && state.getProcesses().size() > 0) {
- summary.append("Following process still running " + "\n");
- for (ProcessInfo pInfo : state.getProcesses()) {
- summary.append(pInfo + "\n");
- }
- // instance.setState(State.UNUSABLE);
- } else {
- // instance.setState(State.INACTIVE);
- }
- }
- state.setSummary(summary.toString());
- instance.setAsterixRuntimeStates(state);
- }
+ public static void updateInstanceWithRuntimeDescription(AsterixInstance instance, AsterixRuntimeState state,
+ boolean expectedRunning) {
+ StringBuffer summary = new StringBuffer();
+ if (expectedRunning) {
+ if (!state.isCcRunning()) {
+ summary.append("Cluster Controller not running at " + instance.getCluster().getMasterNode().getId()
+ + "\n");
+ instance.setState(State.UNUSABLE);
+ }
+ if (state.getFailedNCs() != null && !state.getFailedNCs().isEmpty()) {
+ summary.append("Node Controller not running at the following nodes" + "\n");
+ for (String failedNC : state.getFailedNCs()) {
+ summary.append(failedNC + "\n");
+ }
+ // instance.setState(State.UNUSABLE);
+ }
+ if (!(instance.getState().equals(State.UNUSABLE))) {
+ instance.setState(State.ACTIVE);
+ }
+ } else {
+ if (state.getProcesses() != null && state.getProcesses().size() > 0) {
+ summary.append("Following process still running " + "\n");
+ for (ProcessInfo pInfo : state.getProcesses()) {
+ summary.append(pInfo + "\n");
+ }
+ // instance.setState(State.UNUSABLE);
+ } else {
+ // instance.setState(State.INACTIVE);
+ }
+ }
+ state.setSummary(summary.toString());
+ instance.setAsterixRuntimeStates(state);
+ }
- public static void verifyBackupRestoreConfiguration(String hdfsUrl,
- String hadoopVersion, String hdfsBackupDir) throws Exception {
- StringBuffer errorCheck = new StringBuffer();
- if (hdfsUrl == null || hdfsUrl.length() == 0) {
- errorCheck.append("\n HDFS Url not configured");
- }
- if (hadoopVersion == null || hadoopVersion.length() == 0) {
- errorCheck.append("\n HDFS version not configured");
- }
- if (hdfsBackupDir == null || hdfsBackupDir.length() == 0) {
- errorCheck.append("\n HDFS backup directory not configured");
- }
- if (errorCheck.length() > 0) {
- throw new Exception("Incomplete hdfs configuration" + errorCheck);
- }
- }
+ public static void verifyBackupRestoreConfiguration(String hdfsUrl, String hadoopVersion, String hdfsBackupDir)
+ throws Exception {
+ StringBuffer errorCheck = new StringBuffer();
+ if (hdfsUrl == null || hdfsUrl.length() == 0) {
+ errorCheck.append("\n HDFS Url not configured");
+ }
+ if (hadoopVersion == null || hadoopVersion.length() == 0) {
+ errorCheck.append("\n HDFS version not configured");
+ }
+ if (hdfsBackupDir == null || hdfsBackupDir.length() == 0) {
+ errorCheck.append("\n HDFS backup directory not configured");
+ }
+ if (errorCheck.length() > 0) {
+ throw new Exception("Incomplete hdfs configuration" + errorCheck);
+ }
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/DefaultOutputHandler.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/DefaultOutputHandler.java
index f7155f3..d05c5ab 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/DefaultOutputHandler.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/DefaultOutputHandler.java
@@ -16,7 +16,6 @@
import edu.uci.ics.asterix.event.schema.pattern.Event;
-
public class DefaultOutputHandler implements IOutputHandler {
@Override
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/IOutputHandler.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/IOutputHandler.java
index 5dd370c..f6cf905 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/IOutputHandler.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/IOutputHandler.java
@@ -16,7 +16,6 @@
import edu.uci.ics.asterix.event.schema.pattern.Event;
-
public interface IOutputHandler {
public OutputAnalysis reportEventOutput(Event event, String output);
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/Randomizer.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/Randomizer.java
index 6d5c492..875ee63 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/Randomizer.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/Randomizer.java
@@ -19,48 +19,47 @@
public class Randomizer {
- private static final Logger LOGGER = Logger.getLogger(Randomizer.class
- .getName());
- private static Randomizer INSTANCE;
- private final Random random;
- private final int seed;
+ private static final Logger LOGGER = Logger.getLogger(Randomizer.class.getName());
+ private static Randomizer INSTANCE;
+ private final Random random;
+ private final int seed;
- public static Randomizer getInstance(int seed) {
- if (INSTANCE == null) {
- INSTANCE = new Randomizer(seed);
- }
- return INSTANCE;
- }
+ public static Randomizer getInstance(int seed) {
+ if (INSTANCE == null) {
+ INSTANCE = new Randomizer(seed);
+ }
+ return INSTANCE;
+ }
- public static Randomizer getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new Randomizer();
- }
- return INSTANCE;
- }
+ public static Randomizer getInstance() {
+ if (INSTANCE == null) {
+ INSTANCE = new Randomizer();
+ }
+ return INSTANCE;
+ }
- private Randomizer() {
- Random rm = new Random();
- seed = rm.nextInt(10000);
- random = new Random(seed);
- LOGGER.info("SEED:" + seed);
- }
+ private Randomizer() {
+ Random rm = new Random();
+ seed = rm.nextInt(10000);
+ random = new Random(seed);
+ LOGGER.info("SEED:" + seed);
+ }
- private Randomizer(int seed) {
- this.seed = seed;
- random = new Random(seed);
- LOGGER.info("SEED:" + seed);
- }
+ private Randomizer(int seed) {
+ this.seed = seed;
+ random = new Random(seed);
+ LOGGER.info("SEED:" + seed);
+ }
- public Random getRandom() {
- return random;
- }
+ public Random getRandom() {
+ return random;
+ }
- public int getSeed() {
- return seed;
- }
+ public int getSeed() {
+ return seed;
+ }
- public int getRandomInt(int min, int max) {
- return min + random.nextInt(max - min + 1);
- }
+ public int getRandomInt(int min, int max) {
+ return min + random.nextInt(max - min + 1);
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/ValueType.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/ValueType.java
index 2524d9a..1098fbe 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/ValueType.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/ValueType.java
@@ -16,79 +16,80 @@
import edu.uci.ics.asterix.event.schema.pattern.Value;
-
public class ValueType {
- public static enum Type {
- ABS, RANDOM_RANGE, RANDOM_MIN_MAX
- }
+ public static enum Type {
+ ABS,
+ RANDOM_RANGE,
+ RANDOM_MIN_MAX
+ }
- private Value value;
- private Type type;
+ private Value value;
+ private Type type;
- public ValueType(Value value) {
- this.value = value;
- if (value.getAbsvalue() != null) {
- type = Type.ABS;
- } else if (value.getRandom() != null) {
- if (value.getRandom().getMinmax() != null) {
- type = Type.RANDOM_MIN_MAX;
- } else if (value.getRandom().getRange() != null) {
- type = Type.RANDOM_RANGE;
- } else {
- throw new IllegalStateException("Incorrect value type");
- }
- }
- }
+ public ValueType(Value value) {
+ this.value = value;
+ if (value.getAbsvalue() != null) {
+ type = Type.ABS;
+ } else if (value.getRandom() != null) {
+ if (value.getRandom().getMinmax() != null) {
+ type = Type.RANDOM_MIN_MAX;
+ } else if (value.getRandom().getRange() != null) {
+ type = Type.RANDOM_RANGE;
+ } else {
+ throw new IllegalStateException("Incorrect value type");
+ }
+ }
+ }
- public int getMin() {
- switch (type) {
- case RANDOM_MIN_MAX:
- return Integer.parseInt(value.getRandom().getMinmax().getMin());
- default:
- throw new IllegalStateException("");
- }
- }
+ public int getMin() {
+ switch (type) {
+ case RANDOM_MIN_MAX:
+ return Integer.parseInt(value.getRandom().getMinmax().getMin());
+ default:
+ throw new IllegalStateException("");
+ }
+ }
- public int getMax() {
- switch (type) {
- case RANDOM_MIN_MAX:
- return Integer.parseInt(value.getRandom().getMinmax().getMax());
- default:
- throw new IllegalStateException("");
- }
- }
+ public int getMax() {
+ switch (type) {
+ case RANDOM_MIN_MAX:
+ return Integer.parseInt(value.getRandom().getMinmax().getMax());
+ default:
+ throw new IllegalStateException("");
+ }
+ }
- public String[] getRangeSet() {
- switch (type) {
- case RANDOM_RANGE:
- return value.getRandom().getRange().getSet().split(" ");
- default:
- throw new IllegalStateException("");
- }
- }
+ public String[] getRangeSet() {
+ switch (type) {
+ case RANDOM_RANGE:
+ return value.getRandom().getRange().getSet().split(" ");
+ default:
+ throw new IllegalStateException("");
+ }
+ }
- public String[] getRangeExcluded() {
- switch (type) {
- case RANDOM_RANGE:
- String exl = value.getRandom().getRange().getExclude();
- return exl != null ? exl.split(" ") : null;
- default:
- throw new IllegalStateException("");
- }
- }
+ public String[] getRangeExcluded() {
+ switch (type) {
+ case RANDOM_RANGE:
+ String exl = value.getRandom().getRange().getExclude();
+ return exl != null ? exl.split(" ") : null;
+ default:
+ throw new IllegalStateException("");
+ }
+ }
- public String getAbsoluteValue() {
- switch (type) {
- case ABS:
- return value.getAbsvalue();
- default:
- throw new IllegalStateException("");
- }
- }
+ public String getAbsoluteValue() {
+ switch (type) {
+ case ABS:
+ return value.getAbsvalue();
+ default:
+ throw new IllegalStateException("");
+ }
+ }
- public Type getType() {
- return type;
- }
+ public Type getType() {
+ return type;
+ }
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/AsterixEventServiceUtil.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/AsterixEventServiceUtil.java
index 2a70862..71233ea 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/AsterixEventServiceUtil.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/AsterixEventServiceUtil.java
@@ -244,8 +244,8 @@
private static Node getMetadataNode(String asterixInstanceName, Cluster cluster) {
Node metadataNode = null;
if (cluster.getMetadataNode() != null) {
- for(Node node: cluster.getNode()){
- if(node.getId().equals(cluster.getMetadataNode())){
+ for (Node node : cluster.getNode()) {
+ if (node.getId().equals(cluster.getMetadataNode())) {
metadataNode = node;
break;
}
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/ServiceProvider.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/ServiceProvider.java
index 56e5337..c5ea908 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/ServiceProvider.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/service/ServiceProvider.java
@@ -18,7 +18,7 @@
public static ServiceProvider INSTANCE = new ServiceProvider();
private static ILookupService lookupService = new ZooKeeperService();
-
+
private ServiceProvider() {
}
@@ -26,5 +26,5 @@
public ILookupService getLookupService() {
return lookupService;
}
-
+
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java
index 45a827c..0c9e4b9 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/dataset/adapter/FileSystemBasedAdapter.java
@@ -37,7 +37,8 @@
protected final IAType sourceDatatype;
protected IHyracksTaskContext ctx;
- public FileSystemBasedAdapter(ITupleParserFactory parserFactory, IAType sourceDatatype, IHyracksTaskContext ctx) throws HyracksDataException {
+ public FileSystemBasedAdapter(ITupleParserFactory parserFactory, IAType sourceDatatype, IHyracksTaskContext ctx)
+ throws HyracksDataException {
this.tupleParser = parserFactory.createTupleParser(ctx);
this.sourceDatatype = sourceDatatype;
this.ctx = ctx;
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunction.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunction.java
index c4c40fd..5f0badd 100755
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunction.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunction.java
@@ -85,9 +85,9 @@
public void deinitialize() {
externalFunction.deinitialize();
}
-
+
@Override
- public void initialize(IFunctionHelper functionHelper) throws Exception{
+ public void initialize(IFunctionHelper functionHelper) throws Exception {
externalFunction.initialize(functionHelper);
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunctionDescriptorProvider.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunctionDescriptorProvider.java
index b3914e2..72ab2f9 100755
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunctionDescriptorProvider.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/ExternalFunctionDescriptorProvider.java
@@ -25,7 +25,8 @@
public class ExternalFunctionDescriptorProvider {
- public static IFunctionDescriptor getExternalFunctionDescriptor(IExternalFunctionInfo finfo) throws AsterixException {
+ public static IFunctionDescriptor getExternalFunctionDescriptor(IExternalFunctionInfo finfo)
+ throws AsterixException {
switch (finfo.getKind()) {
case SCALAR:
return new ExternalScalarFunctionDescriptor(finfo);
@@ -62,4 +63,3 @@
}
}
-
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IFunctionHelper.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IFunctionHelper.java
index 0192e33..43eef52 100755
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IFunctionHelper.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IFunctionHelper.java
@@ -27,6 +27,6 @@
public IJObject getResultObject();
public void setResult(IJObject result) throws IOException, AsterixException;
-
+
public IJObject getObject(JTypeTag jtypeTag);
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IResultCollector.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IResultCollector.java
index fee002e..741e071 100755
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IResultCollector.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/IResultCollector.java
@@ -36,6 +36,6 @@
public void writeListResult(AOrderedList list) throws AsterixException;
public IAObject getComplexTypeResultHolder();
-
+
public DataOutput getDataOutput();
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/RuntimeExternalFunctionUtil.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/RuntimeExternalFunctionUtil.java
index c0b6945..27613bd 100755
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/RuntimeExternalFunctionUtil.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/RuntimeExternalFunctionUtil.java
@@ -97,5 +97,4 @@
}
}
-
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJType.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJType.java
index fcc35eb..dfbc464 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJType.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/library/java/IJType.java
@@ -5,7 +5,7 @@
public interface IJType {
- public ATypeTag getTypeTag();
-
- public IAObject getIAObject();
+ public ATypeTag getTypeTag();
+
+ public IAObject getIAObject();
}
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/DNSResolver.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/DNSResolver.java
index d6de58e5..113a112 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/DNSResolver.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/DNSResolver.java
@@ -35,8 +35,7 @@
if (nodeControllers == null || nodeControllers.isEmpty()) {
throw new AsterixException(" No node controllers found at the address: " + value);
}
- String chosenNCId = nodeControllers.toArray(new String[]{})[random
- .nextInt(nodeControllers.size())];
+ String chosenNCId = nodeControllers.toArray(new String[] {})[random.nextInt(nodeControllers.size())];
return chosenNCId;
} catch (AsterixException ae) {
throw ae;
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolver.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolver.java
index c9572cd..b590ab9 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolver.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolver.java
@@ -17,8 +17,7 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
/**
- * A policy for resolving a name to a node controller id.
- *
+ * A policy for resolving a name to a node controller id.
*/
public interface INodeResolver {
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolverFactory.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolverFactory.java
index 655fe3e..9335f9e 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolverFactory.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/util/INodeResolverFactory.java
@@ -17,7 +17,7 @@
/**
* Factory for creating an instance of INodeResolver
*
- * @see INodeResolver
+ * @see INodeResolver
*/
public interface INodeResolverFactory {
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/AlterCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/AlterCommand.java
index 4be8cd5..44a6428 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/AlterCommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/AlterCommand.java
@@ -29,50 +29,44 @@
public class AlterCommand extends AbstractCommand {
- @Override
- protected void execCommand() throws Exception {
- InstallerDriver.initConfig(true);
- String instanceName = ((AlterConfig) config).name;
- AsterixEventServiceUtil.validateAsterixInstanceExists(instanceName,
- State.INACTIVE);
- ILookupService lookupService = ServiceProvider.INSTANCE
- .getLookupService();
- AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(instanceName);
- AsterixEventServiceUtil.createClusterProperties(instance.getCluster(),
- instance.getAsterixConfiguration());
- AsterixConfiguration asterixConfiguration = InstallerUtil
- .getAsterixConfiguration(((AlterConfig) config).confPath);
- instance.setAsterixConfiguration(asterixConfiguration);
- instance.setModifiedTimestamp(new Date());
- lookupService.updateAsterixInstance(instance);
- LOGGER.info("Altered configuration settings for Asterix instance: "
- + instanceName);
+ @Override
+ protected void execCommand() throws Exception {
+ InstallerDriver.initConfig(true);
+ String instanceName = ((AlterConfig) config).name;
+ AsterixEventServiceUtil.validateAsterixInstanceExists(instanceName, State.INACTIVE);
+ ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
+ AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(instanceName);
+ AsterixEventServiceUtil.createClusterProperties(instance.getCluster(), instance.getAsterixConfiguration());
+ AsterixConfiguration asterixConfiguration = InstallerUtil
+ .getAsterixConfiguration(((AlterConfig) config).confPath);
+ instance.setAsterixConfiguration(asterixConfiguration);
+ instance.setModifiedTimestamp(new Date());
+ lookupService.updateAsterixInstance(instance);
+ LOGGER.info("Altered configuration settings for Asterix instance: " + instanceName);
- }
+ }
- @Override
- protected CommandConfig getCommandConfig() {
- return new AlterConfig();
- }
+ @Override
+ protected CommandConfig getCommandConfig() {
+ return new AlterConfig();
+ }
- @Override
- protected String getUsageDescription() {
- return "\nAlter the instance's configuration settings."
- + "\nPrior to running this command, the instance is required to be INACTIVE state."
- + "\nChanged configuration settings will be reflected when the instance is started."
- + "\n\nAvailable arguments/options"
- + "\n-n name of the ASTERIX instance.";
- }
+ @Override
+ protected String getUsageDescription() {
+ return "\nAlter the instance's configuration settings."
+ + "\nPrior to running this command, the instance is required to be INACTIVE state."
+ + "\nChanged configuration settings will be reflected when the instance is started."
+ + "\n\nAvailable arguments/options" + "\n-n name of the ASTERIX instance.";
+ }
}
class AlterConfig extends CommandConfig {
- @Option(name = "-n", required = true, usage = "Name of Asterix Instance")
- public String name;
+ @Option(name = "-n", required = true, usage = "Name of Asterix Instance")
+ public String name;
- @Option(name = "-a", required = true, usage = "Path to asterix instance configuration")
- public String confPath;
+ @Option(name = "-a", required = true, usage = "Path to asterix instance configuration")
+ public String confPath;
}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/StopCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/StopCommand.java
index 820948c..5aa3123 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/StopCommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/StopCommand.java
@@ -40,7 +40,8 @@
String asterixInstanceName = ((StopConfig) config).name;
AsterixInstance asterixInstance = AsterixEventServiceUtil.validateAsterixInstanceExists(asterixInstanceName,
State.ACTIVE, State.UNUSABLE);
- AsterixEventServiceClient client = AsterixEventService.getAsterixEventServiceClient(asterixInstance.getCluster());
+ AsterixEventServiceClient client = AsterixEventService.getAsterixEventServiceClient(asterixInstance
+ .getCluster());
List<Pattern> ncKillPatterns = new ArrayList<Pattern>();
for (Node node : asterixInstance.getCluster().getNode()) {
diff --git a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixFaultToleranceIT.java b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixFaultToleranceIT.java
index b343fd0..62b79f1 100644
--- a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixFaultToleranceIT.java
+++ b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixFaultToleranceIT.java
@@ -63,7 +63,7 @@
@Test
public void test() throws Exception {
for (TestCaseContext testCaseCtx : testCaseCollection) {
- TestsUtils.executeTest(PATH_ACTUAL, testCaseCtx, null);
+ TestsUtils.executeTest(PATH_ACTUAL, testCaseCtx, null);
}
}
diff --git a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java
index 4574f45..1312c5b 100644
--- a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java
+++ b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java
@@ -41,199 +41,178 @@
public class AsterixInstallerIntegrationUtil {
- private static String managixHome;
- private static String clusterConfigurationPath;
- private static final CommandHandler cmdHandler = new CommandHandler();
- public static final String ASTERIX_INSTANCE_NAME = "asterix";
- private static final String CC_IP_ADDRESS = "127.0.0.1";
- private static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
- private static final int zookeeperClientPort = 2900;
- private static final int zookeeperTestClientPort = 3945;
+ private static String managixHome;
+ private static String clusterConfigurationPath;
+ private static final CommandHandler cmdHandler = new CommandHandler();
+ public static final String ASTERIX_INSTANCE_NAME = "asterix";
+ private static final String CC_IP_ADDRESS = "127.0.0.1";
+ private static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
+ private static final int zookeeperClientPort = 2900;
+ private static final int zookeeperTestClientPort = 3945;
- private static IHyracksClientConnection hcc;
+ private static IHyracksClientConnection hcc;
- private static final Logger LOGGER = Logger
- .getLogger(AsterixInstallerIntegrationUtil.class.getName());
+ private static final Logger LOGGER = Logger.getLogger(AsterixInstallerIntegrationUtil.class.getName());
- public static void deinit() throws Exception {
- deleteInstance();
- stopZookeeper();
- }
+ public static void deinit() throws Exception {
+ deleteInstance();
+ stopZookeeper();
+ }
- public static void init() throws Exception {
- File asterixProjectDir = new File(System.getProperty("user.dir"));
-
-
- File installerTargetDir = new File(asterixProjectDir, "target");
- String managixHomeDirName = installerTargetDir
- .list(new FilenameFilter() {
- @Override
- public boolean accept(File dir, String name) {
- return new File(dir, name).isDirectory()
- && name.startsWith("asterix-installer")
- && name.endsWith("binary-assembly");
- }
+ public static void init() throws Exception {
+ File asterixProjectDir = new File(System.getProperty("user.dir"));
- })[0];
- managixHome = new File(installerTargetDir, managixHomeDirName)
- .getAbsolutePath();
- System.setProperty("log4j.configuration", managixHome + File.separator
- + "conf" + File.separator + "log4j.properties");
+ File installerTargetDir = new File(asterixProjectDir, "target");
+ String managixHomeDirName = installerTargetDir.list(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return new File(dir, name).isDirectory() && name.startsWith("asterix-installer")
+ && name.endsWith("binary-assembly");
+ }
- managixHome = AsterixInstallerIntegrationUtil.getManagixHome();
- clusterConfigurationPath = managixHome + File.separator + "clusters"
- + File.separator + "local" + File.separator + "local.xml";
+ })[0];
+ managixHome = new File(installerTargetDir, managixHomeDirName).getAbsolutePath();
+ System.setProperty("log4j.configuration", managixHome + File.separator + "conf" + File.separator
+ + "log4j.properties");
- InstallerDriver.setManagixHome(managixHome);
+ managixHome = AsterixInstallerIntegrationUtil.getManagixHome();
+ clusterConfigurationPath = managixHome + File.separator + "clusters" + File.separator + "local"
+ + File.separator + "local.xml";
- String command = "configure";
- cmdHandler.processCommand(command.split(" "));
- command = "validate -c " + clusterConfigurationPath;
- cmdHandler.processCommand(command.split(" "));
+ InstallerDriver.setManagixHome(managixHome);
- startZookeeper();
- Thread.sleep(2000);
- InstallerDriver.initConfig(true);
- createInstance();
- hcc = new HyracksConnection(CC_IP_ADDRESS,
- DEFAULT_HYRACKS_CC_CLIENT_PORT);
- }
+ String command = "configure";
+ cmdHandler.processCommand(command.split(" "));
+ command = "validate -c " + clusterConfigurationPath;
+ cmdHandler.processCommand(command.split(" "));
- public static IHyracksClientConnection getHyracksConnection() {
- return hcc;
- }
+ startZookeeper();
+ Thread.sleep(2000);
+ InstallerDriver.initConfig(true);
+ createInstance();
+ hcc = new HyracksConnection(CC_IP_ADDRESS, DEFAULT_HYRACKS_CC_CLIENT_PORT);
+ }
- private static void startZookeeper() throws Exception {
- initZookeeperTestConfiguration(zookeeperClientPort);
- String script = managixHome + File.separator + "bin" + File.separator
- + "managix";
+ public static IHyracksClientConnection getHyracksConnection() {
+ return hcc;
+ }
- // shutdown zookeeper if running
- String command = "shutdown";
- cmdHandler.processCommand(command.split(" "));
+ private static void startZookeeper() throws Exception {
+ initZookeeperTestConfiguration(zookeeperClientPort);
+ String script = managixHome + File.separator + "bin" + File.separator + "managix";
- Thread.sleep(2000);
+ // shutdown zookeeper if running
+ String command = "shutdown";
+ cmdHandler.processCommand(command.split(" "));
- // start zookeeper
- initZookeeperTestConfiguration(zookeeperTestClientPort);
- ProcessBuilder pb2 = new ProcessBuilder(script, "describe");
- Map<String, String> env2 = pb2.environment();
- env2.put("MANAGIX_HOME", managixHome);
- pb2.start();
+ Thread.sleep(2000);
- }
+ // start zookeeper
+ initZookeeperTestConfiguration(zookeeperTestClientPort);
+ ProcessBuilder pb2 = new ProcessBuilder(script, "describe");
+ Map<String, String> env2 = pb2.environment();
+ env2.put("MANAGIX_HOME", managixHome);
+ pb2.start();
- public static void createInstance() throws Exception {
+ }
- String command = null;
- AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(ASTERIX_INSTANCE_NAME);
- if (instance != null) {
- transformIntoRequiredState(State.INACTIVE);
- command = "delete -n " + ASTERIX_INSTANCE_NAME;
- cmdHandler.processCommand(command.split(" "));
- }
+ public static void createInstance() throws Exception {
- command = "create -n " + ASTERIX_INSTANCE_NAME + " " + "-c" + " "
- + clusterConfigurationPath;
- cmdHandler.processCommand(command.split(" "));
+ String command = null;
+ AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+ .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+ if (instance != null) {
+ transformIntoRequiredState(State.INACTIVE);
+ command = "delete -n " + ASTERIX_INSTANCE_NAME;
+ cmdHandler.processCommand(command.split(" "));
+ }
- instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(ASTERIX_INSTANCE_NAME);
- AsterixRuntimeState state = VerificationUtil
- .getAsterixRuntimeState(instance);
- assert (state.getFailedNCs().isEmpty() && state.isCcRunning());
- }
+ command = "create -n " + ASTERIX_INSTANCE_NAME + " " + "-c" + " " + clusterConfigurationPath;
+ cmdHandler.processCommand(command.split(" "));
- private static void initZookeeperTestConfiguration(int port)
- throws JAXBException, FileNotFoundException {
- String installerConfPath = InstallerDriver.getManagixHome()
- + File.separator + InstallerDriver.MANAGIX_CONF_XML;
- JAXBContext ctx = JAXBContext.newInstance(Configuration.class);
- Unmarshaller unmarshaller = ctx.createUnmarshaller();
- Configuration configuration = (Configuration) unmarshaller
- .unmarshal(new File(installerConfPath));
- configuration.getZookeeper().setClientPort(new BigInteger("" + port));
- Marshaller marshaller = ctx.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- marshaller.marshal(configuration, new FileOutputStream(
- installerConfPath));
- }
+ instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(ASTERIX_INSTANCE_NAME);
+ AsterixRuntimeState state = VerificationUtil.getAsterixRuntimeState(instance);
+ assert (state.getFailedNCs().isEmpty() && state.isCcRunning());
+ }
- public static void transformIntoRequiredState(AsterixInstance.State state)
- throws Exception {
- AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(ASTERIX_INSTANCE_NAME);
- assert (instance != null);
- if (instance.getState().equals(state)) {
- return;
- }
- if (state.equals(AsterixInstance.State.UNUSABLE)) {
- throw new IllegalArgumentException("Invalid desired state");
- }
+ private static void initZookeeperTestConfiguration(int port) throws JAXBException, FileNotFoundException {
+ String installerConfPath = InstallerDriver.getManagixHome() + File.separator + InstallerDriver.MANAGIX_CONF_XML;
+ JAXBContext ctx = JAXBContext.newInstance(Configuration.class);
+ Unmarshaller unmarshaller = ctx.createUnmarshaller();
+ Configuration configuration = (Configuration) unmarshaller.unmarshal(new File(installerConfPath));
+ configuration.getZookeeper().setClientPort(new BigInteger("" + port));
+ Marshaller marshaller = ctx.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ marshaller.marshal(configuration, new FileOutputStream(installerConfPath));
+ }
- String command = null;
- switch (instance.getState()) {
- case ACTIVE:
- command = "stop -n " + ASTERIX_INSTANCE_NAME;
- break;
- case INACTIVE:
- command = "start -n " + ASTERIX_INSTANCE_NAME;
- break;
- }
- cmdHandler.processCommand(command.split(" "));
- }
+ public static void transformIntoRequiredState(AsterixInstance.State state) throws Exception {
+ AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+ .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+ assert (instance != null);
+ if (instance.getState().equals(state)) {
+ return;
+ }
+ if (state.equals(AsterixInstance.State.UNUSABLE)) {
+ throw new IllegalArgumentException("Invalid desired state");
+ }
- private static void stopZookeeper() throws IOException, JAXBException {
- String script = managixHome + File.separator + "bin" + File.separator
- + "managix";
- // shutdown zookeeper if running
- ProcessBuilder pb = new ProcessBuilder(script, "shutdown");
- Map<String, String> env = pb.environment();
- env.put("MANAGIX_HOME", managixHome);
- pb.start();
- }
+ String command = null;
+ switch (instance.getState()) {
+ case ACTIVE:
+ command = "stop -n " + ASTERIX_INSTANCE_NAME;
+ break;
+ case INACTIVE:
+ command = "start -n " + ASTERIX_INSTANCE_NAME;
+ break;
+ }
+ cmdHandler.processCommand(command.split(" "));
+ }
- private static void deleteInstance() throws Exception {
- String command = null;
- AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+ private static void stopZookeeper() throws IOException, JAXBException {
+ String script = managixHome + File.separator + "bin" + File.separator + "managix";
+ // shutdown zookeeper if running
+ ProcessBuilder pb = new ProcessBuilder(script, "shutdown");
+ Map<String, String> env = pb.environment();
+ env.put("MANAGIX_HOME", managixHome);
+ pb.start();
+ }
- if (instance == null) {
- return;
- } else {
- transformIntoRequiredState(State.INACTIVE);
- command = "delete -n " + ASTERIX_INSTANCE_NAME;
- cmdHandler.processCommand(command.split(" "));
- }
- instance = ServiceProvider.INSTANCE.getLookupService()
- .getAsterixInstance(ASTERIX_INSTANCE_NAME);
- assert (instance == null);
- }
+ private static void deleteInstance() throws Exception {
+ String command = null;
+ AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+ .getAsterixInstance(ASTERIX_INSTANCE_NAME);
- public static String getManagixHome() {
- return managixHome;
- }
+ if (instance == null) {
+ return;
+ } else {
+ transformIntoRequiredState(State.INACTIVE);
+ command = "delete -n " + ASTERIX_INSTANCE_NAME;
+ cmdHandler.processCommand(command.split(" "));
+ }
+ instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(ASTERIX_INSTANCE_NAME);
+ assert (instance == null);
+ }
- public static void installLibrary(String libraryName,
- String libraryDataverse, String libraryPath) throws Exception {
- transformIntoRequiredState(State.INACTIVE);
- String command = "install -n " + ASTERIX_INSTANCE_NAME + " -d "
- + libraryDataverse + " -l " + libraryName + " -p "
- + libraryPath;
- cmdHandler.processCommand(command.split(" "));
- }
+ public static String getManagixHome() {
+ return managixHome;
+ }
- public static void uninstallLibrary(String dataverseName, String libraryName)
- throws Exception {
- transformIntoRequiredState(State.INACTIVE);
- String command = "uninstall -n " + ASTERIX_INSTANCE_NAME + " -d "
- + dataverseName + " -l " + "libraryName";
- cmdHandler.processCommand(command.split(" "));
- }
+ public static void installLibrary(String libraryName, String libraryDataverse, String libraryPath) throws Exception {
+ transformIntoRequiredState(State.INACTIVE);
+ String command = "install -n " + ASTERIX_INSTANCE_NAME + " -d " + libraryDataverse + " -l " + libraryName
+ + " -p " + libraryPath;
+ cmdHandler.processCommand(command.split(" "));
+ }
- public static void executeCommand(String command) throws Exception {
- cmdHandler.processCommand(command.trim().split(" "));
- }
+ public static void uninstallLibrary(String dataverseName, String libraryName) throws Exception {
+ transformIntoRequiredState(State.INACTIVE);
+ String command = "uninstall -n " + ASTERIX_INSTANCE_NAME + " -d " + dataverseName + " -l " + "libraryName";
+ cmdHandler.processCommand(command.split(" "));
+ }
+
+ public static void executeCommand(String command) throws Exception {
+ cmdHandler.processCommand(command.trim().split(" "));
+ }
}
diff --git a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/transaction/RecoveryIT.java b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/transaction/RecoveryIT.java
index 89cbec8..99283d7 100644
--- a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/transaction/RecoveryIT.java
+++ b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/transaction/RecoveryIT.java
@@ -84,7 +84,7 @@
scriptHomePath = asterixInstallerPath + File.separator + "src" + File.separator + "test" + File.separator
+ "resources" + File.separator + "transactionts" + File.separator + "scripts";
env.put("SCRIPT_HOME", scriptHomePath);
-
+
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "configure_and_validate.sh");
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataException.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataException.java
index e58466d..b606839 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataException.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/MetadataException.java
@@ -17,7 +17,6 @@
import edu.uci.ics.asterix.common.exceptions.AsterixException;
-
public class MetadataException extends AsterixException {
private static final long serialVersionUID = 1L;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataEntity.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataEntity.java
index 6a553bd..971b9a7 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataEntity.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/api/IMetadataEntity.java
@@ -20,11 +20,11 @@
import edu.uci.ics.asterix.metadata.MetadataCache;
public interface IMetadataEntity extends Serializable {
-
+
public static final int PENDING_NO_OP = 0;
public static final int PENDING_ADD_OP = 1;
public static final int PENDING_DROP_OP = 2;
-
+
Object addToCache(MetadataCache cache);
Object dropFromCache(MetadataCache cache);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
index 68f9a74..632b6fd 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataPrimaryIndexes.java
@@ -57,7 +57,6 @@
public static final int FIRST_AVAILABLE_USER_DATASET_ID = 100;
-
/**
* Create all metadata primary index descriptors. MetadataRecordTypes must
* have been initialized before calling this init.
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/dataset/hints/IHint.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/dataset/hints/IHint.java
index 519c831..d4a937d 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/dataset/hints/IHint.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/dataset/hints/IHint.java
@@ -16,7 +16,6 @@
import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-
/**
* Represents a hint provided as part of an AQL statement.
*/
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitDataSink.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitDataSink.java
index 0827f09..3e61ec5 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitDataSink.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitDataSink.java
@@ -18,7 +18,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSink;
import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPartitioningProperty;
-
public class FileSplitDataSink implements IDataSink {
private FileSplitSinkId id;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitSinkId.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitSinkId.java
index 9ca7291..5801002 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitSinkId.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/FileSplitSinkId.java
@@ -17,7 +17,6 @@
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
-
public class FileSplitSinkId {
private FileSplit fileSplit;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java
index 50c6225..3fd9285 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java
@@ -20,7 +20,6 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty;
import edu.uci.ics.hyracks.algebricks.core.algebra.properties.ResultSetDomain;
-
public class ResultSetDataSink implements IDataSink {
private ResultSetSinkId id;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java
index 4fa3907..99d026b 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java
@@ -16,7 +16,6 @@
import edu.uci.ics.hyracks.api.dataset.ResultSetId;
-
public class ResultSetSinkId {
private final ResultSetId resultSetId;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataverse.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataverse.java
index 7b894f1..4eee082 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataverse.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Dataverse.java
@@ -42,7 +42,7 @@
public String getDataFormat() {
return dataFormat;
}
-
+
public int getPendingOp() {
return pendingOp;
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
index ed7efae..773cc8d 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/Index.java
@@ -98,11 +98,11 @@
public boolean isPrimaryIndex() {
return isPrimaryIndex;
}
-
+
public int getPendingOp() {
return pendingOp;
}
-
+
public void setPendingOp(int pendingOp) {
this.pendingOp = pendingOp;
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/AbstractFeedDatasourceAdapter.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/AbstractFeedDatasourceAdapter.java
index 4921920..2dc7c56 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/AbstractFeedDatasourceAdapter.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/AbstractFeedDatasourceAdapter.java
@@ -1,6 +1,5 @@
package edu.uci.ics.asterix.metadata.feeds;
-
public abstract class AbstractFeedDatasourceAdapter implements IDatasourceAdapter {
private static final long serialVersionUID = 1L;
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/FeedMessageOperatorDescriptor.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/FeedMessageOperatorDescriptor.java
index d33bf5e..9b00322 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/FeedMessageOperatorDescriptor.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/feeds/FeedMessageOperatorDescriptor.java
@@ -45,6 +45,4 @@
return new FeedMessageOperatorNodePushable(ctx, feedId, feedMessage, partition, nPartitions);
}
-
-
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/AsterixExternalScalarFunctionInfo.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/AsterixExternalScalarFunctionInfo.java
index 6bf5be3..4a06b7d 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/AsterixExternalScalarFunctionInfo.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/AsterixExternalScalarFunctionInfo.java
@@ -35,5 +35,4 @@
super();
}
-
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/ExternalFunctionCompilerUtil.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
index f699c41..d0e6aeb 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/functions/ExternalFunctionCompilerUtil.java
@@ -49,10 +49,9 @@
public class ExternalFunctionCompilerUtil implements Serializable {
- private static Pattern orderedListPattern = Pattern.compile("\\[*\\]");
- private static Pattern unorderedListPattern = Pattern.compile("[{{*}}]");
+ private static Pattern orderedListPattern = Pattern.compile("\\[*\\]");
+ private static Pattern unorderedListPattern = Pattern.compile("[{{*}}]");
-
public static IFunctionInfo getExternalFunctionInfo(MetadataTransactionContext txnCtx, Function function)
throws MetadataException {
@@ -211,7 +210,7 @@
// TODO Auto-generated method stub
return null;
}
-
+
public static void main(String args[]) throws FileNotFoundException, IOException {
ExternalFunctionCompilerUtil obj = new ExternalFunctionCompilerUtil();
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/tmp/ecu.obj"));
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
index e263e87..ba7e65e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AListElementToken.java
@@ -26,7 +26,7 @@
protected int length;
protected int tokenLength;
protected int typeTag;
-
+
@Override
public byte[] getData() {
return data;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AqlNullableTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AqlNullableTypeComputer.java
index 3b474fd..f71fcf4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AqlNullableTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/common/AqlNullableTypeComputer.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.dataflow.data.common;
-
import edu.uci.ics.asterix.om.types.AUnionType;
import edu.uci.ics.asterix.om.types.IAType;
import edu.uci.ics.asterix.om.types.TypeHelper;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
index d2396e0..d83b0a0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
@@ -65,7 +65,7 @@
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
-
+
if (b1[s1] == ATypeTag.NULL.serialize()) {
if (b2[s2] == ATypeTag.NULL.serialize())
return 0;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
index 27456e4..c1f5c3d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
@@ -56,6 +56,6 @@
} catch (IOException e) {
throw new AlgebricksException(e);
}
-
+
}
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
index 1386bb1..466df99 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
@@ -27,7 +27,7 @@
public static final ADayTimeDurationPrinter INSTANCE = new ADayTimeDurationPrinter();
private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
-
+
@Override
public void init() throws AlgebricksException {
// TODO Auto-generated method stub
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinterFactory.java
index 782cfde..4ae93e1 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AFloatPrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AFloatPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16PrinterFactory.java
index 20c2b7d..f578020 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt16PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32PrinterFactory.java
index b530f03..9887f17 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt32PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt32PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8PrinterFactory.java
index 59cb480..7ae5169 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt8PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AIntervalPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AIntervalPrinter.java
index 2ab8d19..9272100 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AIntervalPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AIntervalPrinter.java
@@ -46,21 +46,21 @@
if (typetag == ATypeTag.DATE.serialize()) {
ps.print("-date(\"");
timeInstancePrinter = ADatePrinter.INSTANCE;
- ((ADatePrinter)timeInstancePrinter).printString(b, s + 4, 4, ps);
+ ((ADatePrinter) timeInstancePrinter).printString(b, s + 4, 4, ps);
ps.print(", ");
- ((ADatePrinter)timeInstancePrinter).printString(b, s + 12, 4, ps);
+ ((ADatePrinter) timeInstancePrinter).printString(b, s + 12, 4, ps);
} else if (typetag == ATypeTag.TIME.serialize()) {
ps.print("-time(\"");
timeInstancePrinter = ATimePrinter.INSTANCE;
- ((ATimePrinter)timeInstancePrinter).printString(b, s + 4, 4, ps);
+ ((ATimePrinter) timeInstancePrinter).printString(b, s + 4, 4, ps);
ps.print(", ");
- ((ATimePrinter)timeInstancePrinter).printString(b, s + 12, 4, ps);
+ ((ATimePrinter) timeInstancePrinter).printString(b, s + 12, 4, ps);
} else if (typetag == ATypeTag.DATETIME.serialize()) {
ps.print("-datetime(\"");
timeInstancePrinter = ADateTimePrinter.INSTANCE;
- ((ADateTimePrinter)timeInstancePrinter).printString(b, s, 8, ps);
+ ((ADateTimePrinter) timeInstancePrinter).printString(b, s, 8, ps);
ps.print(", ");
- ((ADateTimePrinter)timeInstancePrinter).printString(b, s + 8, 8, ps);
+ ((ADateTimePrinter) timeInstancePrinter).printString(b, s + 8, 8, ps);
} else {
throw new AlgebricksException("Unsupport internal time types in interval: " + typetag);
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinterFactory.java
index cbd0450..bfbf3f0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ANullPrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class ANullPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinterFactory.java
index 3f74c36..f3c1a29 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/APointPrinterFactory.java
@@ -17,7 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
public class APointPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java
index aceec9f..b8371ee 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AFloatPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java
index cd309d0..65bf3d9 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt16PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java
index ac6badd..1707960 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt32PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java
index 755fb22..8b6467a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class AInt8PrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java
index 1930d10..4dc33e8 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java
@@ -17,8 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
-
public class ANullPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java
index 7fbcd2b..a6c0cc0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java
@@ -17,7 +17,6 @@
import edu.uci.ics.hyracks.algebricks.data.IPrinter;
import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
-
public class APointPrinterFactory implements IPrinterFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java
index 1f93b21..a4cdbfa 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java
@@ -48,8 +48,8 @@
unionList = unionType.getUnionList();
printers = new IPrinter[unionType.getUnionList().size()];
for (int i = 0; i < printers.length; i++) {
- printers[i] = (AqlJSONPrinterFactoryProvider.INSTANCE
- .getPrinterFactory(unionType.getUnionList().get(i))).createPrinter();
+ printers[i] = (AqlJSONPrinterFactoryProvider.INSTANCE.getPrinterFactory(unionType.getUnionList()
+ .get(i))).createPrinter();
printers[i].init();
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
index fb077bd..8b34558 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
@@ -69,17 +69,18 @@
short timeOffset = (short) ((datetime.charAt(0) == '-') ? 1 : 0);
timeOffset += 8;
-
- if(datetime.charAt(timeOffset) != 'T'){
+
+ if (datetime.charAt(timeOffset) != 'T') {
timeOffset += 2;
- if(datetime.charAt(timeOffset) != 'T'){
+ if (datetime.charAt(timeOffset) != 'T') {
throw new AlgebricksException(errorMessage + ": missing T");
}
}
chrononTimeInMs = ADateParserFactory.parseDatePart(datetime, 0, timeOffset);
- chrononTimeInMs += ATimeParserFactory.parseTimePart(datetime, timeOffset + 1, datetime.length() - timeOffset - 1);
+ chrononTimeInMs += ATimeParserFactory.parseTimePart(datetime, timeOffset + 1, datetime.length()
+ - timeOffset - 1);
} catch (Exception e) {
throw new HyracksDataException(e);
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
index 269c508..513ca46 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARectangleSerializerDeserializer.java
@@ -102,7 +102,8 @@
Double.parseDouble(points[1].split(",")[1]));
if (aRectanglePoint1.getX() > aRectanglePoint2.getX() && aRectanglePoint1.getY() > aRectanglePoint2.getY()) {
aRectangle.setValue(aRectanglePoint2, aRectanglePoint1);
- } else if (aRectanglePoint1.getX() < aRectanglePoint2.getX() && aRectanglePoint1.getY() < aRectanglePoint2.getY()) {
+ } else if (aRectanglePoint1.getX() < aRectanglePoint2.getX()
+ && aRectanglePoint1.getY() < aRectanglePoint2.getY()) {
aRectangle.setValue(aRectanglePoint1, aRectanglePoint2);
} else {
throw new IllegalArgumentException(
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
index 91316f2..a881ece 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
@@ -36,7 +36,7 @@
private static final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ATIME);
private static final AMutableTime aTime = new AMutableTime(0);
-
+
private ATimeSerializerDeserializer() {
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/valueproviders/AqlPrimitiveValueProviderFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/valueproviders/AqlPrimitiveValueProviderFactory.java
index f7a05c6..eb27cb9 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/valueproviders/AqlPrimitiveValueProviderFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/valueproviders/AqlPrimitiveValueProviderFactory.java
@@ -23,7 +23,6 @@
import edu.uci.ics.hyracks.storage.am.rtree.impls.FloatPrimitiveValueProviderFactory;
import edu.uci.ics.hyracks.storage.am.rtree.impls.IntegerPrimitiveValueProviderFactory;
-
public class AqlPrimitiveValueProviderFactory implements IPrimitiveValueProviderFactory {
private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
index c5f833e..3ebedde 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
@@ -83,6 +83,6 @@
public INormalizedKeyComputerFactoryProvider getNormalizedKeyComputerFactoryProvider();
public IBinaryHashFunctionFamilyProvider getBinaryHashFunctionFamilyProvider();
-
+
public IPredicateEvaluatorFactoryProvider getPredicateEvaluatorFactoryProvider();
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFamilyProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFamilyProvider.java
index 7763bae..cd7e1fd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFamilyProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFamilyProvider.java
@@ -26,20 +26,18 @@
* We use a type-independent binary hash function family from the hyracks
* codebase
*/
-public class AqlBinaryHashFunctionFamilyProvider implements
- IBinaryHashFunctionFamilyProvider, Serializable {
+public class AqlBinaryHashFunctionFamilyProvider implements IBinaryHashFunctionFamilyProvider, Serializable {
- private static final long serialVersionUID = 1L;
- public static final AqlBinaryHashFunctionFamilyProvider INSTANCE = new AqlBinaryHashFunctionFamilyProvider();
+ private static final long serialVersionUID = 1L;
+ public static final AqlBinaryHashFunctionFamilyProvider INSTANCE = new AqlBinaryHashFunctionFamilyProvider();
- private AqlBinaryHashFunctionFamilyProvider() {
+ private AqlBinaryHashFunctionFamilyProvider() {
- }
+ }
- @Override
- public IBinaryHashFunctionFamily getBinaryHashFunctionFamily(Object type)
- throws AlgebricksException {
- return MurmurHash3BinaryHashFunctionFamily.INSTANCE;
- }
+ @Override
+ public IBinaryHashFunctionFamily getBinaryHashFunctionFamily(Object type) throws AlgebricksException {
+ return MurmurHash3BinaryHashFunctionFamily.INSTANCE;
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPredicateEvaluatorFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPredicateEvaluatorFactoryProvider.java
index f4fa74e..7facab3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPredicateEvaluatorFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlPredicateEvaluatorFactoryProvider.java
@@ -26,51 +26,53 @@
Provides PredicateEvaluator for equi-join cases to properly take care of NULL fields, being compared with each other.
If any of the join keys, from either side, is NULL, record should not pass equi-join condition.
*/
-public class AqlPredicateEvaluatorFactoryProvider implements IPredicateEvaluatorFactoryProvider{
-
- private static final long serialVersionUID = 1L;
- public static final AqlPredicateEvaluatorFactoryProvider INSTANCE = new AqlPredicateEvaluatorFactoryProvider();
-
- @Override
- public IPredicateEvaluatorFactory getPredicateEvaluatorFactory(final int[] keys0, final int[] keys1) {
-
- return new IPredicateEvaluatorFactory() {
- private static final long serialVersionUID = 1L;
- @Override
- public IPredicateEvaluator createPredicateEvaluator() {
- return new IPredicateEvaluator() {
-
- @Override
- public boolean evaluate(IFrameTupleAccessor fta0, int tupId0,
- IFrameTupleAccessor fta1, int tupId1) {
-
- int tStart0 = fta0.getTupleStartOffset(tupId0);
- int fStartOffset0 = fta0.getFieldSlotsLength() + tStart0;
-
- for(int k0 : keys0){
- int fieldStartIx = fta0.getFieldStartOffset(tupId0, k0);
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(fta0.getBuffer().array()[fieldStartIx + fStartOffset0]);
- if(typeTag == ATypeTag.NULL){
- return false;
- }
- }
-
- int tStart1 = fta1.getTupleStartOffset(tupId1);
- int fStartOffset1 = fta1.getFieldSlotsLength() + tStart1;
-
- for(int k1 : keys1){
- int fieldStartIx = fta1.getFieldStartOffset(tupId1, k1);
- ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(fta1.getBuffer().array()[fieldStartIx + fStartOffset1]);
- if(typeTag == ATypeTag.NULL){
- return false;
- }
- }
-
- return true; //none of the fields (from both sides) is NULL
- }
- };
- }
- };
- }
+public class AqlPredicateEvaluatorFactoryProvider implements IPredicateEvaluatorFactoryProvider {
+
+ private static final long serialVersionUID = 1L;
+ public static final AqlPredicateEvaluatorFactoryProvider INSTANCE = new AqlPredicateEvaluatorFactoryProvider();
+
+ @Override
+ public IPredicateEvaluatorFactory getPredicateEvaluatorFactory(final int[] keys0, final int[] keys1) {
+
+ return new IPredicateEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IPredicateEvaluator createPredicateEvaluator() {
+ return new IPredicateEvaluator() {
+
+ @Override
+ public boolean evaluate(IFrameTupleAccessor fta0, int tupId0, IFrameTupleAccessor fta1, int tupId1) {
+
+ int tStart0 = fta0.getTupleStartOffset(tupId0);
+ int fStartOffset0 = fta0.getFieldSlotsLength() + tStart0;
+
+ for (int k0 : keys0) {
+ int fieldStartIx = fta0.getFieldStartOffset(tupId0, k0);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(fta0.getBuffer()
+ .array()[fieldStartIx + fStartOffset0]);
+ if (typeTag == ATypeTag.NULL) {
+ return false;
+ }
+ }
+
+ int tStart1 = fta1.getTupleStartOffset(tupId1);
+ int fStartOffset1 = fta1.getFieldSlotsLength() + tStart1;
+
+ for (int k1 : keys1) {
+ int fieldStartIx = fta1.getFieldStartOffset(tupId1, k1);
+ ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(fta1.getBuffer()
+ .array()[fieldStartIx + fStartOffset1]);
+ if (typeTag == ATypeTag.NULL) {
+ return false;
+ }
+ }
+
+ return true; //none of the fields (from both sides) is NULL
+ }
+ };
+ }
+ };
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
index a7cebb5..86308e1 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
@@ -12,73 +12,73 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.om.base;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.visitors.IOMVisitor;
-
-public class ADouble implements IAObject {
-
- protected double value;
-
- public ADouble(double value) {
- super();
- this.value = value;
- }
-
- public double getDoubleValue() {
- return value;
- }
-
- @Override
- public IAType getType() {
- return BuiltinType.ADOUBLE;
- }
-
- @Override
- public String toString() {
- return "ADouble: {" + value + "}";
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof ADouble))
- return false;
- return value == (((ADouble) obj).getDoubleValue());
- }
-
- @Override
- public int hashCode() {
- long bits = Double.doubleToLongBits(value);
- return (int) (bits ^ (bits >>> 32));
- }
-
- @Override
- public void accept(IOMVisitor visitor) throws AsterixException {
- visitor.visitADouble(this);
- }
-
- @Override
- public boolean deepEqual(IAObject obj) {
- return equals(obj);
- }
-
- @Override
- public int hash() {
- return hashCode();
- }
-
- @Override
- public JSONObject toJSON() throws JSONException {
- JSONObject json = new JSONObject();
-
- json.put("ADouble", value);
-
- return json;
- }
-}
+package edu.uci.ics.asterix.om.base;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+
+public class ADouble implements IAObject {
+
+ protected double value;
+
+ public ADouble(double value) {
+ super();
+ this.value = value;
+ }
+
+ public double getDoubleValue() {
+ return value;
+ }
+
+ @Override
+ public IAType getType() {
+ return BuiltinType.ADOUBLE;
+ }
+
+ @Override
+ public String toString() {
+ return "ADouble: {" + value + "}";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof ADouble))
+ return false;
+ return value == (((ADouble) obj).getDoubleValue());
+ }
+
+ @Override
+ public int hashCode() {
+ long bits = Double.doubleToLongBits(value);
+ return (int) (bits ^ (bits >>> 32));
+ }
+
+ @Override
+ public void accept(IOMVisitor visitor) throws AsterixException {
+ visitor.visitADouble(this);
+ }
+
+ @Override
+ public boolean deepEqual(IAObject obj) {
+ return equals(obj);
+ }
+
+ @Override
+ public int hash() {
+ return hashCode();
+ }
+
+ @Override
+ public JSONObject toJSON() throws JSONException {
+ JSONObject json = new JSONObject();
+
+ json.put("ADouble", value);
+
+ return json;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
index dc3d0b5..c1a7543 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
@@ -12,88 +12,88 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.om.base;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.visitors.IOMVisitor;
-
-public class AInt32 implements IAObject {
-
- protected int value;
-
- public AInt32(int value) {
- super();
- this.value = value;
- }
-
- public AInt32(byte[] bytes, int offset, int length) {
- value = valueFromBytes(bytes, offset, length);
- }
-
- public Integer getIntegerValue() {
- return value;
- }
-
- @Override
- public IAType getType() {
- return BuiltinType.AINT32;
- }
-
- @Override
- public String toString() {
- return "AInt32: {" + value + "}";
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AInt32)) {
- return false;
- } else {
- return value == (((AInt32) obj).getIntegerValue());
- }
- }
-
- @Override
- public int hashCode() {
- return value;
- }
-
- private static Integer valueFromBytes(byte[] bytes, int offset, int length) {
- return ((bytes[offset] & 0xff) << 24) + ((bytes[offset + 1] & 0xff) << 16) + ((bytes[offset + 2] & 0xff) << 8)
- + ((bytes[offset + 3] & 0xff) << 0);
- }
-
- public byte[] toBytes() {
- return new byte[] { (byte) (value >>> 24), (byte) (value >> 16 & 0xff), (byte) (value >> 8 & 0xff),
- (byte) (value & 0xff) };
- }
-
- @Override
- public void accept(IOMVisitor visitor) throws AsterixException {
- visitor.visitAInt32(this);
- }
-
- @Override
- public boolean deepEqual(IAObject obj) {
- return equals(obj);
- }
-
- @Override
- public int hash() {
- return hashCode();
- }
-
- @Override
- public JSONObject toJSON() throws JSONException {
- JSONObject json = new JSONObject();
-
- json.put("AInt32", value);
-
- return json;
- }
-}
+package edu.uci.ics.asterix.om.base;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+
+public class AInt32 implements IAObject {
+
+ protected int value;
+
+ public AInt32(int value) {
+ super();
+ this.value = value;
+ }
+
+ public AInt32(byte[] bytes, int offset, int length) {
+ value = valueFromBytes(bytes, offset, length);
+ }
+
+ public Integer getIntegerValue() {
+ return value;
+ }
+
+ @Override
+ public IAType getType() {
+ return BuiltinType.AINT32;
+ }
+
+ @Override
+ public String toString() {
+ return "AInt32: {" + value + "}";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AInt32)) {
+ return false;
+ } else {
+ return value == (((AInt32) obj).getIntegerValue());
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return value;
+ }
+
+ private static Integer valueFromBytes(byte[] bytes, int offset, int length) {
+ return ((bytes[offset] & 0xff) << 24) + ((bytes[offset + 1] & 0xff) << 16) + ((bytes[offset + 2] & 0xff) << 8)
+ + ((bytes[offset + 3] & 0xff) << 0);
+ }
+
+ public byte[] toBytes() {
+ return new byte[] { (byte) (value >>> 24), (byte) (value >> 16 & 0xff), (byte) (value >> 8 & 0xff),
+ (byte) (value & 0xff) };
+ }
+
+ @Override
+ public void accept(IOMVisitor visitor) throws AsterixException {
+ visitor.visitAInt32(this);
+ }
+
+ @Override
+ public boolean deepEqual(IAObject obj) {
+ return equals(obj);
+ }
+
+ @Override
+ public int hash() {
+ return hashCode();
+ }
+
+ @Override
+ public JSONObject toJSON() throws JSONException {
+ JSONObject json = new JSONObject();
+
+ json.put("AInt32", value);
+
+ return json;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
index 7cb490c..93c0b22 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
@@ -20,20 +20,19 @@
public final class AMutableUnorderedList extends AUnorderedList {
- public AMutableUnorderedList(AUnorderedListType type) {
- super(type);
- }
+ public AMutableUnorderedList(AUnorderedListType type) {
+ super(type);
+ }
- public AMutableUnorderedList(AUnorderedListType type,
- ArrayList<IAObject> sequence) {
- super(type, sequence);
- }
+ public AMutableUnorderedList(AUnorderedListType type, ArrayList<IAObject> sequence) {
+ super(type, sequence);
+ }
- public void add(IAObject obj) {
- values.add(obj);
- }
+ public void add(IAObject obj) {
+ values.add(obj);
+ }
- public void clear() {
- values.clear();
- }
+ public void clear() {
+ values.clear();
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
index a758ee6..c6b8af4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
@@ -12,71 +12,71 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.om.base;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.om.types.BuiltinType;
-import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.om.visitors.IOMVisitor;
-
-public class AString implements IAObject {
-
- protected String value;
-
- public AString(String value) {
- this.value = value;
- }
-
- public String getStringValue() {
- return value;
- }
-
- @Override
- public IAType getType() {
- return BuiltinType.ASTRING;
- }
-
- @Override
- public String toString() {
- return "AString: {" + value + "}";
- }
-
- @Override
- public boolean equals(Object obj) {
- if (!(obj instanceof AString))
- return false;
- return value.equals(((AString) obj).getStringValue());
- }
-
- @Override
- public int hashCode() {
- return value.hashCode();
- }
-
- @Override
- public void accept(IOMVisitor visitor) throws AsterixException {
- visitor.visitAString(this);
- }
-
- @Override
- public boolean deepEqual(IAObject obj) {
- return equals(obj);
- }
-
- @Override
- public int hash() {
- return hashCode();
- }
-
- @Override
- public JSONObject toJSON() throws JSONException {
- JSONObject json = new JSONObject();
-
- json.put("AString", value);
-
- return json;
- }
-}
+package edu.uci.ics.asterix.om.base;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+
+public class AString implements IAObject {
+
+ protected String value;
+
+ public AString(String value) {
+ this.value = value;
+ }
+
+ public String getStringValue() {
+ return value;
+ }
+
+ @Override
+ public IAType getType() {
+ return BuiltinType.ASTRING;
+ }
+
+ @Override
+ public String toString() {
+ return "AString: {" + value + "}";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AString))
+ return false;
+ return value.equals(((AString) obj).getStringValue());
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public void accept(IOMVisitor visitor) throws AsterixException {
+ visitor.visitAString(this);
+ }
+
+ @Override
+ public boolean deepEqual(IAObject obj) {
+ return equals(obj);
+ }
+
+ @Override
+ public int hash() {
+ return hashCode();
+ }
+
+ @Override
+ public JSONObject toJSON() throws JSONException {
+ JSONObject json = new JSONObject();
+
+ json.put("AString", value);
+
+ return json;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateParserFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateParserFactory.java
index 61482ff..97edb5c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateParserFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateParserFactory.java
@@ -60,8 +60,7 @@
* @return
* @throws Exception
*/
- public static long parseDatePart(String dateString, int start, int length)
- throws HyracksDataException {
+ public static long parseDatePart(String dateString, int start, int length) throws HyracksDataException {
int offset = 0;
@@ -139,14 +138,14 @@
if (length > offset) {
throw new HyracksDataException("Too many chars for a date only value");
}
-
- if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)){
+
+ if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)) {
throw new HyracksDataException(dateErrorMessage);
}
-
+
return GregorianCalendarSystem.getInstance().getChronon(year, month, day, 0, 0, 0, 0, 0);
}
-
+
/**
* A copy-and-paste of {@link #parseDatePart(String, int, int)} but for a char array, in order
* to avoid object creation.
@@ -157,8 +156,7 @@
* @return
* @throws HyracksDataException
*/
- public static long parseDatePart(char[] dateString, int start, int length)
- throws HyracksDataException {
+ public static long parseDatePart(char[] dateString, int start, int length) throws HyracksDataException {
int offset = 0;
@@ -236,11 +234,11 @@
if (length > offset) {
throw new HyracksDataException("Too many chars for a date only value");
}
-
- if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)){
+
+ if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)) {
throw new HyracksDataException(dateErrorMessage);
}
-
+
return GregorianCalendarSystem.getInstance().getChronon(year, month, day, 0, 0, 0, 0, 0);
}
@@ -254,8 +252,7 @@
* @return
* @throws HyracksDataException
*/
- public static long parseDatePart(byte[] dateString, int start, int length)
- throws HyracksDataException {
+ public static long parseDatePart(byte[] dateString, int start, int length) throws HyracksDataException {
int offset = 0;
@@ -333,11 +330,11 @@
if (length > offset) {
throw new HyracksDataException("Too many chars for a date only value");
}
-
- if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)){
+
+ if (!GregorianCalendarSystem.getInstance().validate(year, month, day, 0, 0, 0, 0)) {
throw new HyracksDataException(dateErrorMessage);
}
-
+
return GregorianCalendarSystem.getInstance().getChronon(year, month, day, 0, 0, 0, 0, 0);
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
index 8bc0286..d795382 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
@@ -1135,7 +1135,7 @@
public static boolean isSpatialFilterFunction(FunctionIdentifier fi) {
return spatialFilterFunctions.get(getAsterixFunctionInfo(fi)) != null;
}
-
+
static {
similarityFunctions.add(getAsterixFunctionInfo(SIMILARITY_JACCARD));
similarityFunctions.add(getAsterixFunctionInfo(SIMILARITY_JACCARD_CHECK));
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java
index 0f08787..6de1006 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixExternalFunctionInfo.java
@@ -29,17 +29,17 @@
private final FunctionKind kind;
private final IAType returnType;
- public AsterixExternalFunctionInfo(){
+ public AsterixExternalFunctionInfo() {
super();
rtc = null;
- argumentTypes= null;
+ argumentTypes = null;
body = null;
- language=null;
+ language = null;
kind = null;
returnType = null;
-
+
}
-
+
public AsterixExternalFunctionInfo(String namespace, AsterixFunction asterixFunction, FunctionKind kind,
List<IAType> argumentTypes, IAType returnType, IResultTypeComputer rtc, String body, String language) {
super(namespace, asterixFunction);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java
index b4c47cd..02debfa 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixFunctionIdentifier.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.functions;
-
public class AsterixFunctionIdentifier {
private final String dataverse;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java
index 1eb4174..c824578 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/FunctionInfoRepository.java
@@ -47,4 +47,3 @@
functionMap.put(functionSignature, new AsterixFunctionInfo(fid));
}
}
-
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java
index a2bfc13..47e9957 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IExternalFunctionInfo.java
@@ -25,7 +25,7 @@
public interface IExternalFunctionInfo extends IFunctionInfo, Serializable {
public IResultTypeComputer getResultTypeComputer();
-
+
public IAType getReturnType();
public String getFunctionBody();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptorFactory.java
index 2cf7288..a94f46b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptorFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/IFunctionDescriptorFactory.java
@@ -19,6 +19,7 @@
/**
* the artifact registered in function manager
+ *
* @return a new IFunctionDescriptor instance
*/
public IFunctionDescriptor createFunctionDescriptor();
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
index 77b4d38..d08537e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/ARecordPointable.java
@@ -39,7 +39,6 @@
* This class interprets the binary data representation of a record. One can
* call getFieldNames, getFieldTypeTags and getFieldValues to get pointable
* objects for field names, field type tags, and field values.
- *
*/
public class ARecordPointable extends AbstractVisitablePointable {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ADoubleTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ADoubleTypeComputer.java
index e3f0c0f..bd5ed7c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ADoubleTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ADoubleTypeComputer.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AFloatTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AFloatTypeComputer.java
index cd0f8b1..3ff2635 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AFloatTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AFloatTypeComputer.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ARectangleTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ARectangleTypeComputer.java
index 0872b80..88b75f5 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ARectangleTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/ARectangleTypeComputer.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
index fe29823..b17d518 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractBinaryStringTypeComputer.java
@@ -24,17 +24,16 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
/**
- *
* @author Xiaoyu Ma
*/
abstract public class AbstractBinaryStringTypeComputer implements IResultTypeComputer {
-
+
@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().size() < 2)
- throw new AlgebricksException("Wrong Argument Number.");
+ if (fce.getArguments().size() < 2)
+ throw new AlgebricksException("Wrong Argument Number.");
ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
IAType t0, t1;
@@ -44,14 +43,13 @@
} catch (AlgebricksException e) {
throw new AlgebricksException(e);
}
- if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING) ||
- (t1.getTypeTag() != ATypeTag.NULL && t1.getTypeTag() != ATypeTag.STRING)) {
+ if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING)
+ || (t1.getTypeTag() != ATypeTag.NULL && t1.getTypeTag() != ATypeTag.STRING)) {
throw new AlgebricksException("Expects String Type.");
- }
+ }
return getResultType(t0, t1);
- }
-
-
+ }
+
public abstract IAType getResultType(IAType t0, IAType t1);
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
index 751b082..3f0ac2a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractQuadStringTypeComputer.java
@@ -25,40 +25,38 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
/**
- *
* @author Xiaoyu Ma
*/
public abstract class AbstractQuadStringTypeComputer implements IResultTypeComputer {
-
+
@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().size() < 4)
- throw new AlgebricksException("Wrong Argument Number.");
+ if (fce.getArguments().size() < 4)
+ throw new AlgebricksException("Wrong Argument Number.");
ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
- ILogicalExpression arg2 = fce.getArguments().get(2).getValue();
- ILogicalExpression arg3 = fce.getArguments().get(3).getValue();
+ ILogicalExpression arg2 = fce.getArguments().get(2).getValue();
+ ILogicalExpression arg3 = fce.getArguments().get(3).getValue();
IAType t0, t1, t2, t3;
try {
t0 = (IAType) env.getType(arg0);
t1 = (IAType) env.getType(arg1);
- t2 = (IAType) env.getType(arg2);
- t3 = (IAType) env.getType(arg3);
+ t2 = (IAType) env.getType(arg2);
+ t3 = (IAType) env.getType(arg3);
} catch (AlgebricksException e) {
throw new AlgebricksException(e);
}
- if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING) ||
- (t1.getTypeTag() != ATypeTag.NULL && t1.getTypeTag() != ATypeTag.STRING) ||
- (t2.getTypeTag() != ATypeTag.NULL && t2.getTypeTag() != ATypeTag.STRING) ||
- (t3.getTypeTag() != ATypeTag.NULL && t3.getTypeTag() != ATypeTag.STRING)) {
+ if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING)
+ || (t1.getTypeTag() != ATypeTag.NULL && t1.getTypeTag() != ATypeTag.STRING)
+ || (t2.getTypeTag() != ATypeTag.NULL && t2.getTypeTag() != ATypeTag.STRING)
+ || (t3.getTypeTag() != ATypeTag.NULL && t3.getTypeTag() != ATypeTag.STRING)) {
throw new NotImplementedException("Expects String Type.");
}
return getResultType(t0, t1, t2, t3);
- }
-
-
- public abstract IAType getResultType(IAType t0, IAType t1, IAType t2, IAType t3);
+ }
+
+ public abstract IAType getResultType(IAType t0, IAType t1, IAType t2, IAType t3);
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
index 66b707f..cdf48df 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/AbstractTripleStringTypeComputer.java
@@ -24,36 +24,35 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
/**
- *
* @author Xiaoyu Ma
*/
public abstract class AbstractTripleStringTypeComputer implements IResultTypeComputer {
-
+
@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().size() < 3)
- throw new AlgebricksException("Wrong Argument Number.");
+ if (fce.getArguments().size() < 3)
+ throw new AlgebricksException("Wrong Argument Number.");
ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
- ILogicalExpression arg2 = fce.getArguments().get(2).getValue();
+ ILogicalExpression arg2 = fce.getArguments().get(2).getValue();
IAType t0, t1, t2;
try {
t0 = (IAType) env.getType(arg0);
t1 = (IAType) env.getType(arg1);
- t2 = (IAType) env.getType(arg2);
+ t2 = (IAType) env.getType(arg2);
} catch (AlgebricksException e) {
throw new AlgebricksException(e);
}
- if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING) || (t1.getTypeTag() != ATypeTag.NULL &&
- t1.getTypeTag() != ATypeTag.STRING) || (t2.getTypeTag() != ATypeTag.NULL && t2.getTypeTag() != ATypeTag.STRING)) {
+ if ((t0.getTypeTag() != ATypeTag.NULL && t0.getTypeTag() != ATypeTag.STRING)
+ || (t1.getTypeTag() != ATypeTag.NULL && t1.getTypeTag() != ATypeTag.STRING)
+ || (t2.getTypeTag() != ATypeTag.NULL && t2.getTypeTag() != ATypeTag.STRING)) {
throw new AlgebricksException("Expects String Type.");
}
return getResultType(t0, t1, t2);
- }
-
-
+ }
+
public abstract IAType getResultType(IAType t0, IAType t1, IAType t2);
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryBooleanOrNullFunctionTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryBooleanOrNullFunctionTypeComputer.java
index f44a416..5e7d6e0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryBooleanOrNullFunctionTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryBooleanOrNullFunctionTypeComputer.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.ATypeTag;
import edu.uci.ics.asterix.om.types.AUnionType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringBoolOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringBoolOrNullTypeComputer.java
index 5051ee5..3a9fd08 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringBoolOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringBoolOrNullTypeComputer.java
@@ -20,18 +20,19 @@
import edu.uci.ics.asterix.om.types.TypeHelper;
/**
- *
* @author Xiaoyu Ma
*/
public class BinaryStringBoolOrNullTypeComputer extends AbstractBinaryStringTypeComputer {
public static final BinaryStringBoolOrNullTypeComputer INSTANCE = new BinaryStringBoolOrNullTypeComputer();
- private BinaryStringBoolOrNullTypeComputer() {}
-
+
+ private BinaryStringBoolOrNullTypeComputer() {
+ }
+
@Override
public IAType getResultType(IAType t0, IAType t1) {
if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1)) {
return AUnionType.createNullableType(BuiltinType.ABOOLEAN);
- }
+ }
return BuiltinType.ABOOLEAN;
- }
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringStringOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringStringOrNullTypeComputer.java
index 3a301b2..da91ee3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringStringOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/BinaryStringStringOrNullTypeComputer.java
@@ -20,20 +20,21 @@
import edu.uci.ics.asterix.om.types.TypeHelper;
/**
- *
* @author Xiaoyu Ma
*/
public class BinaryStringStringOrNullTypeComputer extends AbstractBinaryStringTypeComputer {
-
+
public static final BinaryStringStringOrNullTypeComputer INSTANCE = new BinaryStringStringOrNullTypeComputer();
- private BinaryStringStringOrNullTypeComputer() {}
+
+ private BinaryStringStringOrNullTypeComputer() {
+ }
@Override
public IAType getResultType(IAType t0, IAType t1) {
if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1)) {
return AUnionType.createNullableType(BuiltinType.ASTRING);
- }
+ }
return BuiltinType.ASTRING;
}
-
+
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericAddSubMulDivTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericAddSubMulDivTypeComputer.java
index 154ce65..0bbf8a3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericAddSubMulDivTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericAddSubMulDivTypeComputer.java
@@ -280,7 +280,7 @@
break;
}
case DURATION: {
- switch(tag2){
+ switch (tag2) {
case DATE:
unionList.add(BuiltinType.ADATE);
break;
@@ -297,7 +297,7 @@
break;
}
case YEARMONTHDURATION: {
- switch(tag2){
+ switch (tag2) {
case DATE:
unionList.add(BuiltinType.ADATE);
break;
@@ -317,7 +317,7 @@
break;
}
case DAYTIMEDURATION: {
- switch(tag2){
+ switch (tag2) {
case DATE:
unionList.add(BuiltinType.ADATE);
break;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
index 8af3ef2..79b0bce 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericRoundHalfToEven2TypeComputer.java
@@ -37,8 +37,7 @@
public class NonTaggedNumericRoundHalfToEven2TypeComputer implements IResultTypeComputer {
- public static final NonTaggedNumericRoundHalfToEven2TypeComputer INSTANCE =
- new NonTaggedNumericRoundHalfToEven2TypeComputer();
+ public static final NonTaggedNumericRoundHalfToEven2TypeComputer INSTANCE = new NonTaggedNumericRoundHalfToEven2TypeComputer();
private NonTaggedNumericRoundHalfToEven2TypeComputer() {
}
@@ -47,17 +46,17 @@
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().size() < 2)
- throw new AlgebricksException("Argument number invalid.");
-
+ if (fce.getArguments().size() < 2)
+ throw new AlgebricksException("Argument number invalid.");
+
ILogicalExpression arg1 = fce.getArguments().get(0).getValue();
ILogicalExpression arg2 = fce.getArguments().get(1).getValue();
-
+
IAType t1 = (IAType) env.getType(arg1);
IAType t2 = (IAType) env.getType(arg2);
-
+
List<IAType> unionList = new ArrayList<IAType>();
- unionList.add(BuiltinType.ANULL);
+ unionList.add(BuiltinType.ANULL);
ATypeTag tag1, tag2;
if (t1.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) t1))
@@ -71,33 +70,33 @@
.getTypeTag();
else
tag2 = t2.getTypeTag();
-
- switch(tag2) {
- case INT8:
- case INT16:
- case INT32:
- case INT64:
- break;
- default:
- throw new AlgebricksException("Argument $precision cannot be type " + t2.getTypeName());
- }
-
+
+ switch (tag2) {
+ case INT8:
+ case INT16:
+ case INT32:
+ case INT64:
+ break;
+ default:
+ throw new AlgebricksException("Argument $precision cannot be type " + t2.getTypeName());
+ }
+
switch (tag1) {
case INT8:
unionList.add(BuiltinType.AINT8);
- break;
+ break;
case INT16:
unionList.add(BuiltinType.AINT16);
- break;
+ break;
case INT32:
unionList.add(BuiltinType.AINT32);
- break;
+ break;
case INT64:
unionList.add(BuiltinType.AINT64);
- break;
+ break;
case FLOAT:
unionList.add(BuiltinType.AFLOAT);
- break;
+ break;
case DOUBLE:
unionList.add(BuiltinType.ADOUBLE);
break;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
index 91e3ad8..b4d9f4c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NonTaggedNumericUnaryFunctionTypeComputer.java
@@ -38,8 +38,7 @@
public class NonTaggedNumericUnaryFunctionTypeComputer implements IResultTypeComputer {
private static final String errMsg = "Arithmetic operations are not implemented for ";
- public static final NonTaggedNumericUnaryFunctionTypeComputer INSTANCE =
- new NonTaggedNumericUnaryFunctionTypeComputer();
+ public static final NonTaggedNumericUnaryFunctionTypeComputer INSTANCE = new NonTaggedNumericUnaryFunctionTypeComputer();
private NonTaggedNumericUnaryFunctionTypeComputer() {
}
@@ -48,37 +47,36 @@
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().isEmpty())
+ if (fce.getArguments().isEmpty())
throw new AlgebricksException("Wrong Argument Number.");
-
+
ILogicalExpression arg1 = fce.getArguments().get(0).getValue();
IAType t = (IAType) env.getType(arg1);
ATypeTag tag = t.getTypeTag();
- if (tag == ATypeTag.UNION
- && NonTaggedFormatUtil.isOptionalField((AUnionType) env.getType(arg1))) {
+ if (tag == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) env.getType(arg1))) {
return (IAType) env.getType(arg1);
}
-
+
List<IAType> unionList = new ArrayList<IAType>();
unionList.add(BuiltinType.ANULL);
switch (tag) {
case INT8:
unionList.add(BuiltinType.AINT8);
- break;
+ break;
case INT16:
unionList.add(BuiltinType.AINT16);
- break;
+ break;
case INT32:
unionList.add(BuiltinType.AINT32);
- break;
+ break;
case INT64:
unionList.add(BuiltinType.AINT64);
- break;
+ break;
case FLOAT:
unionList.add(BuiltinType.AFLOAT);
- break;
+ break;
case DOUBLE:
unionList.add(BuiltinType.ADOUBLE);
break;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NumericAddSubMulTypeDescriptor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NumericAddSubMulTypeDescriptor.java
index 26c61b2..01499f0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NumericAddSubMulTypeDescriptor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/NumericAddSubMulTypeDescriptor.java
@@ -14,7 +14,6 @@
*/
package edu.uci.ics.asterix.om.typecomputer.impl;
-
import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
import edu.uci.ics.asterix.om.types.BuiltinType;
import edu.uci.ics.asterix.om.types.IAType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/QuadStringStringOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/QuadStringStringOrNullTypeComputer.java
index c504671..4b77dc6 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/QuadStringStringOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/QuadStringStringOrNullTypeComputer.java
@@ -20,20 +20,21 @@
import edu.uci.ics.asterix.om.types.TypeHelper;
/**
- *
* @author Xiaoyu Ma
*/
-public class QuadStringStringOrNullTypeComputer extends AbstractQuadStringTypeComputer {
+public class QuadStringStringOrNullTypeComputer extends AbstractQuadStringTypeComputer {
public static final QuadStringStringOrNullTypeComputer INSTANCE = new QuadStringStringOrNullTypeComputer();
- private QuadStringStringOrNullTypeComputer() {}
+
+ private QuadStringStringOrNullTypeComputer() {
+ }
@Override
public IAType getResultType(IAType t0, IAType t1, IAType t2, IAType t3) {
- if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1) ||
- TypeHelper.canBeNull(t2) || TypeHelper.canBeNull(t3)) {
+ if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1) || TypeHelper.canBeNull(t2)
+ || TypeHelper.canBeNull(t3)) {
return AUnionType.createNullableType(BuiltinType.ASTRING);
- }
+ }
return BuiltinType.ASTRING;
}
-
+
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
index ba622fb..584708e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/Substring2TypeComputer.java
@@ -26,52 +26,47 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-
public class Substring2TypeComputer implements IResultTypeComputer {
public static final Substring2TypeComputer INSTANCE = new Substring2TypeComputer();
-
-
+
@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().size() < 2)
- throw new AlgebricksException("Wrong Argument Number.");
+ if (fce.getArguments().size() < 2)
+ throw new AlgebricksException("Wrong Argument Number.");
ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
- ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
+ ILogicalExpression arg1 = fce.getArguments().get(1).getValue();
IAType t0, t1;
try {
t0 = (IAType) env.getType(arg0);
- t1 = (IAType) env.getType(arg1);
+ t1 = (IAType) env.getType(arg1);
} catch (AlgebricksException e) {
throw new AlgebricksException(e);
}
-
+
ATypeTag tag0, tag1;
if (t0.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) t0))
tag0 = ((AUnionType) t0).getUnionList().get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST)
.getTypeTag();
else
tag0 = t0.getTypeTag();
-
+
if (t1.getTypeTag() == ATypeTag.UNION && NonTaggedFormatUtil.isOptionalField((AUnionType) t1))
tag1 = ((AUnionType) t1).getUnionList().get(NonTaggedFormatUtil.OPTIONAL_TYPE_INDEX_IN_UNION_LIST)
.getTypeTag();
else
- tag1 = t1.getTypeTag();
-
- if(tag0 != ATypeTag.NULL && tag0 != ATypeTag.STRING) {
+ tag1 = t1.getTypeTag();
+
+ if (tag0 != ATypeTag.NULL && tag0 != ATypeTag.STRING) {
throw new AlgebricksException("First argument should be String Type.");
}
-
- if(tag1 != ATypeTag.NULL &&
- tag1 != ATypeTag.INT8 &&
- tag1 != ATypeTag.INT16 &&
- tag1 != ATypeTag.INT32 &&
- tag1 != ATypeTag.INT64) {
+
+ if (tag1 != ATypeTag.NULL && tag1 != ATypeTag.INT8 && tag1 != ATypeTag.INT16 && tag1 != ATypeTag.INT32
+ && tag1 != ATypeTag.INT64) {
throw new AlgebricksException("Second argument should be integer Type.");
}
return BuiltinType.ASTRING;
- }
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringBoolOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringBoolOrNullTypeComputer.java
index 3ad0cee..a666afb7 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringBoolOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringBoolOrNullTypeComputer.java
@@ -20,18 +20,20 @@
import edu.uci.ics.asterix.om.types.TypeHelper;
/**
- *
* @author Xiaoyu Ma
*/
-public class TripleStringBoolOrNullTypeComputer extends AbstractTripleStringTypeComputer {
+public class TripleStringBoolOrNullTypeComputer extends AbstractTripleStringTypeComputer {
public static final TripleStringBoolOrNullTypeComputer INSTANCE = new TripleStringBoolOrNullTypeComputer();
- private TripleStringBoolOrNullTypeComputer() {}
+
+ private TripleStringBoolOrNullTypeComputer() {
+ }
+
@Override
public IAType getResultType(IAType t0, IAType t1, IAType t2) {
if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1) || TypeHelper.canBeNull(t2)) {
return AUnionType.createNullableType(BuiltinType.ABOOLEAN);
- }
+ }
return BuiltinType.ABOOLEAN;
}
-
+
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringStringOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringStringOrNullTypeComputer.java
index 5031287..a02ff83 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringStringOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/TripleStringStringOrNullTypeComputer.java
@@ -20,18 +20,19 @@
import edu.uci.ics.asterix.om.types.TypeHelper;
/**
- *
* @author Xiaoyu Ma
*/
-public class TripleStringStringOrNullTypeComputer extends AbstractTripleStringTypeComputer {
+public class TripleStringStringOrNullTypeComputer extends AbstractTripleStringTypeComputer {
public static final TripleStringStringOrNullTypeComputer INSTANCE = new TripleStringStringOrNullTypeComputer();
- private TripleStringStringOrNullTypeComputer() {}
+
+ private TripleStringStringOrNullTypeComputer() {
+ }
@Override
public IAType getResultType(IAType t0, IAType t1, IAType t2) {
if (TypeHelper.canBeNull(t0) || TypeHelper.canBeNull(t1) || TypeHelper.canBeNull(t2)) {
return AUnionType.createNullableType(BuiltinType.ASTRING);
- }
+ }
return BuiltinType.ASTRING;
- }
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
index 1155485..1770685 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringInt32OrNullTypeComputer.java
@@ -61,7 +61,7 @@
List<IAType> unionList = new ArrayList<IAType>();
unionList.add(BuiltinType.ANULL);
- if (t0.getTypeTag() == ATypeTag.NULL) {
+ if (t0.getTypeTag() == ATypeTag.NULL) {
return BuiltinType.ANULL;
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
index dadf330..e319c7d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/UnaryStringOrNullTypeComputer.java
@@ -26,22 +26,22 @@
import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
-
/**
- *
* @author Xiaoyu Ma
*/
-public class UnaryStringOrNullTypeComputer implements IResultTypeComputer {
-
+public class UnaryStringOrNullTypeComputer implements IResultTypeComputer {
+
public static final UnaryStringOrNullTypeComputer INSTANCE = new UnaryStringOrNullTypeComputer();
- private UnaryStringOrNullTypeComputer() {}
-
+
+ private UnaryStringOrNullTypeComputer() {
+ }
+
@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expression;
- if(fce.getArguments().isEmpty())
- throw new AlgebricksException("Wrong Argument Number.");
+ if (fce.getArguments().isEmpty())
+ throw new AlgebricksException("Wrong Argument Number.");
ILogicalExpression arg0 = fce.getArguments().get(0).getValue();
IAType t0;
try {
@@ -49,17 +49,17 @@
} catch (AlgebricksException e) {
throw new AlgebricksException(e);
}
-
+
if (TypeHelper.canBeNull(t0)) {
return AUnionType.createNullableType(BuiltinType.ASTRING);
- }
-
+ }
+
if (t0.getTypeTag() == ATypeTag.NULL)
- return BuiltinType.ANULL;
-
- if(t0.getTypeTag() == ATypeTag.STRING)
- return BuiltinType.ASTRING;
-
- throw new AlgebricksException("Expects String Type.");
- }
+ return BuiltinType.ANULL;
+
+ if (t0.getTypeTag() == ATypeTag.STRING)
+ return BuiltinType.ASTRING;
+
+ throw new AlgebricksException("Expects String Type.");
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
index 2a54485..21ec140 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
@@ -71,7 +71,7 @@
}
@Override
- public JSONObject toJSON() throws JSONException{
+ public JSONObject toJSON() throws JSONException {
JSONObject type = new JSONObject();
type.put("type", itemType);
return type;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
index 0319c7c..35d95d4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
@@ -336,7 +336,8 @@
break;
default:
throw new AlgebricksException("The field \"" + fieldName + "\" which is of type "
- + fieldType.getTypeTag() + " cannot be indexed using the Length Partitioned N-Gram index.");
+ + fieldType.getTypeTag()
+ + " cannot be indexed using the Length Partitioned N-Gram index.");
}
break;
case LENGTH_PARTITIONED_WORD_INVIX:
@@ -348,7 +349,8 @@
break;
default:
throw new AlgebricksException("The field \"" + fieldName + "\" which is of type "
- + fieldType.getTypeTag() + " cannot be indexed using the Length Partitioned Keyword index.");
+ + fieldType.getTypeTag()
+ + " cannot be indexed using the Length Partitioned Keyword index.");
}
break;
case SINGLE_PARTITION_NGRAM_INVIX:
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
index 2c2b341..ffbc6e6 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
@@ -71,7 +71,7 @@
}
@Override
- public JSONObject toJSON() throws JSONException{
+ public JSONObject toJSON() throws JSONException {
JSONObject type = new JSONObject();
type.put("type", itemType);
return type;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java
index d2766dd..7d3fe94 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java
@@ -18,21 +18,21 @@
public abstract class AbstractComplexType implements IAType {
- private static final long serialVersionUID = 1L;
- protected String typeName;
+ private static final long serialVersionUID = 1L;
+ protected String typeName;
- public AbstractComplexType(String typeName) {
- this.typeName = typeName;
- }
+ public AbstractComplexType(String typeName) {
+ this.typeName = typeName;
+ }
- @Override
- public String getTypeName() {
- return typeName;
- }
+ @Override
+ public String getTypeName() {
+ return typeName;
+ }
- @Override
- public boolean equals(Object object) {
- return this.deepEqual((IAObject) object);
- }
+ @Override
+ public boolean equals(Object object) {
+ return this.deepEqual((IAObject) object);
+ }
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeHierarchy.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeHierarchy.java
index ba5c2db..053dbb2 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeHierarchy.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/TypeHierarchy.java
@@ -12,29 +12,29 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package edu.uci.ics.asterix.om.types;
-
-import java.util.Hashtable;
-
-/*
- * Author: Guangqiang Li
- * Created on Sep 24, 2009
- */
-public class TypeHierarchy {
- private static Hashtable<String, String> parentMap = new Hashtable<String, String>();
- static {
- parentMap.put("integer", "decimal");
- parentMap.put("double", "decimal");
- parentMap.put("decimal", "numeric");
- }
-
- public static boolean isSubType(String sub, String par) {
- String parent = parentMap.get(sub);
- if (parent != null)
- if (parent.equals(par))
- return true;
- else
- return isSubType(parent, par);
- return false;
- }
-}
+package edu.uci.ics.asterix.om.types;
+
+import java.util.Hashtable;
+
+/*
+ * Author: Guangqiang Li
+ * Created on Sep 24, 2009
+ */
+public class TypeHierarchy {
+ private static Hashtable<String, String> parentMap = new Hashtable<String, String>();
+ static {
+ parentMap.put("integer", "decimal");
+ parentMap.put("double", "decimal");
+ parentMap.put("decimal", "numeric");
+ }
+
+ public static boolean isSubType(String sub, String par) {
+ String parent = parentMap.get(sub);
+ if (parent != null)
+ if (parent.equals(par))
+ return true;
+ else
+ return isSubType(parent, par);
+ return false;
+ }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
index 12bfaf4..7df6f43 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
@@ -30,7 +30,7 @@
}
for (int i = targetTypeLength - 1; i >= 0; i--) {
- storageForPromotedValue.getDataOutput().writeByte((byte)((num >>> (i * 8)) & 0xFF));
+ storageForPromotedValue.getDataOutput().writeByte((byte) ((num >>> (i * 8)) & 0xFF));
}
}
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
index 014dc2a..dfd116e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
@@ -34,7 +34,7 @@
storageForPromotedValue.getDataOutput().writeByte(ATypeTag.DOUBLE.serialize());
long val = 0L;
for (int i = 0; i < length; i++) {
- val += ((long)(data[start + i] & 0xff)) << (8 * (length - 1 - i));
+ val += ((long) (data[start + i] & 0xff)) << (8 * (length - 1 - i));
}
DoubleSerializerDeserializer.INSTANCE.serialize(Double.valueOf(val), storageForPromotedValue.getDataOutput());
}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java
index 795a4a6..00ffa11 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/ResettableByteArrayOutputStream.java
@@ -19,7 +19,6 @@
/**
* This class extends ByteArrayAccessibleOutputStream to allow reset to a given
* size.
- *
*/
public class ResettableByteArrayOutputStream extends ByteArrayAccessibleOutputStream {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java
index 8014727..8a25cf2 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/container/ListObjectPool.java
@@ -21,7 +21,6 @@
/**
* Object pool backed by a list.
- *
* The argument for creating E instances could be different. This class also
* considers arguments in object reusing, e.g., it reuses an E instances ONLY
* when the construction argument is "equal".
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
index e4d1468..b92c422 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/AbstractAggregateFunctionDynamicDescriptor.java
@@ -17,12 +17,11 @@
import edu.uci.ics.asterix.common.functions.FunctionDescriptorTag;
import edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor;
-public abstract class AbstractAggregateFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
+public abstract class AbstractAggregateFunctionDynamicDescriptor extends AbstractFunctionDescriptor {
private static final long serialVersionUID = 1L;
public FunctionDescriptorTag getFunctionDescriptorTag() {
return FunctionDescriptorTag.AGGREGATE;
}
-
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java
index 9261537..b8733b0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/base/SingleFieldFrameTupleReference.java
@@ -22,13 +22,13 @@
private byte[] fieldData;
private int start;
private int length;
-
+
public void reset(byte[] fieldData, int start, int length) {
this.fieldData = fieldData;
this.start = start;
this.length = length;
}
-
+
@Override
public int getFieldCount() {
return 1;
@@ -41,12 +41,12 @@
@Override
public int getFieldStart(int fIdx) {
- return start;
+ return start;
}
@Override
public int getFieldLength(int fIdx) {
- return length;
+ return length;
}
@Override
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
index a9bd339..bf87f08 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
@@ -40,7 +40,8 @@
}
@Override
- public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider) throws AlgebricksException {
+ public ICopyAggregateFunction createAggregateFunction(final IDataOutputProvider provider)
+ throws AlgebricksException {
return new ICopyAggregateFunction() {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
index c03fe91..231ce34 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
@@ -42,7 +42,7 @@
public ICopySerializableAggregateFunctionFactory createSerializableAggregateFunctionFactory(
final ICopyEvaluatorFactory[] args) throws AlgebricksException {
return new ICopySerializableAggregateFunctionFactory() {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
@Override
public ICopySerializableAggregateFunction createAggregateFunction() throws AlgebricksException {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
index 0d86176..bea6ab8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
@@ -85,8 +85,8 @@
} else if (aggType == ATypeTag.SYSTEM_NULL) {
aggType = typeTag;
} else if (typeTag != ATypeTag.SYSTEM_NULL && typeTag != aggType) {
- throw new AlgebricksException("Unexpected type " + typeTag
- + " in aggregation input stream. Expected type " + aggType + ".");
+ throw new AlgebricksException("Unexpected type " + typeTag + " in aggregation input stream. Expected type "
+ + aggType + ".");
}
switch (typeTag) {
case INT8: {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
index 256af09..09a659c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
@@ -152,7 +152,7 @@
} else if (ATypeHierarchy.canPromote(aggType, typeTag)) {
aggType = typeTag;
}
-
+
if (typeTag != ATypeTag.SYSTEM_NULL) {
++count;
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java
index b972cfd..7455ae9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AsterixListAccessor.java
@@ -26,84 +26,84 @@
import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
/**
- * Utility class for accessing serialized unordered and ordered lists.
+ * Utility class for accessing serialized unordered and ordered lists.
*/
public class AsterixListAccessor {
- protected byte[] listBytes;
- protected int start;
- protected ATypeTag listType;
- protected ATypeTag itemType;
- protected int size;
-
- public ATypeTag getListType() {
- return listType;
- }
+ protected byte[] listBytes;
+ protected int start;
+ protected ATypeTag listType;
+ protected ATypeTag itemType;
+ protected int size;
- public ATypeTag getItemType() {
- return itemType;
- }
+ public ATypeTag getListType() {
+ return listType;
+ }
- public boolean itemsAreSelfDescribing() {
- return itemType == ATypeTag.ANY;
- }
+ public ATypeTag getItemType() {
+ return itemType;
+ }
- public void reset(byte[] listBytes, int start) throws AsterixException {
- this.listBytes = listBytes;
- this.start = start;
- listType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start]);
- if (listType != ATypeTag.UNORDEREDLIST && listType != ATypeTag.ORDEREDLIST) {
- throw new AsterixException("Unsupported type: " + listType);
- }
- itemType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start + 1]);
- if (listType == ATypeTag.UNORDEREDLIST) {
- size = AUnorderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
- } else {
- size = AOrderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
- }
- }
+ public boolean itemsAreSelfDescribing() {
+ return itemType == ATypeTag.ANY;
+ }
- public int size() {
- return size;
- }
-
- public int getItemOffset(int itemIndex) throws AsterixException {
- if (listType == ATypeTag.UNORDEREDLIST) {
- return AUnorderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
- } else {
- return AOrderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
- }
- }
-
- public int getItemLength(int itemOffset) throws AsterixException {
- ATypeTag itemType = getItemType(itemOffset);
- return NonTaggedFormatUtil.getFieldValueLength(listBytes, itemOffset, itemType, itemsAreSelfDescribing());
- }
-
- public ATypeTag getItemType(int itemOffset) throws AsterixException {
- if (itemType == ATypeTag.ANY) {
- return EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[itemOffset]);
- } else {
- return itemType;
- }
- }
-
- public void writeItem(int itemIndex, DataOutput dos) throws AsterixException, IOException {
- int itemOffset = getItemOffset(itemIndex);
- int itemLength = getItemLength(itemOffset);
- if (itemsAreSelfDescribing()) {
- ++itemLength;
- } else {
- dos.writeByte(itemType.serialize());
- }
- dos.write(listBytes, itemOffset, itemLength);
- }
-
- public byte[] getByteArray() {
- return listBytes;
- }
-
- public int getStart() {
- return start;
- }
+ public void reset(byte[] listBytes, int start) throws AsterixException {
+ this.listBytes = listBytes;
+ this.start = start;
+ listType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start]);
+ if (listType != ATypeTag.UNORDEREDLIST && listType != ATypeTag.ORDEREDLIST) {
+ throw new AsterixException("Unsupported type: " + listType);
+ }
+ itemType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[start + 1]);
+ if (listType == ATypeTag.UNORDEREDLIST) {
+ size = AUnorderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
+ } else {
+ size = AOrderedListSerializerDeserializer.getNumberOfItems(listBytes, start);
+ }
+ }
+
+ public int size() {
+ return size;
+ }
+
+ public int getItemOffset(int itemIndex) throws AsterixException {
+ if (listType == ATypeTag.UNORDEREDLIST) {
+ return AUnorderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
+ } else {
+ return AOrderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
+ }
+ }
+
+ public int getItemLength(int itemOffset) throws AsterixException {
+ ATypeTag itemType = getItemType(itemOffset);
+ return NonTaggedFormatUtil.getFieldValueLength(listBytes, itemOffset, itemType, itemsAreSelfDescribing());
+ }
+
+ public ATypeTag getItemType(int itemOffset) throws AsterixException {
+ if (itemType == ATypeTag.ANY) {
+ return EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[itemOffset]);
+ } else {
+ return itemType;
+ }
+ }
+
+ public void writeItem(int itemIndex, DataOutput dos) throws AsterixException, IOException {
+ int itemOffset = getItemOffset(itemIndex);
+ int itemLength = getItemLength(itemOffset);
+ if (itemsAreSelfDescribing()) {
+ ++itemLength;
+ } else {
+ dos.writeByte(itemType.serialize());
+ }
+ dos.write(listBytes, itemOffset, itemLength);
+ }
+
+ public byte[] getByteArray() {
+ return listBytes;
+ }
+
+ public int getStart() {
+ return start;
+ }
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
index dfb236e..9d6d4e1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
@@ -80,7 +80,8 @@
// type-check: (Point/Line/Polygon/Circle/Rectangle/Null, Int32, Int32)
if (outInput1.getByteArray()[0] != SER_INT32_TYPE_TAG
|| outInput2.getByteArray()[0] != SER_INT32_TYPE_TAG) {
- throw new AlgebricksException("Expects Types: (Point/Line/Polygon/Circle/Rectangle/Null, Int32, Int32).");
+ throw new AlgebricksException(
+ "Expects Types: (Point/Line/Polygon/Circle/Rectangle/Null, Int32, Int32).");
}
try {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
index d7a409d..20bd366 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
@@ -49,8 +49,8 @@
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
private final static byte SER_RECORD_TYPE_TAG = ATypeTag.RECORD.serialize();
- public FieldAccessByIndexEvalFactory(ICopyEvaluatorFactory recordEvalFactory, ICopyEvaluatorFactory fieldIndexEvalFactory,
- ARecordType recordType) {
+ public FieldAccessByIndexEvalFactory(ICopyEvaluatorFactory recordEvalFactory,
+ ICopyEvaluatorFactory fieldIndexEvalFactory, ARecordType recordType) {
this.recordEvalFactory = recordEvalFactory;
this.fieldIndexEvalFactory = fieldIndexEvalFactory;
this.recordType = recordType;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
index 390d1de..11f1e3d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
@@ -23,7 +23,7 @@
public class SimilarityJaccardSortedCheckEvaluator extends SimilarityJaccardCheckEvaluator {
protected final SimilarityMetricJaccard jaccard = new SimilarityMetricJaccard();
-
+
public SimilarityJaccardSortedCheckEvaluator(ICopyEvaluatorFactory[] args, IDataOutputProvider output)
throws AlgebricksException {
super(args, output);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
index 9318bd4..67b9ccc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
@@ -24,11 +24,11 @@
public class SimilarityJaccardSortedEvaluator extends SimilarityJaccardEvaluator {
protected final SimilarityMetricJaccard jaccard = new SimilarityMetricJaccard();
-
- public SimilarityJaccardSortedEvaluator(ICopyEvaluatorFactory[] args,
- IDataOutputProvider output) throws AlgebricksException {
- super(args, output);
- }
+
+ public SimilarityJaccardSortedEvaluator(ICopyEvaluatorFactory[] args, IDataOutputProvider output)
+ throws AlgebricksException {
+ super(args, output);
+ }
protected float computeResult(byte[] bytes, int firstStart, int secondStart, ATypeTag argType)
throws AlgebricksException {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
index 20327ff..d62db02 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
@@ -45,7 +45,7 @@
public ICopyEvaluator createEvaluator(IDataOutputProvider output) throws AlgebricksException {
DataOutput out = output.getDataOutput();
switch (comparisonKind) {
- // Should we do any normalization?
+ // Should we do any normalization?
case EQ: {
return new EqualityComparisonEvaluator(out, evalLeftFactory, evalRightFactory);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
index 29e4a77..732cd0e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
@@ -116,7 +116,7 @@
if (intervalStart < 0) {
intervalStart += GregorianCalendarSystem.CHRONON_OF_DAY;
}
-
+
if (argOut1.getByteArray()[0] == SER_TIME_TYPE_TAG) {
intervalEnd = ATimeSerializerDeserializer.getChronon(argOut1.getByteArray(), 1);
} else if (argOut1.getByteArray()[0] == SER_STRING_TYPE_TAG) {
@@ -135,12 +135,12 @@
if (intervalEnd < 0) {
intervalEnd += GregorianCalendarSystem.CHRONON_OF_DAY;
}
-
+
if (intervalEnd < intervalStart) {
throw new AlgebricksException(FID.getName()
+ ": interval end must not be less than the interval start.");
}
-
+
aInterval.setValue(intervalStart, intervalEnd, ATypeTag.TIME.serialize());
intervalSerde.serialize(aInterval, out);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastListDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastListDescriptor.java
index c1817e5..fb0084c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastListDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastListDescriptor.java
@@ -39,7 +39,6 @@
* The runtime function for casting a list(unordered list or ordered list)
*
* @author yingyib
- *
*/
public class CastListDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodepointIterator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodepointIterator.java
index 925e4d4..77799cb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodepointIterator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodepointIterator.java
@@ -17,14 +17,16 @@
import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
public class CodepointIterator {
- public void reset(byte [] buf, int startPos) {
+ public void reset(byte[] buf, int startPos) {
this.buf = buf;
this.curPos = startPos + 2;
this.startPos = startPos;
- len = UTF8StringPointable.getUTFLength(buf, startPos);
+ len = UTF8StringPointable.getUTFLength(buf, startPos);
}
-
- public int size() { return len; }
+
+ public int size() {
+ return len;
+ }
private byte[] buf;
private int curPos = 0;
@@ -40,66 +42,54 @@
// 1 byte
return b[s];
} else if ((b[s] & 0xe0) == 0xc0) { /*
- * 0xe0 = 0b1110000
- */
+ * 0xe0 = 0b1110000
+ */
// 2 bytes
- return ((int) (b[s] & 0x1f)) << 6
- | /*
- * 0x3f = 0b00111111
- */ ((int) (b[s + 1] & 0x3f));
+ return ((int) (b[s] & 0x1f)) << 6 | /*
+ * 0x3f = 0b00111111
+ */((int) (b[s + 1] & 0x3f));
} else if ((b[s] & 0xf0) == 0xe0) {
// 3bytes
- return ((int) (b[s] & 0xf)) << 12
- | ((int) (b[s + 1] & 0x3f)) << 6
- | ((int) (b[s + 2] & 0x3f));
+ return ((int) (b[s] & 0xf)) << 12 | ((int) (b[s + 1] & 0x3f)) << 6 | ((int) (b[s + 2] & 0x3f));
} else if ((b[s] & 0xf8) == 0xf0) {
// 4bytes
- return ((int) (b[s] & 0x7)) << 18
- | ((int) (b[s + 1] & 0x3f)) << 12
- | ((int) (b[s + 2] & 0x3f)) << 6
+ return ((int) (b[s] & 0x7)) << 18 | ((int) (b[s + 1] & 0x3f)) << 12 | ((int) (b[s + 2] & 0x3f)) << 6
| ((int) (b[s + 3] & 0x3f));
} else if ((b[s] & 0xfc) == 0xf8) {
// 5bytes
- return ((int) (b[s] & 0x3)) << 24
- | ((int) (b[s + 1] & 0x3f)) << 18
- | ((int) (b[s + 2] & 0x3f)) << 12
- | ((int) (b[s + 3] & 0x3f)) << 6
- | ((int) (b[s + 4] & 0x3f));
+ return ((int) (b[s] & 0x3)) << 24 | ((int) (b[s + 1] & 0x3f)) << 18 | ((int) (b[s + 2] & 0x3f)) << 12
+ | ((int) (b[s + 3] & 0x3f)) << 6 | ((int) (b[s + 4] & 0x3f));
} else if ((b[s] & 0xfe) == 0xfc) {
// 6bytes
- return ((int) (b[s] & 0x1)) << 30
- | ((int) (b[s + 1] & 0x3f)) << 24
- | ((int) (b[s + 2] & 0x3f)) << 18
- | ((int) (b[s + 3] & 0x3f)) << 12
- | ((int) (b[s + 4] & 0x3f)) << 6
- | ((int) (b[s + 5] & 0x3f));
+ return ((int) (b[s] & 0x1)) << 30 | ((int) (b[s + 1] & 0x3f)) << 24 | ((int) (b[s + 2] & 0x3f)) << 18
+ | ((int) (b[s + 3] & 0x3f)) << 12 | ((int) (b[s + 4] & 0x3f)) << 6 | ((int) (b[s + 5] & 0x3f));
}
return 0;
}
public void next() {
int step = UTF8StringPointable.charSize(buf, curPos);
- if(step + curPos < len + 2 + startPos)
+ if (step + curPos < len + 2 + startPos)
curPos += step;
}
public boolean hasNext() {
int step = UTF8StringPointable.charSize(buf, curPos);
- if(step + curPos < len + 2 + startPos)
- return true;
+ if (step + curPos < len + 2 + startPos)
+ return true;
return false;
}
-
+
public static int compare(CodepointIterator ls, CodepointIterator rs) {
CodepointIterator shortString = ls.size() < rs.size() ? ls : rs;
-
+
while (true) {
int c1 = ls.getCodePoint();
int c2 = rs.getCodePoint();
if (c1 != c2) {
return c1 - c2;
}
- if(shortString.hasNext()) {
+ if (shortString.hasNext()) {
ls.next();
rs.next();
} else {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
index 8439edd..a4d998b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
@@ -143,7 +143,8 @@
aDouble.setValue(Math.floor(val));
serde.serialize(aDouble, out);
} else {
- throw new NotImplementedException(AsterixBuiltinFunctions.NUMERIC_FLOOR.getName() + ": not implemented for "
+ throw new NotImplementedException(AsterixBuiltinFunctions.NUMERIC_FLOOR.getName()
+ + ": not implemented for "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut.getByteArray()[0]));
}
} catch (HyracksDataException e) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
index b66b30b..31d3090 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
@@ -108,7 +108,7 @@
try {
for (int i = 0; i < argEvals.length; i++) {
inputVal.reset();
- argEvals[i].evaluate(tuple);
+ argEvals[i].evaluate(tuple);
builder.addItem(inputVal);
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
index 98a70b4..f593a4f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
@@ -45,5 +45,5 @@
public final static char[] reservedRegexChars = new char[] { '$', '(', ')', '*', '.', '[', '\\', ']', '^', '{',
'|', '}' };
-
+
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
index 4fa03dd..1b8edff 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
@@ -86,7 +86,7 @@
int posPattern = 3;
int offset = 0;
- while (posSrc - 3 < srcLen - patternLen) {
+ while (posSrc - 3 < srcLen - patternLen) {
while (posPattern + offset - 3 < patternLen && posSrc + offset - 3 < srcLen) {
char c1 = UTF8StringPointable.charAt(src, posSrc + offset);
char c2 = UTF8StringPointable.charAt(pattern, posPattern + offset);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
index 14e16c6..122649e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
@@ -91,7 +91,8 @@
}
if (argOut0.getByteArray()[0] != SER_DAY_TIME_DURATION_TYPE_TAG) {
- throw new AlgebricksException(FID.getName() + ": expects NULL/DAY-TIME-DURATION, but got "
+ throw new AlgebricksException(FID.getName()
+ + ": expects NULL/DAY-TIME-DURATION, but got "
+ EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/ParseTimeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/ParseTimeDescriptor.java
index 8ee76e7..6db8453 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/ParseTimeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/ParseTimeDescriptor.java
@@ -110,7 +110,7 @@
int length1 = (argOut1.getByteArray()[1] & 0xff << 8)
+ (argOut1.getByteArray()[2] & 0xff << 0);
long chronon = 0;
-
+
int formatStart = 3;
int formatLength = 0;
boolean processSuccessfully = false;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/YearMonthDurationComparatorDecriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/YearMonthDurationComparatorDecriptor.java
index 22ab96c..c3f6379 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/YearMonthDurationComparatorDecriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/YearMonthDurationComparatorDecriptor.java
@@ -46,7 +46,7 @@
// allowed input types
private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
-
+
private final boolean isGreaterThan;
private YearMonthDurationComparatorDecriptor(boolean isGreaterThan) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java
index aaa38d3..34bc1f9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AbstractDataParser.java
@@ -40,42 +40,42 @@
*/
public abstract class AbstractDataParser implements IDataParser {
- protected AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
- protected AMutableInt16 aInt16 = new AMutableInt16((short) 0);
- protected AMutableInt32 aInt32 = new AMutableInt32(0);
- protected AMutableInt64 aInt64 = new AMutableInt64(0);
- protected AMutableDouble aDouble = new AMutableDouble(0);
- protected AMutableFloat aFloat = new AMutableFloat(0);
- protected AMutableString aString = new AMutableString("");
- protected AMutableString aStringFieldName = new AMutableString("");
+ protected AMutableInt8 aInt8 = new AMutableInt8((byte) 0);
+ protected AMutableInt16 aInt16 = new AMutableInt16((short) 0);
+ protected AMutableInt32 aInt32 = new AMutableInt32(0);
+ protected AMutableInt64 aInt64 = new AMutableInt64(0);
+ protected AMutableDouble aDouble = new AMutableDouble(0);
+ protected AMutableFloat aFloat = new AMutableFloat(0);
+ protected AMutableString aString = new AMutableString("");
+ protected AMutableString aStringFieldName = new AMutableString("");
- // Serializers
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ADOUBLE);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ASTRING);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AFLOAT);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT8);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT16);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT32);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.AINT64);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ABOOLEAN);
- @SuppressWarnings("unchecked")
- protected ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
+ // Serializers
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ADOUBLE);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AString> stringSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ASTRING);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AFLOAT);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT8);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT16);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT32);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AINT64);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ABoolean> booleanSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ABOOLEAN);
+ @SuppressWarnings("unchecked")
+ protected ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.ANULL);
}
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/CustOrdDataGen.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/CustOrdDataGen.java
index 0d697c0..bb42819 100644
--- a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/CustOrdDataGen.java
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/datagen/CustOrdDataGen.java
@@ -48,7 +48,7 @@
private String[] INTERESTS = { "Bass", "Music", "Databases", "Fishing", "Tennis", "Squash", "Computers", "Books",
"Movies", "Cigars", "Wine", "Running", "Walking", "Skiing", "Basketball", "Video Games", "Cooking",
"Coffee", "Base Jumping", "Puzzles", "Chess", "Programming", "Reddit", "Soccer", "Hockey", "Money",
- "Dancing", "Brewing", "Gardening", "Hacking", "Reading"};
+ "Dancing", "Brewing", "Gardening", "Hacking", "Reading" };
private static final int MIN_CHILD_AGE = 0;
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GULongIDGenerator.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GULongIDGenerator.java
index 61c4345..0832613 100644
--- a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GULongIDGenerator.java
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GULongIDGenerator.java
@@ -19,28 +19,28 @@
public class GULongIDGenerator {
- private final int partition;
- private final long baseValue;
- private final AtomicLong nextValue;
+ private final int partition;
+ private final long baseValue;
+ private final AtomicLong nextValue;
- public GULongIDGenerator(int partition, byte seed) {
- this.partition = partition;
- ByteBuffer buffer = ByteBuffer.allocate(8);
- buffer.put(seed);
- buffer.put((byte) partition);
- buffer.putInt(0);
- buffer.putShort((short) 0);
- buffer.flip();
- this.baseValue = new Long(buffer.getLong());
- this.nextValue = new AtomicLong(baseValue);
- }
+ public GULongIDGenerator(int partition, byte seed) {
+ this.partition = partition;
+ ByteBuffer buffer = ByteBuffer.allocate(8);
+ buffer.put(seed);
+ buffer.put((byte) partition);
+ buffer.putInt(0);
+ buffer.putShort((short) 0);
+ buffer.flip();
+ this.baseValue = new Long(buffer.getLong());
+ this.nextValue = new AtomicLong(baseValue);
+ }
- public long getNextULong() {
- return nextValue.incrementAndGet();
- }
+ public long getNextULong() {
+ return nextValue.incrementAndGet();
+ }
- public int getPartition() {
- return partition;
- }
+ public int getPartition() {
+ return partition;
+ }
}
diff --git a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GenericSocketFeedAdapter.java b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GenericSocketFeedAdapter.java
index 31c50a7..4cdda1e 100644
--- a/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GenericSocketFeedAdapter.java
+++ b/asterix-tools/src/main/java/edu/uci/ics/asterix/tools/external/data/GenericSocketFeedAdapter.java
@@ -73,7 +73,7 @@
socket = serverSocket.accept();
inputStream = socket.getInputStream();
} catch (IOException e) {
- if (LOGGER.isLoggable(Level.SEVERE)) {
+ if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.severe("Unable to create input stream required for feed ingestion");
}
e.printStackTrace();
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/SecondaryIndexModificationOperationCallbackFactory.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/SecondaryIndexModificationOperationCallbackFactory.java
index 563e9b7..9a0e49f 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/SecondaryIndexModificationOperationCallbackFactory.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/opcallbacks/SecondaryIndexModificationOperationCallbackFactory.java
@@ -56,8 +56,9 @@
try {
ITransactionContext txnCtx = txnSubsystem.getTransactionManager().getTransactionContext(jobId, false);
- IModificationOperationCallback modCallback = new SecondaryIndexModificationOperationCallback(datasetId, primaryKeyFields, txnCtx,
- txnSubsystem.getLockManager(), txnSubsystem, resourceId, resourceType, indexOp);
+ IModificationOperationCallback modCallback = new SecondaryIndexModificationOperationCallback(datasetId,
+ primaryKeyFields, txnCtx, txnSubsystem.getLockManager(), txnSubsystem, resourceId, resourceType,
+ indexOp);
txnCtx.registerIndexAndCallback(resourceId, index, (AbstractOperationCallback) modCallback, false);
return modCallback;
} catch (ACIDException e) {
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceFactory.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceFactory.java
index b2f8ae6..dc85360 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceFactory.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceFactory.java
@@ -19,7 +19,7 @@
import edu.uci.ics.hyracks.storage.common.file.LocalResource;
public class PersistentLocalResourceFactory implements ILocalResourceFactory {
-
+
private final ILocalResourceMetadata localResourceMetadata;
private final int resourceType;
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/DatasetLockInfo.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/DatasetLockInfo.java
index 0573957..f3ff0e0 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/DatasetLockInfo.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/DatasetLockInfo.java
@@ -288,7 +288,7 @@
//This entityInfo(i.e., holder) is the last resource held by this job.
jobInfo.setlastHoldingResource(holder);
}
-
+
//jobInfo.decreaseDatasetLockCount(holder);
}
@@ -317,9 +317,9 @@
lastObj = lockWaiterManager.getLockWaiter(waiterObjId);
lastObj.setNextWaiterObjId(-1);
-// if (LockManager.IS_DEBUG_MODE) {
-// System.out.println(printWaiters());
-// }
+ // if (LockManager.IS_DEBUG_MODE) {
+ // System.out.println(printWaiters());
+ // }
}
public void removeWaiter(int waiterObjId) {
@@ -362,9 +362,9 @@
firstWaiter = nextObjId;
}
-// if (LockManager.IS_DEBUG_MODE) {
-// System.out.println(printWaiters());
-// }
+ // if (LockManager.IS_DEBUG_MODE) {
+ // System.out.println(printWaiters());
+ // }
}
public void addUpgrader(int waiterObjId) {
@@ -451,7 +451,7 @@
return s.toString();
}
-
+
public String coreDump() {
StringBuilder sb = new StringBuilder();
sb.append("\n\t firstUpgrader: " + firstUpgrader);
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
index ef4cf2e..1c6cb7d 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityInfoManager.java
@@ -257,7 +257,7 @@
break;
}
}
-
+
//reset allocChild to the first buffer
allocChild = 0;
@@ -279,19 +279,19 @@
}
return s.toString();
}
-
+
public void coreDump(OutputStream os) {
StringBuilder sb = new StringBuilder("\n\t########### EntityLockInfoManager Status #############\n");
int size = pArray.size();
ChildEntityInfoArrayManager child;
- sb.append("Number of Child: " + size + "\n");
+ sb.append("Number of Child: " + size + "\n");
for (int i = 0; i < size; i++) {
try {
child = pArray.get(i);
sb.append("child[" + i + "]");
sb.append(child.prettyPrint());
-
+
os.write(sb.toString().getBytes());
} catch (IOException e) {
//ignore IOException
@@ -299,7 +299,7 @@
sb = new StringBuilder();
}
}
-
+
public int getShrinkTimerThreshold() {
return shrinkTimerThreshold;
}
@@ -575,7 +575,7 @@
public int getFreeSlotNum() {
return freeSlotNum;
}
-
+
public String prettyPrint() {
StringBuilder sb = new StringBuilder();
sb.append("\n\toccupiedSlots:" + getNumOfOccupiedSlots());
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityLockInfoManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityLockInfoManager.java
index 2c64b26..9e9a219 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityLockInfoManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/EntityLockInfoManager.java
@@ -256,7 +256,7 @@
break;
}
}
-
+
//reset allocChild to the first buffer
allocChild = 0;
@@ -278,19 +278,19 @@
}
return s.toString();
}
-
+
public void coreDump(OutputStream os) {
StringBuilder sb = new StringBuilder("\n\t########### EntityLockInfoManager Status #############\n");
int size = pArray.size();
ChildEntityLockInfoArrayManager child;
- sb.append("Number of Child: " + size + "\n");
+ sb.append("Number of Child: " + size + "\n");
for (int i = 0; i < size; i++) {
try {
child = pArray.get(i);
sb.append("child[" + i + "]");
sb.append(child.prettyPrint());
-
+
os.write(sb.toString().getBytes());
} catch (IOException e) {
//ignore IOException
@@ -298,7 +298,7 @@
sb = new StringBuilder();
}
}
-
+
public int getShrinkTimerThreshold() {
return SHRINK_TIMER_THRESHOLD;
}
@@ -751,7 +751,7 @@
public int getFreeSlotNum() {
return freeSlotNum;
}
-
+
public String prettyPrint() {
StringBuilder sb = new StringBuilder();
sb.append("\n\toccupiedSlots:" + getNumOfOccupiedSlots());
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/JobInfo.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/JobInfo.java
index 28d60f3..46bde4e 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/JobInfo.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/JobInfo.java
@@ -289,7 +289,7 @@
}
return s.toString();
}
-
+
public String coreDump() {
StringBuilder sb = new StringBuilder();
sb.append("\n\t datasetISLockHT");
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
index e61cb55..b3cff76 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockManagerDeterministicUnitTest.java
@@ -42,7 +42,8 @@
//prepare configuration file
File cwd = new File(System.getProperty("user.dir"));
File asterixdbDir = cwd.getParentFile();
- File srcFile = new File(asterixdbDir.getAbsoluteFile(), "asterix-app/src/main/resources/asterix-build-configuration.xml");
+ File srcFile = new File(asterixdbDir.getAbsoluteFile(),
+ "asterix-app/src/main/resources/asterix-build-configuration.xml");
File destFile = new File(cwd, "target/classes/asterix-configuration.xml");
FileUtils.copyFile(srcFile, destFile);
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockRequestTracker.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockRequestTracker.java
index 702f492..a5bae28 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockRequestTracker.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockRequestTracker.java
@@ -45,7 +45,7 @@
//handle global request queue
historyForAllJobs.append(request.prettyPrint()).append("--> ").append(msg).append("\n");
}
-
+
public void addRequest(LockRequest request) {
requestHistoryForAllJobs.append(request.prettyPrint());
}
@@ -64,7 +64,7 @@
}
return history.toString();
}
-
+
public String getRequestHistoryForAllJobs() {
return requestHistoryForAllJobs.toString();
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiter.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiter.java
index 8bf9929..8fa28fe 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiter.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiter.java
@@ -17,9 +17,9 @@
/**
* LockWaiter object is used for keeping a lock waiter or a lock upgrader information on a certain resource.
- * The resource can be a dataset or an entity.
+ * The resource can be a dataset or an entity.
+ *
* @author kisskys
- *
*/
public class LockWaiter {
/**
@@ -77,69 +77,69 @@
public boolean isVictim() {
return this.victim;
}
-
+
public void increaseWaiterCount() {
waiterCount++;
}
-
+
public void decreaseWaiterCount() {
waiterCount--;
}
-
+
public byte getWaiterCount() {
return waiterCount;
}
-
+
public void setWaiterCount(byte count) {
waiterCount = count;
}
-
+
public void setFirstGetUp(boolean isFirst) {
firstGetUp = isFirst;
}
-
+
public boolean isFirstGetUp() {
return firstGetUp;
}
-
+
public void setNextWaiterObjId(int next) {
nextWaiterObjId = next;
}
-
+
public int getNextWaiterObjId() {
return nextWaiterObjId;
}
-
+
public void setNextWaitingResourceObjId(int next) {
nextWaitingResourceObjId = next;
}
-
+
public int getNextWaitingResourceObjId() {
return nextWaitingResourceObjId;
}
-
+
public void setBeginWaitTime(long time) {
this.beginWaitTime = time;
}
-
+
public long getBeginWaitTime() {
return beginWaitTime;
}
-
+
public boolean isWaiter() {
return isWaiter;
}
-
+
public void setWaiter(boolean isWaiter) {
this.isWaiter = isWaiter;
}
-
+
public boolean isWaitingOnEntityLock() {
return isWaitingOnEntityLock;
}
-
+
public void setWaitingOnEntityLock(boolean isWaitingOnEntityLock) {
this.isWaitingOnEntityLock = isWaitingOnEntityLock;
}
-
+
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiterManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiterManager.java
index 617c9ba..110f8a2 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiterManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/LockWaiterManager.java
@@ -37,96 +37,96 @@
private boolean isShrinkTimerOn;
private int occupiedSlots;
-// ////////////////////////////////////////////////
-// // begin of unit test
-// ////////////////////////////////////////////////
-//
-// public static final int SHRINK_TIMER_THRESHOLD = 0; //for unit test
-//
-// /**
-// * @param args
-// */
-// public static void main(String[] args) {
-// final int DataSize = 5000;
-//
-// int i, j;
-// int slots = ChildLockWaiterArrayManager.NUM_OF_SLOTS;
-// int data[] = new int[DataSize];
-// LockWaiterManager lwMgr = new LockWaiterManager();
-//
-// //allocate: 50
-// System.out.println("allocate: 50");
-// for (i = 0; i < 5; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// data[j] = lwMgr.allocate();
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //deallocate from the last child to the first child
-// System.out.println("deallocate from the last child to the first child");
-// for (i = 4; i >= 0; i--) {
-// for (j = i * slots + slots - 1; j >= i * slots; j--) {
-// lwMgr.deallocate(data[j]);
-// }
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //allocate: 50
-// System.out.println("allocate: 50");
-// for (i = 0; i < 5; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// data[j] = lwMgr.allocate();
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //deallocate from the first child to last child
-// System.out.println("deallocate from the first child to last child");
-// for (i = 0; i < 5; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// lwMgr.deallocate(data[j]);
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //allocate: 50
-// System.out.println("allocate: 50");
-// for (i = 0; i < 5; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// data[j] = lwMgr.allocate();
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //deallocate from the first child to 4th child
-// System.out.println("deallocate from the first child to 4th child");
-// for (i = 0; i < 4; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// lwMgr.deallocate(data[j]);
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-//
-// //allocate: 40
-// System.out.println("allocate: 40");
-// for (i = 0; i < 4; i++) {
-// for (j = i * slots; j < i * slots + slots; j++) {
-// data[j] = lwMgr.allocate();
-// }
-//
-// System.out.println(lwMgr.prettyPrint());
-// }
-// }
-//
-// ////////////////////////////////////////////////
-// // end of unit test
-// ////////////////////////////////////////////////
+ // ////////////////////////////////////////////////
+ // // begin of unit test
+ // ////////////////////////////////////////////////
+ //
+ // public static final int SHRINK_TIMER_THRESHOLD = 0; //for unit test
+ //
+ // /**
+ // * @param args
+ // */
+ // public static void main(String[] args) {
+ // final int DataSize = 5000;
+ //
+ // int i, j;
+ // int slots = ChildLockWaiterArrayManager.NUM_OF_SLOTS;
+ // int data[] = new int[DataSize];
+ // LockWaiterManager lwMgr = new LockWaiterManager();
+ //
+ // //allocate: 50
+ // System.out.println("allocate: 50");
+ // for (i = 0; i < 5; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // data[j] = lwMgr.allocate();
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //deallocate from the last child to the first child
+ // System.out.println("deallocate from the last child to the first child");
+ // for (i = 4; i >= 0; i--) {
+ // for (j = i * slots + slots - 1; j >= i * slots; j--) {
+ // lwMgr.deallocate(data[j]);
+ // }
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //allocate: 50
+ // System.out.println("allocate: 50");
+ // for (i = 0; i < 5; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // data[j] = lwMgr.allocate();
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //deallocate from the first child to last child
+ // System.out.println("deallocate from the first child to last child");
+ // for (i = 0; i < 5; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // lwMgr.deallocate(data[j]);
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //allocate: 50
+ // System.out.println("allocate: 50");
+ // for (i = 0; i < 5; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // data[j] = lwMgr.allocate();
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //deallocate from the first child to 4th child
+ // System.out.println("deallocate from the first child to 4th child");
+ // for (i = 0; i < 4; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // lwMgr.deallocate(data[j]);
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ //
+ // //allocate: 40
+ // System.out.println("allocate: 40");
+ // for (i = 0; i < 4; i++) {
+ // for (j = i * slots; j < i * slots + slots; j++) {
+ // data[j] = lwMgr.allocate();
+ // }
+ //
+ // System.out.println(lwMgr.prettyPrint());
+ // }
+ // }
+ //
+ // ////////////////////////////////////////////////
+ // // end of unit test
+ // ////////////////////////////////////////////////
public LockWaiterManager() {
pArray = new ArrayList<ChildLockWaiterArrayManager>();
@@ -249,7 +249,7 @@
break;
}
}
-
+
//reset allocChild to the first buffer
allocChild = 0;
@@ -271,19 +271,19 @@
}
return s.toString();
}
-
+
public void coreDump(OutputStream os) {
StringBuilder sb = new StringBuilder("\n########### LockWaiterManager Status #############\n");
int size = pArray.size();
ChildLockWaiterArrayManager child;
- sb.append("Number of Child: " + size + "\n");
+ sb.append("Number of Child: " + size + "\n");
for (int i = 0; i < size; i++) {
try {
child = pArray.get(i);
sb.append("child[" + i + "]");
sb.append(child.prettyPrint());
-
+
os.write(sb.toString().getBytes());
} catch (IOException e) {
//ignore IOException
@@ -291,11 +291,11 @@
sb = new StringBuilder();
}
}
-
+
public int getShrinkTimerThreshold() {
return SHRINK_TIMER_THRESHOLD;
}
-
+
public LockWaiter getLockWaiter(int slotNum) {
return pArray.get(slotNum / ChildLockWaiterArrayManager.NUM_OF_SLOTS).getLockWaiter(
slotNum % ChildLockWaiterArrayManager.NUM_OF_SLOTS);
@@ -304,7 +304,7 @@
class ChildLockWaiterArrayManager {
public static final int NUM_OF_SLOTS = 100; //number of LockWaiter objects in 'childArray'.
-// public static final int NUM_OF_SLOTS = 10; //for unit test
+ // public static final int NUM_OF_SLOTS = 10; //for unit test
private int freeSlotNum;
private int occupiedSlots; //-1 represents 'deinitialized' state.
@@ -336,13 +336,13 @@
freeSlotNum = childArray[currentSlot].getNextFreeSlot();
childArray[currentSlot].setWait(true);
childArray[currentSlot].setVictim(false);
- childArray[currentSlot].setWaiterCount((byte)0);
+ childArray[currentSlot].setWaiterCount((byte) 0);
childArray[currentSlot].setNextWaiterObjId(-1);
childArray[currentSlot].setNextWaitingResourceObjId(-1);
childArray[currentSlot].setBeginWaitTime(-1l);
occupiedSlots++;
if (LockManager.IS_DEBUG_MODE) {
- System.out.println(Thread.currentThread().getName()+" Alloc LockWaiterId("+currentSlot+")");
+ System.out.println(Thread.currentThread().getName() + " Alloc LockWaiterId(" + currentSlot + ")");
}
return currentSlot;
}
@@ -352,7 +352,7 @@
freeSlotNum = slotNum;
occupiedSlots--;
if (LockManager.IS_DEBUG_MODE) {
- System.out.println(Thread.currentThread().getName()+" Dealloc LockWaiterId("+slotNum+")");
+ System.out.println(Thread.currentThread().getName() + " Dealloc LockWaiterId(" + slotNum + ")");
}
}
@@ -380,7 +380,7 @@
public int getFreeSlotNum() {
return freeSlotNum;
}
-
+
public String prettyPrint() {
LockWaiter waiter;
StringBuilder sb = new StringBuilder();
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/PrimitiveIntHashMap.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/PrimitiveIntHashMap.java
index 2ac0c64..01becdd 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/PrimitiveIntHashMap.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/PrimitiveIntHashMap.java
@@ -21,16 +21,15 @@
* PrimitiveIntHashMap supports primitive int type as key and value.
* The hash map grows when the available slots in a bucket are overflowed.
* Also, the hash map shrinks according to the following shrink policy.
- * : Shrink when the resource under-utilization lasts for a certain threshold time.
- *
+ * : Shrink when the resource under-utilization lasts for a certain threshold time.
+ *
* @author kisskys
- *
*/
public class PrimitiveIntHashMap {
private final int CHILD_BUCKETS; //INIT_NUM_OF_BUCKETS;
private final int NUM_OF_SLOTS; //NUM_OF_SLOTS_IN_A_BUCKET;
private final int SHRINK_TIMER_THRESHOLD;
-
+
private int occupiedSlots;
private ArrayList<ChildIntArrayManager> pArray; //parent array
private int hashMod;
@@ -41,113 +40,113 @@
private int iterChildIndex;
private KeyValuePair iterPair;
-// ////////////////////////////////////////////////
-// // begin of unit test
-// ////////////////////////////////////////////////
-//
-// /**
-// * @param args
-// */
-// public static void main(String[] args) {
-// int i, j;
-// int k = 0;
-// int num = 5;
-// int key[] = new int[500];
-// int val[] = new int[500];
-// KeyValuePair pair;
-// PrimitiveIntHashMap map = new PrimitiveIntHashMap(1<<4, 1<<3, 5);
-//
-// for (j=0; j < num; j++) {
-//
-// k += 100;
-// //generate data
-// for (i=0; i < k; i++) {
-// key[i] = i;
-// val[i] = i;
-// }
-//
-// //put data to map
-// for (i=0; i < k-30; i++) {
-// map.put(key[i], val[i]);
-// }
-//
-// //put data to map
-// for (i=0; i < k-30; i++) {
-// map.put(key[i], val[i]);
-// }
-//
-// map.beginIterate();
-// pair = map.getNextKeyValue();
-// i = 0;
-// while (pair != null) {
-// i++;
-// System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
-// pair = map.getNextKeyValue();
-// }
-//
-// //System.out.println(map.prettyPrint());
-//
-// for (i=k-20; i< k; i++) { //skip X70~X79
-// map.put(key[i], val[i]);
-// }
-//
-// System.out.println(map.prettyPrint());
-//
-// //remove data to map
-// for (i=0; i < k-10; i++) {
-// map.remove(key[i]);
-// try {
-// Thread.currentThread().sleep(1);
-// } catch (InterruptedException e) {
-// e.printStackTrace();
-// }
-// }
-//
-// map.beginIterate();
-// pair = map.getNextKeyValue();
-// i = 0;
-// while (pair != null) {
-// i++;
-// System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
-// pair = map.getNextKeyValue();
-// }
-//
-// //remove data to map
-// for (i=0; i < k-10; i++) {
-// map.remove(key[i]);
-// try {
-// Thread.currentThread().sleep(1);
-// } catch (InterruptedException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// }
-//
-// System.out.println(map.prettyPrint());
-//
-// //get data from map
-// for (i=0; i < k; i++) {
-// System.out.println(""+i+"=> key:"+ key[i] + ", val:"+val[i] +", result: " + map.get(key[i]));
-// }
-// }
-//
-// map.beginIterate();
-// pair = map.getNextKeyValue();
-// i = 0;
-// while (pair != null) {
-// i++;
-// System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
-// pair = map.getNextKeyValue();
-// }
-// }
-//
-// ////////////////////////////////////////////////
-// // end of unit test
-// ////////////////////////////////////////////////
-
+ // ////////////////////////////////////////////////
+ // // begin of unit test
+ // ////////////////////////////////////////////////
+ //
+ // /**
+ // * @param args
+ // */
+ // public static void main(String[] args) {
+ // int i, j;
+ // int k = 0;
+ // int num = 5;
+ // int key[] = new int[500];
+ // int val[] = new int[500];
+ // KeyValuePair pair;
+ // PrimitiveIntHashMap map = new PrimitiveIntHashMap(1<<4, 1<<3, 5);
+ //
+ // for (j=0; j < num; j++) {
+ //
+ // k += 100;
+ // //generate data
+ // for (i=0; i < k; i++) {
+ // key[i] = i;
+ // val[i] = i;
+ // }
+ //
+ // //put data to map
+ // for (i=0; i < k-30; i++) {
+ // map.put(key[i], val[i]);
+ // }
+ //
+ // //put data to map
+ // for (i=0; i < k-30; i++) {
+ // map.put(key[i], val[i]);
+ // }
+ //
+ // map.beginIterate();
+ // pair = map.getNextKeyValue();
+ // i = 0;
+ // while (pair != null) {
+ // i++;
+ // System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
+ // pair = map.getNextKeyValue();
+ // }
+ //
+ // //System.out.println(map.prettyPrint());
+ //
+ // for (i=k-20; i< k; i++) { //skip X70~X79
+ // map.put(key[i], val[i]);
+ // }
+ //
+ // System.out.println(map.prettyPrint());
+ //
+ // //remove data to map
+ // for (i=0; i < k-10; i++) {
+ // map.remove(key[i]);
+ // try {
+ // Thread.currentThread().sleep(1);
+ // } catch (InterruptedException e) {
+ // e.printStackTrace();
+ // }
+ // }
+ //
+ // map.beginIterate();
+ // pair = map.getNextKeyValue();
+ // i = 0;
+ // while (pair != null) {
+ // i++;
+ // System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
+ // pair = map.getNextKeyValue();
+ // }
+ //
+ // //remove data to map
+ // for (i=0; i < k-10; i++) {
+ // map.remove(key[i]);
+ // try {
+ // Thread.currentThread().sleep(1);
+ // } catch (InterruptedException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // }
+ // }
+ //
+ // System.out.println(map.prettyPrint());
+ //
+ // //get data from map
+ // for (i=0; i < k; i++) {
+ // System.out.println(""+i+"=> key:"+ key[i] + ", val:"+val[i] +", result: " + map.get(key[i]));
+ // }
+ // }
+ //
+ // map.beginIterate();
+ // pair = map.getNextKeyValue();
+ // i = 0;
+ // while (pair != null) {
+ // i++;
+ // System.out.println("["+i+"] key:"+ pair.key + ", val:"+ pair.value);
+ // pair = map.getNextKeyValue();
+ // }
+ // }
+ //
+ // ////////////////////////////////////////////////
+ // // end of unit test
+ // ////////////////////////////////////////////////
+
public PrimitiveIntHashMap() {
- CHILD_BUCKETS = 1<<9; //INIT_NUM_OF_BUCKETS;
- NUM_OF_SLOTS = 1<<3; //NUM_OF_SLOTS_IN_A_BUCKET;
+ CHILD_BUCKETS = 1 << 9; //INIT_NUM_OF_BUCKETS;
+ NUM_OF_SLOTS = 1 << 3; //NUM_OF_SLOTS_IN_A_BUCKET;
SHRINK_TIMER_THRESHOLD = 120000; //2min
pArray = new ArrayList<ChildIntArrayManager>();
pArray.add(new ChildIntArrayManager(this));
@@ -155,7 +154,7 @@
occupiedSlots = 0;
iterPair = new KeyValuePair();
}
-
+
public PrimitiveIntHashMap(int childBuckets, int numOfSlots, int shrinkTimerThreshold) {
CHILD_BUCKETS = childBuckets;
NUM_OF_SLOTS = numOfSlots;
@@ -166,126 +165,127 @@
occupiedSlots = 0;
iterPair = new KeyValuePair();
}
-
+
public void put(int key, int value) {
int growCount = 0;
int bucketNum = hash(key);
- ChildIntArrayManager child = pArray.get(bucketNum/CHILD_BUCKETS);
- while (child.isFull(bucketNum%CHILD_BUCKETS)) {
+ ChildIntArrayManager child = pArray.get(bucketNum / CHILD_BUCKETS);
+ while (child.isFull(bucketNum % CHILD_BUCKETS)) {
growHashMap();
bucketNum = hash(key);
- child = pArray.get(bucketNum/CHILD_BUCKETS);
+ child = pArray.get(bucketNum / CHILD_BUCKETS);
if (growCount > 2) {
//changeHashFunc();
}
growCount++;
}
- occupiedSlots += child.put(bucketNum%CHILD_BUCKETS, key, value, false);
+ occupiedSlots += child.put(bucketNum % CHILD_BUCKETS, key, value, false);
}
-
- public void upsert (int key, int value) {
+
+ public void upsert(int key, int value) {
int growCount = 0;
int bucketNum = hash(key);
- ChildIntArrayManager child = pArray.get(bucketNum/CHILD_BUCKETS);
- while (child.isFull(bucketNum%CHILD_BUCKETS)) {
+ ChildIntArrayManager child = pArray.get(bucketNum / CHILD_BUCKETS);
+ while (child.isFull(bucketNum % CHILD_BUCKETS)) {
growHashMap();
bucketNum = hash(key);
- child = pArray.get(bucketNum/CHILD_BUCKETS);
+ child = pArray.get(bucketNum / CHILD_BUCKETS);
if (growCount > 2) {
//changeHashFunc();
}
growCount++;
}
- occupiedSlots += child.put(bucketNum%CHILD_BUCKETS, key, value, true);
+ occupiedSlots += child.put(bucketNum % CHILD_BUCKETS, key, value, true);
}
-
+
private int hash(int key) {
- return key%hashMod;
+ return key % hashMod;
}
-
+
private void growHashMap() {
int size = pArray.size();
- int i;
-
+ int i;
+
//grow buckets by adding more child
- for (i=0; i<size; i++) {
+ for (i = 0; i < size; i++) {
pArray.add(new ChildIntArrayManager(this));
}
-
+
//increase hashMod
hashMod *= 2;
-
+
//re-hash
- rehash(0, size, hashMod/2);
+ rehash(0, size, hashMod / 2);
}
-
+
private void shrinkHashMap() {
int size = pArray.size();
int i;
-
+
//decrease hashMod
hashMod /= 2;
-
+
//re-hash
- rehash(size/2, size, hashMod*2);
-
+ rehash(size / 2, size, hashMod * 2);
+
//shrink buckets by removing child(s)
- for (i=size-1; i>=size/2;i--) {
+ for (i = size - 1; i >= size / 2; i--) {
pArray.remove(i);
}
}
-
+
private void rehash(int begin, int end, int oldHashMod) {
int i, j, k;
int key, value;
ChildIntArrayManager child;
-
+
//re-hash
- for (i=begin; i<end; i++) {
+ for (i = begin; i < end; i++) {
child = pArray.get(i);
- for (j=0; j<CHILD_BUCKETS; j++) {
+ for (j = 0; j < CHILD_BUCKETS; j++) {
if (child.cArray[j][0] == 0) {
continue;
}
- for (k=1; k<NUM_OF_SLOTS; k++) {
+ for (k = 1; k < NUM_OF_SLOTS; k++) {
//if the hashValue of the key is different, then re-hash it.
- key = child.cArray[j][k*2];
- if (hash(key) != key%oldHashMod) {
- value = child.cArray[j][k*2+1];
+ key = child.cArray[j][k * 2];
+ if (hash(key) != key % oldHashMod) {
+ value = child.cArray[j][k * 2 + 1];
//remove existing key and value
//Notice! To avoid bucket iteration, child.remove() is not used.
- child.cArray[j][k*2] = -1;
+ child.cArray[j][k * 2] = -1;
child.cArray[j][0]--;
//re-hash it
- pArray.get(hash(key)/CHILD_BUCKETS).put(hash(key)%CHILD_BUCKETS, key, value, false);
+ pArray.get(hash(key) / CHILD_BUCKETS).put(hash(key) % CHILD_BUCKETS, key, value, false);
}
}
}
}
}
-
-// private void changeHashFunc() {
-// //TODO need to implement.
-// throw new UnsupportedOperationException("changeHashFunc() not implemented");
-// }
-
+
+ // private void changeHashFunc() {
+ // //TODO need to implement.
+ // throw new UnsupportedOperationException("changeHashFunc() not implemented");
+ // }
+
public int get(int key) {
int bucketNum = hash(key);
- return pArray.get(bucketNum/CHILD_BUCKETS).get(bucketNum%CHILD_BUCKETS, key);
+ return pArray.get(bucketNum / CHILD_BUCKETS).get(bucketNum % CHILD_BUCKETS, key);
}
-
+
public void remove(int key) {
int bucketNum = hash(key);
- occupiedSlots -= pArray.get(bucketNum/CHILD_BUCKETS).remove(bucketNum%CHILD_BUCKETS, key);
-
+ occupiedSlots -= pArray.get(bucketNum / CHILD_BUCKETS).remove(bucketNum % CHILD_BUCKETS, key);
+
if (needShrink()) {
shrinkHashMap();
}
}
-
+
/**
* Shrink policy:
- * Shrink when the resource under-utilization lasts for a certain amount of time.
+ * Shrink when the resource under-utilization lasts for a certain amount of time.
+ *
* @return
*/
private boolean needShrink() {
@@ -294,7 +294,7 @@
if (usedSlots == 0) {
usedSlots = 1;
}
- if (size > 1 && size*CHILD_BUCKETS*NUM_OF_SLOTS/usedSlots >= 3 && isSafeToShrink()) {
+ if (size > 1 && size * CHILD_BUCKETS * NUM_OF_SLOTS / usedSlots >= 3 && isSafeToShrink()) {
if (isShrinkTimerOn) {
if (System.currentTimeMillis() - shrinkTimer >= SHRINK_TIMER_THRESHOLD) {
isShrinkTimerOn = false;
@@ -311,7 +311,7 @@
}
return false;
}
-
+
private boolean isSafeToShrink() {
int i, j;
int size = pArray.size();
@@ -319,50 +319,51 @@
//[HChild(Head Child):0 and TChild(Tail Child): 4], [1(H),5(T)], [2(H),6(T)] and so on.
//When the map shrinks, the sum of occupied slots in H/TChild should not exceed the NUM_OF_SLOTS-1.
//Then it is safe to shrink. Otherwise, unsafe.
- ChildIntArrayManager HChild, TChild;
-
- for (i=0; i<size/2; i++){
+ ChildIntArrayManager HChild, TChild;
+
+ for (i = 0; i < size / 2; i++) {
HChild = pArray.get(i);
- TChild = pArray.get(size/2+i);
- for (j=0; j<CHILD_BUCKETS; j++) {
- if (HChild.cArray[j][0] + TChild.cArray[j][0] > NUM_OF_SLOTS-1) {
+ TChild = pArray.get(size / 2 + i);
+ for (j = 0; j < CHILD_BUCKETS; j++) {
+ if (HChild.cArray[j][0] + TChild.cArray[j][0] > NUM_OF_SLOTS - 1) {
return false;
}
}
}
return true;
}
-
+
public String prettyPrint() {
StringBuilder s = new StringBuilder("\n########### PrimitiveIntHashMap Status #############\n");
ChildIntArrayManager child;
int i, j, k;
int size = pArray.size();
- for (i=0; i<size;i++) {
+ for (i = 0; i < size; i++) {
child = pArray.get(i);
s.append("child[").append(i).append("]\n");
- for (j=0; j<CHILD_BUCKETS;j++) {
+ for (j = 0; j < CHILD_BUCKETS; j++) {
s.append(j).append(" ");
- for (k=0; k<NUM_OF_SLOTS;k++) {
- s.append("[").append(child.cArray[j][k*2]).append(",").append(child.cArray[j][k*2+1]).append("] ");
+ for (k = 0; k < NUM_OF_SLOTS; k++) {
+ s.append("[").append(child.cArray[j][k * 2]).append(",").append(child.cArray[j][k * 2 + 1])
+ .append("] ");
}
s.append("\n");
}
}
return s.toString();
}
-
+
public int getNumOfSlots() {
return NUM_OF_SLOTS;
}
-
+
public int getNumOfChildBuckets() {
return CHILD_BUCKETS;
}
-
+
public void clear(boolean needShrink) {
int size = pArray.size();
- for (int i=size-1; i >= 0; i--) {
+ for (int i = size - 1; i >= 0; i--) {
if (needShrink && i != 0) {
pArray.remove(i);
} else {
@@ -371,29 +372,29 @@
}
occupiedSlots = 0;
}
-
+
///////////////////////////////////////
// iterate method
///////////////////////////////////////
-
+
public void beginIterate() {
iterChildIndex = 0;
iterBucketIndex = 0;
iterSlotIndex = 1;
}
-
+
public KeyValuePair getNextKeyValue() {
for (; iterChildIndex < pArray.size(); iterChildIndex++, iterBucketIndex = 0) {
for (; iterBucketIndex < CHILD_BUCKETS; iterBucketIndex++, iterSlotIndex = 1) {
- if (iterSlotIndex ==1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
+ if (iterSlotIndex == 1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
continue;
}
for (; iterSlotIndex < NUM_OF_SLOTS; iterSlotIndex++) {
- iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex*2];
+ iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex * 2];
if (iterPair.key == -1) {
continue;
}
- iterPair.value = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex*2+1];
+ iterPair.value = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex * 2 + 1];
iterSlotIndex++;
return iterPair;
}
@@ -401,15 +402,15 @@
}
return null;
}
-
+
public int getNextKey() {
for (; iterChildIndex < pArray.size(); iterChildIndex++, iterBucketIndex = 0) {
for (; iterBucketIndex < CHILD_BUCKETS; iterBucketIndex++, iterSlotIndex = 1) {
- if (iterSlotIndex ==1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
+ if (iterSlotIndex == 1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
continue;
}
for (; iterSlotIndex < NUM_OF_SLOTS; iterSlotIndex++) {
- iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex*2];
+ iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex * 2];
if (iterPair.key == -1) {
continue;
}
@@ -420,19 +421,19 @@
}
return -1;
}
-
+
public int getNextValue() {
for (; iterChildIndex < pArray.size(); iterChildIndex++, iterBucketIndex = 0) {
for (; iterBucketIndex < CHILD_BUCKETS; iterBucketIndex++, iterSlotIndex = 1) {
- if (iterSlotIndex ==1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
+ if (iterSlotIndex == 1 && pArray.get(iterChildIndex).cArray[iterBucketIndex][0] == 0) {
continue;
}
for (; iterSlotIndex < NUM_OF_SLOTS; iterSlotIndex++) {
- iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex*2];
+ iterPair.key = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex * 2];
if (iterPair.key == -1) {
continue;
}
- iterPair.value = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex*2+1];
+ iterPair.value = pArray.get(iterChildIndex).cArray[iterBucketIndex][iterSlotIndex * 2 + 1];
iterSlotIndex++;
return iterPair.value;
}
@@ -440,23 +441,23 @@
}
return -1;
}
-
+
public static class KeyValuePair {
public int key;
- public int value;
+ public int value;
}
}
class ChildIntArrayManager {
- private final int DIM1_SIZE;
- private final int DIM2_SIZE;
+ private final int DIM1_SIZE;
+ private final int DIM2_SIZE;
private final int NUM_OF_SLOTS;
public int[][] cArray; //child array
-
+
public ChildIntArrayManager(PrimitiveIntHashMap parentHashMap) {
DIM1_SIZE = parentHashMap.getNumOfChildBuckets();
DIM2_SIZE = parentHashMap.getNumOfSlots() * 2; //2: Array of [key, value] pair
- NUM_OF_SLOTS = parentHashMap.getNumOfSlots() ;
+ NUM_OF_SLOTS = parentHashMap.getNumOfSlots();
initialize();
}
@@ -468,11 +469,11 @@
//cArray[i][1] is not used.
cArray[i][0] = 0;
for (j = 1; j < NUM_OF_SLOTS; j++) {
- cArray[i][j*2] = -1; // -1 represent that the slot is empty
+ cArray[i][j * 2] = -1; // -1 represent that the slot is empty
}
}
}
-
+
public void clear() {
int i, j;
for (i = 0; i < DIM1_SIZE; i++) {
@@ -483,23 +484,23 @@
}
cArray[i][0] = 0;
for (j = 1; j < NUM_OF_SLOTS; j++) {
- cArray[i][j*2] = -1; // -1 represent that the slot is empty
+ cArray[i][j * 2] = -1; // -1 represent that the slot is empty
}
}
}
-
+
public void deinitialize() {
cArray = null;
}
-
+
public void allocate() {
initialize();
}
public boolean isFull(int bucketNum) {
- return cArray[bucketNum][0] == NUM_OF_SLOTS-1;
+ return cArray[bucketNum][0] == NUM_OF_SLOTS - 1;
}
-
+
public boolean isEmpty(int bucketNum) {
return cArray[bucketNum][0] == 0;
}
@@ -514,11 +515,11 @@
* @param key
* @param value
* @param isUpsert
- * @return 1 for new insertion, 0 for key duplication
+ * @return 1 for new insertion, 0 for key duplication
*/
public int put(int bucketNum, int key, int value, boolean isUpsert) {
int i;
- int emptySlot=-1;
+ int emptySlot = -1;
if (cArray[bucketNum][0] == 0) {
cArray[bucketNum][2] = key;
@@ -528,65 +529,63 @@
}
for (i = 1; i < NUM_OF_SLOTS; i++) {
- if (cArray[bucketNum][i*2] == key) {
+ if (cArray[bucketNum][i * 2] == key) {
if (isUpsert) {
- cArray[bucketNum][i*2+1] = value;
+ cArray[bucketNum][i * 2 + 1] = value;
}
return 0;
- }
- else if (cArray[bucketNum][i*2] == -1) {
+ } else if (cArray[bucketNum][i * 2] == -1) {
emptySlot = i;
}
}
-
+
if (emptySlot == -1) {
throw new UnsupportedOperationException("error");
}
-
- cArray[bucketNum][emptySlot*2] = key;
- cArray[bucketNum][emptySlot*2+1] = value;
+
+ cArray[bucketNum][emptySlot * 2] = key;
+ cArray[bucketNum][emptySlot * 2 + 1] = value;
cArray[bucketNum][0]++;
return 1;
}
public int get(int bucketNum, int key) {
int i;
-
+
if (cArray[bucketNum][0] == 0) {
return -1;
}
for (i = 1; i < NUM_OF_SLOTS; i++) {
- if (cArray[bucketNum][i*2] == key) {
- return cArray[bucketNum][i*2+1];
+ if (cArray[bucketNum][i * 2] == key) {
+ return cArray[bucketNum][i * 2 + 1];
}
}
return -1;
}
-
+
/**
* remove key if it exists. Otherwise, ignore it.
+ *
* @param bucketNum
* @param key
- * @return 1 for success, 0 if the key doesn't exist
+ * @return 1 for success, 0 if the key doesn't exist
*/
public int remove(int bucketNum, int key) {
int i;
-
+
if (cArray[bucketNum][0] == 0) {
return 0;
}
for (i = 1; i < NUM_OF_SLOTS; i++) {
- if (cArray[bucketNum][i*2] == key) {
- cArray[bucketNum][i*2] = -1;
+ if (cArray[bucketNum][i * 2] == key) {
+ cArray[bucketNum][i * 2] = -1;
cArray[bucketNum][0]--;
return 1;
}
}
-
+
return 0;
}
}
-
-
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogManager.java
index 419438f..933afcd 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogManager.java
@@ -134,7 +134,7 @@
appendPage.append(logRecord, appendLSN);
appendLSN += logRecord.getLogSize();
}
-
+
private void getAndInitNewPage() {
appendPage = null;
while (appendPage == null) {
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
index 9dc966c..778d24b 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogReader.java
@@ -39,7 +39,7 @@
private long bufferBeginLSN;
private long fileBeginLSN;
private FileChannel fileChannel;
-
+
private enum ReturnState {
FLUSH,
EOF
@@ -64,7 +64,7 @@
getFileChannel();
readPage();
}
-
+
//for scanning
@Override
public ILogRecord next() throws ACIDException {
@@ -81,7 +81,7 @@
readLSN += logRecord.getLogSize();
return logRecord;
}
-
+
private ReturnState waitForFlushOrReturnIfEOF() {
synchronized (flushLSN) {
while (readLSN >= flushLSN.get()) {
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogType.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogType.java
index f9e9304..1716cfb 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogType.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/LogType.java
@@ -26,7 +26,6 @@
private static final String STRING_ABORT = "ABORT";
private static final String STRING_INVALID_LOG_TYPE = "INVALID_LOG_TYPE";
-
public static String toString(byte logType) {
switch (logType) {
case LogType.UPDATE:
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/PrimaryKeyTupleReference.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/PrimaryKeyTupleReference.java
index d45b209..7acc000 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/PrimaryKeyTupleReference.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/logging/PrimaryKeyTupleReference.java
@@ -12,7 +12,7 @@
this.start = start;
this.length = length;
}
-
+
@Override
public int getFieldCount() {
return 1;
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/CheckpointObject.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/CheckpointObject.java
index f2cb22a..49cb500 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/CheckpointObject.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/CheckpointObject.java
@@ -19,7 +19,7 @@
public class CheckpointObject implements Serializable, Comparable<CheckpointObject> {
private static final long serialVersionUID = 1L;
-
+
private final long checkpointLsn;
private final long minMCTFirstLsn;
private final int maxJobId;
@@ -31,7 +31,7 @@
this.maxJobId = maxJobId;
this.timeStamp = timeStamp;
}
-
+
public long getCheckpointLsn() {
return checkpointLsn;
}
@@ -50,18 +50,18 @@
@Override
public int compareTo(CheckpointObject checkpointObject) {
- long compareTimeStamp = checkpointObject.getTimeStamp();
-
+ long compareTimeStamp = checkpointObject.getTimeStamp();
+
//decending order
long diff = compareTimeStamp - this.timeStamp;
if (diff > 0) {
return 1;
- } else if (diff == 0){
+ } else if (diff == 0) {
return 0;
} else {
return -1;
}
-
+
//ascending order
//return this.timeStamp - compareTimeStamp;
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/RecoveryManager.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/RecoveryManager.java
index 95ee767..997ac90 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/RecoveryManager.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/recovery/RecoveryManager.java
@@ -340,8 +340,9 @@
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("[RecoveryMgr] recovery is completed.");
- LOGGER.info("[RecoveryMgr's recovery log count] update/entityCommit/jobCommit/abort/redo = " + updateLogCount + "/"
- + entityCommitLogCount + "/" + jobCommitLogCount + "/" + abortLogCount + "/" + redoCount);
+ LOGGER.info("[RecoveryMgr's recovery log count] update/entityCommit/jobCommit/abort/redo = "
+ + updateLogCount + "/" + entityCommitLogCount + "/" + jobCommitLogCount + "/" + abortLogCount + "/"
+ + redoCount);
}
}
@@ -666,8 +667,8 @@
logReader.close();
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info(" undone loser transaction's effect");
- LOGGER.info("[RecoveryManager's rollback log count] update/entityCommit/undo:" + updateLogCount + "/" + entityCommitLogCount + "/"
- + undoCount);
+ LOGGER.info("[RecoveryManager's rollback log count] update/entityCommit/undo:" + updateLogCount + "/"
+ + entityCommitLogCount + "/" + undoCount);
}
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/DatasetIdFactory.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/DatasetIdFactory.java
index c6f245b..8a3d299 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/DatasetIdFactory.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/DatasetIdFactory.java
@@ -18,21 +18,21 @@
public class DatasetIdFactory {
private static AtomicInteger id = new AtomicInteger();
- private static boolean isInitialized = false;
-
+ private static boolean isInitialized = false;
+
public static boolean isInitialized() {
return isInitialized;
}
-
+
public static void initialize(int initialId) {
- id.set(initialId);
- isInitialized = true;
+ id.set(initialId);
+ isInitialized = true;
}
public static int generateDatasetId() {
return id.incrementAndGet();
}
-
+
public static int getMostRecentDatasetId() {
return id.get();
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/FieldsHashValueGenerator.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/FieldsHashValueGenerator.java
index 6ad4dc7..0b915c1 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/FieldsHashValueGenerator.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/FieldsHashValueGenerator.java
@@ -28,7 +28,7 @@
tuple.getFieldStart(primaryKeyFieldIdx), tuple.getFieldLength(primaryKeyFieldIdx));
h = h * 31 + fh;
if (h < 0) {
- h = h*(-1);
+ h = h * (-1);
}
}
return h;
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/JobIdFactory.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/JobIdFactory.java
index 019bdfd..ea912c0 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/JobIdFactory.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/JobIdFactory.java
@@ -27,7 +27,7 @@
public static JobId generateJobId() {
return new JobId(Id.incrementAndGet());
}
-
+
public static void initJobId(int id) {
Id.set(id);
}
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/MutableResourceId.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/MutableResourceId.java
index 9eb7bbd..545d5c0 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/MutableResourceId.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/MutableResourceId.java
@@ -14,7 +14,7 @@
*/
package edu.uci.ics.asterix.transaction.management.service.transaction;
-public class MutableResourceId{
+public class MutableResourceId {
long id;
public MutableResourceId(long id) {
@@ -31,7 +31,7 @@
@Override
public int hashCode() {
- return (int)id;
+ return (int) id;
}
@Override
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java
index 06f5399..664a4f1 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionContext.java
@@ -43,203 +43,197 @@
*/
public class TransactionContext implements ITransactionContext, Serializable {
- private static final long serialVersionUID = -6105616785783310111L;
- private TransactionSubsystem transactionSubsystem;
+ private static final long serialVersionUID = -6105616785783310111L;
+ private TransactionSubsystem transactionSubsystem;
- // jobId is set once and read concurrently.
- private final JobId jobId;
+ // jobId is set once and read concurrently.
+ private final JobId jobId;
- // There are no concurrent writers on both firstLSN and lastLSN
- // since both values are updated by serialized log appenders.
- // But readers and writers can be different threads,
- // so both LSNs are atomic variables in order to be read and written
- // atomically.
- private AtomicLong firstLSN;
- private AtomicLong lastLSN;
+ // There are no concurrent writers on both firstLSN and lastLSN
+ // since both values are updated by serialized log appenders.
+ // But readers and writers can be different threads,
+ // so both LSNs are atomic variables in order to be read and written
+ // atomically.
+ private AtomicLong firstLSN;
+ private AtomicLong lastLSN;
- // txnState is read and written concurrently.
- private AtomicInteger txnState;
+ // txnState is read and written concurrently.
+ private AtomicInteger txnState;
- // isTimeout is read and written under the lockMgr's tableLatch
- // Thus, no other synchronization is required separately.
- private boolean isTimeout;
+ // isTimeout is read and written under the lockMgr's tableLatch
+ // Thus, no other synchronization is required separately.
+ private boolean isTimeout;
- // isWriteTxn can be set concurrently by multiple threads.
- private AtomicBoolean isWriteTxn;
+ // isWriteTxn can be set concurrently by multiple threads.
+ private AtomicBoolean isWriteTxn;
- // isMetadataTxn is accessed by a single thread since the metadata is not
- // partitioned
- private boolean isMetadataTxn;
+ // isMetadataTxn is accessed by a single thread since the metadata is not
+ // partitioned
+ private boolean isMetadataTxn;
- // indexMap is concurrently accessed by multiple threads,
- // so those threads are synchronized on indexMap object itself
- private Map<MutableLong, AbstractLSMIOOperationCallback> indexMap;
+ // indexMap is concurrently accessed by multiple threads,
+ // so those threads are synchronized on indexMap object itself
+ private Map<MutableLong, AbstractLSMIOOperationCallback> indexMap;
- // TODO: fix ComponentLSNs' issues.
- // primaryIndex, primaryIndexCallback, and primaryIndexOptracker will be
- // modified accordingly
- // when the issues of componentLSNs are fixed.
- private ILSMIndex primaryIndex;
- private PrimaryIndexModificationOperationCallback primaryIndexCallback;
- private PrimaryIndexOperationTracker primaryIndexOpTracker;
+ // TODO: fix ComponentLSNs' issues.
+ // primaryIndex, primaryIndexCallback, and primaryIndexOptracker will be
+ // modified accordingly
+ // when the issues of componentLSNs are fixed.
+ private ILSMIndex primaryIndex;
+ private PrimaryIndexModificationOperationCallback primaryIndexCallback;
+ private PrimaryIndexOperationTracker primaryIndexOpTracker;
- // The following three variables are used as temporary variables in order to
- // avoid object creations.
- // Those are used in synchronized methods.
- private MutableLong tempResourceIdForRegister;
- private MutableLong tempResourceIdForSetLSN;
- private LogRecord logRecord;
+ // The following three variables are used as temporary variables in order to
+ // avoid object creations.
+ // Those are used in synchronized methods.
+ private MutableLong tempResourceIdForRegister;
+ private MutableLong tempResourceIdForSetLSN;
+ private LogRecord logRecord;
- // TODO: implement transactionContext pool in order to avoid object
- // creations.
- // also, the pool can throttle the number of concurrent active jobs at every
- // moment.
- public TransactionContext(JobId jobId,
- TransactionSubsystem transactionSubsystem) throws ACIDException {
- this.jobId = jobId;
- this.transactionSubsystem = transactionSubsystem;
- firstLSN = new AtomicLong(-1);
- lastLSN = new AtomicLong(-1);
- txnState = new AtomicInteger(ITransactionManager.ACTIVE);
- isTimeout = false;
- isWriteTxn = new AtomicBoolean(false);
- isMetadataTxn = false;
- indexMap = new HashMap<MutableLong, AbstractLSMIOOperationCallback>();
- primaryIndex = null;
- tempResourceIdForRegister = new MutableLong();
- tempResourceIdForSetLSN = new MutableLong();
- logRecord = new LogRecord();
- }
+ // TODO: implement transactionContext pool in order to avoid object
+ // creations.
+ // also, the pool can throttle the number of concurrent active jobs at every
+ // moment.
+ public TransactionContext(JobId jobId, TransactionSubsystem transactionSubsystem) throws ACIDException {
+ this.jobId = jobId;
+ this.transactionSubsystem = transactionSubsystem;
+ firstLSN = new AtomicLong(-1);
+ lastLSN = new AtomicLong(-1);
+ txnState = new AtomicInteger(ITransactionManager.ACTIVE);
+ isTimeout = false;
+ isWriteTxn = new AtomicBoolean(false);
+ isMetadataTxn = false;
+ indexMap = new HashMap<MutableLong, AbstractLSMIOOperationCallback>();
+ primaryIndex = null;
+ tempResourceIdForRegister = new MutableLong();
+ tempResourceIdForSetLSN = new MutableLong();
+ logRecord = new LogRecord();
+ }
- public void registerIndexAndCallback(long resourceId, ILSMIndex index,
- AbstractOperationCallback callback, boolean isPrimaryIndex) {
- synchronized (indexMap) {
- if (isPrimaryIndex && primaryIndex == null) {
- primaryIndex = index;
- primaryIndexCallback = (PrimaryIndexModificationOperationCallback) callback;
- primaryIndexOpTracker = (PrimaryIndexOperationTracker) index
- .getOperationTracker();
- }
- tempResourceIdForRegister.set(resourceId);
- if (!indexMap.containsKey(tempResourceIdForRegister)) {
- indexMap.put(new MutableLong(resourceId),
- ((AbstractLSMIOOperationCallback) index
- .getIOOperationCallback()));
- }
- }
- }
+ public void registerIndexAndCallback(long resourceId, ILSMIndex index, AbstractOperationCallback callback,
+ boolean isPrimaryIndex) {
+ synchronized (indexMap) {
+ if (isPrimaryIndex && primaryIndex == null) {
+ primaryIndex = index;
+ primaryIndexCallback = (PrimaryIndexModificationOperationCallback) callback;
+ primaryIndexOpTracker = (PrimaryIndexOperationTracker) index.getOperationTracker();
+ }
+ tempResourceIdForRegister.set(resourceId);
+ if (!indexMap.containsKey(tempResourceIdForRegister)) {
+ indexMap.put(new MutableLong(resourceId),
+ ((AbstractLSMIOOperationCallback) index.getIOOperationCallback()));
+ }
+ }
+ }
- // [Notice]
- // This method is called sequentially by the LogAppender threads.
- // However, the indexMap is concurrently read and modified through this
- // method and registerIndexAndCallback()
- @Override
- public void setLastLSN(long resourceId, long LSN) {
- synchronized (indexMap) {
- firstLSN.compareAndSet(-1, LSN);
- lastLSN.set(Math.max(lastLSN.get(), LSN));
- if (resourceId != -1) {
- // Non-update log's resourceId is -1.
- tempResourceIdForSetLSN.set(resourceId);
- AbstractLSMIOOperationCallback ioOpCallback = indexMap
- .get(tempResourceIdForSetLSN);
- ioOpCallback.updateLastLSN(LSN);
- }
- }
- }
+ // [Notice]
+ // This method is called sequentially by the LogAppender threads.
+ // However, the indexMap is concurrently read and modified through this
+ // method and registerIndexAndCallback()
+ @Override
+ public void setLastLSN(long resourceId, long LSN) {
+ synchronized (indexMap) {
+ firstLSN.compareAndSet(-1, LSN);
+ lastLSN.set(Math.max(lastLSN.get(), LSN));
+ if (resourceId != -1) {
+ // Non-update log's resourceId is -1.
+ tempResourceIdForSetLSN.set(resourceId);
+ AbstractLSMIOOperationCallback ioOpCallback = indexMap.get(tempResourceIdForSetLSN);
+ ioOpCallback.updateLastLSN(LSN);
+ }
+ }
+ }
- @Override
- public void notifyOptracker(boolean isJobLevelCommit) {
- try {
- if (isJobLevelCommit && isMetadataTxn) {
- primaryIndexOpTracker.exclusiveJobCommitted();
- } else if (!isJobLevelCommit) {
- primaryIndexOpTracker.completeOperation(null,
- LSMOperationType.MODIFICATION, null,
- primaryIndexCallback);
- }
- } catch (HyracksDataException e) {
- throw new IllegalStateException(e);
- }
- }
+ @Override
+ public void notifyOptracker(boolean isJobLevelCommit) {
+ try {
+ if (isJobLevelCommit && isMetadataTxn) {
+ primaryIndexOpTracker.exclusiveJobCommitted();
+ } else if (!isJobLevelCommit) {
+ primaryIndexOpTracker
+ .completeOperation(null, LSMOperationType.MODIFICATION, null, primaryIndexCallback);
+ }
+ } catch (HyracksDataException e) {
+ throw new IllegalStateException(e);
+ }
+ }
- public void setWriteTxn(boolean isWriteTxn) {
- this.isWriteTxn.set(isWriteTxn);
- }
+ public void setWriteTxn(boolean isWriteTxn) {
+ this.isWriteTxn.set(isWriteTxn);
+ }
- public boolean isWriteTxn() {
- return isWriteTxn.get();
- }
+ public boolean isWriteTxn() {
+ return isWriteTxn.get();
+ }
- @Override
- public long getFirstLSN() {
- return firstLSN.get();
- }
+ @Override
+ public long getFirstLSN() {
+ return firstLSN.get();
+ }
- @Override
- public long getLastLSN() {
- return lastLSN.get();
- }
+ @Override
+ public long getLastLSN() {
+ return lastLSN.get();
+ }
- public JobId getJobId() {
- return jobId;
- }
+ public JobId getJobId() {
+ return jobId;
+ }
- public void setTimeout(boolean isTimeout) {
- this.isTimeout = isTimeout;
- }
+ public void setTimeout(boolean isTimeout) {
+ this.isTimeout = isTimeout;
+ }
- public boolean isTimeout() {
- return isTimeout;
- }
+ public boolean isTimeout() {
+ return isTimeout;
+ }
- public void setTxnState(int txnState) {
- this.txnState.set(txnState);
- }
+ public void setTxnState(int txnState) {
+ this.txnState.set(txnState);
+ }
- public int getTxnState() {
- return txnState.get();
- }
+ public int getTxnState() {
+ return txnState.get();
+ }
- @Override
- public int hashCode() {
- return jobId.getId();
- }
+ @Override
+ public int hashCode() {
+ return jobId.getId();
+ }
- @Override
- public boolean equals(Object o) {
- return (o == this);
- }
+ @Override
+ public boolean equals(Object o) {
+ return (o == this);
+ }
- @Override
- public void setMetadataTransaction(boolean isMetadataTxn) {
- this.isMetadataTxn = isMetadataTxn;
- }
+ @Override
+ public void setMetadataTransaction(boolean isMetadataTxn) {
+ this.isMetadataTxn = isMetadataTxn;
+ }
- @Override
- public boolean isMetadataTransaction() {
- return isMetadataTxn;
- }
+ @Override
+ public boolean isMetadataTransaction() {
+ return isMetadataTxn;
+ }
- public String prettyPrint() {
- StringBuilder sb = new StringBuilder();
- sb.append("\n" + jobId + "\n");
- sb.append("isWriteTxn: " + isWriteTxn + "\n");
- sb.append("firstLSN: " + firstLSN.get() + "\n");
- sb.append("lastLSN: " + lastLSN.get() + "\n");
- sb.append("TransactionState: " + txnState + "\n");
- sb.append("isTimeout: " + isTimeout + "\n");
- return sb.toString();
- }
+ public String prettyPrint() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("\n" + jobId + "\n");
+ sb.append("isWriteTxn: " + isWriteTxn + "\n");
+ sb.append("firstLSN: " + firstLSN.get() + "\n");
+ sb.append("lastLSN: " + lastLSN.get() + "\n");
+ sb.append("TransactionState: " + txnState + "\n");
+ sb.append("isTimeout: " + isTimeout + "\n");
+ return sb.toString();
+ }
- public LogRecord getLogRecord() {
- return logRecord;
- }
+ public LogRecord getLogRecord() {
+ return logRecord;
+ }
- public void cleanupForAbort() {
- if (primaryIndexOpTracker != null) {
- primaryIndexOpTracker
- .cleanupNumActiveOperationsForAbortedJob(primaryIndexCallback);
- }
- }
+ public void cleanupForAbort() {
+ if (primaryIndexOpTracker != null) {
+ primaryIndexOpTracker.cleanupNumActiveOperationsForAbortedJob(primaryIndexCallback);
+ }
+ }
}