1) support providing iodevices in cluster configuration
2) support for providing java_opts in cluster configuration
3) managix uses cluster/client ip in cluster configuration
4) consistent use of IPs and Ids when describing an asterix instance
5) managix poulates log.properties for the initialization of log manager and bakes them inside asterix-app*.jar 
   Log Manager can read log properties by its class loader.    
6) changes in  backup/restore to account for artifacts created by log manager. 
7) cosmetic changes.


git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization@1449 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
index 6d21b27..49ca5ba 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/algebra/operators/physical/InvertedIndexPOperator.java
@@ -19,6 +19,7 @@
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.ATypeTag;
 import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
 import edu.uci.ics.asterix.optimizer.rules.am.InvertedIndexAccessMethod;
 import edu.uci.ics.asterix.optimizer.rules.am.InvertedIndexAccessMethod.SearchModifierType;
 import edu.uci.ics.asterix.optimizer.rules.am.InvertedIndexJobGenParams;
@@ -159,9 +160,8 @@
             ITypeTraits[] tokenTypeTraits = new ITypeTraits[numTokenKeys];
             IBinaryComparatorFactory[] tokenComparatorFactories = new IBinaryComparatorFactory[numTokenKeys];
             for (int i = 0; i < numSecondaryKeys; i++) {
-                tokenComparatorFactories[i] = InvertedIndexAccessMethod
-                        .getTokenBinaryComparatorFactory(secondaryKeyType);
-                tokenTypeTraits[i] = InvertedIndexAccessMethod.getTokenTypeTrait(secondaryKeyType);
+                tokenComparatorFactories[i] = NonTaggedFormatUtil.getTokenBinaryComparatorFactory(secondaryKeyType);
+                tokenTypeTraits[i] = NonTaggedFormatUtil.getTokenTypeTrait(secondaryKeyType);
             }
             if (isPartitioned) {
                 // The partitioning field is hardcoded to be a short *without* an Asterix type tag.
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 3310f4d..fed591d 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
@@ -146,7 +146,10 @@
             project.getInputs().add(new MutableObject<ILogicalOperator>(currentTop));
             context.computeAndSetTypeEnvironmentForOperator(project);
             context.computeAndSetTypeEnvironmentForOperator(assign);
-            if (index.getIndexType() == IndexType.BTREE) {
+            if (index.getIndexType() == IndexType.BTREE || index.getIndexType() == IndexType.WORD_INVIX
+                    || index.getIndexType() == IndexType.NGRAM_INVIX
+                    || index.getIndexType() == IndexType.FUZZY_WORD_INVIX
+                    || index.getIndexType() == IndexType.FUZZY_NGRAM_INVIX) {
                 for (LogicalVariable secondaryKeyVar : secondaryKeyVars) {
                     secondaryExpressions.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(
                             secondaryKeyVar)));
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
index d4d6b43..ff260f1 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/InvertedIndexAccessMethod.java
@@ -12,9 +12,7 @@
 import edu.uci.ics.asterix.algebra.base.LogicalOperatorDeepCopyVisitor;
 import edu.uci.ics.asterix.aql.util.FunctionUtils;
 import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
-import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlBinaryTokenizerFactoryProvider;
-import edu.uci.ics.asterix.formats.nontagged.AqlTypeTraitProvider;
 import edu.uci.ics.asterix.metadata.entities.Dataset;
 import edu.uci.ics.asterix.metadata.entities.Index;
 import edu.uci.ics.asterix.om.base.AFloat;
@@ -25,11 +23,8 @@
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
-import edu.uci.ics.asterix.om.types.AOrderedListType;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.ATypeTag;
-import edu.uci.ics.asterix.om.types.AUnorderedListType;
-import edu.uci.ics.asterix.om.types.AbstractCollectionType;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.common.utils.Triple;
@@ -57,8 +52,6 @@
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnionAllOperator;
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
-import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
-import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
 import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifierFactory;
 import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.search.ConjunctiveSearchModifierFactory;
 import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.search.EditDistanceSearchModifierFactory;
@@ -519,37 +512,37 @@
             joinInputSubTreeVarMap.put(optFuncExpr.getLogicalVar(i), context.newVar());
             newProbeSubTreeVarMap.put(optFuncExpr.getLogicalVar(i), optFuncExpr.getLogicalVar(i));
         }
-        for (int i = 0; i < originalSubTreePKs.size(); i++) {            
+        for (int i = 0; i < originalSubTreePKs.size(); i++) {
             LogicalVariable newPKVar = context.newVar();
             surrogateSubTreePKs.add(newPKVar);
             joinInputSubTreeVarMap.put(originalSubTreePKs.get(i), newPKVar);
             newProbeSubTreeVarMap.put(originalSubTreePKs.get(i), originalSubTreePKs.get(i));
         }
-        
+
         // Create first copy.
         Counter firstCounter = new Counter(context.getVarCounter());
         LogicalOperatorDeepCopyVisitor firstDeepCopyVisitor = new LogicalOperatorDeepCopyVisitor(firstCounter,
                 newProbeSubTreeVarMap);
         ILogicalOperator newProbeSubTree = firstDeepCopyVisitor.deepCopy(probeSubTree.root, null);
         inferTypes(newProbeSubTree, context);
-        Mutable<ILogicalOperator> newProbeSubTreeRootRef = new MutableObject<ILogicalOperator>(newProbeSubTree);        
+        Mutable<ILogicalOperator> newProbeSubTreeRootRef = new MutableObject<ILogicalOperator>(newProbeSubTree);
         context.setVarCounter(firstCounter.get());
         // Create second copy.
         Counter secondCounter = new Counter(context.getVarCounter());
         LogicalOperatorDeepCopyVisitor secondDeepCopyVisitor = new LogicalOperatorDeepCopyVisitor(secondCounter,
-                joinInputSubTreeVarMap);        
+                joinInputSubTreeVarMap);
         ILogicalOperator joinInputSubTree = secondDeepCopyVisitor.deepCopy(probeSubTree.root, null);
         inferTypes(joinInputSubTree, context);
         probeSubTree.rootRef.setValue(joinInputSubTree);
         context.setVarCounter(secondCounter.get());
-        
+
         // Remember the original probe subtree reference so we can return it.
         Mutable<ILogicalOperator> originalProbeSubTreeRootRef = probeSubTree.rootRef;
 
         // Replace the original probe subtree with its copy.
         Dataset origDataset = probeSubTree.dataset;
         ARecordType origRecordType = probeSubTree.recordType;
-        probeSubTree.initFromSubTree(newProbeSubTreeRootRef);        
+        probeSubTree.initFromSubTree(newProbeSubTreeRootRef);
         probeSubTree.dataset = origDataset;
         probeSubTree.recordType = origRecordType;
 
@@ -571,7 +564,7 @@
         for (int i = 0; i < numPKVars; i++) {
             List<Mutable<ILogicalExpression>> args = new ArrayList<Mutable<ILogicalExpression>>();
             args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(surrogateSubTreePKs.get(i))));
-            args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(originalSubTreePKs.get(i))));                   
+            args.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(originalSubTreePKs.get(i))));
             ILogicalExpression eqFunc = new ScalarFunctionCallExpression(
                     FunctionUtils.getFunctionInfo(AlgebricksBuiltinFunctions.EQ), args);
             eqExprs.add(new MutableObject<ILogicalExpression>(eqFunc));
@@ -839,42 +832,6 @@
         return false;
     }
 
-    public static IBinaryComparatorFactory getTokenBinaryComparatorFactory(IAType keyType) throws AlgebricksException {
-        IAType type = keyType;
-        ATypeTag typeTag = keyType.getTypeTag();
-        // Extract item type from list.
-        if (typeTag == ATypeTag.UNORDEREDLIST || typeTag == ATypeTag.ORDEREDLIST) {
-            AbstractCollectionType listType = (AbstractCollectionType) keyType;
-            if (!listType.isTyped()) {
-                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
-            }
-            type = listType.getItemType();
-        }
-        // Ignore case for string types.
-        return AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(type, true, true);
-    }
-
-    public static ITypeTraits getTokenTypeTrait(IAType keyType) throws AlgebricksException {
-        IAType type = keyType;
-        ATypeTag typeTag = keyType.getTypeTag();
-        // Extract item type from list.
-        if (typeTag == ATypeTag.UNORDEREDLIST) {
-            AUnorderedListType ulistType = (AUnorderedListType) keyType;
-            if (!ulistType.isTyped()) {
-                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
-            }
-            type = ulistType.getItemType();
-        }
-        if (typeTag == ATypeTag.ORDEREDLIST) {
-            AOrderedListType olistType = (AOrderedListType) keyType;
-            if (!olistType.isTyped()) {
-                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
-            }
-            type = olistType.getItemType();
-        }
-        return AqlTypeTraitProvider.INSTANCE.getTypeTrait(type);
-    }
-
     public static IBinaryTokenizerFactory getBinaryTokenizerFactory(SearchModifierType searchModifierType,
             ATypeTag searchKeyType, Index index) throws AlgebricksException {
         switch (index.getIndexType()) {
@@ -895,24 +852,6 @@
         }
     }
 
-    public static IBinaryTokenizerFactory getBinaryTokenizerFactory(ATypeTag keyType, IndexType indexType,
-            int gramLength) throws AlgebricksException {
-        switch (indexType) {
-            case WORD_INVIX:
-            case FUZZY_WORD_INVIX: {
-                return AqlBinaryTokenizerFactoryProvider.INSTANCE.getWordTokenizerFactory(keyType, false);
-            }
-            case NGRAM_INVIX:
-            case FUZZY_NGRAM_INVIX: {
-                return AqlBinaryTokenizerFactoryProvider.INSTANCE.getNGramTokenizerFactory(keyType, gramLength, true,
-                        false);
-            }
-            default: {
-                throw new AlgebricksException("Tokenizer not applicable to index type '" + indexType + "'.");
-            }
-        }
-    }
-
     public static IInvertedIndexSearchModifierFactory getSearchModifierFactory(SearchModifierType searchModifierType,
             IAObject simThresh, Index index) throws AlgebricksException {
         switch (searchModifierType) {
diff --git a/asterix-app/data/dblp-small/dblp-small-nulls.adm b/asterix-app/data/dblp-small/dblp-small-nulls.adm
new file mode 100644
index 0000000..d943f54
--- /dev/null
+++ b/asterix-app/data/dblp-small/dblp-small-nulls.adm
@@ -0,0 +1,100 @@
+{ "id": 2, "dblpid": "books/acm/kim95/Blakeley95", "title": "OQL[C++]  Extending C++ with an Object Query Capability.", "authors": "José A. Blakeley", "misc": "2002-01-03 69-88 Modern Database Systems db/books/collections/kim95.html#Blakeley95 1995" }
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 6, "dblpid": "books/acm/kim95/DittrichD95", "title": "Where Object-Oriented DBMSs Should Do Better  A Critique Based on Early Experiences.", "authors": "Angelika Kotz Dittrich Klaus R. Dittrich", "misc": "2002-01-03 238-254 1995 Modern Database Systems db/books/collections/kim95.html#DittrichD95" }
+{ "id": 8, "dblpid": "books/acm/kim95/Goodman95", "title": "An Object-Oriented DBMS War Story  Developing a Genome Mapping Database in C++.", "authors": "Nathan Goodman", "misc": "2002-01-03 216-237 1995 Modern Database Systems db/books/collections/kim95.html#Goodman95" }
+{ "id": 10, "dblpid": "books/acm/kim95/KelleyGKRG95", "title": "Schema Architecture of the UniSQL/M Multidatabase System", "authors": "William Kelley Sunit K. Gala Won Kim Tom C. Reyes Bruce Graham", "misc": "2004-03-08 Modern Database Systems books/acm/Kim95 621-648 1995 db/books/collections/kim95.html#KelleyGKRG95" }
+{ "id": 12, "dblpid": "books/acm/kim95/Kim95", "authors": "Won Kim", "misc": "2002-01-03 5-17 1995 Modern Database Systems db/books/collections/kim95.html#Kim95" }
+{ "id": 14, "dblpid": "books/acm/kim95/Kim95b", "title": "Introduction to Part 2  Technology for Interoperating Legacy Databases.", "authors": "Won Kim", "misc": "2002-01-03 515-520 1995 Modern Database Systems db/books/collections/kim95.html#Kim95b" }
+{ "id": 16, "dblpid": "books/acm/kim95/KimG95", "authors": "Won Kim Jorge F. Garza", "misc": "2002-01-03 203-215 1995 Modern Database Systems db/books/collections/kim95.html#KimG95" }
+{ "id": 18, "dblpid": "books/acm/kim95/Kowalski95", "title": "The POSC Solution to Managing E&P Data.", "authors": "Vincent J. Kowalski", "misc": "2002-01-03 281-301 1995 Modern Database Systems db/books/collections/kim95.html#Kowalski95" }
+{ "id": 20, "dblpid": "books/acm/kim95/Lunt95", "title": "Authorization in Object-Oriented Databases.", "authors": "Teresa F. Lunt", "misc": "2002-01-03 130-145 1995 Modern Database Systems db/books/collections/kim95.html#Lunt95" }
+{ "id": 22, "dblpid": "books/acm/kim95/Motro95", "authors": "Amihai Motro", "misc": "2002-01-03 457-476 1995 Modern Database Systems db/books/collections/kim95.html#Motro95" }
+{ "id": 24, "dblpid": "books/acm/kim95/OzsuB95", "authors": "M. Tamer Özsu José A. Blakeley", "misc": "2002-01-03 146-174 1995 Modern Database Systems db/books/collections/kim95.html#OzsuB95" }
+{ "id": 26, "dblpid": "books/acm/kim95/Samet95", "title": "Spatial Data Structures.", "authors": "Hanan Samet", "misc": "2004-03-08 361-385 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Samet95 1995" }
+{ "id": 28, "dblpid": "books/acm/kim95/ShanADDK95", "title": "Pegasus  A Heterogeneous Information Management System.", "authors": "Ming-Chien Shan Rafi Ahmed Jim Davis Weimin Du William Kent", "misc": "2004-03-08 664-682 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#ShanADDK95 1995" }
+{ "id": 30, "dblpid": "books/acm/kim95/SoleyK95", "title": "The OMG Object Model.", "authors": "Richard Mark Soley William Kent", "misc": "2002-01-03 18-41 1995 Modern Database Systems db/books/collections/kim95.html#SoleyK95" }
+{ "id": 32, "dblpid": "books/acm/kim95/Thompson95", "title": "The Changing Database Standards Landscape.", "authors": "Craig W. Thompson", "misc": "2002-01-03 302-317 1995 Modern Database Systems db/books/collections/kim95.html#Thompson95" }
+{ "id": 34, "dblpid": "books/acm/Kim95", "title": "Modern Database Systems  The Object Model, Interoperability, and Beyond.", "authors": "", "misc": "2004-03-08 Won Kim Modern Database Systems ACM Press and Addison-Wesley 1995 0-201-59098-0 db/books/collections/kim95.html" }
+{ "id": 36, "dblpid": "books/aw/kimL89/BjornerstedtH89", "title": "Version Control in an Object-Oriented Architecture.", "authors": "Anders Björnerstedt Christer Hulten", "misc": "2006-02-24 451-485 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BjornerstedtH89" }
+{ "id": 38, "dblpid": "books/aw/kimL89/CareyDRS89", "title": "Storage Management in EXODUS.", "authors": "Michael J. Carey David J. DeWitt Joel E. Richardson Eugene J. Shekita", "misc": "2002-01-03 341-369 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#CareyDRS89" }
+{ "id": 40, "dblpid": "books/aw/kimL89/DiederichM89", "title": "Objects, Messages, and Rules in Database Design.", "authors": "Jim Diederich Jack Milton", "misc": "2002-01-03 177-197 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#DiederichM89" }
+{ "id": 42, "dblpid": "books/aw/kimL89/FishmanABCCDHHKLLMNRSW89", "title": "Overview of the Iris DBMS.", "authors": "Daniel H. Fishman Jurgen Annevelink David Beech E. C. Chow Tim Connors J. W. Davis Waqar Hasan C. G. Hoch William Kent S. Leichner Peter Lyngbæk Brom Mahbod Marie-Anne Neimat Tore Risch Ming-Chien Shan W. Kevin Wilkinson", "misc": "2002-01-03 219-250 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#FishmanABCCDHHKLLMNRSW89" }
+{ "id": 44, "dblpid": "books/aw/kimL89/KimKD89", "title": "Indexing Techniques for Object-Oriented Databases.", "authors": "Won Kim Kyung-Chang Kim Alfred G. Dale", "misc": "2002-01-03 371-394 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimKD89" }
+{ "id": 46, "dblpid": "books/aw/kimL89/Maier89", "title": "Making Database Systems Fast Enough for CAD Applications.", "authors": "David Maier", "misc": "2002-01-03 573-582 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Maier89" }
+{ "id": 48, "dblpid": "books/aw/kimL89/Moon89", "title": "The Common List Object-Oriented Programming Language Standard.", "authors": "David A. Moon", "misc": "2002-01-03 49-78 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moon89" }
+{ "id": 50, "dblpid": "books/aw/kimL89/Nierstrasz89", "title": "A Survey of Object-Oriented Concepts.", "authors": "Oscar Nierstrasz", "misc": "2002-01-03 3-21 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Nierstrasz89" }
+{ "id": 52, "dblpid": "books/aw/kimL89/Russinoff89", "title": "Proteus  A Frame-Based Nonmonotonic Inference System.", "authors": "David M. Russinoff", "misc": "2002-01-03 127-150 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#Russinoff89" }
+{ "id": 54, "dblpid": "books/aw/kimL89/SteinLU89", "authors": "Lynn Andrea Stein Henry Lieberman David Ungar", "misc": "2002-01-03 31-48 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SteinLU89" }
+{ "id": 56, "dblpid": "books/aw/kimL89/TomlinsonS89", "title": "Concurrent Object-Oriented Programming Languages.", "authors": "Chris Tomlinson Mark Scheevel", "misc": "2002-01-03 79-124 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TomlinsonS89" }
+{ "id": 58, "dblpid": "books/aw/kimL89/Wand89", "title": "A Proposal for a Formal Model of Objects.", "authors": "Yair Wand", "misc": "2002-01-03 537-559 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Wand89" }
+{ "id": 60, "dblpid": "books/aw/stonebraker86/RoweS86", "authors": "Lawrence A. Rowe Michael Stonebraker", "misc": "2002-01-03 63-82 1986 The INGRES Papers db/books/collections/Stonebraker86.html#RoweS86 db/books/collections/Stonebraker86/RoweS86.html ingres/P063.pdf" }
+{ "id": 62, "dblpid": "books/aw/stonebraker86/Stonebraker86a", "title": "Supporting Studies on Relational Systems (Introduction to Section 2).", "authors": "Michael Stonebraker", "misc": "2002-01-03 83-85 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86a db/books/collections/Stonebraker86/Stonebraker86a.html ingres/P083.pdf" }
+{ "id": 64, "dblpid": "books/aw/stonebraker86/Stonebraker86c", "authors": "Michael Stonebraker", "misc": "2002-01-03 187-196 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86c db/books/collections/Stonebraker86/Stonebraker86c.html ingres/P187.pdf" }
+{ "id": 66, "dblpid": "books/aw/stonebraker86/Stonebraker86e", "title": "Extended Semantics for the Relational Model (Introduction to Section 5).", "authors": "Michael Stonebraker", "misc": "2002-01-03 313-316 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86e db/books/collections/Stonebraker86/Stonebraker86e.html ingres/P313.pdf" }
+{ "id": 68, "dblpid": "books/aw/stonebraker86/X86", "title": "Title, Preface, Contents.", "authors": "", "misc": "2002-01-03 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86 db/books/collections/Stonebraker86/X86.html ingres/frontmatter.pdf" }
+{ "id": 70, "dblpid": "books/aw/Knuth86a", "title": "TeX  The Program", "authors": "Donald E. Knuth", "misc": "2002-01-03 Addison-Wesley 1986 0-201-13437-3" }
+{ "id": 72, "dblpid": "books/aw/Lamport86", "title": "LaTeX  User's Guide & Reference Manual", "authors": "Leslie Lamport", "misc": "2002-01-03 Addison-Wesley 1986 0-201-15790-X" }
+{ "id": 74, "dblpid": "books/aw/Lamport2002", "title": "Specifying Systems, The TLA+ Language and Tools for Hardware and Software Engineers", "authors": "Leslie Lamport", "misc": "2005-07-28 Addison-Wesley 2002 0-3211-4306-X http //research.microsoft.com/users/lamport/tla/book.html" }
+{ "id": 76, "dblpid": "books/aw/LewisBK01", "title": "Databases and Transaction Processing  An Application-Oriented Approach", "authors": "Philip M. Lewis Arthur J. Bernstein Michael Kifer", "misc": "2002-01-03 Addison-Wesley 2001 0-201-70872-8" }
+{ "id": 78, "dblpid": "books/aw/LindholmY97", "title": "The Java Virtual Machine Specification", "authors": "Tim Lindholm Frank Yellin", "misc": "2002-01-28 Addison-Wesley 1997 0-201-63452-X" }
+{ "id": 80, "dblpid": "books/aw/Sedgewick83", "title": "Algorithms", "authors": "Robert Sedgewick", "misc": "2002-01-03 Addison-Wesley 1983 0-201-06672-6" }
+{ "id": 82, "dblpid": "conf/focs/AspnesW92", "title": "Randomized Consensus in Expected O(n log ^2 n) Operations Per Processor", "authors": "James Aspnes Orli Waarts", "misc": "2006-04-25 137-146 conf/focs/FOCS33 1992 FOCS db/conf/focs/focs92.html#AspnesW92" }
+{ "id": 84, "dblpid": "conf/stoc/Bloniarz80", "title": "A Shortest-Path Algorithm with Expected Time O(n^2 log n log ^* n)", "authors": "Peter A. Bloniarz", "misc": "2006-04-25 378-384 conf/stoc/STOC12 1980 STOC db/conf/stoc/stoc80.html#Bloniarz80" }
+{ "id": 86, "dblpid": "conf/focs/Megiddo82", "title": "Linear-Time Algorithms for Linear Programming in R^3 and Related Problems", "authors": "Nimrod Megiddo", "misc": "2006-04-25 329-338 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#Megiddo82" }
+{ "id": 88, "dblpid": "conf/focs/MoffatT85", "title": "An All Pairs Shortest Path Algorithm with Expected Running Time O(n^2 log n)", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2006-04-25 101-105 conf/focs/FOCS26 1985 FOCS db/conf/focs/focs85.html#MoffatT85" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
+{ "id": 92, "dblpid": "conf/stacs/Laue08", "title": "Geometric Set Cover and Hitting Sets for Polytopes in R³.", "authors": "Sören Laue", "misc": "2008-03-04 2008 STACS 479-490 http //drops.dagstuhl.de/opus/volltexte/2008/1367 conf/stacs/2008 db/conf/stacs/stacs2008.html#Laue08" }
+{ "id": 94, "dblpid": "conf/awoc/IbarraJRC88", "title": "On Some Languages in NC.", "authors": "Oscar H. Ibarra Tao Jiang Bala Ravikumar Jik H. Chang", "misc": "2002-08-06 64-73 1988 conf/awoc/1988 AWOC db/conf/awoc/awoc88.html#IbarraJRC88" }
+{ "id": 96, "dblpid": "conf/focs/GalilHLSW82", "title": "An O(n^3 log n) Deterministic and an O(n^3) Probabilistic Isomorphism Test for Trivalent Graphs", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2006-04-25 118-125 conf/focs/FOCS23 1982 FOCS db/conf/focs/focs82.html#GalilHLSW82" }
+{ "id": 98, "dblpid": "conf/focs/GalilT86", "title": "An O(n^2 (m + n log n) log n) Min-Cost Flow Algorithm", "authors": "Zvi Galil Éva Tardos", "misc": "2006-04-25 1-9 conf/focs/FOCS27 1986 FOCS db/conf/focs/focs86.html#GalilT86" }
+{ "id": 100, "dblpid": "series/synthesis/2009Brozos", "title": "The Geometry of Walker Manifolds", "authors": "Miguel Brozos-Vázquez Eduardo García-Río Peter Gilkey Stana Nikcevic Rámon Vázquez-Lorenzo", "misc": "2009-09-06 The Geometry of Walker Manifolds http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 http //dx.doi.org/10.2200/S00197ED1V01Y200906MAS005 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
+{ "id": 1, "dblpid": "books/acm/kim95/AnnevelinkACFHK95", "title": "Object SQL - A Language for the Design and Implementation of Object Databases.", "authors": "Jurgen Annevelink Rafiul Ahad Amelia Carlson Daniel H. Fishman Michael L. Heytens William Kent", "misc": "2002-01-03 42-68 1995 Modern Database Systems db/books/collections/kim95.html#AnnevelinkACFHK95" }
+{ "id": 3, "dblpid": "books/acm/kim95/BreitbartGS95", "title": "Transaction Management in Multidatabase Systems.", "authors": "Yuri Breitbart Hector Garcia-Molina Abraham Silberschatz", "misc": "2004-03-08 573-591 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartGS95 1995" }
+{ "id": 5, "dblpid": "books/acm/kim95/DayalHW95", "title": "Active Database Systems.", "authors": "Umeshwar Dayal Eric N. Hanson Jennifer Widom", "misc": "2002-01-03 434-456 1995 Modern Database Systems db/books/collections/kim95.html#DayalHW95" }
+{ "id": 7, "dblpid": "books/acm/kim95/Garcia-MolinaH95", "title": "Distributed Databases.", "authors": "Hector Garcia-Molina Meichun Hsu", "misc": "2002-01-03 477-493 1995 Modern Database Systems db/books/collections/kim95.html#Garcia-MolinaH95" }
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
+{ "id": 11, "dblpid": "books/acm/kim95/KemperM95", "title": "Physical Object Management.", "authors": "Alfons Kemper Guido Moerkotte", "misc": "2002-01-03 175-202 1995 Modern Database Systems db/books/collections/kim95.html#KemperM95" }
+{ "id": 13, "dblpid": "books/acm/kim95/Kim95a", "title": "Object-Oriented Database Systems  Promises, Reality, and Future.", "authors": "Won Kim", "misc": "2002-01-03 255-280 1995 Modern Database Systems db/books/collections/kim95.html#Kim95a" }
+{ "id": 15, "dblpid": "books/acm/kim95/KimCGS95", "title": "On Resolving Schematic Heterogeneity in Multidatabase Systems.", "authors": "Won Kim Injun Choi Sunit K. Gala Mark Scheevel", "misc": "2002-01-03 521-550 1995 Modern Database Systems db/books/collections/kim95.html#KimCGS95" }
+{ "id": 17, "dblpid": "books/acm/kim95/KimK95", "title": "On View Support in Object-Oriented Databases Systems.", "authors": "Won Kim William Kelley", "misc": "2002-01-03 108-129 1995 Modern Database Systems db/books/collections/kim95.html#KimK95" }
+{ "id": 19, "dblpid": "books/acm/kim95/KriegerA95", "title": "C++ Bindings to an Object Database.", "authors": "David Krieger Tim Andrews", "misc": "2002-01-03 89-107 1995 Modern Database Systems db/books/collections/kim95.html#KriegerA95" }
+{ "id": 21, "dblpid": "books/acm/kim95/MengY95", "title": "Query Processing in Multidatabase Systems.", "authors": "Weiyi Meng Clement T. Yu", "misc": "2002-01-03 551-572 1995 Modern Database Systems db/books/collections/kim95.html#MengY95" }
+{ "id": 23, "dblpid": "books/acm/kim95/Omiecinski95", "title": "Parallel Relational Database Systems.", "authors": "Edward Omiecinski", "misc": "2002-01-03 494-512 1995 Modern Database Systems db/books/collections/kim95.html#Omiecinski95" }
+{ "id": 25, "dblpid": "books/acm/kim95/RusinkiewiczS95", "title": "Specification and Execution of Transactional Workflows.", "authors": "Marek Rusinkiewicz Amit P. Sheth", "misc": "2004-03-08 592-620 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#RusinkiewiczS95 1995" }
+{ "id": 27, "dblpid": "books/acm/kim95/SametA95", "title": "Spatial Data Models and Query Processing.", "authors": "Hanan Samet Walid G. Aref", "misc": "2002-01-03 338-360 1995 Modern Database Systems db/books/collections/kim95.html#SametA95" }
+{ "id": 29, "dblpid": "books/acm/kim95/Snodgrass95", "title": "Temporal Object-Oriented Databases  A Critical Comparison.", "authors": "Richard T. Snodgrass", "misc": "2002-01-03 386-408 1995 Modern Database Systems db/books/collections/kim95.html#Snodgrass95" }
+{ "id": 31, "dblpid": "books/acm/kim95/Stout95", "title": "EDA/SQL.", "authors": "Ralph L. Stout", "misc": "2004-03-08 649-663 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#Stout95 1995" }
+{ "id": 33, "dblpid": "books/acm/kim95/BreitbartR95", "title": "Overview of the ADDS System.", "authors": "Yuri Breitbart Tom C. Reyes", "misc": "2009-06-12 683-701 Modern Database Systems books/acm/Kim95 db/books/collections/kim95.html#BreitbartR95 1995" }
+{ "id": 35, "dblpid": "books/ap/MarshallO79", "title": "Inequalities  Theory of Majorization and Its Application.", "authors": "Albert W. Marshall Ingram Olkin", "misc": "2002-01-03 Academic Press 1979 0-12-473750-1" }
+{ "id": 37, "dblpid": "books/aw/kimL89/BretlMOPSSWW89", "title": "The GemStone Data Management System.", "authors": "Robert Bretl David Maier Allen Otis D. Jason Penney Bruce Schuchardt Jacob Stein E. Harold Williams Monty Williams", "misc": "2002-01-03 283-308 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#BretlMOPSSWW89" }
+{ "id": 39, "dblpid": "books/aw/kimL89/Decouchant89", "title": "A Distributed Object Manager for the Smalltalk-80 System.", "authors": "Dominique Decouchant", "misc": "2002-01-03 487-520 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Decouchant89" }
+{ "id": 41, "dblpid": "books/aw/kimL89/EllisG89", "title": "Active Objects  Ealities and Possibilities.", "authors": "Clarence A. Ellis Simon J. Gibbs", "misc": "2002-01-03 561-572 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#EllisG89" }
+{ "id": 43, "dblpid": "books/aw/kimL89/KimBCGW89", "title": "Features of the ORION Object-Oriented Database System.", "authors": "Won Kim Nat Ballou Hong-Tai Chou Jorge F. Garza Darrell Woelk", "misc": "2002-01-03 251-282 Object-Oriented Concepts, Databases, and Applications ACM Press and Addison-Wesley 1989 db/books/collections/kim89.html#KimBCGW89" }
+{ "id": 45, "dblpid": "books/aw/kimL89/King89", "title": "My Cat Is Object-Oriented.", "authors": "Roger King", "misc": "2002-01-03 23-30 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#King89" }
+{ "id": 47, "dblpid": "books/aw/kimL89/MellenderRS89", "authors": "Fred Mellender Steve Riegel Andrew Straw", "misc": "2002-01-03 423-450 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#MellenderRS89" }
+{ "id": 49, "dblpid": "books/aw/kimL89/Moss89", "title": "Object Orientation as Catalyst for Language-Database Inegration.", "authors": "J. Eliot B. Moss", "misc": "2002-01-03 583-592 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#Moss89" }
+{ "id": 51, "dblpid": "books/aw/kimL89/NierstraszT89", "title": "Integrated Office Systems.", "authors": "Oscar Nierstrasz Dennis Tsichritzis", "misc": "2002-01-03 199-215 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#NierstraszT89" }
+{ "id": 53, "dblpid": "books/aw/kimL89/SkarraZ89", "title": "Concurrency Control and Object-Oriented Databases.", "authors": "Andrea H. Skarra Stanley B. Zdonik", "misc": "2002-01-03 395-421 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#SkarraZ89" }
+{ "id": 55, "dblpid": "books/aw/kimL89/TarltonT89", "title": "Pogo  A Declarative Representation System for Graphics.", "authors": "Mark A. Tarlton P. Nong Tarlton", "misc": "2002-01-03 151-176 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TarltonT89" }
+{ "id": 57, "dblpid": "books/aw/kimL89/TsichritzisN89", "title": "Directions in Object-Oriented Research.", "authors": "Dennis Tsichritzis Oscar Nierstrasz", "misc": "2002-01-03 523-536 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#TsichritzisN89" }
+{ "id": 59, "dblpid": "books/aw/kimL89/WeiserL89", "title": "OZ+  An Object-Oriented Database System.", "authors": "Stephen P. Weiser Frederick H. Lochovsky", "misc": "2002-01-03 309-337 1989 Object-Oriented Concepts, Databases, and Applications db/books/collections/kim89.html#WeiserL89" }
+{ "id": 61, "dblpid": "books/aw/stonebraker86/Stonebraker86", "title": "Design of Relational Systems (Introduction to Section 1).", "authors": "Michael Stonebraker", "misc": "2002-01-03 1-3 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86 db/books/collections/Stonebraker86/Stonebraker86.html ingres/P001.pdf" }
+{ "id": 63, "dblpid": "books/aw/stonebraker86/Stonebraker86b", "title": "Distributed Database Systems (Introduction to Section 3).", "authors": "Michael Stonebraker", "misc": "2002-01-03 183-186 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86b db/books/collections/Stonebraker86/Stonebraker86b.html ingres/P183.pdf" }
+{ "id": 65, "dblpid": "books/aw/stonebraker86/Stonebraker86d", "title": "User Interfaces for Database Systems (Introduction to Section 4).", "authors": "Michael Stonebraker", "misc": "2002-01-03 243-245 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86d db/books/collections/Stonebraker86/Stonebraker86d.html ingres/P243.pdf" }
+{ "id": 67, "dblpid": "books/aw/stonebraker86/Stonebraker86f", "authors": "Michael Stonebraker", "misc": "2002-01-03 393-394 1986 The INGRES Papers db/books/collections/Stonebraker86.html#Stonebraker86f db/books/collections/Stonebraker86/Stonebraker86f.html ingres/P393.pdf" }
+{ "id": 69, "dblpid": "books/aw/stonebraker86/X86a", "title": "References.", "authors": "", "misc": "2002-01-03 429-444 1986 The INGRES Papers db/books/collections/Stonebraker86.html#X86a db/books/collections/Stonebraker86/X86a.html ingres/P429.pdf" }
+{ "id": 71, "dblpid": "books/aw/AbiteboulHV95", "title": "Foundations of Databases.", "authors": "Serge Abiteboul Richard Hull Victor Vianu", "misc": "2002-01-03 Addison-Wesley 1995 0-201-53771-0 AHV/Toc.pdf ... ... journals/tods/AstrahanBCEGGKLMMPTWW76 books/bc/AtzeniA93 journals/tcs/AtzeniABM82 journals/jcss/AbiteboulB86 journals/csur/AtkinsonB87 conf/pods/AtzeniB87 journals/vldb/AbiteboulB95 conf/sigmod/AbiteboulB91 conf/dood/AtkinsonBDDMZ89 conf/vldb/AlbanoBGO93 ... conf/icdt/Abiteboul88 journals/ipl/Abiteboul89 conf/ds/Abrial74 journals/tods/AhoBU79 books/mk/minker88/AptBW88 conf/vldb/AroraC78 conf/stoc/AfratiC89 journals/tods/AlbanoCO85 conf/pods/AfratiCY91 conf/pods/AusielloDM85 conf/vldb/AbiteboulG85 journals/jacm/AjtaiG87 conf/focs/AjtaiG89 journals/tods/AbiteboulG91 ... ... journals/tods/AbiteboulH87 conf/sigmod/AbiteboulH88 ... conf/sigmod/AbiteboulK89 journals/tcs/AbiteboulKG91 journals/jcss/AbiteboulKRW95 conf/sigmod/AbiteboulLUW93 conf/pods/AtzeniP82 conf/pods/AfratiP87 conf/pods/AptP87 conf/wg/AndriesP91 conf/pods/AfratiPPRSU86 books/el/leeuwen90/Apt90 conf/ifip/Armstrong74 journals/siamcomp/AhoSSU81 journals/tods/AhoSU79 journals/siamcomp/AhoSU79 conf/pods/AbiteboulSV90 journals/is/AtzeniT93 conf/popl/AhoU79 conf/pods/AbiteboulV87 conf/jcdkb/AbiteboulV88 journals/jacm/AbiteboulV88 conf/pods/AbiteboulV88 journals/jacm/AbiteboulV89 journals/jcss/AbiteboulV90 journals/jcss/AbiteboulV91 conf/stoc/AbiteboulV91 journals/amai/AbiteboulV91 journals/jcss/AbiteboulV95 journals/jacm/AptE82 conf/coco/AbiteboulVV92 conf/iclp/AptB88 conf/oopsla/BobrowKKMSZ86 journals/tse/BatoryBGSTTW88 conf/mfcs/Bancilhon78 ... conf/db-workshops/Bancilhon85 books/el/leeuwen90/Barendregt90 ... journals/tods/BeeriB79 books/el/leeuwen90/BerstelB90 conf/icdt/BeneventanoB92 conf/vldb/BernsteinBC80 conf/vldb/BeeriBG78 conf/sigmod/BorgidaBMR89 journals/tods/BunemanC79 journals/jacm/BernsteinC81 conf/dbpl/BancilhonCD89 books/bc/tanselCGSS93/BaudinetCW93 conf/sigmod/BiskupDB79 journals/jacm/BeeriDFS84 books/mk/BancilhonDK92 conf/edbt/BryDM88 conf/pods/BunemanDW88 journals/jcss/BunemanDW91 journals/tods/Beeri80 journals/dke/Beeri90 ... journals/tods/Bernstein76 conf/lics/BidoitF87 journals/iandc/BidoitF91 conf/sigmod/BeeriFH77 conf/stoc/BeeriFMMUY81 journals/jacm/BeeriFMY83 journals/tods/BunemanFN82 journals/siamcomp/BernsteinG81 journals/iandc/BlassGK85 conf/ijcai/BrachmanGL85 journals/tods/BernsteinGWRR81 books/aw/BernsteinHG87 ... journals/tcs/Bidoit91 journals/tcs/Biskup80 conf/adbt/Biskup79 journals/tods/Biskup83 journals/tcs/BunemanJO91 journals/tods/BeeriK86 conf/pods/BeeriKBR87 conf/icdt/BidoitL90 journals/csur/BatiniL86 conf/sigmod/BlakeleyLT86 conf/vldb/BeeriM91 conf/sigmod/BlakeleyMG93 journals/siamcomp/BeeriMSU81 conf/pods/BancilhonMSU86 conf/pods/BeeriNRST87 journals/software/Borgida85 conf/icalp/BraP83 conf/fgcs/BalbinMR88 ... conf/pods/BeeriR87 journals/jlp/BalbinR87 conf/sigmod/BancilhonR86 books/mk/minker88/BancilhonR88 journals/jlp/BeeriR91 conf/vldb/BancilhonRS82 conf/pods/BeeriRSS92 conf/dood/Bry89 journals/tods/BancilhonS81 journals/cogsci/BrachmanS85 journals/tods/BergamaschiS92 conf/sigmod/BernsteinST75 conf/dbpl/TannenBN91 conf/icdt/TannenBW92 ... journals/jacm/BeeriV84 conf/icalp/BeeriV81 conf/adbt/BeeriV79 journals/siamcomp/BeeriV84 journals/iandc/BeeriV84 journals/jacm/BeeriV84 journals/tcs/BeeriV85 journals/ibmrd/ChamberlinAEGLMRW76 ... journals/iandc/Cardelli88 books/mk/Cattell94 conf/sigmod/CacaceCCTZ90 conf/vldb/CastilhoCF82 conf/adbt/CasanovaF82 conf/focs/CaiFI89 journals/jcss/CasanovaFP84 conf/stoc/CosmadakisGKV88 conf/dood/CorciuloGP93 books/sp/CeriGT90 conf/focs/ChandraH80 journals/jcss/ChandraH80 journals/jcss/ChandraH82 journals/jlp/ChandraH85 conf/popl/Chandra81 conf/adbt/Chang79 conf/pods/Chandra88 ... journals/tods/Chen76 conf/ride/ChenHM94 conf/icde/Chomicki92 conf/pods/Chomicki92 ... ... ... conf/stoc/CosmadakisK85 journals/acr/CosmadakisK86 ... journals/jcss/CosmadakisKS86 journals/jacm/CosmadakisKV90 ... conf/pods/CalvaneseL94 conf/adbt/Clark77 conf/stoc/ChandraLM81 conf/stoc/ChandraM77 conf/pods/ConsensM90 conf/sigmod/ConsensM93 conf/icdt/ConsensM90 journals/cacm/Codd70 conf/sigmod/Codd71a persons/Codd71a persons/Codd72 conf/ifip/Codd74 ... conf/sigmod/Codd79 journals/cacm/Codd82 ... conf/sigmod/Cohen89 journals/cacm/Cohen90 ... journals/jcss/Cook74 conf/pods/Cosmadakis83 conf/focs/Cosmadakis87 books/el/leeuwen90/Courcelle90a journals/jacm/CosmadakisP84 conf/edbt/CeriCGLLTZ88 ... conf/vldb/CeriT87 conf/vldb/CasanovaTF88 ... conf/pods/CasanovaV83 journals/siamcomp/ChandraV85 conf/pods/ChaudhuriV92 conf/pods/ChaudhuriV93 conf/pods/ChaudhuriV94 journals/csur/CardelliW85 conf/pods/ChenW89 conf/pods/CohenW89 conf/vldb/CeriW90 conf/vldb/CeriW91 conf/iclp/ChenW92 conf/vldb/CeriW93 ... conf/birthday/Dahlhaus87 conf/vldb/Date81 books/aw/Date86 ... conf/dbpl/Dayal89 journals/tods/DayalB82 journals/ibmrd/DelobelC73 conf/icde/DelcambreD89 ... journals/tods/Delobel78 journals/jacm/Demolombe92 journals/tods/DateF92 ... conf/vldb/DayalHL91 journals/jacm/Paola69a conf/caap/DahlhausM86 journals/acr/DAtriM86 journals/iandc/DahlhausM92 conf/sigmod/DerrMP93 conf/vldb/MaindrevilleS88 conf/pods/Dong92 conf/adbt/BraP82 ... conf/dbpl/DongS91 journals/iandc/DongS95 conf/dbpl/DongS93 conf/dbpl/DongS93 conf/icdt/DongT92 conf/vldb/DenninghoffV91 conf/pods/DenninghoffV93 ... ... books/acm/kim95/DayalHW95 ... conf/pods/EiterGM94 conf/pods/Escobar-MolanoHJ93 ... books/el/leeuwen90/Emerson90 books/bc/ElmasriN89 ... conf/icse/Eswaran76 conf/sigmod/EpsteinSW78 ... ... conf/vldb/Fagin77 journals/tods/Fagin77 conf/sigmod/Fagin79 journals/tods/Fagin81 journals/ipl/FaginV83 journals/jacm/Fagin82 journals/jacm/Fagin83 journals/tcs/Fagin93 books/sp/kimrb85/FurtadoC85 ... journals/jlp/Fitting85a journals/tcs/FischerJT83 journals/acr/FaginKUV86 conf/icdt/FernandezM92 journals/tods/FaginMU82 conf/vldb/FaloutsosNS91 ... journals/ai/Forgy82 ... conf/sigmod/Freytag87 ... journals/siamcomp/FischerT83 journals/siamcomp/FaginMUY83 conf/pods/FaginUV83 conf/icalp/FaginV84 ... ... ... ... conf/sigmod/GraefeD87 conf/ride/GatziuD94 conf/sigmod/GardarinM86 conf/sigmod/GyssensG88 journals/tcs/GinsburgH83a journals/jacm/GinsburgH86 ... books/bc/tanselCGSS93/Ginsburg93 books/fm/GareyJ79 journals/jacm/GrantJ82 conf/vldb/GehaniJ91 conf/vldb/GhandeharizadehHJCELLTZ93 journals/tods/GhandeharizadehHJ96 conf/vldb/GehaniJS92 ... conf/sigmod/GehaniJS92 ... conf/deductive/GuptaKM92 conf/pods/GurevichL82 conf/iclp/GelfondL88 conf/adbt/77 journals/csur/GallaireMN84 conf/pods/GrahneMR92 conf/sigmod/GuptaMS93 conf/lics/GaifmanMSV87 journals/jacm/GaifmanMSV93 journals/jacm/GrahamMV86 conf/csl/GradelO92 ... conf/pods/Gottlob87 conf/pods/GyssensPG90 conf/dood/GiannottiPSZ91 books/aw/GoldbergR83 journals/acr/GrahneR86 journals/ipl/Grant77 ... journals/iandc/Grandjean83 conf/vldb/Grahne84 ... journals/csur/Graefe93 books/sp/Greibach75 journals/tods/GoodmanS82 journals/jcss/GoodmanS84 conf/focs/GurevichS85 ... conf/pods/GrumbachS94 conf/sigmod/GangulyST90 ... journals/tcs/Gunter92 ... ... ... ... conf/pods/GrahamV84 conf/pods/GrumbachV91 conf/icde/GardarinV92 conf/sigmod/GraefeW89 ... journals/jacm/GinsburgZ82 conf/vldb/GottlobZ88 ... ... journals/sigmod/Hanson89 ... journals/cacm/Harel80 journals/tkde/HaasCLMWLLPCS90 conf/lics/Hella92 journals/iandc/Herrmann95 conf/pods/HirstH93 conf/vldb/HullJ91 conf/ewdw/HullJ90 journals/csur/HullK87 journals/tods/HudsonK89 conf/lics/HillebrandKM93 conf/nato/HillebrandKR93 conf/jcdkb/HsuLM88 journals/ipl/HoneymanLY80 journals/tods/HammerM81 conf/adbt/HenschenMN82 ... journals/jacm/HenschenN84 journals/jacm/Honeyman82 conf/sigmod/HullS89 conf/pods/HullS89 journals/acta/HullS94 journals/jcss/HullS93 conf/fodo/HullTY89 journals/jcss/Hull83 journals/jacm/Hull84 journals/tcs/Hull85 journals/siamcomp/Hull86 ... conf/vldb/Hulin89 ... journals/jacm/HullY84 conf/vldb/HullY90 conf/pods/HullY91 conf/sigmod/IoannidisK90 journals/jcss/ImielinskiL84 conf/adbt/Imielinski82 journals/jcss/Immerman82 journals/iandc/Immerman86 ... journals/siamcomp/Immerman87 conf/pods/ImielinskiN88 conf/vldb/IoannidisNSS92 conf/sigmod/ImielinskiNV91 conf/dood/ImielinskiNV91 conf/vldb/Ioannidis85 journals/jacm/Jacobs82 conf/dbpl/JacobsH91 journals/csur/JarkeK84 journals/jcss/JohnsonK84 conf/popl/JaffarL87 books/el/leeuwen90/Johnson90 journals/jacm/Joyner76 conf/pods/JaeschkeS82 ... books/mk/minker88/Kanellakis88 books/el/leeuwen90/Kanellakis90 conf/oopsla/KhoshafianC86 conf/edbt/KotzDM88 conf/jcdkb/Keller82 conf/pods/Keller85 journals/computer/Keller86 ... journals/tods/Kent79 ... journals/ngc/RohmerLK86 conf/tacs/KanellakisG94 conf/jcdkb/Kifer88 conf/pods/KanellakisKR90 conf/sigmod/KiferKS92 ... conf/icdt/KiferL86 books/aw/KimL89 ... journals/tods/Klug80 journals/jacm/Klug82 journals/jacm/Klug88 journals/jacm/KiferLW95 conf/kr/KatsunoM91 journals/ai/KatsunoM92 conf/jcdkb/KrishnamurthyN88 journals/csur/Knight89 ... journals/iandc/Kolaitis91 journals/ai/Konolige88 conf/ifip/Kowalski74 journals/jacm/Kowalski75 conf/bncod/Kowalski84 conf/vldb/KoenigP81 journals/tods/KlugP82 ... conf/pods/KolaitisP88 conf/pods/KiferRS88 conf/sigmod/KrishnamurthyRS88 books/mg/SilberschatzK91 conf/iclp/KempT88 conf/sigmod/KellerU84 conf/dood/Kuchenhoff91 ... journals/jlp/Kunen87 conf/iclp/Kunen88 conf/pods/Kuper87 conf/pods/Kuper88 conf/ppcp/Kuper93 conf/pods/KuperV84 conf/stoc/KolaitisV87 journals/tcs/KarabegV90 journals/iandc/KolaitisV90 conf/pods/KolaitisV90 journals/tods/KarabegV91 journals/iandc/KolaitisV92 journals/tcs/KuperV93 journals/tods/KuperV93 journals/tse/KellerW85 conf/pods/KiferW89 conf/jcdkb/Lang88 books/el/Leeuwen90 ... journals/jcss/Leivant89 ... journals/iandc/Leivant90 ... conf/db-workshops/Levesque82 journals/ai/Levesque84 conf/mfdbs/Libkin91 conf/er/Lien79 journals/jacm/Lien82 books/mk/minker88/Lifschitz88 ... journals/tcs/Lindell91 journals/tods/Lipski79 journals/jacm/Lipski81 journals/tcs/LeratL86 journals/cj/LeveneL90 books/sp/Lloyd87 conf/pods/LakshmananM89 conf/tlca/LeivantM93 conf/sigmod/LaverMG83 conf/pods/LiptonN90 journals/jcss/LucchesiO78 conf/sigmod/Lohman88 ... conf/ijcai/Lozinskii85 books/ph/LewisP81 ... conf/sigmod/LecluseRV88 journals/is/LipeckS87 journals/jlp/LloydST87 journals/tods/LingTK81 conf/sigmod/LyngbaekV87 conf/dood/LefebvreV89 conf/pods/LibkinW93 conf/dbpl/LibkinW93 journals/jacm/Maier80 books/cs/Maier83 ... conf/vldb/Makinouchi77 conf/icalp/Makowsky81 ... conf/icdt/Malvestuto86 conf/aaai/MacGregorB92 journals/tods/MylopoulosBW80 conf/sigmod/McCarthyD89 journals/csur/MishraE92 conf/sigmod/MumickFPR90 books/mk/Minker88 journals/jlp/Minker88 conf/vldb/MillerIR93 journals/is/MillerIR94 journals/iandc/Mitchell83 conf/pods/Mitchell83 conf/vldb/MendelzonM79 journals/tods/MaierMS79 journals/jcss/MaierMSU80 conf/pods/MendelzonMW94 journals/debu/MorrisNSUG87 journals/ai/Moore85 conf/vldb/Morgenstern83 conf/pods/Morris88 ... conf/pods/MannilaR85 ... journals/jlp/MinkerR90 books/aw/MannilaR92 journals/acr/MaierRW86 ... journals/tods/MarkowitzS92 conf/pods/Marchetti-SpaccamelaPS87 journals/jacm/MaierSY81 conf/iclp/MorrisUG86 journals/tods/MaierUV84 conf/iclp/MorrisUG86 journals/acta/MakowskyV86 books/bc/MaierW88 books/mk/minker88/ManchandraW88 conf/pods/Naughton86 conf/sigmod/NgFS91 ... conf/vldb/Nejdl87 conf/adbt/NicolasM77 conf/sigmod/Nicolas78 journals/acta/Nicolas82 conf/ds/76 conf/pods/NaqviK88 journals/tods/NegriPS91 conf/vldb/NaughtonRSU89 conf/pods/NaughtonS87 ... ... conf/vldb/Osborn79 ... journals/tods/OzsoyogluY87 conf/adbt/Paige82 ... books/cs/Papadimitriou86 ... journals/ipl/Paredaens78 ... books/sp/ParedaensBGG89 journals/ai/Andersen91 books/el/leeuwen90/Perrin90 journals/ins/Petrov89 conf/pods/ParedaensG88 conf/pods/PatnaikI94 conf/adbt/ParedaensJ79 journals/csur/PeckhamM88 ... ... conf/sigmod/ParkerP80 ... conf/iclp/Przymusinski88 conf/pods/Przymusinski89 ... conf/vldb/ParkerSV92 conf/aaai/PearlV87 journals/ai/PereiraW80a conf/pods/PapadimitriouY92 journals/tkde/QianW91 ... journals/jlp/Ramakrishnan91 conf/pods/RamakrishnanBS87 ... conf/adbt/Reiter77 journals/ai/Reiter80 conf/db-workshops/Reiter82 journals/jacm/Reiter86 journals/tods/Rissanen77 conf/mfcs/Rissanen78 conf/pods/Rissanen82 ... journals/ngc/RohmerLK86 journals/jacm/Robinson65 ... conf/pods/Ross89 ... ... conf/sigmod/RoweS79 conf/sigmod/RichardsonS91 journals/debu/RamamohanaraoSBPNTZD87 conf/vldb/RamakrishnanSS92 conf/sigmod/RamakrishnanSSS93 conf/pods/RamakrishnanSUV89 journals/jcss/RamakrishnanSUV93 journals/jlp/RamakrishnanU95 conf/sigmod/SelingerACLP79 conf/sigmod/Sagiv81 journals/tods/Sagiv83 books/mk/minker88/Sagiv88 conf/slp/Sagiv90 conf/sigmod/Sciore81 journals/jacm/Sciore82 conf/pods/Sciore83 journals/acr/Sciore86 journals/jacm/SagivDPF81 conf/pods/X89 ... journals/ai/SmithG85 books/mk/minker88/Shepherdson88 journals/tods/Shipman81 conf/pods/Shmueli87 conf/iclp/SekiI88 conf/sigmod/ShmueliI84 journals/tc/Sickel76 journals/jsc/Siekmann89 conf/sigmod/StonebrakerJGP90 conf/vldb/SimonKM92 journals/csur/ShethL90 conf/pods/SeibL91 conf/sigmod/SuLRD93 conf/adbt/SilvaM79 journals/sigmod/Snodgrass90 journals/sigmod/Soo91 conf/pods/SuciuP94 conf/sigmod/StonebrakerR86 conf/slp/SudarshanR93 conf/pods/SagivS86 journals/cacm/Stonebraker81 books/mk/Stonebraker88 journals/tkde/Stonebraker92 books/aw/Stroustrup91 journals/jacm/SadriU82 conf/vldb/Su91 conf/pods/SagivV89 journals/jacm/SagivW82 journals/tods/StonebrakerWKH76 journals/jacm/SagivY80 conf/pods/SaccaZ86 journals/tcs/SaccaZ88 ... conf/pods/SaccaZ90 ... ... books/bc/TanselCGJSS93 ... journals/acr/ThomasF86 ... ... ... ... journals/tcs/Topor87 ... books/mk/minker88/ToporS88 ... journals/siamcomp/TarjanY84 journals/csur/TeoreyYF86 journals/algorithmica/UllmanG88 conf/pods/Ullman82 books/cs/Ullman82 journals/tods/Ullman85 books/cs/Ullman88 conf/pods/Ullman89 books/cs/Ullman89 conf/sigmod/Gelder86 ... conf/pods/BusscheG92 conf/focs/BusscheGAG92 conf/pods/BusscheP91 conf/slp/Gelder86 conf/pods/Gelder89 conf/pods/GelderRS88 journals/jacm/GelderRS91 journals/tods/GelderT91 journals/ipl/Vardi81 conf/stoc/Vardi82 conf/focs/Vardi82 journals/acta/Vardi83 journals/jcss/Vardi84 conf/pods/Vardi85 conf/pods/Vardi86 journals/jcss/Vardi86 ... conf/pods/Vardi88 conf/sigmod/Vassiliou79 ... ... journals/jacm/EmdenK76 conf/nf2/SchollABBGPRV87 journals/jacm/Vianu87 journals/acta/Vianu87 conf/eds/Vieille86 conf/iclp/Vieille87 ... conf/eds/Vieille88 journals/tcs/Vieille89 ... journals/tcs/VianuV92 conf/sigmod/WidomF90 conf/icde/WangH92 conf/pos/WidjojoHW90 journals/computer/Wiederhold92 conf/pods/Wilkins86 conf/pods/Winslett88 conf/sigmod/WolfsonO90 conf/pods/Wong93 conf/sigmod/WolfsonS88 journals/ibmrd/WangW75 journals/tods/WongY76 conf/vldb/Yannakakis81 journals/csur/YuC84 ... journals/jcss/YannakakisP82 ... journals/tods/Zaniolo82 journals/jcss/Zaniolo84 ... conf/edbt/ZhouH90 journals/ibmsj/Zloof77 books/mk/ZdonikM90 db/books/dbtext/abiteboul95.html" }
+{ "id": 73, "dblpid": "books/aw/AhoHU74", "title": "The Design and Analysis of Computer Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1974 0-201-00029-6" }
+{ "id": 75, "dblpid": "books/aw/AhoHU83", "title": "Data Structures and Algorithms.", "authors": "Alfred V. Aho John E. Hopcroft Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1983 0-201-00023-7" }
+{ "id": 77, "dblpid": "books/aw/AhoKW88", "title": "The AWK Programming Language", "authors": "Alfred V. Aho Brian W. Kernighan Peter J. Weinberger", "misc": "2002-01-03 Addison-Wesley 1988" }
+{ "id": 79, "dblpid": "books/aw/AhoSU86", "title": "Compilers  Princiles, Techniques, and Tools.", "authors": "Alfred V. Aho Ravi Sethi Jeffrey D. Ullman", "misc": "2002-01-03 Addison-Wesley 1986 0-201-10088-6" }
+{ "id": 81, "dblpid": "journals/siamcomp/AspnesW96", "authors": "James Aspnes Orli Waarts", "misc": "2002-01-03 1024-1044 1996 25 SIAM J. Comput. 5 db/journals/siamcomp/siamcomp25.html#AspnesW96" }
+{ "id": 83, "dblpid": "journals/siamcomp/Bloniarz83", "title": "A Shortest-Path Algorithm with Expected Time O(n² log n log* n).", "authors": "Peter A. Bloniarz", "misc": "2002-01-03 588-600 1983 12 SIAM J. Comput. 3 db/journals/siamcomp/siamcomp12.html#Bloniarz83" }
+{ "id": 85, "dblpid": "journals/siamcomp/Megiddo83a", "title": "Linear-Time Algorithms for Linear Programming in R³ and Related Problems.", "authors": "Nimrod Megiddo", "misc": "2002-01-03 759-776 1983 12 SIAM J. Comput. 4 db/journals/siamcomp/siamcomp12.html#Megiddo83a" }
+{ "id": 87, "dblpid": "journals/siamcomp/MoffatT87", "title": "An All Pairs Shortest Path Algorithm with Expected Time O(n² log n).", "authors": "Alistair Moffat Tadao Takaoka", "misc": "2002-01-03 1023-1031 1987 16 SIAM J. Comput. 6 db/journals/siamcomp/siamcomp16.html#MoffatT87" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 91, "dblpid": "journals/corr/abs-0802-2861", "title": "Geometric Set Cover and Hitting Sets for Polytopes in $R^3$", "authors": "Sören Laue", "misc": "2008-03-03 http //arxiv.org/abs/0802.2861 2008 CoRR abs/0802.2861 db/journals/corr/corr0802.html#abs-0802-2861 informal publication" }
+{ "id": 93, "dblpid": "journals/iandc/IbarraJCR91", "authors": "Oscar H. Ibarra Tao Jiang Jik H. Chang Bala Ravikumar", "misc": "2006-04-25 86-106 Inf. Comput. January 1991 90 1 db/journals/iandc/iandc90.html#IbarraJCR91" }
+{ "id": 95, "dblpid": "journals/jacm/GalilHLSW87", "title": "An O(n³log n) deterministic and an O(n³) Las Vegs isomorphism test for trivalent graphs.", "authors": "Zvi Galil Christoph M. Hoffmann Eugene M. Luks Claus-Peter Schnorr Andreas Weber", "misc": "2003-11-20 513-531 1987 34 J. ACM 3 http //doi.acm.org/10.1145/28869.28870 db/journals/jacm/jacm34.html#GalilHLSW87" }
+{ "id": 97, "dblpid": "journals/jacm/GalilT88", "title": "An O(n²(m + n log n)log n) min-cost flow algorithm.", "authors": "Zvi Galil Éva Tardos", "misc": "2003-11-20 374-386 1988 35 J. ACM 2 http //doi.acm.org/10.1145/42282.214090 db/journals/jacm/jacm35.html#GalilT88" }
+{ "id": 99, "dblpid": "series/synthesis/2009Weintraub", "title": "Jordan Canonical Form  Theory and Practice", "authors": "Steven H. Weintraub", "misc": "2009-09-06 Jordan Canonical Form  Theory and Practice http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 http //dx.doi.org/10.2200/S00218ED1V01Y200908MAS006 2009 Synthesis Lectures on Mathematics & Statistics Morgan & Claypool Publishers" }
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
index daa6d66..62a92cc 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/file/SecondaryInvertedIndexCreator.java
@@ -9,7 +9,7 @@
 import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
 import edu.uci.ics.asterix.metadata.entities.Index;
 import edu.uci.ics.asterix.om.types.IAType;
-import edu.uci.ics.asterix.optimizer.rules.am.InvertedIndexAccessMethod;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
 import edu.uci.ics.asterix.runtime.formats.FormatUtils;
 import edu.uci.ics.asterix.transaction.management.resource.ILocalResourceMetadata;
 import edu.uci.ics.asterix.transaction.management.resource.LSMInvertedIndexLocalResourceMetadata;
@@ -104,8 +104,8 @@
         int numTokenFields = (!isPartitioned) ? numSecondaryKeys : numSecondaryKeys + 1;
         tokenComparatorFactories = new IBinaryComparatorFactory[numTokenFields];
         tokenTypeTraits = new ITypeTraits[numTokenFields];
-        tokenComparatorFactories[0] = InvertedIndexAccessMethod.getTokenBinaryComparatorFactory(secondaryKeyType);
-        tokenTypeTraits[0] = InvertedIndexAccessMethod.getTokenTypeTrait(secondaryKeyType);
+        tokenComparatorFactories[0] = NonTaggedFormatUtil.getTokenBinaryComparatorFactory(secondaryKeyType);
+        tokenTypeTraits[0] = NonTaggedFormatUtil.getTokenTypeTrait(secondaryKeyType);
         if (isPartitioned) {
             // The partitioning field is hardcoded to be a short *without* an Asterix type tag.
             tokenComparatorFactories[1] = PointableBinaryComparatorFactory.of(ShortPointable.FACTORY);
@@ -114,7 +114,7 @@
         // Set tokenizer factory.
         // TODO: We might want to expose the hashing option at the AQL level,
         // and add the choice to the index metadata.
-        tokenizerFactory = InvertedIndexAccessMethod.getBinaryTokenizerFactory(secondaryKeyType.getTypeTag(),
+        tokenizerFactory = NonTaggedFormatUtil.getBinaryTokenizerFactory(secondaryKeyType.getTypeTag(),
                 createIndexStmt.getIndexType(), createIndexStmt.getGramLength());
         // Type traits for inverted-list elements. Inverted lists contain
         // primary keys.
@@ -130,8 +130,7 @@
         tokenKeyPairComparatorFactories = new IBinaryComparatorFactory[numTokenKeyPairFields];
         tokenKeyPairFields[0] = serdeProvider.getSerializerDeserializer(secondaryKeyType);
         tokenKeyPairTypeTraits[0] = tokenTypeTraits[0];
-        tokenKeyPairComparatorFactories[0] = InvertedIndexAccessMethod
-                .getTokenBinaryComparatorFactory(secondaryKeyType);
+        tokenKeyPairComparatorFactories[0] = NonTaggedFormatUtil.getTokenBinaryComparatorFactory(secondaryKeyType);
         int pkOff = 1;
         if (isPartitioned) {
             tokenKeyPairFields[1] = ShortSerializerDeserializer.INSTANCE;
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..d00347d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,24 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..1d5d4fd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..a79828c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index fuzzy_ngram_index on DBLP(title) type fuzzy ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..7e917b5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..c1c6247
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..e98b328
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,23 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..381ce87
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..ede69f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+create index fuzzy_ngram_index on DBLP(title) type fuzzy ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..9c58c7e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..ca070fc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..45570ac
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,24 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..d26c270
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..3747bb1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+create index fuzzy_keyword_index on DBLP(title) type fuzzy keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..eb15450
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id<50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..c1fb278
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..9d04c14
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.ddl.aql
@@ -0,0 +1,24 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.2.update.aql
new file mode 100644
index 0000000..a5995f6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..97aef53
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+create index fuzzy_keyword_index on DBLP(title) type fuzzy keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.4.update.aql
new file mode 100644
index 0000000..001e605
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id<50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.5.query.aql
new file mode 100644
index 0000000..7910859
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary fuzzy keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..370ac1c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,24 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..a0c9b77
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..81104ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..68fc68b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..cc3c827
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..e6f184c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,23 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..5257ea5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..127c55d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..6a87cc9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id>50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..5650a21
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary ngram inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..36b3d31
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,22 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..e66540c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..98ccfea
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..0116a0a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id<50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..979fb45
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index that are built on nullable fields. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..5332316
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.ddl.aql
@@ -0,0 +1,23 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.2.update.aql
new file mode 100644
index 0000000..95fd5e8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..3481942
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.3.ddl.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.4.update.aql
new file mode 100644
index 0000000..d480735
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.4.update.aql
@@ -0,0 +1,10 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+delete $o from dataset DBLP where $o.id<50;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.5.query.aql
new file mode 100644
index 0000000..39603e7
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-delete-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test deletion from secondary keyword inverted index.
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..21ff64a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..9108ad6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..426654c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index fuzzy_ngram_index on DBLP(title) type fuzzy ngram(3);
+create index fuzzy_ngram_index1 on DBLP1(title) type fuzzy ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..2fe30df
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.4.update.aql
@@ -0,0 +1,21 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..f61df2a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..af890c4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..382a4a6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..8109213
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index fuzzy_ngram_index on DBLP(title) type fuzzy ngram(3);
+create index fuzzy_ngram_index1 on DBLP1(title) type fuzzy ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..b829b15
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.4.update.aql
@@ -0,0 +1,21 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..324b351
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..7dbf7ee
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..1d8126f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..798622a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index fuzzy_keyword_index on DBLP(title) type fuzzy keyword;
+create index fuzzy_keyword_index1 on DBLP1(title) type fuzzy keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..3234c4e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.4.update.aql
@@ -0,0 +1,20 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..43ad95c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..5dd6f1a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.2.update.aql
new file mode 100644
index 0000000..25e9446
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..f43c5cf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index fuzzy_keyword_index on DBLP(title) type fuzzy keyword;
+create index fuzzy_keyword_index1 on DBLP1(title) type fuzzy keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.4.update.aql
new file mode 100644
index 0000000..b8a1af1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.4.update.aql
@@ -0,0 +1,20 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.5.query.aql
new file mode 100644
index 0000000..0fe611a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-fuzzy-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary fuzzy keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..5f82843
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..bde4abd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..23a302b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
+create index ngram_index1 on DBLP1(title) type ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..ccef47a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.4.update.aql
@@ -0,0 +1,21 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..ec2c974
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..eee618b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql
new file mode 100644
index 0000000..a22b722
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..d40a27b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index ngram_index on DBLP(title) type ngram(3);
+create index ngram_index1 on DBLP1(title) type ngram(3);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql
new file mode 100644
index 0000000..3d81edf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.4.update.aql
@@ -0,0 +1,21 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+where contains($o.title, "Multimedia")
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql
new file mode 100644
index 0000000..bd9eb2b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.5.query.aql
@@ -0,0 +1,13 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-ngram-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary ngram inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+where contains($o.title, "Multimedia")
+order by $o.id
+return $o
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql
new file mode 100644
index 0000000..bafad5b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string?,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql
new file mode 100644
index 0000000..e3f0c6f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-nulls.adm"),("format"="adm"));
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql
new file mode 100644
index 0000000..64d07c0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
+create index keyword_index1 on DBLP1(title) type keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql
new file mode 100644
index 0000000..b2f265fb
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.4.update.aql
@@ -0,0 +1,20 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql
new file mode 100644
index 0000000..10bff06
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index-nullable.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index that are built on nullable fields.  
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql
new file mode 100644
index 0000000..642a0c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.ddl.aql
@@ -0,0 +1,25 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+drop dataverse test if exists;
+create dataverse test;
+
+use dataverse test;
+
+create type DBLPType as closed {
+  id: int32, 
+  dblpid: string,
+  title: string,
+  authors: string,
+  misc: string
+}
+
+create dataset DBLP(DBLPType) primary key id;
+create dataset DBLP1(DBLPType) primary key id;
+
+
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql
new file mode 100644
index 0000000..c51f848
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.2.update.aql
@@ -0,0 +1,12 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+load dataset DBLP using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql
new file mode 100644
index 0000000..ac90624
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.3.ddl.aql
@@ -0,0 +1,11 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+create index keyword_index on DBLP(title) type keyword;
+create index keyword_index1 on DBLP1(title) type keyword;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql
new file mode 100644
index 0000000..57ce169
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.4.update.aql
@@ -0,0 +1,20 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+insert into dataset DBLP1 (
+for $o in dataset('DBLP')
+order by $o.id
+return {
+		"id": $o.id,
+		"dblpid": $o.dblpid,
+		"title": $o.title,
+		"authors": $o.authors,
+		"misc": $o.misc
+	}
+);
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql
new file mode 100644
index 0000000..73fc519
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.5.query.aql
@@ -0,0 +1,14 @@
+/* 
+ * Test case Name  : scan-insert-inverted-index-word-secondary-index.aql
+ * Description     : This test is intended to test insertion from secondary keyword inverted index. 
+ * Expected Result : Success
+ * Date            : March 31 2013
+ */
+ 
+use dataverse test;
+
+for $o in dataset('DBLP1')
+let $jacc := similarity-jaccard-check(word-tokens($o.title), word-tokens("Transactions for Cooperative Environments"), 0.5f)
+where $jacc[0]
+return $o
+
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..7810e91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm
@@ -0,0 +1 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.adm
new file mode 100644
index 0000000..7810e91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-ngram-secondary-index/scan-delete-inverted-index-fuzzy-ngram-secondary-index.1.adm
@@ -0,0 +1 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable/scan-delete-inverted-index-fuzzy-word-secondary-index-nullable.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-fuzzy-word-secondary-index/scan-delete-inverted-index-fuzzy-word-secondary-index.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..7810e91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index-nullable/scan-delete-inverted-index-ngram-secondary-index-nullable.1.adm
@@ -0,0 +1 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.adm
new file mode 100644
index 0000000..7810e91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-ngram-secondary-index/scan-delete-inverted-index-ngram-secondary-index.1.adm
@@ -0,0 +1 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index-nullable/scan-delete-inverted-index-word-secondary-index-nullable.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-delete-inverted-index-word-secondary-index/scan-delete-inverted-index-word-secondary-index.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..8a99b26
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable/scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable.1.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.adm
new file mode 100644
index 0000000..8a99b26
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-ngram-secondary-index/scan-insert-inverted-index-fuzzy-ngram-secondary-index.1.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..5bf6ae0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable/scan-insert-inverted-index-fuzzy-word-secondary-index-nullable.1.adm
@@ -0,0 +1 @@
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.adm
new file mode 100644
index 0000000..5bf6ae0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-fuzzy-word-secondary-index/scan-insert-inverted-index-fuzzy-word-secondary-index.1.adm
@@ -0,0 +1 @@
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..8a99b26
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index-nullable/scan-insert-inverted-index-ngram-secondary-index-nullable.1.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.adm
new file mode 100644
index 0000000..8a99b26
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-ngram-secondary-index/scan-insert-inverted-index-ngram-secondary-index.1.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "dblpid": "books/acm/kim95/ChristodoulakisK95", "title": "Multimedia Information Systems  Issues and Approaches.", "authors": "Stavros Christodoulakis Leonidas Koveos", "misc": "2002-01-03 318-337 1995 Modern Database Systems db/books/collections/kim95.html#ChristodoulakisK95" }
+{ "id": 89, "dblpid": "conf/icip/SchonfeldL98", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-11-05 123-127 1998 ICIP (3) db/conf/icip/icip1998-3.html#SchonfeldL98" }
+{ "id": 90, "dblpid": "conf/hicss/SchonfeldL99", "title": "VORTEX  Video Retrieval and Tracking from Compressed Multimedia Databases ¾ Visual Search Engine.", "authors": "Dan Schonfeld Dan Lelescu", "misc": "2002-01-03 1999 HICSS http //computer.org/proceedings/hicss/0001/00013/00013006abs.htm db/conf/hicss/hicss1999-3.html#SchonfeldL99" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.adm
new file mode 100644
index 0000000..5bf6ae0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index-nullable/scan-insert-inverted-index-word-secondary-index-nullable.1.adm
@@ -0,0 +1 @@
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.adm b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.adm
new file mode 100644
index 0000000..5bf6ae0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/scan-insert-inverted-index-word-secondary-index/scan-insert-inverted-index-word-secondary-index.1.adm
@@ -0,0 +1 @@
+{ "id": 9, "dblpid": "books/acm/kim95/Kaiser95", "title": "Cooperative Transactions for Multiuser Environments.", "authors": "Gail E. Kaiser", "misc": "2002-01-03 409-433 1995 Modern Database Systems db/books/collections/kim95.html#Kaiser95" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index f1f2a26..af77e2f 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -925,6 +925,86 @@
         <output-dir compare="Text">scan-insert-rtree-secondary-index</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-ngram-secondary-index">
+        <output-dir compare="Text">scan-insert-inverted-index-ngram-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-word-secondary-index">
+        <output-dir compare="Text">scan-insert-inverted-index-word-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-fuzzy-ngram-secondary-index">
+        <output-dir compare="Text">scan-insert-inverted-index-fuzzy-ngram-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-fuzzy-word-secondary-index">
+        <output-dir compare="Text">scan-insert-inverted-index-fuzzy-word-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-ngram-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-inverted-index-ngram-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-word-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-inverted-index-word-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-inverted-index-fuzzy-ngram-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-insert-inverted-index-fuzzy-word-secondary-index-nullable">
+        <output-dir compare="Text">scan-insert-inverted-index-fuzzy-word-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-ngram-secondary-index">
+        <output-dir compare="Text">scan-delete-inverted-index-ngram-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-word-secondary-index">
+        <output-dir compare="Text">scan-delete-inverted-index-word-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-fuzzy-ngram-secondary-index">
+        <output-dir compare="Text">scan-delete-inverted-index-fuzzy-ngram-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-fuzzy-word-secondary-index">
+        <output-dir compare="Text">scan-delete-inverted-index-fuzzy-word-secondary-index</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-ngram-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-inverted-index-ngram-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-word-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-inverted-index-word-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-inverted-index-fuzzy-ngram-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="dml">
+      <compilation-unit name="scan-delete-inverted-index-fuzzy-word-secondary-index-nullable">
+        <output-dir compare="Text">scan-delete-inverted-index-fuzzy-word-secondary-index-nullable</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="employee">
     <test-case FilePath="employee">
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventUtil.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventUtil.java
index d484947..e6c58eb 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventUtil.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventUtil.java
@@ -31,215 +31,232 @@
 
 public class EventUtil {
 
-    public static final String EVENTS_DIR = "events";
-    public static final String CLUSTER_CONF = "config/cluster.xml";
-    public static final String PATTERN_CONF = "config/pattern.xml";
-    public static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+	public static final String EVENTS_DIR = "events";
+	public static final String CLUSTER_CONF = "config/cluster.xml";
+	public static final String PATTERN_CONF = "config/pattern.xml";
+	public static final DateFormat dateFormat = new SimpleDateFormat(
+			"yyyy/MM/dd HH:mm:ss");
 
-    private static final String IP_LOCATION = "IP_LOCATION";
-    private static final String CLUSTER_ENV = "ENV";
-    private static final String SCRIPT = "SCRIPT";
-    private static final String ARGS = "ARGS";
-    private static final String EXECUTE_SCRIPT = "events/execute.sh";
+	private static final String IP_LOCATION = "IP_LOCATION";
+	private static final String CLUSTER_ENV = "ENV";
+	private static final String SCRIPT = "SCRIPT";
+	private static final String ARGS = "ARGS";
+	private static final String EXECUTE_SCRIPT = "events/execute.sh";
 
-    public static long parseTimeInterval(ValueType v, String unit) throws IllegalArgumentException {
-        int val = 0;
-        switch (v.getType()) {
-            case ABS:
-                val = Integer.parseInt(v.getAbsoluteValue());
-                break;
-            case RANDOM_MIN_MAX:
-                val = Randomizer.getInstance().getRandomInt(v.getMin(), v.getMax());
-                break;
-            case RANDOM_RANGE:
-                String[] values = v.getRangeSet();
-                val = Integer.parseInt(values[Randomizer.getInstance().getRandomInt(0, values.length - 1)]);
-                break;
-        }
-        return computeInterval(val, unit);
-    }
+	public static long parseTimeInterval(ValueType v, String unit)
+			throws IllegalArgumentException {
+		int val = 0;
+		switch (v.getType()) {
+		case ABS:
+			val = Integer.parseInt(v.getAbsoluteValue());
+			break;
+		case RANDOM_MIN_MAX:
+			val = Randomizer.getInstance().getRandomInt(v.getMin(), v.getMax());
+			break;
+		case RANDOM_RANGE:
+			String[] values = v.getRangeSet();
+			val = Integer.parseInt(values[Randomizer.getInstance()
+					.getRandomInt(0, values.length - 1)]);
+			break;
+		}
+		return computeInterval(val, unit);
+	}
 
-    public static long parseTimeInterval(String v, String unit) throws IllegalArgumentException {
-        int value = Integer.parseInt(v);
-        return computeInterval(value, unit);
-    }
+	public static long parseTimeInterval(String v, String unit)
+			throws IllegalArgumentException {
+		int value = Integer.parseInt(v);
+		return computeInterval(value, unit);
+	}
 
-    private static long computeInterval(int val, String unit) {
-        int vmult = 1;
-        if ("hr".equalsIgnoreCase(unit)) {
-            vmult = 3600 * 1000;
-        } else if ("min".equalsIgnoreCase(unit)) {
-            vmult = 60 * 1000;
-        } else if ("sec".equalsIgnoreCase(unit)) {
-            vmult = 1000;
-        } else
-            throw new IllegalArgumentException(" invalid unit value specified for frequency (hr,min,sec)");
-        return val * vmult;
+	private static long computeInterval(int val, String unit) {
+		int vmult = 1;
+		if ("hr".equalsIgnoreCase(unit)) {
+			vmult = 3600 * 1000;
+		} else if ("min".equalsIgnoreCase(unit)) {
+			vmult = 60 * 1000;
+		} else if ("sec".equalsIgnoreCase(unit)) {
+			vmult = 1000;
+		} else
+			throw new IllegalArgumentException(
+					" invalid unit value specified for frequency (hr,min,sec)");
+		return val * vmult;
 
-    }
+	}
 
-    public static Event getEvent(Pattern pattern, Events events) {
-        for (Event event : events.getEvent()) {
-            if (event.getType().equals(pattern.getEvent().getType())) {
-                return event;
-            }
-        }
-        throw new IllegalArgumentException(" Unknown event type" + pattern.getEvent().getType());
-    }
+	public static Event getEvent(Pattern pattern, Events events) {
+		for (Event event : events.getEvent()) {
+			if (event.getType().equals(pattern.getEvent().getType())) {
+				return event;
+			}
+		}
+		throw new IllegalArgumentException(" Unknown event type"
+				+ pattern.getEvent().getType());
+	}
 
-    public static Node getEventLocation(Pattern pattern, List<Node> candidateLocations, Cluster cluster) {
-        ValueType value = new ValueType(pattern.getEvent().getNodeid().getValue());
-        Node location = null;
-        Type vtype = value.getType();
+	public static Node getEventLocation(Pattern pattern,
+			List<Node> candidateLocations, Cluster cluster) {
+		ValueType value = new ValueType(pattern.getEvent().getNodeid()
+				.getValue());
+		Node location = null;
+		Type vtype = value.getType();
 
-        switch (vtype) {
-            case ABS:
-                location = getNodeFromId(value.getAbsoluteValue(), cluster);
-                break;
-            case RANDOM_RANGE:
-                int nodeIndex = Randomizer.getInstance().getRandomInt(0, candidateLocations.size() - 1);
-                location = candidateLocations.get(nodeIndex);
-                break;
-            case RANDOM_MIN_MAX:
-                throw new IllegalStateException(" Canont configure a min max value range for location");
-        }
-        return location;
+		switch (vtype) {
+		case ABS:
+			location = getNodeFromId(value.getAbsoluteValue(), cluster);
+			break;
+		case RANDOM_RANGE:
+			int nodeIndex = Randomizer.getInstance().getRandomInt(0,
+					candidateLocations.size() - 1);
+			location = candidateLocations.get(nodeIndex);
+			break;
+		case RANDOM_MIN_MAX:
+			throw new IllegalStateException(
+					" Canont configure a min max value range for location");
+		}
+		return location;
 
-    }
+	}
 
-    public static List<Node> getCandidateLocations(Pattern pattern, Cluster cluster) {
-        ValueType value = new ValueType(pattern.getEvent().getNodeid().getValue());
-        List<Node> candidateList = new ArrayList<Node>();
-        switch (value.getType()) {
-            case ABS:
-                candidateList.add(getNodeFromId(value.getAbsoluteValue(), cluster));
-                break;
-            case RANDOM_RANGE:
-                boolean anyOption = false;
-                String[] values = value.getRangeSet();
-                for (String v : values) {
-                    if (v.equalsIgnoreCase("ANY")) {
-                        anyOption = true;
-                    }
-                }
-                if (anyOption) {
-                    for (Node node : cluster.getNode()) {
-                        candidateList.add(node);
-                    }
-                } else {
-                    boolean found = false;
-                    for (String v : values) {
-                        for (Node node : cluster.getNode()) {
-                            if (node.getId().equals(v)) {
-                                candidateList.add(node);
-                                found = true;
-                                break;
-                            }
-                        }
-                        if (!found) {
-                            throw new IllegalStateException("Unknonw nodeId : " + v);
-                        }
-                        found = false;
-                    }
+	public static List<Node> getCandidateLocations(Pattern pattern,
+			Cluster cluster) {
+		ValueType value = new ValueType(pattern.getEvent().getNodeid()
+				.getValue());
+		List<Node> candidateList = new ArrayList<Node>();
+		switch (value.getType()) {
+		case ABS:
+			candidateList.add(getNodeFromId(value.getAbsoluteValue(), cluster));
+			break;
+		case RANDOM_RANGE:
+			boolean anyOption = false;
+			String[] values = value.getRangeSet();
+			for (String v : values) {
+				if (v.equalsIgnoreCase("ANY")) {
+					anyOption = true;
+				}
+			}
+			if (anyOption) {
+				for (Node node : cluster.getNode()) {
+					candidateList.add(node);
+				}
+			} else {
+				boolean found = false;
+				for (String v : values) {
+					for (Node node : cluster.getNode()) {
+						if (node.getId().equals(v)) {
+							candidateList.add(node);
+							found = true;
+							break;
+						}
+					}
+					if (!found) {
+						throw new IllegalStateException("Unknonw nodeId : " + v);
+					}
+					found = false;
+				}
 
-                }
-                String[] excluded = value.getRangeExcluded();
-                if (excluded != null && excluded.length > 0) {
-                    List<Node> markedForRemoval = new ArrayList<Node>();
-                    for (String exclusion : excluded) {
-                        for (Node node : candidateList) {
-                            if (node.getId().equals(exclusion)) {
-                                markedForRemoval.add(node);
-                            }
-                        }
-                    }
-                    candidateList.removeAll(markedForRemoval);
-                }
-                break;
-            case RANDOM_MIN_MAX:
-                throw new IllegalStateException(" Invalid value configured for location");
-        }
-        return candidateList;
-    }
+			}
+			String[] excluded = value.getRangeExcluded();
+			if (excluded != null && excluded.length > 0) {
+				List<Node> markedForRemoval = new ArrayList<Node>();
+				for (String exclusion : excluded) {
+					for (Node node : candidateList) {
+						if (node.getId().equals(exclusion)) {
+							markedForRemoval.add(node);
+						}
+					}
+				}
+				candidateList.removeAll(markedForRemoval);
+			}
+			break;
+		case RANDOM_MIN_MAX:
+			throw new IllegalStateException(
+					" Invalid value configured for location");
+		}
+		return candidateList;
+	}
 
-    private static Node getNodeFromId(String nodeid, Cluster cluster) {
-        if (nodeid.equals(EventDriver.CLIENT_NODE.getId())) {
-            return EventDriver.CLIENT_NODE;
-        }
+	private static Node getNodeFromId(String nodeid, Cluster cluster) {
+		if (nodeid.equals(EventDriver.CLIENT_NODE.getId())) {
+			return EventDriver.CLIENT_NODE;
+		}
 
-        if (nodeid.equals(cluster.getMasterNode().getId())) {
-            String javaOpts = cluster.getMasterNode().getJavaOpts() == null ? cluster.getJavaOpts() : cluster
-                    .getMasterNode().getJavaOpts();
-            String logDir = cluster.getMasterNode().getLogdir() == null ? cluster.getLogdir() : cluster.getMasterNode()
-                    .getLogdir();
-            String javaHome = cluster.getMasterNode().getJavaHome() == null ? cluster.getJavaHome() : cluster
-                    .getMasterNode().getJavaHome();
-            BigInteger debug = cluster.getMasterNode().getDebug();
-            return new Node(cluster.getMasterNode().getId(), cluster.getMasterNode().getClusterIp(), javaHome,
-                    javaOpts, logDir, null, null, debug);
-        }
+		if (nodeid.equals(cluster.getMasterNode().getId())) {
+			String javaOpts = cluster.getMasterNode().getJavaOpts() == null ? cluster
+					.getJavaOpts() : cluster.getMasterNode().getJavaOpts();
+			String logDir = cluster.getMasterNode().getLogdir() == null ? cluster
+					.getLogdir() : cluster.getMasterNode().getLogdir();
+			String javaHome = cluster.getMasterNode().getJavaHome() == null ? cluster
+					.getJavaHome() : cluster.getMasterNode().getJavaHome();
+			BigInteger debug = cluster.getMasterNode().getDebug();
+			return new Node(cluster.getMasterNode().getId(), cluster
+					.getMasterNode().getClusterIp(), javaHome, javaOpts,
+					logDir, null, null, debug);
+		}
 
-        List<Node> nodeList = cluster.getNode();
-        for (Node node : nodeList) {
-            if (node.getId().equals(nodeid)) {
-                return node;
-            }
-        }
-        StringBuffer buffer = new StringBuffer();
-        buffer.append(EventDriver.CLIENT_NODE.getId() + ",");
-        buffer.append(cluster.getMasterNode().getId() + ",");
-        for (Node v : cluster.getNode()) {
-            buffer.append(v.getId() + ",");
-        }
-        buffer.deleteCharAt(buffer.length() - 1);
-        throw new IllegalArgumentException("Unknown node id :" + nodeid + " valid ids:" + buffer);
-    }
+		List<Node> nodeList = cluster.getNode();
+		for (Node node : nodeList) {
+			if (node.getId().equals(nodeid)) {
+				return node;
+			}
+		}
+		StringBuffer buffer = new StringBuffer();
+		buffer.append(EventDriver.CLIENT_NODE.getId() + ",");
+		buffer.append(cluster.getMasterNode().getId() + ",");
+		for (Node v : cluster.getNode()) {
+			buffer.append(v.getId() + ",");
+		}
+		buffer.deleteCharAt(buffer.length() - 1);
+		throw new IllegalArgumentException("Unknown node id :" + nodeid
+				+ " valid ids:" + buffer);
+	}
 
-    public static void executeEventScript(Node node, String script, List<String> args, Cluster cluster)
-            throws IOException, InterruptedException {
-        List<String> pargs = new ArrayList<String>();
-        pargs.add("/bin/bash");
-        pargs.add(EventDriver.getEventsDir() + "/" + EXECUTE_SCRIPT);
-        StringBuffer argBuffer = new StringBuffer();
-        String env = EventDriver.getStringifiedEnv(cluster) + " " + IP_LOCATION + "=" + node.getClusterIp();
-        if (args != null) {
-            for (String arg : args) {
-                argBuffer.append(arg + " ");
-            }
-        }
-        ProcessBuilder pb = new ProcessBuilder(pargs);
-        pb.environment().putAll(EventDriver.getEnvironment());
-        pb.environment().put(IP_LOCATION, node.getClusterIp());
-        pb.environment().put(CLUSTER_ENV, env);
-        pb.environment().put(SCRIPT, script);
-        pb.environment().put(ARGS, argBuffer.toString());
-        pb.start();
-    }
+	public static void executeEventScript(Node node, String script,
+			List<String> args, Cluster cluster) throws IOException,
+			InterruptedException {
+		List<String> pargs = new ArrayList<String>();
+		pargs.add("/bin/bash");
+		pargs.add(EventDriver.getEventsDir() + "/" + EXECUTE_SCRIPT);
+		StringBuffer argBuffer = new StringBuffer();
+		String env = EventDriver.getStringifiedEnv(cluster) + " " + IP_LOCATION
+				+ "=" + node.getClusterIp();
+		if (args != null) {
+			for (String arg : args) {
+				argBuffer.append(arg + " ");
+			}
+		}
+		ProcessBuilder pb = new ProcessBuilder(pargs);
+		pb.environment().putAll(EventDriver.getEnvironment());
+		pb.environment().put(IP_LOCATION, node.getClusterIp());
+		pb.environment().put(CLUSTER_ENV, env);
+		pb.environment().put(SCRIPT, script);
+		pb.environment().put(ARGS, argBuffer.toString());
+		pb.start();
+	}
 
-    public static void executeLocalScript(Node node, String script, List<String> args) throws IOException,
-            InterruptedException {
-        List<String> pargs = new ArrayList<String>();
-        pargs.add("/bin/bash");
-        pargs.add(script);
-        if (args != null) {
-            pargs.addAll(args);
-        }
-        ProcessBuilder pb = new ProcessBuilder(pargs);
-        pb.environment().putAll(EventDriver.getEnvironment());
-        pb.environment().put(IP_LOCATION, node.getClusterIp());
-        pb.start();
-    }
+	public static void executeLocalScript(Node node, String script,
+			List<String> args) throws IOException, InterruptedException {
+		List<String> pargs = new ArrayList<String>();
+		pargs.add("/bin/bash");
+		pargs.add(script);
+		if (args != null) {
+			pargs.addAll(args);
+		}
+		ProcessBuilder pb = new ProcessBuilder(pargs);
+		pb.environment().putAll(EventDriver.getEnvironment());
+		pb.environment().put(IP_LOCATION, node.getClusterIp());
+		pb.start();
+	}
 
-    public static List<String> getEventArgs(Pattern pattern) {
-        List<String> pargs = new ArrayList<String>();
-        if (pattern.getEvent().getPargs() == null) {
-            return pargs;
-        }
-        String[] args = pattern.getEvent().getPargs().split(" ");
-        for (String arg : args) {
-            pargs.add(arg.trim());
-        }
-        return pargs;
-    }
+	public static List<String> getEventArgs(Pattern pattern) {
+		List<String> pargs = new ArrayList<String>();
+		if (pattern.getEvent().getPargs() == null) {
+			return pargs;
+		}
+		String[] args = pattern.getEvent().getPargs().split(" ");
+		for (String arg : args) {
+			pargs.add(arg.trim());
+		}
+		return pargs;
+	}
 
 }
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventrixClient.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventrixClient.java
index 52d46c8..6f4336d 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventrixClient.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventrixClient.java
@@ -156,23 +156,25 @@
         submit(patterns);
     }
 
-    private Patterns initPattern(String eventsDir) {
-        Nodeid nodeid = new Nodeid(new Value(null, EventDriver.CLIENT_NODE.getId()));
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        String workingDir = cluster.getWorkingDir().getDir();
-        String username = cluster.getUsername() == null ? System.getProperty("user.name") : cluster.getUsername();
-        patternList.add(getDirectoryTransferPattern(username, eventsDir, nodeid,
-                cluster.getMasterNode().getClusterIp(), workingDir));
+	private Patterns initPattern(String eventsDir) {
+		Nodeid nodeid = new Nodeid(new Value(null,
+				EventDriver.CLIENT_NODE.getId()));
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		String workingDir = cluster.getWorkingDir().getDir();
+		String username = cluster.getUsername() == null ? System
+				.getProperty("user.name") : cluster.getUsername();
+		patternList.add(getDirectoryTransferPattern(username, eventsDir,
+				nodeid, cluster.getMasterNode().getClusterIp(), workingDir));
 
-        if (!cluster.getWorkingDir().isNFS()) {
-            for (Node node : cluster.getNode()) {
-                patternList.add(getDirectoryTransferPattern(username, eventsDir, nodeid, node.getClusterIp(),
-                        workingDir));
-            }
-        }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		if (!cluster.getWorkingDir().isNFS()) {
+			for (Node node : cluster.getNode()) {
+				patternList.add(getDirectoryTransferPattern(username,
+						eventsDir, nodeid, node.getClusterIp(), workingDir));
+			}
+		}
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
     private Pattern getDirectoryTransferPattern(String username, String src, Nodeid srcNode, String destNodeIp,
             String destDir) {
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CreateCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CreateCommand.java
index 56cd345..fd0af04 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CreateCommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CreateCommand.java
@@ -38,82 +38,95 @@
 
 public class CreateCommand extends AbstractCommand {
 
-    private String asterixInstanceName;
-    private Cluster cluster;
+	private String asterixInstanceName;
+	private Cluster cluster;
 
-    @Override
-    protected void execCommand() throws Exception {
-        InstallerDriver.initConfig();
-        ValidateCommand validateCommand = new ValidateCommand();
-        boolean valid = validateCommand.validateCluster(((CreateConfig) config).clusterPath);
-        if (!valid) {
-            throw new Exception("Cannot create an Asterix instance.");
-        }
-        asterixInstanceName = ((CreateConfig) config).name;
-        InstallerUtil.validateAsterixInstanceNotExists(asterixInstanceName);
-        CreateConfig createConfig = (CreateConfig) config;
-        JAXBContext ctx = JAXBContext.newInstance(Cluster.class);
-        Unmarshaller unmarshaller = ctx.createUnmarshaller();
-        cluster = (Cluster) unmarshaller.unmarshal(new File(createConfig.clusterPath));
-        AsterixInstance asterixInstance = InstallerUtil.createAsterixInstance(asterixInstanceName, cluster);
-        InstallerUtil.evaluateConflictWithOtherInstances(asterixInstance);
-        InstallerUtil.createAsterixZip(asterixInstance, true);
-        List<Property> clusterProperties = new ArrayList<Property>();
-        clusterProperties.add(new Property("ASTERIX_HOME", cluster.getWorkingDir().getDir() + File.separator
-                + "asterix"));
-        StringBuilder javaOpts = new StringBuilder();
-        if (cluster.getJavaOpts() != null) {
-            javaOpts.append(cluster.getJavaOpts());
-        }
-        clusterProperties.add(new Property("JAVA_OPTS", javaOpts.toString()));
-        clusterProperties.add(new Property("CLUSTER_NET_IP", cluster.getMasterNode().getClusterIp()));
-        clusterProperties.add(new Property("CLIENT_NET_IP", cluster.getMasterNode().getClusterIp()));
-        clusterProperties.add(new Property("LOG_DIR", cluster.getLogdir()));
-        clusterProperties.add(new Property("JAVA_HOME", cluster.getJavaHome()));
-        clusterProperties.add(new Property("WORKING_DIR", cluster.getWorkingDir().getDir()));
-        cluster.setEnv(new Env(clusterProperties));
+	@Override
+	protected void execCommand() throws Exception {
+		InstallerDriver.initConfig();
+		ValidateCommand validateCommand = new ValidateCommand();
+		boolean valid = validateCommand
+				.validateCluster(((CreateConfig) config).clusterPath);
+		if (!valid) {
+			throw new Exception("Cannot create an Asterix instance.");
+		}
+		asterixInstanceName = ((CreateConfig) config).name;
+		InstallerUtil.validateAsterixInstanceNotExists(asterixInstanceName);
+		CreateConfig createConfig = (CreateConfig) config;
+		JAXBContext ctx = JAXBContext.newInstance(Cluster.class);
+		Unmarshaller unmarshaller = ctx.createUnmarshaller();
+		cluster = (Cluster) unmarshaller.unmarshal(new File(
+				createConfig.clusterPath));
+		AsterixInstance asterixInstance = InstallerUtil.createAsterixInstance(
+				asterixInstanceName, cluster);
+		InstallerUtil.evaluateConflictWithOtherInstances(asterixInstance);
+		InstallerUtil.createAsterixZip(asterixInstance, true);
+		List<Property> clusterProperties = new ArrayList<Property>();
+		clusterProperties.add(new Property("ASTERIX_HOME", cluster
+				.getWorkingDir().getDir() + File.separator + "asterix"));
+		StringBuilder javaOpts = new StringBuilder();
+		if (cluster.getJavaOpts() != null) {
+			javaOpts.append(cluster.getJavaOpts());
+		}
+		clusterProperties.add(new Property("JAVA_OPTS", javaOpts.toString()));
+		clusterProperties.add(new Property("CLUSTER_NET_IP", cluster
+				.getMasterNode().getClusterIp()));
+		clusterProperties.add(new Property("CLIENT_NET_IP", cluster
+				.getMasterNode().getClientIp()));
+		clusterProperties.add(new Property("LOG_DIR", cluster.getLogdir()));
+		clusterProperties.add(new Property("JAVA_HOME", cluster.getJavaHome()));
+		clusterProperties.add(new Property("WORKING_DIR", cluster
+				.getWorkingDir().getDir()));
+		cluster.setEnv(new Env(clusterProperties));
 
-        PatternCreator pc = new PatternCreator();
-        Patterns patterns = pc.getStartAsterixPattern(asterixInstanceName, cluster);
-        InstallerUtil.getEventrixClient(cluster).submit(patterns);
+		PatternCreator pc = new PatternCreator();
+		Patterns patterns = pc.getStartAsterixPattern(asterixInstanceName,
+				cluster);
+		InstallerUtil.getEventrixClient(cluster).submit(patterns);
 
-        AsterixRuntimeState runtimeState = VerificationUtil.getAsterixRuntimeState(asterixInstance);
-        VerificationUtil.updateInstanceWithRuntimeDescription(asterixInstance, runtimeState, true);
-        ServiceProvider.INSTANCE.getLookupService().writeAsterixInstance(asterixInstance);
-        InstallerUtil.deleteDirectory(InstallerDriver.getManagixHome() + File.separator + InstallerDriver.ASTERIX_DIR
-                + File.separator + asterixInstanceName);
-        LOGGER.info(asterixInstance.getDescription(false));
-    }
+		AsterixRuntimeState runtimeState = VerificationUtil
+				.getAsterixRuntimeState(asterixInstance);
+		VerificationUtil.updateInstanceWithRuntimeDescription(asterixInstance,
+				runtimeState, true);
+		ServiceProvider.INSTANCE.getLookupService().writeAsterixInstance(
+				asterixInstance);
+		InstallerUtil.deleteDirectory(InstallerDriver.getManagixHome()
+				+ File.separator + InstallerDriver.ASTERIX_DIR + File.separator
+				+ asterixInstanceName);
+		LOGGER.info(asterixInstance.getDescription(false));
+	}
 
-    @Override
-    protected CommandConfig getCommandConfig() {
-        return new CreateConfig();
-    }
+	@Override
+	protected CommandConfig getCommandConfig() {
+		return new CreateConfig();
+	}
 
-    public Cluster getCluster() {
-        return cluster;
-    }
+	public Cluster getCluster() {
+		return cluster;
+	}
 
-    public String getAsterixInstanceName() {
-        return asterixInstanceName;
-    }
+	public String getAsterixInstanceName() {
+		return asterixInstanceName;
+	}
 
-    @Override
-    protected String getUsageDescription() {
-        return "\nCreates an ASTERIX instance with a specified name."
-                + "\n\nPost creation, the instance is in ACTIVE state, indicating its "
-                + "\navailability for executing statements/queries." + "\n\nUsage arguments/options:"
-                + "\n-n Name of the ASTERIX instance." + "\n-c Path to the cluster configuration file";
-    }
+	@Override
+	protected String getUsageDescription() {
+		return "\nCreates an ASTERIX instance with a specified name."
+				+ "\n\nPost creation, the instance is in ACTIVE state, indicating its "
+				+ "\navailability for executing statements/queries."
+				+ "\n\nUsage arguments/options:"
+				+ "\n-n Name of the ASTERIX instance."
+				+ "\n-c Path to the cluster configuration file";
+	}
 
 }
 
 class CreateConfig 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 = "-c", required = true, usage = "Path to cluster configuration")
-    public String clusterPath;
+	@Option(name = "-c", required = true, usage = "Path to cluster configuration")
+	public String clusterPath;
 
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ValidateCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ValidateCommand.java
index 1abeb0e..3d292a9 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ValidateCommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ValidateCommand.java
@@ -29,213 +29,239 @@
 import edu.uci.ics.asterix.event.schema.cluster.Cluster;
 import edu.uci.ics.asterix.event.schema.cluster.MasterNode;
 import edu.uci.ics.asterix.event.schema.cluster.Node;
-import edu.uci.ics.asterix.event.schema.pattern.Patterns;
 import edu.uci.ics.asterix.installer.driver.InstallerDriver;
-import edu.uci.ics.asterix.installer.driver.InstallerUtil;
-import edu.uci.ics.asterix.installer.events.PatternCreator;
 import edu.uci.ics.asterix.installer.schema.conf.Configuration;
 import edu.uci.ics.asterix.installer.schema.conf.Zookeeper;
 
 public class ValidateCommand extends AbstractCommand {
 
-    private static final String OK = " [" + "\u2713" + "]";
-    private static final String ERROR = " [" + "x" + "]";
-    private static final String WARNING = " [" + "!" + "]";
+	private static final String OK = " [" + "OK" + "]";
+	private static final String ERROR = " [" + "ERROR" + "]";
+	private static final String WARNING = " [" + "WARNING" + "]";
 
-    @Override
-    protected void execCommand() throws Exception {
-        ValidateConfig vConfig = (ValidateConfig) config;
-        logValidationResult("Environment", validateEnvironment());
-        if (((ValidateConfig) config).cluster != null) {
-            logValidationResult("Cluster configuration", validateCluster(vConfig.cluster));
-        } else {
-            logValidationResult("Installer Configuration", validateConfiguration());
-        }
-    }
+	@Override
+	protected void execCommand() throws Exception {
+		ValidateConfig vConfig = (ValidateConfig) config;
+		logValidationResult("Environment", validateEnvironment());
+		if (((ValidateConfig) config).cluster != null) {
+			logValidationResult("Cluster configuration",
+					validateCluster(vConfig.cluster));
+		} else {
+			logValidationResult("Installer Configuration",
+					validateConfiguration());
+		}
+	}
 
-    private void logValidationResult(String prefix, boolean isValid) {
-        if (!isValid) {
-            LOGGER.fatal(prefix + ERROR);
-        } else {
-            LOGGER.info(prefix + OK);
-        }
-    }
+	private void logValidationResult(String prefix, boolean isValid) {
+		if (!isValid) {
+			LOGGER.fatal(prefix + ERROR);
+		} else {
+			LOGGER.info(prefix + OK);
+		}
+	}
 
-    @Override
-    protected CommandConfig getCommandConfig() {
-        return new ValidateConfig();
-    }
+	@Override
+	protected CommandConfig getCommandConfig() {
+		return new ValidateConfig();
+	}
 
-    @Override
-    protected String getUsageDescription() {
-        return "\nValidate the installer's configuration or a cluster configuration" + "\nUsage"
-                + "\nFor validating the installer configuration" + "\nuse managix validate"
-                + "\n\nFor validating a cluster configuration"
-                + "\nuse managix validate -c <path to the cluster configuration file>";
-    }
+	@Override
+	protected String getUsageDescription() {
+		return "\nValidate the installer's configuration or a cluster configuration"
+				+ "\nUsage"
+				+ "\nFor validating the installer configuration"
+				+ "\nuse managix validate"
+				+ "\n\nFor validating a cluster configuration"
+				+ "\nuse managix validate -c <path to the cluster configuration file>";
+	}
 
-    public boolean validateEnvironment() throws Exception {
-        boolean valid = true;
-        String managixHome = System.getenv(InstallerDriver.ENV_MANAGIX_HOME);
-        if (managixHome == null) {
-            valid = false;
-            LOGGER.fatal(InstallerDriver.ENV_MANAGIX_HOME + " not set " + ERROR);
-        } else {
-            File home = new File(managixHome);
-            if (!home.exists()) {
-                valid = false;
-                LOGGER.fatal(InstallerDriver.ENV_MANAGIX_HOME + ": " + home.getAbsolutePath() + " does not exist!"
-                        + ERROR);
-            }
-        }
-        return valid;
+	public boolean validateEnvironment() throws Exception {
+		boolean valid = true;
+		String managixHome = System.getenv(InstallerDriver.ENV_MANAGIX_HOME);
+		if (managixHome == null) {
+			valid = false;
+			LOGGER.fatal(InstallerDriver.ENV_MANAGIX_HOME + " not set " + ERROR);
+		} else {
+			File home = new File(managixHome);
+			if (!home.exists()) {
+				valid = false;
+				LOGGER.fatal(InstallerDriver.ENV_MANAGIX_HOME + ": "
+						+ home.getAbsolutePath() + " does not exist!" + ERROR);
+			}
+		}
+		return valid;
 
-    }
+	}
 
-    public boolean validateCluster(String clusterPath) throws Exception {
-        boolean valid = true;
-        Cluster cluster = null;
-        File f = new File(clusterPath);
-        if (!f.exists() || !f.isFile()) {
-            LOGGER.error(" Invalid path " + f.getAbsolutePath() + ERROR);
-            valid = false;
-        } else {
-            JAXBContext ctx = JAXBContext.newInstance(Cluster.class);
-            Unmarshaller unmarshaller = ctx.createUnmarshaller();
-            cluster = (Cluster) unmarshaller.unmarshal(new File(clusterPath));
-            validateClusterProperties(cluster);
+	public boolean validateCluster(String clusterPath) throws Exception {
+		boolean valid = true;
+		Cluster cluster = null;
+		File f = new File(clusterPath);
+		if (!f.exists() || !f.isFile()) {
+			LOGGER.error(" Invalid path " + f.getAbsolutePath() + ERROR);
+			valid = false;
+		} else {
+			JAXBContext ctx = JAXBContext.newInstance(Cluster.class);
+			Unmarshaller unmarshaller = ctx.createUnmarshaller();
+			cluster = (Cluster) unmarshaller.unmarshal(new File(clusterPath));
+			validateClusterProperties(cluster);
 
-            Set<String> servers = new HashSet<String>();
-            Set<String> serverIds = new HashSet<String>();
-            servers.add(cluster.getMasterNode().getClusterIp());
-            serverIds.add(cluster.getMasterNode().getId());
+			Set<String> servers = new HashSet<String>();
+			Set<String> serverIds = new HashSet<String>();
+			servers.add(cluster.getMasterNode().getClusterIp());
+			serverIds.add(cluster.getMasterNode().getId());
 
-            MasterNode masterNode = cluster.getMasterNode();
-            Node master = new Node(masterNode.getId(), masterNode.getClusterIp(), masterNode.getJavaOpts(),
-                    masterNode.getJavaHome(), masterNode.getLogdir(), null, null, null);
+			MasterNode masterNode = cluster.getMasterNode();
+			Node master = new Node(masterNode.getId(),
+					masterNode.getClusterIp(), masterNode.getJavaOpts(),
+					masterNode.getJavaHome(), masterNode.getLogdir(), null,
+					null, null);
 
-            valid = valid & validateNodeConfiguration(master, cluster);
+			valid = valid & validateNodeConfiguration(master, cluster);
 
-            for (Node node : cluster.getNode()) {
-                servers.add(node.getClusterIp());
-                if (serverIds.contains(node.getId())) {
-                    valid = false;
-                    LOGGER.error("Duplicate node id :" + node.getId() + ERROR);
-                } else {
-                    valid = valid & validateNodeConfiguration(node, cluster);
-                }
-            }
-        }
+			for (Node node : cluster.getNode()) {
+				servers.add(node.getClusterIp());
+				if (serverIds.contains(node.getId())) {
+					valid = false;
+					LOGGER.error("Duplicate node id :" + node.getId() + ERROR);
+				} else {
+					valid = valid & validateNodeConfiguration(node, cluster);
+				}
+			}
+		}
 
-        return valid;
-    }
+		return valid;
+	}
 
-    private void validateClusterProperties(Cluster cluster) {
-        List<String> tempDirs = new ArrayList<String>();
-        if (cluster.getLogdir() != null && checkTemporaryPath(cluster.getLogdir())) {
-            tempDirs.add("Log directory: " + cluster.getLogdir());
-        }
-        if (cluster.getStore() != null && checkTemporaryPath(cluster.getStore())) {
-            tempDirs.add("Store directory: " + cluster.getStore());
-        }
+	private void validateClusterProperties(Cluster cluster) {
+		List<String> tempDirs = new ArrayList<String>();
+		if (cluster.getLogdir() != null
+				&& checkTemporaryPath(cluster.getLogdir())) {
+			tempDirs.add("Log directory: " + cluster.getLogdir());
+		}
+		if (cluster.getIodevices() != null
+				&& checkTemporaryPath(cluster.getIodevices())) {
+			tempDirs.add("IO Device: " + cluster.getIodevices());
+		}
 
-        if (tempDirs.size() > 0) {
-            StringBuffer msg = new StringBuffer();
-            msg.append("The following paths are subject to be cleaned up by OS");
-            for (String tempDir : tempDirs) {
-                msg.append("\n" + tempDir + WARNING);
-            }
-            LOGGER.warn(msg);
-        }
+		if (tempDirs.size() > 0) {
+			StringBuffer msg = new StringBuffer();
+			msg.append("The following paths are subject to be cleaned up by OS");
+			for (String tempDir : tempDirs) {
+				msg.append("\n" + tempDir + WARNING);
+			}
+			LOGGER.warn(msg);
+		}
 
-    }
+	}
 
-    private boolean validateNodeConfiguration(Node node, Cluster cluster) {
-        boolean valid = true;
-        valid = checkNodeReachability(node.getClusterIp());
-        if (node.getJavaHome() == null || node.getJavaHome().length() == 0) {
-            if (cluster.getJavaHome() == null || cluster.getJavaHome().length() == 0) {
-                valid = false;
-                LOGGER.fatal("java_home not defined at cluster/node level for node: " + node.getId() + ERROR);
-            }
-        }
+	private boolean validateNodeConfiguration(Node node, Cluster cluster) {
+		boolean valid = true;
+		valid = checkNodeReachability(node.getClusterIp());
+		if (node.getJavaHome() == null || node.getJavaHome().length() == 0) {
+			if (cluster.getJavaHome() == null
+					|| cluster.getJavaHome().length() == 0) {
+				valid = false;
+				LOGGER.fatal("java_home not defined at cluster/node level for node: "
+						+ node.getId() + ERROR);
+			}
+		}
 
-        if (node.getLogdir() == null || node.getLogdir().length() == 0) {
-            if (cluster.getLogdir() == null || cluster.getLogdir().length() == 0) {
-                valid = false;
-                LOGGER.fatal("log_dir not defined at cluster/node level for node: " + node.getId() + ERROR);
-            }
-        }
+		if (node.getLogdir() == null || node.getLogdir().length() == 0) {
+			if (cluster.getLogdir() == null
+					|| cluster.getLogdir().length() == 0) {
+				valid = false;
+				LOGGER.fatal("log_dir not defined at cluster/node level for node: "
+						+ node.getId() + ERROR);
+			}
+		}
 
-        if (node.getStore() == null || cluster.getStore().length() == 0) {
-            if (cluster.getMasterNode().getId().equals(node.getId())
-                    && (cluster.getStore() == null || cluster.getStore().length() == 0)) {
-                valid = false;
-                LOGGER.fatal("store not defined at cluster/node level for node: " + node.getId() + ERROR);
-            }
-        }
+		if (node.getStore() == null || node.getStore().length() == 0) {
+			if (!cluster.getMasterNode().getId().equals(node.getId())
+					&& (cluster.getStore() == null || cluster.getStore()
+							.length() == 0)) {
+				valid = false;
+				LOGGER.fatal("store not defined at cluster/node level for node: "
+						+ node.getId() + ERROR);
+			}
+		}
 
-        return valid;
-    }
+		if (node.getIodevices() == null || node.getIodevices().length() == 0) {
+			if (!cluster.getMasterNode().getId().equals(node.getId())
+					&& (cluster.getIodevices() == null || cluster
+							.getIodevices().length() == 0)) {
+				valid = false;
+				LOGGER.fatal("iodevice(s) not defined at cluster/node level for node: "
+						+ node.getId() + ERROR);
+			}
+		}
 
-    private boolean checkTemporaryPath(String logdir) {
-        return logdir.startsWith("/tmp/");
+		return valid;
+	}
 
-    }
+	private boolean checkTemporaryPath(String logdir) {
+		return logdir.startsWith("/tmp/");
 
-    public boolean validateConfiguration() throws Exception {
-        String managixHome = System.getenv(InstallerDriver.ENV_MANAGIX_HOME);
-        File configFile = new File(managixHome + File.separator + InstallerDriver.MANAGIX_CONF_XML);
-        JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
-        Unmarshaller unmarshaller = configCtx.createUnmarshaller();
-        Configuration conf = (Configuration) unmarshaller.unmarshal(configFile);
-        return validateZookeeperConfiguration(conf);
-    }
+	}
 
-    private boolean validateZookeeperConfiguration(Configuration conf) throws Exception {
-        boolean valid = true;
-        Zookeeper zk = conf.getZookeeper();
+	public boolean validateConfiguration() throws Exception {
+		String managixHome = System.getenv(InstallerDriver.ENV_MANAGIX_HOME);
+		File configFile = new File(managixHome + File.separator
+				+ InstallerDriver.MANAGIX_CONF_XML);
+		JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
+		Unmarshaller unmarshaller = configCtx.createUnmarshaller();
+		Configuration conf = (Configuration) unmarshaller.unmarshal(configFile);
+		return validateZookeeperConfiguration(conf);
+	}
 
-        if (zk.getHomeDir() == null || zk.getHomeDir().length() == 0) {
-            valid = false;
-            LOGGER.fatal("Zookeeper home dir not configured" + ERROR);
-        } else if (checkTemporaryPath(zk.getHomeDir())) {
-            LOGGER.warn("Zookeeper home dir is subject to be cleaned up by OS" + WARNING);
-        }
+	private boolean validateZookeeperConfiguration(Configuration conf)
+			throws Exception {
+		boolean valid = true;
+		Zookeeper zk = conf.getZookeeper();
 
-        if (zk.getServers().getServer().isEmpty()) {
-            valid = false;
-            LOGGER.fatal("Zookeeper servers not configured" + ERROR);
-        }
+		if (zk.getHomeDir() == null || zk.getHomeDir().length() == 0) {
+			valid = false;
+			LOGGER.fatal("Zookeeper home dir not configured" + ERROR);
+		} else if (checkTemporaryPath(zk.getHomeDir())) {
+			LOGGER.warn("Zookeeper home dir is subject to be cleaned up by OS"
+					+ WARNING);
+		}
 
-        boolean validEnsemble = true;
-        for (String server : zk.getServers().getServer()) {
-            validEnsemble = validEnsemble && checkNodeReachability(server);
-        }
+		if (zk.getServers().getServer().isEmpty()) {
+			valid = false;
+			LOGGER.fatal("Zookeeper servers not configured" + ERROR);
+		}
 
-        return valid;
-    }
+		boolean validEnsemble = true;
+		for (String server : zk.getServers().getServer()) {
+			validEnsemble = validEnsemble && checkNodeReachability(server);
+		}
 
-    private boolean checkNodeReachability(String server) {
-        boolean reachable = true;
-        try {
-            InetAddress address = InetAddress.getByName(server);
-            if (!address.isReachable(1000)) {
-                LOGGER.fatal("\n" + "Server: " + server + " unreachable" + ERROR);
-                reachable = false;
-            }
-        } catch (Exception e) {
-            reachable = false;
-            LOGGER.fatal("\n" + "Server: " + server + " Invalid address" + ERROR);
-        }
-        return reachable;
-    }
+		return valid;
+	}
+
+	private boolean checkNodeReachability(String server) {
+		boolean reachable = true;
+		try {
+			InetAddress address = InetAddress.getByName(server);
+			if (!address.isReachable(1000)) {
+				LOGGER.fatal("\n" + "Server: " + server + " unreachable"
+						+ ERROR);
+				reachable = false;
+			}
+		} catch (Exception e) {
+			reachable = false;
+			LOGGER.fatal("\n" + "Server: " + server + " Invalid address"
+					+ ERROR);
+		}
+		return reachable;
+	}
 
 }
 
 class ValidateConfig extends CommandConfig {
 
-    @Option(name = "-c", required = false, usage = "Path to the cluster configuration xml")
-    public String cluster;
+	@Option(name = "-c", required = false, usage = "Path to the cluster configuration xml")
+	public String cluster;
 
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
index 3164bd7..8083427 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
@@ -30,109 +30,133 @@
 
 public class InstallerDriver {
 
-    public static final String MANAGIX_INTERNAL_DIR = ".installer";
-    public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix";
-    public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix"
-            + File.separator + "scripts";
-    public static final String ASTERIX_DIR = "asterix";
-    public static final String EVENTS_DIR = "events";
+	public static final String MANAGIX_INTERNAL_DIR = ".installer";
+	public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR
+			+ File.separator + "eventrix";
+	public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR
+			+ File.separator + "eventrix" + File.separator + "scripts";
+	public static final String ASTERIX_DIR = "asterix";
+	public static final String EVENTS_DIR = "events";
 
-    private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class.getName());
-    public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
-    public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
+	private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class
+			.getName());
+	public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
+	public static final String MANAGIX_CONF_XML = "conf" + File.separator
+			+ "managix-conf.xml";
 
-    private static Configuration conf;
-    private static String managixHome;
-    private static String asterixZip;
+	private static Configuration conf;
+	private static String managixHome;
+	private static String asterixZip;
 
-    public static String getAsterixZip() {
-        return asterixZip;
-    }
+	public static String getAsterixZip() {
+		return asterixZip;
+	}
 
-    public static Configuration getConfiguration() {
-        return conf;
-    }
+	public static Configuration getConfiguration() {
+		return conf;
+	}
 
-    public static void initConfig() throws Exception {
-        File configFile = new File(managixHome + File.separator + MANAGIX_CONF_XML);
-        JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
-        Unmarshaller unmarshaller = configCtx.createUnmarshaller();
-        conf = (Configuration) unmarshaller.unmarshal(configFile);
-        asterixZip = initBinary("asterix-server");
+	public static void initConfig() throws Exception {
+		File configFile = new File(managixHome + File.separator
+				+ MANAGIX_CONF_XML);
+		JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
+		Unmarshaller unmarshaller = configCtx.createUnmarshaller();
+		conf = (Configuration) unmarshaller.unmarshal(configFile);
+		asterixZip = initBinary("asterix-server");
 
-        ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
-        if (!lookupService.isRunning(conf)) {
-            lookupService.startService(conf);
-        }
-    }
+		ILookupService lookupService = ServiceProvider.INSTANCE
+				.getLookupService();
+		if (!lookupService.isRunning(conf)) {
+			lookupService.startService(conf);
+		}
+	}
 
-    private static String initBinary(final String fileNamePattern) {
-        String asterixDir = InstallerDriver.getAsterixDir();
-        File file = new File(asterixDir);
-        File[] zipFiles = file.listFiles(new FileFilter() {
-            public boolean accept(File arg0) {
-                return arg0.getAbsolutePath().contains(fileNamePattern) && arg0.isFile();
-            }
-        });
-        if (zipFiles.length == 0) {
-            String msg = " Binary not found at " + asterixDir;
-            LOGGER.log(Level.FATAL, msg);
-            throw new IllegalStateException(msg);
-        }
-        if (zipFiles.length > 1) {
-            String msg = " Multiple binaries found at " + asterixDir;
-            LOGGER.log(Level.FATAL, msg);
-            throw new IllegalStateException(msg);
-        }
+	private static String initBinary(final String fileNamePattern) {
+		String asterixDir = InstallerDriver.getAsterixDir();
+		File file = new File(asterixDir);
+		File[] zipFiles = file.listFiles(new FileFilter() {
+			public boolean accept(File arg0) {
+				return arg0.getAbsolutePath().contains(fileNamePattern)
+						&& arg0.isFile();
+			}
+		});
+		if (zipFiles.length == 0) {
+			String msg = " Binary not found at " + asterixDir;
+			LOGGER.log(Level.FATAL, msg);
+			throw new IllegalStateException(msg);
+		}
+		if (zipFiles.length > 1) {
+			String msg = " Multiple binaries found at " + asterixDir;
+			LOGGER.log(Level.FATAL, msg);
+			throw new IllegalStateException(msg);
+		}
 
-        return zipFiles[0].getAbsolutePath();
-    }
+		return zipFiles[0].getAbsolutePath();
+	}
 
-    public static String getManagixHome() {
-        return managixHome;
-    }
+	public static String getManagixHome() {
+		return managixHome;
+	}
 
-    public static String getAsterixDir() {
-        return managixHome + File.separator + ASTERIX_DIR;
-    }
+	public static String getAsterixDir() {
+		return managixHome + File.separator + ASTERIX_DIR;
+	}
 
-    public static void main(String args[]) {
-        try {
-            if (args.length != 0) {
-                managixHome = System.getenv(ENV_MANAGIX_HOME);
-                CommandHandler cmdHandler = new CommandHandler();
-                cmdHandler.processCommand(args);
-            } else {
-                printUsage();
-            }
-        } catch (IllegalArgumentException iae) {
-            LOGGER.error("Unknown command");
-            printUsage();
-        } catch (Exception e) {
-            LOGGER.error(e.getMessage());
-        }
-    }
+	public static void main(String args[]) {
+		try {
+			if (args.length != 0) {
+				managixHome = System.getenv(ENV_MANAGIX_HOME);
+				CommandHandler cmdHandler = new CommandHandler();
+				cmdHandler.processCommand(args);
+			} else {
+				printUsage();
+			}
+		} catch (IllegalArgumentException iae) {
+			LOGGER.error("Unknown command");
+			printUsage();
+		} catch (Exception e) {
+			LOGGER.error(e.getMessage());
+			if (e.getMessage() == null || e.getMessage().length() == 0) {
+				e.printStackTrace();
+			}
+		}
+	}
 
-    private static void printUsage() {
-        StringBuffer buffer = new StringBuffer("managix <command> <options>" + "\n");
-        buffer.append("Commands" + "\n");
-        buffer.append("create   " + ":" + " Creates a new asterix instance" + "\n");
-        buffer.append("delete   " + ":" + " Deletes an asterix instance" + "\n");
-        buffer.append("start    " + ":" + " Starts an  asterix instance" + "\n");
-        buffer.append("stop     " + ":" + " Stops an asterix instance that is in ACTIVE state" + "\n");
-        buffer.append("backup   " + ":" + " Creates a back up for an existing asterix instance" + "\n");
-        buffer.append("restore  " + ":" + " Restores an asterix instance" + "\n");
-        buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
-        buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
-        buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
-                + "\n");
-        buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
-        buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
-        buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
-                + "\n");
-        buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
-        buffer.append("help     " + ":" + " Provides usage description of a command" + "\n");
+	private static void printUsage() {
+		StringBuffer buffer = new StringBuffer("managix <command> <options>"
+				+ "\n");
+		buffer.append("Commands" + "\n");
+		buffer.append("create   " + ":" + " Creates a new asterix instance"
+				+ "\n");
+		buffer.append("delete   " + ":" + " Deletes an asterix instance" + "\n");
+		buffer.append("start    " + ":" + " Starts an  asterix instance" + "\n");
+		buffer.append("stop     " + ":"
+				+ " Stops an asterix instance that is in ACTIVE state" + "\n");
+		buffer.append("backup   " + ":"
+				+ " Creates a back up for an existing asterix instance" + "\n");
+		buffer.append("restore  " + ":" + " Restores an asterix instance"
+				+ "\n");
+		buffer.append("describe " + ":"
+				+ " Describes an existing asterix instance" + "\n");
+		buffer.append("validate " + ":"
+				+ " Validates the installer/cluster configuration" + "\n");
+		buffer.append("configure"
+				+ ":"
+				+ " Auto-generate configuration for local psedu-distributed Asterix instance"
+				+ "\n");
+		buffer.append("shutdown " + ":" + " Shutdown the installer service"
+				+ "\n");
+		buffer.append("validate " + ":"
+				+ " Validates the installer/cluster configuration" + "\n");
+		buffer.append("configure"
+				+ ":"
+				+ " Auto-generate configuration for local psedu-distributed Asterix instance"
+				+ "\n");
+		buffer.append("shutdown " + ":" + " Shutdown the installer service"
+				+ "\n");
+		buffer.append("help     " + ":"
+				+ " Provides usage description of a command" + "\n");
 
-        LOGGER.info(buffer.toString());
-    }
+		LOGGER.info(buffer.toString());
+	}
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/error/VerificationUtil.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/error/VerificationUtil.java
index 612c2e4..05a92f2 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/error/VerificationUtil.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/error/VerificationUtil.java
@@ -29,99 +29,110 @@
 
 public class VerificationUtil {
 
-    private static final String VERIFY_SCRIPT_PATH = InstallerDriver.getManagixHome() + File.separator
-            + InstallerDriver.MANAGIX_INTERNAL_DIR + File.separator + "scripts" + File.separator + "verify.sh";
+	private static final String VERIFY_SCRIPT_PATH = InstallerDriver
+			.getManagixHome()
+			+ File.separator
+			+ InstallerDriver.MANAGIX_INTERNAL_DIR
+			+ 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());
-        }
+		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());
+		}
 
-        String output = InstallerUtil.executeLocalScript(VERIFY_SCRIPT_PATH, args);
-        boolean ccRunning = true;
-        List<String> failedNCs = new ArrayList<String>();
-        String[] infoFields;
-        ProcessInfo pInfo;
-        List<ProcessInfo> processes = new ArrayList<ProcessInfo>();
+		String output = InstallerUtil.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().getClusterIp() + "\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 in " + InstallerDriver.getManagixHome() + File.separator
-                    + InstallerDriver.MANAGIX_CONF_XML + 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 in "
+					+ InstallerDriver.getManagixHome() + File.separator
+					+ InstallerDriver.MANAGIX_CONF_XML + errorCheck);
+		}
+	}
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
index 61f0d27..2184a63 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
@@ -42,393 +42,485 @@
 
 public class PatternCreator {
 
-    private ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
+	private ILookupService lookupService = ServiceProvider.INSTANCE
+			.getLookupService();
 
-    private void addInitialDelay(Pattern p, int delay, String unit) {
-        Delay d = new Delay(new Value(null, "" + delay), unit);
-        p.setDelay(d);
-    }
+	private void addInitialDelay(Pattern p, int delay, String unit) {
+		Delay d = new Delay(new Value(null, "" + delay), unit);
+		p.setDelay(d);
+	}
 
-    public Patterns getStartAsterixPattern(String asterixInstanceName, Cluster cluster) throws Exception {
-        String ccLocationId = cluster.getMasterNode().getId();
-        String ccLocationIp = cluster.getMasterNode().getClusterIp();
+	public Patterns getStartAsterixPattern(String asterixInstanceName,
+			Cluster cluster) throws Exception {
+		String ccLocationId = cluster.getMasterNode().getId();
+		String ccLocationIp = cluster.getMasterNode().getClusterIp();
 
-        String destDir = cluster.getWorkingDir().getDir() + File.separator + "asterix";
-        List<Pattern> ps = new ArrayList<Pattern>();
+		String destDir = cluster.getWorkingDir().getDir() + File.separator
+				+ "asterix";
+		List<Pattern> ps = new ArrayList<Pattern>();
 
-        Pattern copyHyracks = createCopyHyracksPattern(asterixInstanceName, cluster, ccLocationIp, destDir);
-        ps.add(copyHyracks);
+		Pattern copyHyracks = createCopyHyracksPattern(asterixInstanceName,
+				cluster, ccLocationIp, destDir);
+		ps.add(copyHyracks);
 
-        Pattern createCC = createCCStartPattern(ccLocationId);
-        addInitialDelay(createCC, 2, "sec");
-        ps.add(createCC);
+		Pattern createCC = createCCStartPattern(ccLocationId);
+		addInitialDelay(createCC, 2, "sec");
+		ps.add(createCC);
 
-        boolean copyHyracksToNC = !cluster.getWorkingDir().isNFS();
-        for (Node node : cluster.getNode()) {
-            if (copyHyracksToNC) {
-                Pattern copyHyracksForNC = createCopyHyracksPattern(asterixInstanceName, cluster, node.getClusterIp(),
-                        destDir);
-                ps.add(copyHyracksForNC);
-            }
-            String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
-            Pattern createNC = createNCStartPattern(cluster.getMasterNode().getClusterIp(), node.getId(),
-                    asterixInstanceName + "_" + node.getId(), iodevices);
-            addInitialDelay(createNC, 4, "sec");
-            ps.add(createNC);
-        }
+		boolean copyHyracksToNC = !cluster.getWorkingDir().isNFS();
+		for (Node node : cluster.getNode()) {
+			if (copyHyracksToNC) {
+				Pattern copyHyracksForNC = createCopyHyracksPattern(
+						asterixInstanceName, cluster, node.getClusterIp(),
+						destDir);
+				ps.add(copyHyracksForNC);
+			}
+			String iodevices = node.getIodevices() == null ? cluster
+					.getIodevices() : node.getIodevices();
+			Pattern createNC = createNCStartPattern(cluster.getMasterNode()
+					.getClusterIp(), node.getId(), asterixInstanceName + "_"
+					+ node.getId(), iodevices);
+			addInitialDelay(createNC, 4, "sec");
+			ps.add(createNC);
+		}
 
-        Patterns patterns = new Patterns(ps);
-        patterns.getPattern().addAll(createHadoopLibraryTransferPattern(cluster).getPattern());
-        return patterns;
-    }
+		Patterns patterns = new Patterns(ps);
+		patterns.getPattern().addAll(
+				createHadoopLibraryTransferPattern(cluster).getPattern());
+		return patterns;
+	}
 
-    public Patterns getStopCommandPattern(StopCommand stopCommand) throws Exception {
-        List<Pattern> ps = new ArrayList<Pattern>();
-        AsterixInstance asterixInstance = lookupService.getAsterixInstance(stopCommand.getAsterixInstanceName());
-        Cluster cluster = asterixInstance.getCluster();
+	public Patterns getStopCommandPattern(StopCommand stopCommand)
+			throws Exception {
+		List<Pattern> ps = new ArrayList<Pattern>();
+		AsterixInstance asterixInstance = lookupService
+				.getAsterixInstance(stopCommand.getAsterixInstanceName());
+		Cluster cluster = asterixInstance.getCluster();
 
-        String ccLocation = cluster.getMasterNode().getId();
-        Pattern createCC = createCCStopPattern(ccLocation);
-        addInitialDelay(createCC, 5, "sec");
-        ps.add(createCC);
+		String ccLocation = cluster.getMasterNode().getId();
+		Pattern createCC = createCCStopPattern(ccLocation);
+		addInitialDelay(createCC, 5, "sec");
+		ps.add(createCC);
 
-        String asterixInstanceName = stopCommand.getAsterixInstanceName();
-        int nodeControllerIndex = 1;
-        for (Node node : cluster.getNode()) {
-            Pattern createNC = createNCStopPattern(node.getId(), asterixInstanceName + "_" + nodeControllerIndex);
-            ps.add(createNC);
-            nodeControllerIndex++;
-        }
+		String asterixInstanceName = stopCommand.getAsterixInstanceName();
+		int nodeControllerIndex = 1;
+		for (Node node : cluster.getNode()) {
+			Pattern createNC = createNCStopPattern(node.getId(),
+					asterixInstanceName + "_" + nodeControllerIndex);
+			ps.add(createNC);
+			nodeControllerIndex++;
+		}
 
-        Patterns patterns = new Patterns(ps);
-        return patterns;
-    }
+		Patterns patterns = new Patterns(ps);
+		return patterns;
+	}
 
-    public Patterns getBackUpAsterixPattern(AsterixInstance instance, Backup backupConf) throws Exception {
-        BackupType backupType = BackupInfo.getBackupType(backupConf);
-        Patterns patterns = null;
-        switch (backupType) {
-            case HDFS:
-                patterns = getHDFSBackUpAsterixPattern(instance, backupConf);
-                break;
-            case LOCAL:
-                patterns = getLocalBackUpAsterixPattern(instance, backupConf);
-                break;
-        }
-        return patterns;
-    }
+	public Patterns getBackUpAsterixPattern(AsterixInstance instance,
+			Backup backupConf) throws Exception {
+		BackupType backupType = BackupInfo.getBackupType(backupConf);
+		Patterns patterns = null;
+		switch (backupType) {
+		case HDFS:
+			patterns = getHDFSBackUpAsterixPattern(instance, backupConf);
+			break;
+		case LOCAL:
+			patterns = getLocalBackUpAsterixPattern(instance, backupConf);
+			break;
+		}
+		return patterns;
+	}
 
-    public Patterns getRestoreAsterixPattern(AsterixInstance instance, BackupInfo backupInfo) throws Exception {
-        BackupType backupType = backupInfo.getBackupType();
-        Patterns patterns = null;
-        switch (backupType) {
-            case HDFS:
-                patterns = getHDFSRestoreAsterixPattern(instance, backupInfo);
-                break;
-            case LOCAL:
-                patterns = getLocalRestoreAsterixPattern(instance, backupInfo);
-                break;
-        }
-        return patterns;
-    }
+	public Patterns getRestoreAsterixPattern(AsterixInstance instance,
+			BackupInfo backupInfo) throws Exception {
+		BackupType backupType = backupInfo.getBackupType();
+		Patterns patterns = null;
+		switch (backupType) {
+		case HDFS:
+			patterns = getHDFSRestoreAsterixPattern(instance, backupInfo);
+			break;
+		case LOCAL:
+			patterns = getLocalRestoreAsterixPattern(instance, backupInfo);
+			break;
+		}
+		return patterns;
+	}
 
-    private Patterns getHDFSBackUpAsterixPattern(AsterixInstance instance, Backup backupConf) throws Exception {
-        Cluster cluster = instance.getCluster();
-        String hdfsUrl = backupConf.getHdfs().getUrl();
-        String hadoopVersion = backupConf.getHdfs().getVersion();
-        String hdfsBackupDir = backupConf.getBackupDir();
-        VerificationUtil.verifyBackupRestoreConfiguration(hdfsUrl, hadoopVersion, hdfsBackupDir);
-        String workingDir = cluster.getWorkingDir().getDir();
-        String backupId = "" + instance.getBackupInfo().size();
-        String store;
-        String pargs;
-        String iodevices;
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        for (Node node : cluster.getNode()) {
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            iodevices = node.getIodevices() == null ? instance.getCluster().getIodevices() : node.getIodevices();
-            store = node.getStore() == null ? cluster.getStore() : node.getStore();
-            pargs = workingDir + " " + instance.getName() + " " + iodevices + " " + store + " "
-                    + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId + " " + hdfsBackupDir + " " + "hdfs"
-                    + " " + node.getId() + " " + hdfsUrl + " " + hadoopVersion;
-            Event event = new Event("backup", nodeid, pargs);
-            patternList.add(new Pattern(null, 1, null, event));
-        }
-        return new Patterns(patternList);
-    }
+	private Patterns getHDFSBackUpAsterixPattern(AsterixInstance instance,
+			Backup backupConf) throws Exception {
+		Cluster cluster = instance.getCluster();
+		String hdfsUrl = backupConf.getHdfs().getUrl();
+		String hadoopVersion = backupConf.getHdfs().getVersion();
+		String hdfsBackupDir = backupConf.getBackupDir();
+		VerificationUtil.verifyBackupRestoreConfiguration(hdfsUrl,
+				hadoopVersion, hdfsBackupDir);
+		String workingDir = cluster.getWorkingDir().getDir();
+		String backupId = "" + instance.getBackupInfo().size();
+		String store;
+		String pargs;
+		String iodevices;
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		for (Node node : cluster.getNode()) {
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			iodevices = node.getIodevices() == null ? instance.getCluster()
+					.getIodevices() : node.getIodevices();
+			store = node.getStore() == null ? cluster.getStore() : node
+					.getStore();
+			pargs = workingDir + " " + instance.getName() + " " + iodevices
+					+ " " + store + " "
+					+ BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId
+					+ " " + hdfsBackupDir + " " + "hdfs" + " " + node.getId()
+					+ " " + hdfsUrl + " " + hadoopVersion;
+			Event event = new Event("backup", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
+		return new Patterns(patternList);
+	}
 
-    private Patterns getLocalBackUpAsterixPattern(AsterixInstance instance, Backup backupConf) throws Exception {
-        Cluster cluster = instance.getCluster();
-        String backupDir = backupConf.getBackupDir();
-        String workingDir = cluster.getWorkingDir().getDir();
-        String backupId = "" + instance.getBackupInfo().size();
-        String iodevices;
-        String store;
-        String pargs;
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        for (Node node : cluster.getNode()) {
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            iodevices = node.getIodevices() == null ? instance.getCluster().getIodevices() : node.getIodevices();
-            store = node.getStore() == null ? cluster.getStore() : node.getStore();
-            pargs = workingDir + " " + instance.getName() + " " + iodevices + " " + store + " "
-                    + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId + " " + backupDir + " " + "local" + " "
-                    + node.getId();
-            Event event = new Event("backup", nodeid, pargs);
-            patternList.add(new Pattern(null, 1, null, event));
-        }
-        return new Patterns(patternList);
-    }
+	private Patterns getLocalBackUpAsterixPattern(AsterixInstance instance,
+			Backup backupConf) throws Exception {
+		Cluster cluster = instance.getCluster();
+		String backupDir = backupConf.getBackupDir();
+		String workingDir = cluster.getWorkingDir().getDir();
+		String backupId = "" + instance.getBackupInfo().size();
+		String iodevices;
+		String store;
+		String pargs;
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		for (Node node : cluster.getNode()) {
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			iodevices = node.getIodevices() == null ? instance.getCluster()
+					.getIodevices() : node.getIodevices();
+			store = node.getStore() == null ? cluster.getStore() : node
+					.getStore();
+			pargs = workingDir + " " + instance.getName() + " " + iodevices
+					+ " " + store + " "
+					+ BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId
+					+ " " + backupDir + " " + "local" + " " + node.getId();
+			Event event = new Event("backup", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
+		return new Patterns(patternList);
+	}
 
-    public Patterns getHDFSRestoreAsterixPattern(AsterixInstance instance, BackupInfo backupInfo) throws Exception {
-        Cluster cluster = instance.getCluster();
-        String clusterStore = instance.getCluster().getStore();
-        String hdfsUrl = backupInfo.getBackupConf().getHdfs().getUrl();
-        String hadoopVersion = backupInfo.getBackupConf().getHdfs().getVersion();
-        String hdfsBackupDir = backupInfo.getBackupConf().getBackupDir();
-        VerificationUtil.verifyBackupRestoreConfiguration(hdfsUrl, hadoopVersion, hdfsBackupDir);
-        String workingDir = cluster.getWorkingDir().getDir();
-        int backupId = backupInfo.getId();
-        String nodeStore;
-        String pargs;
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        for (Node node : cluster.getNode()) {
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
-            nodeStore = node.getStore() == null ? clusterStore : node.getStore();
-            pargs = workingDir + " " + instance.getName() + " " + iodevices + " " + nodeStore + " "
-                    + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId + " " + " " + hdfsBackupDir + " "
-                    + "hdfs" + " " + node.getId() + " " + hdfsUrl + " " + hadoopVersion;
-            Event event = new Event("restore", nodeid, pargs);
-            patternList.add(new Pattern(null, 1, null, event));
-        }
-        return new Patterns(patternList);
-    }
+	public Patterns getHDFSRestoreAsterixPattern(AsterixInstance instance,
+			BackupInfo backupInfo) throws Exception {
+		Cluster cluster = instance.getCluster();
+		String clusterStore = instance.getCluster().getStore();
+		String hdfsUrl = backupInfo.getBackupConf().getHdfs().getUrl();
+		String hadoopVersion = backupInfo.getBackupConf().getHdfs()
+				.getVersion();
+		String hdfsBackupDir = backupInfo.getBackupConf().getBackupDir();
+		VerificationUtil.verifyBackupRestoreConfiguration(hdfsUrl,
+				hadoopVersion, hdfsBackupDir);
+		String workingDir = cluster.getWorkingDir().getDir();
+		int backupId = backupInfo.getId();
+		String nodeStore;
+		String pargs;
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		for (Node node : cluster.getNode()) {
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			String iodevices = node.getIodevices() == null ? cluster
+					.getIodevices() : node.getIodevices();
+			nodeStore = node.getStore() == null ? clusterStore : node
+					.getStore();
+			pargs = workingDir + " " + instance.getName() + " " + iodevices
+					+ " " + nodeStore + " "
+					+ BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId
+					+ " " + " " + hdfsBackupDir + " " + "hdfs" + " "
+					+ node.getId() + " " + hdfsUrl + " " + hadoopVersion;
+			Event event = new Event("restore", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
+		return new Patterns(patternList);
+	}
 
-    public Patterns getLocalRestoreAsterixPattern(AsterixInstance instance, BackupInfo backupInfo) throws Exception {
-        Cluster cluster = instance.getCluster();
-        String clusterStore = instance.getCluster().getStore();
-        String backupDir = backupInfo.getBackupConf().getBackupDir();
-        String workingDir = cluster.getWorkingDir().getDir();
-        int backupId = backupInfo.getId();
-        String nodeStore;
-        String pargs;
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        for (Node node : cluster.getNode()) {
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
-            nodeStore = node.getStore() == null ? clusterStore : node.getStore();
-            pargs = workingDir + " " + instance.getName() + " " + iodevices + " " + nodeStore + " "
-                    + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId + " " + backupDir + " " + "local" + " "
-                    + node.getId();
-            Event event = new Event("restore", nodeid, pargs);
-            patternList.add(new Pattern(null, 1, null, event));
-        }
-        return new Patterns(patternList);
-    }
+	public Patterns getLocalRestoreAsterixPattern(AsterixInstance instance,
+			BackupInfo backupInfo) throws Exception {
+		Cluster cluster = instance.getCluster();
+		String clusterStore = instance.getCluster().getStore();
+		String backupDir = backupInfo.getBackupConf().getBackupDir();
+		String workingDir = cluster.getWorkingDir().getDir();
+		int backupId = backupInfo.getId();
+		String nodeStore;
+		String pargs;
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		for (Node node : cluster.getNode()) {
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			String iodevices = node.getIodevices() == null ? cluster
+					.getIodevices() : node.getIodevices();
+			nodeStore = node.getStore() == null ? clusterStore : node
+					.getStore();
+			pargs = workingDir + " " + instance.getName() + " " + iodevices
+					+ " " + nodeStore + " "
+					+ BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + backupId
+					+ " " + backupDir + " " + "local" + " " + node.getId();
+			Event event = new Event("restore", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
+		return new Patterns(patternList);
+	}
 
-    public Patterns createHadoopLibraryTransferPattern(Cluster cluster) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        String workingDir = cluster.getWorkingDir().getDir();
-        String hadoopVersion = InstallerDriver.getConfiguration().getBackup().getHdfs().getVersion();
-        File hadoopDir = new File(InstallerDriver.getManagixHome() + File.separator
-                + InstallerDriver.MANAGIX_INTERNAL_DIR + File.separator + "hadoop-" + hadoopVersion);
-        if (!hadoopDir.exists()) {
-            throw new IllegalStateException("Hadoop version :" + hadoopVersion + " not supported");
-        }
+	public Patterns createHadoopLibraryTransferPattern(Cluster cluster)
+			throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		String workingDir = cluster.getWorkingDir().getDir();
+		String hadoopVersion = InstallerDriver.getConfiguration().getBackup()
+				.getHdfs().getVersion();
+		File hadoopDir = new File(InstallerDriver.getManagixHome()
+				+ File.separator + InstallerDriver.MANAGIX_INTERNAL_DIR
+				+ File.separator + "hadoop-" + hadoopVersion);
+		if (!hadoopDir.exists()) {
+			throw new IllegalStateException("Hadoop version :" + hadoopVersion
+					+ " not supported");
+		}
 
-        Nodeid nodeid = new Nodeid(new Value(null, EventDriver.CLIENT_NODE.getId()));
-        String username = cluster.getUsername() != null ? cluster.getUsername() : System.getProperty("user.name");
-        String pargs = username + " " + hadoopDir.getAbsolutePath() + " " + cluster.getMasterNode().getClusterIp()
-                + " " + workingDir;
-        Event event = new Event("directory_transfer", nodeid, pargs);
-        Pattern p = new Pattern(null, 1, null, event);
-        addInitialDelay(p, 2, "sec");
-        patternList.add(p);
+		Nodeid nodeid = new Nodeid(new Value(null,
+				EventDriver.CLIENT_NODE.getId()));
+		String username = cluster.getUsername() != null ? cluster.getUsername()
+				: System.getProperty("user.name");
+		String pargs = username + " " + hadoopDir.getAbsolutePath() + " "
+				+ cluster.getMasterNode().getClusterIp() + " " + workingDir;
+		Event event = new Event("directory_transfer", nodeid, pargs);
+		Pattern p = new Pattern(null, 1, null, event);
+		addInitialDelay(p, 2, "sec");
+		patternList.add(p);
 
-        boolean copyToNC = !cluster.getWorkingDir().isNFS();
-        if (copyToNC) {
-            for (Node node : cluster.getNode()) {
-                nodeid = new Nodeid(new Value(null, node.getId()));
-                pargs = cluster.getUsername() + " " + hadoopDir.getAbsolutePath() + " " + node.getClusterIp() + " "
-                        + workingDir;
-                event = new Event("directory_transfer", nodeid, pargs);
-                p = new Pattern(null, 1, null, event);
-                addInitialDelay(p, 2, "sec");
-                patternList.add(p);
-            }
-        }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		boolean copyToNC = !cluster.getWorkingDir().isNFS();
+		if (copyToNC) {
+			for (Node node : cluster.getNode()) {
+				nodeid = new Nodeid(new Value(null, node.getId()));
+				pargs = cluster.getUsername() + " "
+						+ hadoopDir.getAbsolutePath() + " "
+						+ node.getClusterIp() + " " + workingDir;
+				event = new Event("directory_transfer", nodeid, pargs);
+				p = new Pattern(null, 1, null, event);
+				addInitialDelay(p, 2, "sec");
+				patternList.add(p);
+			}
+		}
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    public Patterns createDeleteInstancePattern(AsterixInstance instance) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        patternList.addAll(createRemoveAsterixStoragePattern(instance).getPattern());
-        if (instance.getBackupInfo() != null && instance.getBackupInfo().size() > 0) {
-            List<BackupInfo> backups = instance.getBackupInfo();
-            Set<String> removedBackupDirsHDFS = new HashSet<String>();
-            Set<String> removedBackupDirsLocal = new HashSet<String>();
+	public Patterns createDeleteInstancePattern(AsterixInstance instance)
+			throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		patternList.addAll(createRemoveAsterixStoragePattern(instance)
+				.getPattern());
+		if (instance.getBackupInfo() != null
+				&& instance.getBackupInfo().size() > 0) {
+			List<BackupInfo> backups = instance.getBackupInfo();
+			Set<String> removedBackupDirsHDFS = new HashSet<String>();
+			Set<String> removedBackupDirsLocal = new HashSet<String>();
 
-            String backupDir;
-            for (BackupInfo binfo : backups) {
-                backupDir = binfo.getBackupConf().getBackupDir();
-                switch (binfo.getBackupType()) {
-                    case HDFS:
-                        if (removedBackupDirsHDFS.contains(backups)) {
-                            continue;
-                        }
-                        patternList.addAll(createRemoveHDFSBackupPattern(instance, backupDir).getPattern());
-                        removedBackupDirsHDFS.add(backupDir);
-                        break;
+			String backupDir;
+			for (BackupInfo binfo : backups) {
+				backupDir = binfo.getBackupConf().getBackupDir();
+				switch (binfo.getBackupType()) {
+				case HDFS:
+					if (removedBackupDirsHDFS.contains(backups)) {
+						continue;
+					}
+					patternList.addAll(createRemoveHDFSBackupPattern(instance,
+							backupDir).getPattern());
+					removedBackupDirsHDFS.add(backupDir);
+					break;
 
-                    case LOCAL:
-                        if (removedBackupDirsLocal.contains(backups)) {
-                            continue;
-                        }
-                        patternList.addAll(createRemoveLocalBackupPattern(instance, backupDir).getPattern());
-                        removedBackupDirsLocal.add(backupDir);
-                        break;
-                }
+				case LOCAL:
+					if (removedBackupDirsLocal.contains(backups)) {
+						continue;
+					}
+					patternList.addAll(createRemoveLocalBackupPattern(instance,
+							backupDir).getPattern());
+					removedBackupDirsLocal.add(backupDir);
+					break;
+				}
 
-            }
-        }
-        patternList.addAll(createRemoveAsterixLogDirPattern(instance).getPattern());
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+			}
+		}
+		patternList.addAll(createRemoveAsterixLogDirPattern(instance)
+				.getPattern());
+		patternList.addAll(createRemoveAsterixRootMetadata(instance)
+				.getPattern());
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    private Patterns createRemoveHDFSBackupPattern(AsterixInstance instance, String hdfsBackupDir) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        Cluster cluster = instance.getCluster();
-        String hdfsUrl = InstallerDriver.getConfiguration().getBackup().getHdfs().getUrl();
-        String hadoopVersion = InstallerDriver.getConfiguration().getBackup().getHdfs().getVersion();
-        String workingDir = cluster.getWorkingDir().getDir();
-        Node launchingNode = cluster.getNode().get(0);
-        Nodeid nodeid = new Nodeid(new Value(null, launchingNode.getId()));
-        String pathToDelete = hdfsBackupDir + File.separator + instance.getName();
-        String pargs = workingDir + " " + hadoopVersion + " " + hdfsUrl + " " + pathToDelete;
-        Event event = new Event("hdfs_delete", nodeid, pargs);
-        patternList.add(new Pattern(null, 1, null, event));
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+	private Patterns createRemoveHDFSBackupPattern(AsterixInstance instance,
+			String hdfsBackupDir) throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
+		String hdfsUrl = InstallerDriver.getConfiguration().getBackup()
+				.getHdfs().getUrl();
+		String hadoopVersion = InstallerDriver.getConfiguration().getBackup()
+				.getHdfs().getVersion();
+		String workingDir = cluster.getWorkingDir().getDir();
+		Node launchingNode = cluster.getNode().get(0);
+		Nodeid nodeid = new Nodeid(new Value(null, launchingNode.getId()));
+		String pathToDelete = hdfsBackupDir + File.separator
+				+ instance.getName();
+		String pargs = workingDir + " " + hadoopVersion + " " + hdfsUrl + " "
+				+ pathToDelete;
+		Event event = new Event("hdfs_delete", nodeid, pargs);
+		patternList.add(new Pattern(null, 1, null, event));
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    private Patterns createRemoveLocalBackupPattern(AsterixInstance instance, String localBackupDir) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        Cluster cluster = instance.getCluster();
+	private Patterns createRemoveLocalBackupPattern(AsterixInstance instance,
+			String localBackupDir) throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
 
-        String pathToDelete = localBackupDir + File.separator + instance.getName();
-        String pargs = pathToDelete;
-        List<String> removedBackupDirs = new ArrayList<String>();
-        for (Node node : cluster.getNode()) {
-            if (removedBackupDirs.contains(node.getClusterIp())) {
-                continue;
-            }
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            Event event = new Event("file_delete", nodeid, pargs);
-            patternList.add(new Pattern(null, 1, null, event));
-            removedBackupDirs.add(node.getClusterIp());
-        }
+		String pathToDelete = localBackupDir + File.separator
+				+ instance.getName();
+		String pargs = pathToDelete;
+		List<String> removedBackupDirs = new ArrayList<String>();
+		for (Node node : cluster.getNode()) {
+			if (removedBackupDirs.contains(node.getClusterIp())) {
+				continue;
+			}
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			Event event = new Event("file_delete", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+			removedBackupDirs.add(node.getClusterIp());
+		}
 
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    public Patterns createRemoveAsterixWorkingDirPattern(AsterixInstance instance) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        Cluster cluster = instance.getCluster();
-        String workingDir = cluster.getWorkingDir().getDir();
-        String pargs = workingDir;
-        Nodeid nodeid = new Nodeid(new Value(null, cluster.getMasterNode().getId()));
-        Event event = new Event("file_delete", nodeid, pargs);
-        patternList.add(new Pattern(null, 1, null, event));
+	public Patterns createRemoveAsterixWorkingDirPattern(
+			AsterixInstance instance) throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
+		String workingDir = cluster.getWorkingDir().getDir();
+		String pargs = workingDir;
+		Nodeid nodeid = new Nodeid(new Value(null, cluster.getMasterNode()
+				.getId()));
+		Event event = new Event("file_delete", nodeid, pargs);
+		patternList.add(new Pattern(null, 1, null, event));
 
-        if (!cluster.getWorkingDir().isNFS()) {
-            for (Node node : cluster.getNode()) {
-                nodeid = new Nodeid(new Value(null, node.getId()));
-                event = new Event("file_delete", nodeid, pargs);
-                patternList.add(new Pattern(null, 1, null, event));
-            }
-        }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		if (!cluster.getWorkingDir().isNFS()) {
+			for (Node node : cluster.getNode()) {
+				nodeid = new Nodeid(new Value(null, node.getId()));
+				event = new Event("file_delete", nodeid, pargs);
+				patternList.add(new Pattern(null, 1, null, event));
+			}
+		}
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    private Patterns createRemoveAsterixLogDirPattern(AsterixInstance instance) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        Cluster cluster = instance.getCluster();
-        String pargs = instance.getCluster().getLogdir();
-        Nodeid nodeid = new Nodeid(new Value(null, cluster.getMasterNode().getId()));
-        Event event = new Event("file_delete", nodeid, pargs);
-        patternList.add(new Pattern(null, 1, null, event));
+	private Patterns createRemoveAsterixRootMetadata(AsterixInstance instance)
+			throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
+		Nodeid nodeid = null;
+		String pargs = null;
+		Event event = null;
+		for (Node node : cluster.getNode()) {
+			String iodevices = node.getIodevices() == null ? cluster
+					.getIodevices() : node.getIodevices();
+			String primaryIODevice = iodevices.split(",")[0].trim();
+			pargs = primaryIODevice + File.separator
+					+ BackupCommand.ASTERIX_ROOT_METADATA_DIR;
+			nodeid = new Nodeid(new Value(null, node.getId()));
+			event = new Event("file_delete", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
 
-        if (!cluster.getWorkingDir().isNFS()) {
-            for (Node node : cluster.getNode()) {
-                nodeid = new Nodeid(new Value(null, node.getId()));
-                event = new Event("file_delete", nodeid, pargs);
-                patternList.add(new Pattern(null, 1, null, event));
-            }
-        }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    private Patterns createRemoveAsterixStoragePattern(AsterixInstance instance) throws Exception {
-        List<Pattern> patternList = new ArrayList<Pattern>();
-        Cluster cluster = instance.getCluster();
-        String pargs = null;
+	private Patterns createRemoveAsterixLogDirPattern(AsterixInstance instance)
+			throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
+		String pargs = instance.getCluster().getLogdir();
+		Nodeid nodeid = new Nodeid(new Value(null, cluster.getMasterNode()
+				.getId()));
+		Event event = new Event("file_delete", nodeid, pargs);
+		patternList.add(new Pattern(null, 1, null, event));
 
-        for (Node node : cluster.getNode()) {
-            Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
-            String[] nodeIODevices;
-            String iodevices = node.getIodevices() == null ? cluster.getIodevices() : node.getIodevices();
-            nodeIODevices = iodevices.trim().split(",");
-            for (String nodeIODevice : nodeIODevices) {
-                String nodeStore = node.getStore() == null ? cluster.getStore() : node.getStore();
-                pargs = nodeIODevice.trim() + File.separator + nodeStore;
-                Event event = new Event("file_delete", nodeid, pargs);
-                patternList.add(new Pattern(null, 1, null, event));
-            }
-        }
-        Patterns patterns = new Patterns(patternList);
-        return patterns;
-    }
+		for (Node node : cluster.getNode()) {
+			nodeid = new Nodeid(new Value(null, node.getId()));
+			event = new Event("file_delete", nodeid, pargs);
+			patternList.add(new Pattern(null, 1, null, event));
+		}
 
-    private Pattern createCopyHyracksPattern(String instanceName, Cluster cluster, String destinationIp, String destDir) {
-        Nodeid nodeid = new Nodeid(new Value(null, EventDriver.CLIENT_NODE.getId()));
-        String username = cluster.getUsername() != null ? cluster.getUsername() : System.getProperty("user.name");
-        String asterixZipName = InstallerDriver.getAsterixZip().substring(
-                InstallerDriver.getAsterixZip().lastIndexOf(File.separator) + 1);
-        String fileToTransfer = new File(InstallerDriver.getAsterixDir() + File.separator + instanceName
-                + File.separator + asterixZipName).getAbsolutePath();
-        String pargs = username + " " + fileToTransfer + " " + destinationIp + " " + destDir + " " + "unpack";
-        Event event = new Event("file_transfer", nodeid, pargs);
-        return new Pattern(null, 1, null, event);
-    }
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    private Pattern createCCStartPattern(String hostId) {
-        Nodeid nodeid = new Nodeid(new Value(null, hostId));
-        Event event = new Event("cc_start", nodeid, "");
-        return new Pattern(null, 1, null, event);
-    }
+	private Patterns createRemoveAsterixStoragePattern(AsterixInstance instance)
+			throws Exception {
+		List<Pattern> patternList = new ArrayList<Pattern>();
+		Cluster cluster = instance.getCluster();
+		String pargs = null;
 
-    public Pattern createCCStopPattern(String hostId) {
-        Nodeid nodeid = new Nodeid(new Value(null, hostId));
-        Event event = new Event("cc_failure", nodeid, null);
-        return new Pattern(null, 1, null, event);
-    }
+		for (Node node : cluster.getNode()) {
+			Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+			String[] nodeIODevices;
+			String iodevices = node.getIodevices() == null ? cluster
+					.getIodevices() : node.getIodevices();
+			nodeIODevices = iodevices.trim().split(",");
+			for (String nodeIODevice : nodeIODevices) {
+				String nodeStore = node.getStore() == null ? cluster.getStore()
+						: node.getStore();
+				pargs = nodeIODevice.trim() + File.separator + nodeStore;
+				Event event = new Event("file_delete", nodeid, pargs);
+				patternList.add(new Pattern(null, 1, null, event));
+			}
+		}
+		Patterns patterns = new Patterns(patternList);
+		return patterns;
+	}
 
-    public Pattern createNCStartPattern(String ccHost, String hostId, String nodeControllerId, String iodevices) {
-        Nodeid nodeid = new Nodeid(new Value(null, hostId));
-        String pargs = ccHost + " " + nodeControllerId + " " + iodevices;
-        Event event = new Event("node_join", nodeid, pargs);
-        return new Pattern(null, 1, null, event);
-    }
+	private Pattern createCopyHyracksPattern(String instanceName,
+			Cluster cluster, String destinationIp, String destDir) {
+		Nodeid nodeid = new Nodeid(new Value(null,
+				EventDriver.CLIENT_NODE.getId()));
+		String username = cluster.getUsername() != null ? cluster.getUsername()
+				: System.getProperty("user.name");
+		String asterixZipName = InstallerDriver.getAsterixZip()
+				.substring(
+						InstallerDriver.getAsterixZip().lastIndexOf(
+								File.separator) + 1);
+		String fileToTransfer = new File(InstallerDriver.getAsterixDir()
+				+ File.separator + instanceName + File.separator
+				+ asterixZipName).getAbsolutePath();
+		String pargs = username + " " + fileToTransfer + " " + destinationIp
+				+ " " + destDir + " " + "unpack";
+		Event event = new Event("file_transfer", nodeid, pargs);
+		return new Pattern(null, 1, null, event);
+	}
 
-    public Pattern createNCStopPattern(String hostId, String nodeControllerId) {
-        Nodeid nodeid = new Nodeid(new Value(null, hostId));
-        Event event = new Event("node_failure", nodeid, nodeControllerId);
-        return new Pattern(null, 1, null, event);
-    }
+	private Pattern createCCStartPattern(String hostId) {
+		Nodeid nodeid = new Nodeid(new Value(null, hostId));
+		Event event = new Event("cc_start", nodeid, "");
+		return new Pattern(null, 1, null, event);
+	}
+
+	public Pattern createCCStopPattern(String hostId) {
+		Nodeid nodeid = new Nodeid(new Value(null, hostId));
+		Event event = new Event("cc_failure", nodeid, null);
+		return new Pattern(null, 1, null, event);
+	}
+
+	public Pattern createNCStartPattern(String ccHost, String hostId,
+			String nodeControllerId, String iodevices) {
+		Nodeid nodeid = new Nodeid(new Value(null, hostId));
+		String pargs = ccHost + " " + nodeControllerId + " " + iodevices;
+		Event event = new Event("node_join", nodeid, pargs);
+		return new Pattern(null, 1, null, event);
+	}
+
+	public Pattern createNCStopPattern(String hostId, String nodeControllerId) {
+		Nodeid nodeid = new Nodeid(new Value(null, hostId));
+		Event event = new Event("node_failure", nodeid, nodeControllerId);
+		return new Pattern(null, 1, null, event);
+	}
 
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
index de1dcb3..9f8b28d 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
@@ -25,158 +25,159 @@
 
 public class AsterixInstance implements Serializable {
 
-    private static final long serialVersionUID = 2874439550187520449L;
+	private static final long serialVersionUID = 2874439550187520449L;
 
-    public enum State {
-        ACTIVE,
-        INACTIVE,
-        UNUSABLE
-    }
+	public enum State {
+		ACTIVE, INACTIVE, UNUSABLE
+	}
 
-    private final Cluster cluster;
-    private final String name;
-    private final Date createdTimestamp;
-    private Date stateChangeTimestamp;
-    private Date modifiedTimestamp;
-    private Properties configuration;
-    private State state;
-    private final String metadataNodeId;
-    private final String asterixVersion;
-    private final List<BackupInfo> backupInfo;
-    private final String webInterfaceUrl;
-    private AsterixRuntimeState runtimeState;
-    private State previousState;
+	private final Cluster cluster;
+	private final String name;
+	private final Date createdTimestamp;
+	private Date stateChangeTimestamp;
+	private Date modifiedTimestamp;
+	private Properties configuration;
+	private State state;
+	private final String metadataNodeId;
+	private final String asterixVersion;
+	private final List<BackupInfo> backupInfo;
+	private final String webInterfaceUrl;
+	private AsterixRuntimeState runtimeState;
+	private State previousState;
 
-    public AsterixInstance(String name, Cluster cluster, Properties configuration, String metadataNodeId,
-            String asterixVersion) {
-        this.name = name;
-        this.cluster = cluster;
-        this.configuration = configuration;
-        this.metadataNodeId = metadataNodeId;
-        this.state = State.ACTIVE;
-        this.previousState = State.UNUSABLE;
-        this.asterixVersion = asterixVersion;
-        this.createdTimestamp = new Date();
-        this.backupInfo = new ArrayList<BackupInfo>();
-        this.webInterfaceUrl = "http://" + cluster.getMasterNode().getClusterIp() + ":" + 19001;
-    }
+	public AsterixInstance(String name, Cluster cluster,
+			Properties configuration, String metadataNodeId,
+			String asterixVersion) {
+		this.name = name;
+		this.cluster = cluster;
+		this.configuration = configuration;
+		this.metadataNodeId = metadataNodeId;
+		this.state = State.ACTIVE;
+		this.previousState = State.UNUSABLE;
+		this.asterixVersion = asterixVersion;
+		this.createdTimestamp = new Date();
+		this.backupInfo = new ArrayList<BackupInfo>();
+		this.webInterfaceUrl = "http://"
+				+ cluster.getMasterNode().getClusterIp() + ":" + 19001;
+	}
 
-    public Date getModifiedTimestamp() {
-        return stateChangeTimestamp;
-    }
+	public Date getModifiedTimestamp() {
+		return stateChangeTimestamp;
+	}
 
-    public Properties getConfiguration() {
-        return configuration;
-    }
+	public Properties getConfiguration() {
+		return configuration;
+	}
 
-    public void setConfiguration(Properties properties) {
-        this.configuration = properties;
-    }
+	public void setConfiguration(Properties properties) {
+		this.configuration = properties;
+	}
 
-    public State getState() {
-        return state;
-    }
+	public State getState() {
+		return state;
+	}
 
-    public void setState(State state) {
-        this.previousState = this.state;
-        this.state = state;
-    }
+	public void setState(State state) {
+		this.previousState = this.state;
+		this.state = state;
+	}
 
-    public Cluster getCluster() {
-        return cluster;
-    }
+	public Cluster getCluster() {
+		return cluster;
+	}
 
-    public String getName() {
-        return name;
-    }
+	public String getName() {
+		return name;
+	}
 
-    public Date getCreatedTimestamp() {
-        return createdTimestamp;
-    }
+	public Date getCreatedTimestamp() {
+		return createdTimestamp;
+	}
 
-    public Date getStateChangeTimestamp() {
-        return stateChangeTimestamp;
-    }
+	public Date getStateChangeTimestamp() {
+		return stateChangeTimestamp;
+	}
 
-    public void setStateChangeTimestamp(Date stateChangeTimestamp) {
-        this.stateChangeTimestamp = stateChangeTimestamp;
-    }
+	public void setStateChangeTimestamp(Date stateChangeTimestamp) {
+		this.stateChangeTimestamp = stateChangeTimestamp;
+	}
 
-    public void setModifiedTimestamp(Date modifiedTimestamp) {
-        this.modifiedTimestamp = modifiedTimestamp;
-    }
+	public void setModifiedTimestamp(Date modifiedTimestamp) {
+		this.modifiedTimestamp = modifiedTimestamp;
+	}
 
-    public String getMetadataNodeId() {
-        return metadataNodeId;
-    }
+	public String getMetadataNodeId() {
+		return metadataNodeId;
+	}
 
-    public String getAsterixVersion() {
-        return asterixVersion;
-    }
+	public String getAsterixVersion() {
+		return asterixVersion;
+	}
 
-    public String getDescription(boolean detailed) {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("Name:" + name + "\n");
-        buffer.append("Created:" + createdTimestamp + "\n");
-        buffer.append("Web-Url:" + webInterfaceUrl + "\n");
-        buffer.append("State:" + state);
-        if (!state.equals(State.UNUSABLE) && stateChangeTimestamp != null) {
-            buffer.append(" (" + stateChangeTimestamp + ")" + "\n");
-        } else {
-            buffer.append("\n");
-        }
-        if (modifiedTimestamp != null) {
-            buffer.append("Last modified timestamp:" + modifiedTimestamp + "\n");
-        }
+	public String getDescription(boolean detailed) {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("Name:" + name + "\n");
+		buffer.append("Created:" + createdTimestamp + "\n");
+		buffer.append("Web-Url:" + webInterfaceUrl + "\n");
+		buffer.append("State:" + state);
+		if (!state.equals(State.UNUSABLE) && stateChangeTimestamp != null) {
+			buffer.append(" (" + stateChangeTimestamp + ")" + "\n");
+		} else {
+			buffer.append("\n");
+		}
+		if (modifiedTimestamp != null) {
+			buffer.append("Last modified timestamp:" + modifiedTimestamp + "\n");
+		}
 
-        if (runtimeState.getSummary() != null && runtimeState.getSummary().length() > 0) {
-            buffer.append("\nWARNING!:" + runtimeState.getSummary() + "\n");
-        }
-        if (detailed) {
-            addDetailedInformation(buffer);
-        }
-        return buffer.toString();
-    }
+		if (runtimeState.getSummary() != null
+				&& runtimeState.getSummary().length() > 0) {
+			buffer.append("\nWARNING!:" + runtimeState.getSummary() + "\n");
+		}
+		if (detailed) {
+			addDetailedInformation(buffer);
+		}
+		return buffer.toString();
+	}
 
-    public List<BackupInfo> getBackupInfo() {
-        return backupInfo;
-    }
+	public List<BackupInfo> getBackupInfo() {
+		return backupInfo;
+	}
 
-    public String getWebInterfaceUrl() {
-        return webInterfaceUrl;
-    }
+	public String getWebInterfaceUrl() {
+		return webInterfaceUrl;
+	}
 
-    public AsterixRuntimeState getAsterixRuntimeState() {
-        return runtimeState;
-    }
+	public AsterixRuntimeState getAsterixRuntimeState() {
+		return runtimeState;
+	}
 
-    public void setAsterixRuntimeStates(AsterixRuntimeState runtimeState) {
-        this.runtimeState = runtimeState;
-    }
+	public void setAsterixRuntimeStates(AsterixRuntimeState runtimeState) {
+		this.runtimeState = runtimeState;
+	}
 
-    private void addDetailedInformation(StringBuffer buffer) {
-        buffer.append("Master node:" + cluster.getMasterNode().getId() + ":" + cluster.getMasterNode().getClusterIp()
-                + "\n");
-        for (Node node : cluster.getNode()) {
-            buffer.append(node.getId() + ":" + node.getClusterIp() + "\n");
-        }
+	private void addDetailedInformation(StringBuffer buffer) {
+		buffer.append("Master node:" + cluster.getMasterNode().getId() + ":"
+				+ cluster.getMasterNode().getClusterIp() + "\n");
+		for (Node node : cluster.getNode()) {
+			buffer.append(node.getId() + ":" + node.getClusterIp() + "\n");
+		}
 
-        if (backupInfo != null && backupInfo.size() > 0) {
-            for (BackupInfo info : backupInfo) {
-                buffer.append(info + "\n");
-            }
-        }
-        buffer.append("\n");
-        buffer.append("Asterix version:" + asterixVersion + "\n");
-        buffer.append("Metadata Node:" + metadataNodeId + "\n");
-        buffer.append("Processes" + "\n");
-        for (ProcessInfo pInfo : runtimeState.getProcesses()) {
-            buffer.append(pInfo + "\n");
-        }
+		if (backupInfo != null && backupInfo.size() > 0) {
+			for (BackupInfo info : backupInfo) {
+				buffer.append(info + "\n");
+			}
+		}
+		buffer.append("\n");
+		buffer.append("Asterix version:" + asterixVersion + "\n");
+		buffer.append("Metadata Node:" + metadataNodeId + "\n");
+		buffer.append("Processes" + "\n");
+		for (ProcessInfo pInfo : runtimeState.getProcesses()) {
+			buffer.append(pInfo + "\n");
+		}
 
-    }
+	}
 
-    public State getPreviousState() {
-        return previousState;
-    }
+	public State getPreviousState() {
+		return previousState;
+	}
 }
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
index 1bba863..938dfc4 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
@@ -24,6 +24,7 @@
 import java.util.logging.Logger;
 
 import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
+import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
 import edu.uci.ics.asterix.common.config.GlobalConfig;
 import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
 import edu.uci.ics.asterix.common.context.TransactionSubsystemProvider;
@@ -106,6 +107,8 @@
 import edu.uci.ics.hyracks.api.dataset.ResultSetId;
 import edu.uci.ics.hyracks.api.io.FileReference;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
+import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
+import edu.uci.ics.hyracks.data.std.primitive.ShortPointable;
 import edu.uci.ics.hyracks.dataflow.std.file.ConstantFileSplitProvider;
 import edu.uci.ics.hyracks.dataflow.std.file.FileScanOperatorDescriptor;
 import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
@@ -123,6 +126,9 @@
 import edu.uci.ics.hyracks.storage.am.common.tuples.TypeAwareTupleWriterFactory;
 import edu.uci.ics.hyracks.storage.am.lsm.btree.dataflow.LSMBTreeDataflowHelperFactory;
 import edu.uci.ics.hyracks.storage.am.lsm.common.dataflow.LSMTreeIndexInsertUpdateDeleteOperatorDescriptor;
+import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.dataflow.LSMInvertedIndexDataflowHelperFactory;
+import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.dataflow.LSMInvertedIndexInsertUpdateDeleteOperator;
+import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
 import edu.uci.ics.hyracks.storage.am.lsm.rtree.dataflow.LSMRTreeDataflowHelperFactory;
 import edu.uci.ics.hyracks.storage.am.rtree.dataflow.RTreeSearchOperatorDescriptor;
 import edu.uci.ics.hyracks.storage.am.rtree.frames.RTreePolicyType;
@@ -888,6 +894,14 @@
                 return getRTreeDmlRuntime(dataverseName, datasetName, indexName, propagatedSchema, typeEnv,
                         primaryKeys, secondaryKeys, filterFactory, recordDesc, context, spec, indexOp);
             }
+            case WORD_INVIX:
+            case NGRAM_INVIX:
+            case FUZZY_WORD_INVIX:
+            case FUZZY_NGRAM_INVIX: {
+                return getInvertedIndexDmlRuntime(dataverseName, datasetName, indexName, propagatedSchema, typeEnv,
+                        primaryKeys, secondaryKeys, filterFactory, recordDesc, context, spec, indexOp,
+                        secondaryIndex.getIndexType());
+            }
             default: {
                 throw new AlgebricksException("Insert and delete not implemented for index type: "
                         + secondaryIndex.getIndexType());
@@ -1028,6 +1042,132 @@
         }
     }
 
+    private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getInvertedIndexDmlRuntime(String dataverseName,
+            String datasetName, String indexName, IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv,
+            List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys,
+            AsterixTupleFilterFactory filterFactory, RecordDescriptor recordDesc, JobGenContext context,
+            JobSpecification spec, IndexOperation indexOp, IndexType indexType) throws AlgebricksException {
+
+        // Sanity checks.
+        if (primaryKeys.size() > 1) {
+            throw new AlgebricksException("Cannot create inverted index on dataset with composite primary key.");
+        }
+        if (secondaryKeys.size() > 1) {
+            throw new AlgebricksException("Cannot create composite inverted index on multiple fields.");
+        }
+
+        int numKeys = primaryKeys.size() + secondaryKeys.size();
+        // generate field permutations
+        int[] fieldPermutation = new int[numKeys];
+        int i = 0;
+        for (LogicalVariable varKey : secondaryKeys) {
+            int idx = propagatedSchema.findVariable(varKey);
+            fieldPermutation[i] = idx;
+            i++;
+        }
+        for (LogicalVariable varKey : primaryKeys) {
+            int idx = propagatedSchema.findVariable(varKey);
+            fieldPermutation[i] = idx;
+            i++;
+        }
+
+        boolean isPartitioned;
+        if (indexType == IndexType.FUZZY_WORD_INVIX || indexType == IndexType.FUZZY_NGRAM_INVIX) {
+            isPartitioned = true;
+        } else {
+            isPartitioned = false;
+        }
+
+        Dataset dataset = findDataset(dataverseName, datasetName);
+        if (dataset == null) {
+            throw new AlgebricksException("Unknown dataset " + datasetName + " in dataverse " + dataverseName);
+        }
+        String itemTypeName = dataset.getItemTypeName();
+        IAType itemType;
+        try {
+            itemType = MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataset.getDataverseName(), itemTypeName)
+                    .getDatatype();
+
+            if (itemType.getTypeTag() != ATypeTag.RECORD) {
+                throw new AlgebricksException("Only record types can be indexed.");
+            }
+
+            ARecordType recType = (ARecordType) itemType;
+
+            // Index parameters.
+            Index secondaryIndex = MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+                    dataset.getDatasetName(), indexName);
+
+            List<String> secondaryKeyExprs = secondaryIndex.getKeyFieldNames();
+
+            int numTokenFields = (!isPartitioned) ? secondaryKeys.size() : secondaryKeys.size() + 1;
+            ITypeTraits[] tokenTypeTraits = new ITypeTraits[numTokenFields];
+            ITypeTraits[] invListsTypeTraits = new ITypeTraits[primaryKeys.size()];
+            IBinaryComparatorFactory[] tokenComparatorFactories = new IBinaryComparatorFactory[numTokenFields];
+            IBinaryComparatorFactory[] invListComparatorFactories = new IBinaryComparatorFactory[primaryKeys.size()];
+
+            IAType secondaryKeyType = null;
+            for (i = 0; i < secondaryKeys.size(); ++i) {
+                Pair<IAType, Boolean> keyPairType = Index.getNonNullableKeyFieldType(secondaryKeyExprs.get(i)
+                        .toString(), recType);
+                secondaryKeyType = keyPairType.first;
+            }
+            List<String> partitioningKeys = DatasetUtils.getPartitioningKeys(dataset);
+            i = 0;
+            for (String partitioningKey : partitioningKeys) {
+                IAType keyType = recType.getFieldType(partitioningKey);
+                invListsTypeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(keyType);
+                ++i;
+            }
+
+            tokenComparatorFactories[0] = NonTaggedFormatUtil.getTokenBinaryComparatorFactory(secondaryKeyType);
+            tokenTypeTraits[0] = NonTaggedFormatUtil.getTokenTypeTrait(secondaryKeyType);
+            if (isPartitioned) {
+                // The partitioning field is hardcoded to be a short *without* an Asterix type tag.
+                tokenComparatorFactories[1] = PointableBinaryComparatorFactory.of(ShortPointable.FACTORY);
+                tokenTypeTraits[1] = ShortPointable.TYPE_TRAITS;
+            }
+            IBinaryTokenizerFactory tokenizerFactory = NonTaggedFormatUtil.getBinaryTokenizerFactory(
+                    secondaryKeyType.getTypeTag(), indexType, secondaryIndex.getGramLength());
+
+            IAsterixApplicationContextInfo appContext = (IAsterixApplicationContextInfo) context.getAppContext();
+            Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = splitProviderAndPartitionConstraintsForInternalOrFeedDataset(
+                    dataverseName, datasetName, indexName);
+
+            //prepare callback
+            JobId jobId = ((JobEventListenerFactory) spec.getJobletEventListenerFactory()).getJobId();
+            int datasetId = dataset.getDatasetId();
+            int[] primaryKeyFields = new int[primaryKeys.size()];
+            i = 0;
+            for (LogicalVariable varKey : primaryKeys) {
+                int idx = propagatedSchema.findVariable(varKey);
+                primaryKeyFields[i] = idx;
+                i++;
+            }
+            TransactionSubsystemProvider txnSubsystemProvider = new TransactionSubsystemProvider();
+            SecondaryIndexModificationOperationCallbackFactory modificationCallbackFactory = new SecondaryIndexModificationOperationCallbackFactory(
+                    jobId, datasetId, primaryKeyFields, txnSubsystemProvider, indexOp, ResourceType.LSM_INVERTED_INDEX);
+
+            LSMInvertedIndexInsertUpdateDeleteOperator insertDeleteOp = new LSMInvertedIndexInsertUpdateDeleteOperator(
+                    spec, recordDesc, appContext.getStorageManagerInterface(), splitsAndConstraint.first,
+                    appContext.getIndexLifecycleManagerProvider(), tokenTypeTraits, tokenComparatorFactories,
+                    invListsTypeTraits, invListComparatorFactories, tokenizerFactory, fieldPermutation, indexOp,
+                    new LSMInvertedIndexDataflowHelperFactory(
+                            AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
+                            AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
+                            AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
+                            AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
+                            GlobalConfig.DEFAULT_INDEX_MEM_PAGE_SIZE, GlobalConfig.DEFAULT_INDEX_MEM_NUM_PAGES),
+                    filterFactory, modificationCallbackFactory);
+            return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(insertDeleteOp,
+                    splitsAndConstraint.second);
+        } catch (MetadataException e) {
+            throw new AlgebricksException(e);
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+
     private Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getRTreeDmlRuntime(String dataverseName,
             String datasetName, String indexName, IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv,
             List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys,
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
index a8c0485..047c459 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
@@ -2,18 +2,29 @@
 
 import java.util.List;
 
+import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
+import edu.uci.ics.asterix.formats.nontagged.AqlBinaryTokenizerFactoryProvider;
+import edu.uci.ics.asterix.formats.nontagged.AqlTypeTraitProvider;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.ATypeTag;
 import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.AbstractCollectionType;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.EnumDeserializer;
 import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
+import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
 
 public final class NonTaggedFormatUtil {
 
@@ -160,4 +171,58 @@
                 throw new NotImplementedException(typeTag + " is not a supported spatial data type.");
         }
     }
+
+    public static IBinaryTokenizerFactory getBinaryTokenizerFactory(ATypeTag keyType, IndexType indexType,
+            int gramLength) throws AlgebricksException {
+        switch (indexType) {
+            case WORD_INVIX:
+            case FUZZY_WORD_INVIX: {
+                return AqlBinaryTokenizerFactoryProvider.INSTANCE.getWordTokenizerFactory(keyType, false);
+            }
+            case NGRAM_INVIX:
+            case FUZZY_NGRAM_INVIX: {
+                return AqlBinaryTokenizerFactoryProvider.INSTANCE.getNGramTokenizerFactory(keyType, gramLength, true,
+                        false);
+            }
+            default: {
+                throw new AlgebricksException("Tokenizer not applicable to index type '" + indexType + "'.");
+            }
+        }
+    }
+
+    public static IBinaryComparatorFactory getTokenBinaryComparatorFactory(IAType keyType) throws AlgebricksException {
+        IAType type = keyType;
+        ATypeTag typeTag = keyType.getTypeTag();
+        // Extract item type from list.
+        if (typeTag == ATypeTag.UNORDEREDLIST || typeTag == ATypeTag.ORDEREDLIST) {
+            AbstractCollectionType listType = (AbstractCollectionType) keyType;
+            if (!listType.isTyped()) {
+                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
+            }
+            type = listType.getItemType();
+        }
+        // Ignore case for string types.
+        return AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(type, true, true);
+    }
+
+    public static ITypeTraits getTokenTypeTrait(IAType keyType) throws AlgebricksException {
+        IAType type = keyType;
+        ATypeTag typeTag = keyType.getTypeTag();
+        // Extract item type from list.
+        if (typeTag == ATypeTag.UNORDEREDLIST) {
+            AUnorderedListType ulistType = (AUnorderedListType) keyType;
+            if (!ulistType.isTyped()) {
+                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
+            }
+            type = ulistType.getItemType();
+        }
+        if (typeTag == ATypeTag.ORDEREDLIST) {
+            AOrderedListType olistType = (AOrderedListType) keyType;
+            if (!olistType.isTyped()) {
+                throw new AlgebricksException("Cannot build an inverted index on untyped lists.)");
+            }
+            type = olistType.getItemType();
+        }
+        return AqlTypeTraitProvider.INSTANCE.getTypeTrait(type);
+    }
 }