diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 6bb6f35..4d71715 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -459,26 +459,13 @@
     }
 
     protected void handleCreateDataverseStatement(MetadataProvider metadataProvider, Statement stmt) throws Exception {
-
         CreateDataverseStatement stmtCreateDataverse = (CreateDataverseStatement) stmt;
         String dvName = stmtCreateDataverse.getDataverseName().getValue();
         MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
         metadataProvider.setMetadataTxnContext(mdTxnCtx);
-
         lockManager.acquireDataverseReadLock(metadataProvider.getLocks(), dvName);
         try {
-            Dataverse dv = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(), dvName);
-            if (dv != null) {
-                if (stmtCreateDataverse.getIfNotExists()) {
-                    MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
-                    return;
-                } else {
-                    throw new CompilationException(ErrorCode.DATAVERSE_EXISTS, stmt.getSourceLocation(), dvName);
-                }
-            }
-            MetadataManager.INSTANCE.addDataverse(metadataProvider.getMetadataTxnContext(),
-                    new Dataverse(dvName, stmtCreateDataverse.getFormat(), MetadataUtil.PENDING_NO_OP));
-            MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+            doCreateDataverseStatement(mdTxnCtx, metadataProvider, stmtCreateDataverse);
         } catch (Exception e) {
             abort(e, e, mdTxnCtx);
             throw e;
@@ -487,6 +474,26 @@
         }
     }
 
+    @SuppressWarnings("squid:S00112")
+    protected boolean doCreateDataverseStatement(MetadataTransactionContext mdTxnCtx, MetadataProvider metadataProvider,
+            CreateDataverseStatement stmtCreateDataverse) throws Exception {
+        String dvName = stmtCreateDataverse.getDataverseName().getValue();
+        Dataverse dv = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(), dvName);
+        if (dv != null) {
+            if (stmtCreateDataverse.getIfNotExists()) {
+                MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+                return false;
+            } else {
+                throw new CompilationException(ErrorCode.DATAVERSE_EXISTS, stmtCreateDataverse.getSourceLocation(),
+                        dvName);
+            }
+        }
+        MetadataManager.INSTANCE.addDataverse(metadataProvider.getMetadataTxnContext(),
+                new Dataverse(dvName, stmtCreateDataverse.getFormat(), MetadataUtil.PENDING_NO_OP));
+        MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+        return true;
+    }
+
     protected static void validateCompactionPolicy(String compactionPolicy,
             Map<String, String> compactionPolicyProperties, MetadataTransactionContext mdTxnCtx,
             boolean isExternalDataset, SourceLocation sourceLoc) throws CompilationException, Exception {
@@ -1220,19 +1227,29 @@
             throw new CompilationException(ErrorCode.COMPILATION_ERROR, sourceLoc,
                     MetadataBuiltinEntities.DEFAULT_DATAVERSE_NAME + " dataverse can't be dropped");
         }
+        lockManager.acquireDataverseWriteLock(metadataProvider.getLocks(), dataverseName);
+        try {
+            doDropDataverse(stmtDelete, sourceLoc, metadataProvider, hcc);
+        } finally {
+            metadataProvider.getLocks().unlock();
+            ExternalDatasetsRegistry.INSTANCE.releaseAcquiredLocks(metadataProvider);
+        }
+    }
 
+    protected boolean doDropDataverse(DataverseDropStatement stmtDelete, SourceLocation sourceLoc,
+            MetadataProvider metadataProvider, IHyracksClientConnection hcc) throws Exception {
+        String dataverseName = stmtDelete.getDataverseName().getValue();
         ProgressState progress = ProgressState.NO_PROGRESS;
         MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
         boolean bActiveTxn = true;
         metadataProvider.setMetadataTxnContext(mdTxnCtx);
         List<JobSpecification> jobsToExecute = new ArrayList<>();
-        lockManager.acquireDataverseWriteLock(metadataProvider.getLocks(), dataverseName);
         try {
             Dataverse dv = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
             if (dv == null) {
                 if (stmtDelete.getIfExists()) {
                     MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
-                    return;
+                    return false;
                 } else {
                     throw new CompilationException(ErrorCode.UNKNOWN_DATAVERSE, sourceLoc, dataverseName);
                 }
@@ -1336,6 +1353,7 @@
                 activeDataverse = null;
             }
             MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+            return true;
         } catch (Exception e) {
             if (bActiveTxn) {
                 abort(e, e, mdTxnCtx);
@@ -1369,11 +1387,7 @@
                             + ") couldn't be removed from the metadata", e);
                 }
             }
-
             throw e;
-        } finally {
-            metadataProvider.getLocks().unlock();
-            ExternalDatasetsRegistry.INSTANCE.releaseAcquiredLocks(metadataProvider);
         }
     }
 
@@ -2871,7 +2885,7 @@
 
     @Override
     public String getActiveDataverseName(String dataverse) {
-        return (dataverse != null) ? dataverse : activeDataverse.getDataverseName();
+        return (dataverse != null && !dataverse.isEmpty()) ? dataverse : activeDataverse.getDataverseName();
     }
 
     @Override
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 447f851..d919d0e 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -168,6 +168,9 @@
     public static final int TYPE_EXISTS = 1085;
     public static final int PARAMETER_NO_VALUE = 1086;
     public static final int COMPILATION_INVALID_NUM_OF_ARGS = 1087;
+    public static final int FIELD_NOT_FOUND = 1088;
+    public static final int FIELD_NOT_OF_TYPE = 1089;
+    public static final int ARRAY_FIELD_ELEMENTS_MUST_BE_OF_TYPE = 1090;
 
     // Feed errors
     public static final int DATAFLOW_ILLEGAL_STATE = 3001;
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 720ff57..ac51570 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -155,6 +155,9 @@
 1085 = A datatype with this name %1$s already exists
 1086 = No value for parameter: %1$s
 1087 = Invalid number of arguments: at least %1$d arguments are required for function %2$s
+1088 = Required field %1$s was not found
+1089 = Field %1$s must be of type %2$s but found to be of type %3$s
+1090 = Field %1$s must be of an array of type %2$s but found to contain an item of type %3$s
 
 # Feed Errors
 3001 = Illegal state.
diff --git a/asterixdb/asterix-lang-common/pom.xml b/asterixdb/asterix-lang-common/pom.xml
index b20bd58..96123d0 100644
--- a/asterixdb/asterix-lang-common/pom.xml
+++ b/asterixdb/asterix-lang-common/pom.xml
@@ -103,10 +103,5 @@
       <groupId>org.apache.hyracks</groupId>
       <artifactId>hyracks-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.hyracks</groupId>
-      <artifactId>hyracks-data-std</artifactId>
-    </dependency>
   </dependencies>
-
 </project>
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
index 8367fa0..c358444 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/LangRecordParseUtil.java
@@ -23,66 +23,53 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
-import org.apache.asterix.builders.OrderedListBuilder;
-import org.apache.asterix.builders.RecordBuilder;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.exceptions.ErrorCode;
-import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.Literal;
 import org.apache.asterix.lang.common.expression.FieldBinding;
 import org.apache.asterix.lang.common.expression.ListConstructor;
 import org.apache.asterix.lang.common.expression.LiteralExpr;
 import org.apache.asterix.lang.common.expression.RecordConstructor;
+import org.apache.asterix.object.base.AdmArrayNode;
+import org.apache.asterix.object.base.AdmBigIntNode;
+import org.apache.asterix.object.base.AdmBooleanNode;
+import org.apache.asterix.object.base.AdmDoubleNode;
+import org.apache.asterix.object.base.AdmNullNode;
+import org.apache.asterix.object.base.AdmObjectNode;
+import org.apache.asterix.object.base.AdmStringNode;
+import org.apache.asterix.object.base.IAdmNode;
 import org.apache.asterix.om.base.ABoolean;
 import org.apache.asterix.om.base.ADouble;
 import org.apache.asterix.om.base.AInt64;
 import org.apache.asterix.om.base.AMutableString;
-import org.apache.asterix.om.base.ANull;
 import org.apache.asterix.om.base.AOrderedList;
 import org.apache.asterix.om.base.ARecord;
 import org.apache.asterix.om.base.AString;
 import org.apache.asterix.om.base.IACursor;
 import org.apache.asterix.om.base.IAObject;
-import org.apache.asterix.om.types.BuiltinType;
-import org.apache.asterix.om.utils.RecordUtil;
+import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
-import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 
-@SuppressWarnings("unchecked")
 public class LangRecordParseUtil {
     private static final String NOT_ALLOWED_EXPRESSIONS_ERROR_MESSAGE =
             "JSON record can only have expressions [%1$s, %2$s, %3$s]";
-    private static final ISerializerDeserializer<ADouble> doubleSerde =
-            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ADOUBLE);
-    private static final ISerializerDeserializer<AString> stringSerde =
-            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ASTRING);
-    private static final ISerializerDeserializer<AInt64> intSerde =
-            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT64);
-    private static final ISerializerDeserializer<ABoolean> booleanSerde =
-            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ABOOLEAN);
-    private static final ISerializerDeserializer<ANull> nullSerde =
-            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
 
     private LangRecordParseUtil() {
     }
 
-    private static void parseExpression(Expression expr, ArrayBackedValueStorage serialized)
-            throws HyracksDataException, CompilationException {
+    private static IAdmNode parseExpression(Expression expr) throws HyracksDataException, CompilationException {
         switch (expr.getKind()) {
             case LITERAL_EXPRESSION:
-                parseLiteral((LiteralExpr) expr, serialized);
-                break;
+                return parseLiteral((LiteralExpr) expr);
             case RECORD_CONSTRUCTOR_EXPRESSION:
-                parseRecord((RecordConstructor) expr, serialized, true, Collections.emptyList());
-                break;
+                return parseRecord((RecordConstructor) expr, Collections.emptyList());
             case LIST_CONSTRUCTOR_EXPRESSION:
-                parseList((ListConstructor) expr, serialized);
-                break;
+                return parseList((ListConstructor) expr);
             default:
                 throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR,
                         NOT_ALLOWED_EXPRESSIONS_ERROR_MESSAGE,
@@ -92,41 +79,30 @@
         }
     }
 
-    public static void parseRecord(RecordConstructor recordValue, ArrayBackedValueStorage serialized, boolean tagged,
-            List<Pair<String, String>> defaults) throws HyracksDataException, CompilationException {
+    public static AdmObjectNode parseRecord(RecordConstructor recordValue, List<Pair<String, String>> defaults)
+            throws HyracksDataException, CompilationException {
+        AdmObjectNode record = new AdmObjectNode();
         AMutableString fieldNameString = new AMutableString(null);
-        ArrayBackedValueStorage fieldName = new ArrayBackedValueStorage();
-        ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
-        RecordBuilder recordBuilder = new RecordBuilder();
-        recordBuilder.reset(RecordUtil.FULLY_OPEN_RECORD_TYPE);
-        recordBuilder.init();
         List<FieldBinding> fbList = recordValue.getFbList();
         HashSet<String> fieldNames = new HashSet<>();
         for (FieldBinding fb : fbList) {
-            fieldName.reset();
-            fieldValue.reset();
             // get key
             fieldNameString.setValue(exprToStringLiteral(fb.getLeftExpr()).getStringValue());
             if (!fieldNames.add(fieldNameString.getStringValue())) {
                 throw new HyracksDataException(
                         "Field " + fieldNameString.getStringValue() + " was specified multiple times");
             }
-            stringSerde.serialize(fieldNameString, fieldName.getDataOutput());
             // get value
-            parseExpression(fb.getRightExpr(), fieldValue);
-            recordBuilder.addField(fieldName, fieldValue);
+            IAdmNode value = parseExpression(fb.getRightExpr());
+            record.set(fieldNameString.getStringValue(), value);
         }
         // defaults
         for (Pair<String, String> kv : defaults) {
             if (!fieldNames.contains(kv.first)) {
-                fieldName.reset();
-                fieldValue.reset();
-                stringSerde.serialize(new AString(kv.first), fieldName.getDataOutput());
-                stringSerde.serialize(new AString(kv.second), fieldValue.getDataOutput());
-                recordBuilder.addField(fieldName, fieldValue);
+                record.set(kv.first, new AdmStringNode(kv.second));
             }
         }
-        recordBuilder.write(serialized.getDataOutput(), tagged);
+        return record;
     }
 
     public static Literal exprToStringLiteral(Expression expr) throws CompilationException {
@@ -143,51 +119,37 @@
         return keyLiteral;
     }
 
-    private static void parseList(ListConstructor valueExpr, ArrayBackedValueStorage serialized)
-            throws CompilationException, HyracksDataException {
+    private static AdmArrayNode parseList(ListConstructor valueExpr) throws CompilationException, HyracksDataException {
         if (valueExpr.getType() != ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR) {
             throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR, "JSON List can't be of type %1$s",
                     valueExpr.getType());
         }
-        ArrayBackedValueStorage serializedValue = new ArrayBackedValueStorage();
-        OrderedListBuilder listBuilder = new OrderedListBuilder();
-        listBuilder.reset(null);
-        for (Expression expr : valueExpr.getExprList()) {
-            serializedValue.reset();
-            parseExpression(expr, serializedValue);
-            listBuilder.addItem(serializedValue);
+        List<Expression> exprs = valueExpr.getExprList();
+        AdmArrayNode list = new AdmArrayNode(exprs.size());
+        for (Expression expr : exprs) {
+            list.add(parseExpression(expr));
         }
-        listBuilder.write(serialized.getDataOutput(), true);
+        return list;
     }
 
-    private static void parseLiteral(LiteralExpr objectExpr, ArrayBackedValueStorage serialized)
-            throws HyracksDataException {
+    private static IAdmNode parseLiteral(LiteralExpr objectExpr) throws HyracksDataException {
         Literal value = objectExpr.getValue();
         switch (value.getLiteralType()) {
             case DOUBLE:
-                doubleSerde.serialize(new ADouble((Double) value.getValue()), serialized.getDataOutput());
-                break;
-            case TRUE:
-                booleanSerde.serialize(ABoolean.TRUE, serialized.getDataOutput());
-                break;
-            case FALSE:
-                booleanSerde.serialize(ABoolean.FALSE, serialized.getDataOutput());
-                break;
             case FLOAT:
-                doubleSerde.serialize(new ADouble((Float) value.getValue()), serialized.getDataOutput());
-                break;
+                return new AdmDoubleNode((Double) value.getValue());
+            case TRUE:
+                return AdmBooleanNode.TRUE;
+            case FALSE:
+                return AdmBooleanNode.FALSE;
             case INTEGER:
-                intSerde.serialize(new AInt64(((Integer) value.getValue()).longValue()), serialized.getDataOutput());
-                break;
+                return new AdmBigIntNode((Integer) value.getValue());
             case LONG:
-                intSerde.serialize(new AInt64((Long) value.getValue()), serialized.getDataOutput());
-                break;
+                return new AdmBigIntNode((Long) value.getValue());
             case NULL:
-                nullSerde.serialize(ANull.NULL, serialized.getDataOutput());
-                break;
+                return AdmNullNode.INSTANCE;
             case STRING:
-                stringSerde.serialize(new AString((String) value.getValue()), serialized.getDataOutput());
-                break;
+                return new AdmStringNode((String) value.getValue());
             default:
                 throw new HyracksDataException(ErrorCode.ASTERIX, ErrorCode.PARSE_ERROR, "Unknown Literal Type %1$s",
                         value.getLiteralType());
@@ -203,6 +165,21 @@
         }
     }
 
+    public static void recordToMap(Map<String, String> map, AdmObjectNode record) throws AlgebricksException {
+        for (Entry<String, IAdmNode> field : record.getFields()) {
+            String value = aObjToString(field.getValue());
+            map.put(field.getKey(), value);
+        }
+    }
+
+    private static String aObjToString(IAdmNode aObj) {
+        if (aObj.getType() == ATypeTag.STRING) {
+            return ((AdmStringNode) aObj).get();
+        } else {
+            return aObj.toString();
+        }
+    }
+
     public static String aObjToString(IAObject aObj) throws AlgebricksException {
         switch (aObj.getType().getTypeTag()) {
             case DOUBLE:
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java
index 4474684..e5ee163 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java
@@ -25,8 +25,6 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.asterix.common.config.MetadataProperties;
 import org.apache.asterix.common.dataflow.ICcApplicationContext;
@@ -60,6 +58,9 @@
 import org.apache.asterix.transaction.management.opcallbacks.AbstractIndexModificationOperationCallback.Operation;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.util.ExitUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * Provides access to Asterix metadata via remote methods to the metadata node.
@@ -94,6 +95,7 @@
  * with transaction ids of regular jobs or other metadata transactions.
  */
 public abstract class MetadataManager implements IMetadataManager {
+    private static final Logger LOGGER = LogManager.getLogger();
     private final MetadataCache cache = new MetadataCache();
     protected final Collection<IAsterixStateProxy> proxies;
     protected IMetadataNode metadataNode;
@@ -132,15 +134,29 @@
         return new MetadataTransactionContext(txnId);
     }
 
+    @SuppressWarnings("squid:S1181")
     @Override
-    public void commitTransaction(MetadataTransactionContext ctx) throws RemoteException, ACIDException {
-        metadataNode.commitTransaction(ctx.getTxnId());
-        cache.commit(ctx);
+    public void commitTransaction(MetadataTransactionContext ctx) {
+        try {
+            metadataNode.commitTransaction(ctx.getTxnId());
+            cache.commit(ctx);
+        } catch (Throwable th) {
+            // Metadata node should abort all transactions on re-joining the new CC
+            LOGGER.fatal("Failure committing a metadata transaction", th);
+            ExitUtil.halt(ExitUtil.EC_FAILED_TO_COMMIT_METADATA_TXN);
+        }
     }
 
+    @SuppressWarnings("squid:S1181")
     @Override
-    public void abortTransaction(MetadataTransactionContext ctx) throws RemoteException, ACIDException {
-        metadataNode.abortTransaction(ctx.getTxnId());
+    public void abortTransaction(MetadataTransactionContext ctx) {
+        try {
+            metadataNode.abortTransaction(ctx.getTxnId());
+        } catch (Throwable th) {
+            // Metadata node should abort all transactions on re-joining the new CC
+            LOGGER.fatal("Failure aborting a metadata transaction", th);
+            ExitUtil.halt(ExitUtil.EC_FAILED_TO_ABORT_METADATA_TXN);
+        }
     }
 
     @Override
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
index 543b794..164c867 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataNode.java
@@ -30,18 +30,15 @@
 import org.apache.asterix.common.api.INcApplicationContext;
 import org.apache.asterix.common.config.DatasetConfig.DatasetType;
 import org.apache.asterix.common.config.DatasetConfig.IndexType;
-import org.apache.asterix.common.context.PrimaryIndexOperationTracker;
 import org.apache.asterix.common.dataflow.LSMIndexUtil;
 import org.apache.asterix.common.exceptions.ACIDException;
 import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.common.metadata.MetadataIndexImmutableProperties;
-import org.apache.asterix.common.transactions.DatasetId;
 import org.apache.asterix.common.transactions.IRecoveryManager.ResourceType;
 import org.apache.asterix.common.transactions.ITransactionContext;
 import org.apache.asterix.common.transactions.ITransactionManager.AtomicityLevel;
 import org.apache.asterix.common.transactions.ITransactionSubsystem;
 import org.apache.asterix.common.transactions.ITxnIdFactory;
-import org.apache.asterix.common.transactions.ImmutableDatasetId;
 import org.apache.asterix.common.transactions.TransactionOptions;
 import org.apache.asterix.common.transactions.TxnId;
 import org.apache.asterix.common.utils.StoragePathUtil;
@@ -124,10 +121,13 @@
 import org.apache.hyracks.storage.common.IIndexCursor;
 import org.apache.hyracks.storage.common.IModificationOperationCallback;
 import org.apache.hyracks.storage.common.MultiComparator;
+import org.apache.hyracks.util.ExitUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class MetadataNode implements IMetadataNode {
     private static final long serialVersionUID = 1L;
-
+    private static final Logger LOGGER = LogManager.getLogger();
     // shared between core and extension
     private IDatasetLifecycleManager datasetLifecycleManager;
     private ITransactionSubsystem transactionSubsystem;
@@ -172,14 +172,28 @@
         transactionSubsystem.getTransactionManager().beginTransaction(transactionId, options);
     }
 
+    @SuppressWarnings("squid:S1181")
     @Override
     public void commitTransaction(TxnId txnId) throws RemoteException, ACIDException {
-        transactionSubsystem.getTransactionManager().commitTransaction(txnId);
+        try {
+            transactionSubsystem.getTransactionManager().commitTransaction(txnId);
+        } catch (Throwable th) {
+            // Metadata node should abort all Metadata transactions on re-start
+            LOGGER.fatal("Failure committing a metadata transaction", th);
+            ExitUtil.halt(ExitUtil.EC_FAILED_TO_COMMIT_METADATA_TXN);
+        }
     }
 
+    @SuppressWarnings("squid:S1181")
     @Override
     public void abortTransaction(TxnId txnId) throws RemoteException, ACIDException {
-        transactionSubsystem.getTransactionManager().abortTransaction(txnId);
+        try {
+            transactionSubsystem.getTransactionManager().abortTransaction(txnId);
+        } catch (Throwable th) {
+            // Metadata node should abort all uncommitted transactions on re-start
+            LOGGER.fatal("Failure committing a metadata transaction", th);
+            ExitUtil.halt(ExitUtil.EC_FAILED_TO_ABORT_METADATA_TXN);
+        }
     }
 
     // TODO(amoudi): make all metadata operations go through the generic methods
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataset.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataset.java
index bcd05ee..d0a22b7 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataset.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataset.java
@@ -127,9 +127,6 @@
      */
     private static final long serialVersionUID = 1L;
     private static final Logger LOGGER = LogManager.getLogger();
-    //TODO: Remove Singletons
-    private static final BTreeResourceFactoryProvider bTreeResourceFactoryProvider =
-            BTreeResourceFactoryProvider.INSTANCE;
     private static final RTreeResourceFactoryProvider rTreeResourceFactoryProvider =
             RTreeResourceFactoryProvider.INSTANCE;
     private static final InvertedIndexResourceFactoryProvider invertedIndexResourceFactoryProvider =
@@ -153,10 +150,6 @@
     private final long rebalanceCount;
     private int pendingOp;
 
-    /*
-     * Transient (For caching)
-     */
-
     public Dataset(String dataverseName, String datasetName, String recordTypeDataverseName, String recordTypeName,
             String nodeGroupName, String compactionPolicy, Map<String, String> compactionPolicyProperties,
             IDatasetDetails datasetDetails, Map<String, String> hints, DatasetType datasetType, int datasetId,
@@ -473,8 +466,9 @@
         IResourceFactory resourceFactory;
         switch (index.getIndexType()) {
             case BTREE:
-                resourceFactory = bTreeResourceFactoryProvider.getResourceFactory(mdProvider, this, index, recordType,
-                        metaType, mergePolicyFactory, mergePolicyProperties, filterTypeTraits, filterCmpFactories);
+                resourceFactory = BTreeResourceFactoryProvider.INSTANCE.getResourceFactory(mdProvider, this, index,
+                        recordType, metaType, mergePolicyFactory, mergePolicyProperties, filterTypeTraits,
+                        filterCmpFactories);
                 break;
             case RTREE:
                 resourceFactory = rTreeResourceFactoryProvider.getResourceFactory(mdProvider, this, index, recordType,
@@ -853,4 +847,8 @@
         }
         return partitions;
     }
+
+    public String getFullyQualifiedName() {
+        return dataverseName + '.' + datasetName;
+    }
 }
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataverse.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataverse.java
index 1b40484..35d21a0 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataverse.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/Dataverse.java
@@ -65,4 +65,19 @@
     public String toString() {
         return getClass().getSimpleName() + ":" + dataverseName;
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (!(o instanceof Dataverse)) {
+            return false;
+        }
+        Dataverse other = (Dataverse) o;
+        return dataverseName.equals(other.getDataverseName());
+    }
+
+    @Override
+    public int hashCode() {
+        return dataverseName.hashCode();
+    }
+
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/SerializerDeserializerProvider.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/SerializerDeserializerProvider.java
index d66673d..0cba8b6 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/SerializerDeserializerProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/SerializerDeserializerProvider.java
@@ -81,8 +81,7 @@
     // Can't be shared among threads <Stateful>
     @SuppressWarnings("rawtypes")
     public ISerializerDeserializer getAStringSerializerDeserializer() {
-        return addTag(new AStringSerializerDeserializer(new UTF8StringWriter(), new UTF8StringReader()),
-                ATypeTag.STRING);
+        return addTag(new AStringSerializerDeserializer(new UTF8StringWriter(), new UTF8StringReader()));
     }
 
     @SuppressWarnings("rawtypes")
@@ -98,7 +97,7 @@
                 // we could do smth better for nullable fields
                 return AObjectSerializerDeserializer.INSTANCE;
             default:
-                return addTag(getNonTaggedSerializerDeserializer(aqlType), aqlType.getTypeTag());
+                return addTag(getNonTaggedSerializerDeserializer(aqlType));
         }
     }
 
@@ -172,7 +171,7 @@
     }
 
     @SuppressWarnings("rawtypes")
-    private ISerializerDeserializer addTag(final ISerializerDeserializer nonTaggedSerde, final ATypeTag typeTag) {
+    private ISerializerDeserializer addTag(final ISerializerDeserializer nonTaggedSerde) {
         return new ISerializerDeserializer<IAObject>() {
 
             private static final long serialVersionUID = 1L;
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/TypeTraitProvider.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/TypeTraitProvider.java
index 9ec5a08..1836cfa 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/TypeTraitProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/TypeTraitProvider.java
@@ -36,7 +36,7 @@
     private static final ITypeTraits THIRTYTWOBYTETYPETRAIT = new TypeTrait(32 + 1);
     private static final ITypeTraits TWENTYFOURBYTETYPETRAIT = new TypeTrait(24 + 1);
 
-    private static final ITypeTraits VARLENTYPETRAIT = new TypeTrait(false, -1);
+    public static final ITypeTraits VARLENTYPETRAIT = new TypeTrait(false, -1);
 
     public static final TypeTraitProvider INSTANCE = new TypeTraitProvider();
 
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmArrayNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmArrayNode.java
index e489cd5..60ef41a4 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmArrayNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmArrayNode.java
@@ -18,12 +18,19 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
+import org.apache.asterix.builders.OrderedListBuilder;
+import org.apache.asterix.om.types.AOrderedListType;
 import org.apache.asterix.om.types.ATypeTag;
+import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 
-public class AdmArrayNode implements IAdmNode {
+public class AdmArrayNode implements IAdmNode, Iterable<IAdmNode> {
+    private static final long serialVersionUID = 1L;
     private final List<IAdmNode> children;
 
     public AdmArrayNode() {
@@ -42,6 +49,10 @@
         add(AdmBooleanNode.get(value));
     }
 
+    public int size() {
+        return children.size();
+    }
+
     public void add(IAdmNode value) {
         if (value == null) {
             value = AdmNullNode.INSTANCE; // NOSONAR
@@ -74,4 +85,23 @@
     public String toString() {
         return children.toString();
     }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        OrderedListBuilder listBuilder = new OrderedListBuilder();
+        listBuilder.reset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE);
+        ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
+        for (int i = 0; i < children.size(); i++) {
+            itemValue.reset();
+            IAdmNode next = children.get(i);
+            next.serialize(itemValue.getDataOutput());
+            listBuilder.addItem(itemValue);
+        }
+        listBuilder.write(dataOutput, false);
+    }
+
+    @Override
+    public Iterator<IAdmNode> iterator() {
+        return children.iterator();
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBigIntNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBigIntNode.java
index 0006668..61afc74 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBigIntNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBigIntNode.java
@@ -18,9 +18,14 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+
 import org.apache.asterix.om.types.ATypeTag;
 
 public class AdmBigIntNode implements IAdmNode {
+
+    private static final long serialVersionUID = 1L;
     private long value;
 
     public AdmBigIntNode() {
@@ -52,4 +57,9 @@
     public String toString() {
         return Long.toString(value);
     }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        dataOutput.writeLong(value);
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBooleanNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBooleanNode.java
index aeebd86..721ce4c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBooleanNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmBooleanNode.java
@@ -18,10 +18,14 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+
 import org.apache.asterix.om.types.ATypeTag;
 
 public class AdmBooleanNode implements IAdmNode {
 
+    private static final long serialVersionUID = 1L;
     public static final AdmBooleanNode TRUE = new AdmBooleanNode(true);
     public static final AdmBooleanNode FALSE = new AdmBooleanNode(false);
     private final boolean value;
@@ -56,4 +60,9 @@
     public String toString() {
         return Boolean.toString(value);
     }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        dataOutput.writeBoolean(value);
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmDoubleNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmDoubleNode.java
index 0150b4e..0601e63 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmDoubleNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmDoubleNode.java
@@ -18,9 +18,13 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+
 import org.apache.asterix.om.types.ATypeTag;
 
 public class AdmDoubleNode implements IAdmNode {
+    private static final long serialVersionUID = 1L;
     private double value;
 
     public AdmDoubleNode() {
@@ -53,4 +57,9 @@
     public String toString() {
         return Double.toString(value);
     }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        dataOutput.writeDouble(value);
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmNullNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmNullNode.java
index 2804ca3..6fe8357 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmNullNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmNullNode.java
@@ -18,10 +18,14 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+
 import org.apache.asterix.om.types.ATypeTag;
 
 public class AdmNullNode implements IAdmNode {
 
+    private static final long serialVersionUID = 1L;
     public static final AdmNullNode INSTANCE = new AdmNullNode();
 
     private AdmNullNode() {
@@ -41,4 +45,9 @@
     public String toString() {
         return "null";
     }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        // Nothing to write
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmObjectNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmObjectNode.java
index e35b28f..99b7176 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmObjectNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmObjectNode.java
@@ -18,23 +18,43 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.apache.asterix.builders.RecordBuilder;
+import org.apache.asterix.common.exceptions.CompilationException;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
+import org.apache.asterix.om.base.AString;
 import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.utils.RecordUtil;
+import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 
 /**
  * An adm object instance
  */
 public class AdmObjectNode implements IAdmNode {
+
+    private static final long serialVersionUID = 1L;
+    public static final AdmObjectNode EMPTY = new AdmObjectNode(Collections.emptyMap());
     private final Map<String, IAdmNode> children;
 
     public AdmObjectNode() {
         children = new HashMap<>();
     }
 
+    public AdmObjectNode(Map<String, IAdmNode> children) {
+        this.children = children;
+    }
+
     @Override
     public ATypeTag getType() {
         return ATypeTag.OBJECT;
@@ -56,10 +76,13 @@
         return children.entrySet();
     }
 
-    public AdmObjectNode set(String fieldName, IAdmNode value) {
+    public AdmObjectNode set(String fieldName, IAdmNode value) throws CompilationException {
         if (value == null) {
             value = AdmNullNode.INSTANCE; // NOSONAR
         }
+        if (children.containsKey(fieldName)) {
+            throw new CompilationException(ErrorCode.DUPLICATE_FIELD_NAME, fieldName);
+        }
         children.put(fieldName, value);
         return this;
     }
@@ -92,4 +115,51 @@
         sb.append("}");
         return sb.toString();
     }
+
+    public static AdmObjectNode from(Map<String, IAdmNode> fields) {
+        return fields.isEmpty() ? EMPTY : new AdmObjectNode(fields);
+    }
+
+    public boolean isEmpty() {
+        return children.isEmpty();
+    }
+
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        ISerializerDeserializer<AString> stringSerde =
+                SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ASTRING);
+        RecordBuilder confRecordBuilder = new RecordBuilder();
+        confRecordBuilder.reset(RecordUtil.FULLY_OPEN_RECORD_TYPE);
+        confRecordBuilder.init();
+        ArrayBackedValueStorage fieldNameBytes = new ArrayBackedValueStorage();
+        ArrayBackedValueStorage fieldValueBytes = new ArrayBackedValueStorage();
+        for (Entry<String, IAdmNode> field : getFields()) {
+            String fieldName = field.getKey();
+            fieldValueBytes.reset();
+            fieldNameBytes.reset();
+            stringSerde.serialize(new AString(fieldName), fieldNameBytes.getDataOutput());
+            IAdmNode value = field.getValue();
+            value.serialize(fieldValueBytes.getDataOutput());
+            confRecordBuilder.addField(fieldNameBytes, fieldValueBytes);
+        }
+        confRecordBuilder.write(dataOutput, false);
+    }
+
+    public boolean contains(String fieldName) {
+        return children.containsKey(fieldName);
+    }
+
+    public String getString(String field) throws HyracksDataException {
+        return getString(this, field);
+    }
+
+    public static String getString(AdmObjectNode openFields, String field) throws HyracksDataException {
+        IAdmNode node = openFields.get(field);
+        if (node == null) {
+            throw HyracksDataException.create(ErrorCode.FIELD_NOT_FOUND, field);
+        } else if (node.getType() != ATypeTag.STRING) {
+            throw HyracksDataException.create(ErrorCode.FIELD_NOT_OF_TYPE, field, ATypeTag.STRING, node.getType());
+        }
+        return ((AdmStringNode) node).get();
+    }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmStringNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmStringNode.java
index 4c92f09..3dc70d1 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmStringNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/AdmStringNode.java
@@ -18,9 +18,15 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+
 import org.apache.asterix.om.types.ATypeTag;
+import org.apache.hyracks.util.string.UTF8StringUtil;
 
 public class AdmStringNode implements IAdmNode {
+
+    private static final long serialVersionUID = 1L;
     private String value;
 
     public AdmStringNode() {
@@ -49,4 +55,9 @@
         return "\"" + value + "\"";
     }
 
+    @Override
+    public void serializeValue(DataOutput dataOutput) throws IOException {
+        UTF8StringUtil.writeUTF8(value, dataOutput, null);
+    }
+
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/IAdmNode.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/IAdmNode.java
index c382fd2..98d7fe4 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/IAdmNode.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/object/base/IAdmNode.java
@@ -18,12 +18,16 @@
  */
 package org.apache.asterix.object.base;
 
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
 import org.apache.asterix.om.types.ATypeTag;
 
 /**
  * An interface representing an adm node
  */
-public interface IAdmNode {
+public interface IAdmNode extends Serializable {
 
     /**
      * @return true if the object is a value, false if the object is a container
@@ -62,4 +66,23 @@
      * reset the node
      */
     void reset();
+
+    /**
+     * Serialize the field with a type tag
+     *
+     * @param dataOutput
+     * @throws IOException
+     */
+    default void serialize(DataOutput dataOutput) throws IOException {
+        dataOutput.writeByte(getType().serialize());
+        serializeValue(dataOutput);
+    }
+
+    /**
+     * Serialize the value without a type tag
+     *
+     * @param dataOutput
+     * @throws IOException
+     */
+    void serializeValue(DataOutput dataOutput) throws IOException;
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AIntervalPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AIntervalPointable.java
index ce04f6d..299649b 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AIntervalPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AIntervalPointable.java
@@ -99,6 +99,7 @@
         start.set(bytes, getStartOffset(), getStartSize());
     }
 
+    @Override
     public int getStartOffset() {
         return getTypeOffset() + getTypeSize();
     }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
index 7c74a69..8d525f3 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
@@ -22,7 +22,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.om.types.AOrderedListType;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.AbstractCollectionType;
@@ -40,6 +39,7 @@
  * This class interprets the binary data representation of a list.
  *
  * List {
+ *   byte tag;
  *   byte type;
  *   int length;
  *   int numberOfItems;
@@ -62,11 +62,16 @@
         }
     };
 
-    public static final IPointableFactory FACTORY = new IPointableFactory() {
+    public static final AListPointableFactory FACTORY = new AListPointableFactory();
+
+    public static class AListPointableFactory implements IPointableFactory {
         private static final long serialVersionUID = 1L;
 
+        private AListPointableFactory() {
+        }
+
         @Override
-        public IPointable createPointable() {
+        public AListPointable createPointable() {
             return new AListPointable();
         }
 
@@ -169,7 +174,7 @@
             return getItemCountOffset() + getItemCountSize() + index * getFixedLength(inputType);
         } else {
             int offset = getItemCountOffset() + getItemCountSize() + index * ITEM_OFFSET_SIZE;
-            return IntegerPointable.getInteger(bytes, offset);
+            return start + IntegerPointable.getInteger(bytes, offset);
         }
     }
 
@@ -195,5 +200,4 @@
         }
         dOut.write(bytes, getItemOffset(inputType, index), getItemSize(inputType, index));
     }
-
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
index 77491e8..8ae533b 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
@@ -22,7 +22,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.AUnionType;
@@ -230,6 +229,21 @@
         }
     }
 
+    /**
+     * This is always untagged
+     *
+     * @param recordType
+     * @param fieldId
+     * @param pointable
+     * @throws IOException
+     */
+    public void getClosedFieldValue(ARecordType recordType, int fieldId, IPointable pointable) throws IOException {
+        if (isClosedFieldNull(recordType, fieldId) || isClosedFieldMissing(recordType, fieldId)) {
+            throw new IllegalStateException("Can't read a null or missing field");
+        }
+        pointable.set(bytes, getClosedFieldOffset(recordType, fieldId), getClosedFieldSize(recordType, fieldId));
+    }
+
     public String getClosedFieldName(ARecordType recordType, int fieldId) {
         return recordType.getFieldNames()[fieldId];
     }
@@ -304,6 +318,14 @@
         dOut.write(bytes, getOpenFieldNameOffset(recordType, fieldId), getOpenFieldNameSize(recordType, fieldId));
     }
 
+    public String getOpenFieldName(ARecordType recordType, int fieldId) throws IOException {
+        StringBuilder str = new StringBuilder();
+        int offset = getOpenFieldNameOffset(recordType, fieldId);
+        UTF8StringUtil.toString(str, bytes, offset);
+        String fieldName = str.toString();
+        return fieldName;
+    }
+
     public int getOpenFieldNameSize(ARecordType recordType, int fieldId) {
         int utfleng = UTF8StringUtil.getUTFLength(bytes, getOpenFieldNameOffset(recordType, fieldId));
         return utfleng + UTF8StringUtil.getNumBytesToStoreLength(utfleng);
@@ -340,5 +362,4 @@
     public int getOpenFieldOffsetSize(ARecordType recordType, int fieldId) {
         return OPEN_FIELD_HASH_SIZE;
     }
-
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/AdmNodeUtils.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/AdmNodeUtils.java
new file mode 100644
index 0000000..6f4ee17
--- /dev/null
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/AdmNodeUtils.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.om.utils;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.asterix.object.base.AdmArrayNode;
+import org.apache.asterix.object.base.AdmBigIntNode;
+import org.apache.asterix.object.base.AdmBooleanNode;
+import org.apache.asterix.object.base.AdmDoubleNode;
+import org.apache.asterix.object.base.AdmNullNode;
+import org.apache.asterix.object.base.AdmObjectNode;
+import org.apache.asterix.object.base.AdmStringNode;
+import org.apache.asterix.object.base.IAdmNode;
+import org.apache.asterix.om.pointables.nonvisitor.AListPointable;
+import org.apache.asterix.om.pointables.nonvisitor.ARecordPointable;
+import org.apache.asterix.om.types.AOrderedListType;
+import org.apache.asterix.om.types.ARecordType;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.hyracks.data.std.primitive.BooleanPointable;
+import org.apache.hyracks.data.std.primitive.DoublePointable;
+import org.apache.hyracks.data.std.primitive.LongPointable;
+import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
+
+public class AdmNodeUtils {
+
+    private AdmNodeUtils() {
+    }
+
+    public static Map<String, IAdmNode> getOpenFields(ARecordPointable recPointable, ARecordType recordType)
+            throws IOException {
+        int openFieldCount = recPointable.getOpenFieldCount(recordType);
+        Map<String, IAdmNode> map = (openFieldCount == 0) ? Collections.emptyMap() : new HashMap<>();
+        for (int i = 0; i < openFieldCount; i++) {
+            map.put(recPointable.getOpenFieldName(recordType, i), getOpenField(recPointable, recordType, i));
+        }
+        return map;
+    }
+
+    private static IAdmNode getOpenField(ARecordPointable recPointable, ARecordType type, int i) throws IOException {
+        byte tagByte = recPointable.getOpenFieldTag(type, i);
+        ATypeTag tag = ATypeTag.VALUE_TYPE_MAPPING[tagByte];
+        switch (tag) {
+            case ARRAY:
+                return getOpenFieldAsArray(recPointable, type, i);
+            case BIGINT:
+                return new AdmBigIntNode(LongPointable.getLong(recPointable.getByteArray(),
+                        recPointable.getOpenFieldValueOffset(type, i) + 1));
+            case BOOLEAN:
+                return AdmBooleanNode.get(BooleanPointable.getBoolean(recPointable.getByteArray(),
+                        recPointable.getOpenFieldValueOffset(type, i) + 1));
+            case DOUBLE:
+                return new AdmDoubleNode(DoublePointable.getDouble(recPointable.getByteArray(),
+                        recPointable.getOpenFieldValueOffset(type, i) + 1));
+            case NULL:
+                return AdmNullNode.INSTANCE;
+            case OBJECT:
+                return getOpenFieldAsObject(recPointable, type, i);
+            case STRING:
+                UTF8StringPointable str = UTF8StringPointable.FACTORY.createPointable();
+                str.set(recPointable.getByteArray(), recPointable.getOpenFieldValueOffset(type, i) + 1,
+                        recPointable.getOpenFieldValueSize(type, i) - 1);
+                return new AdmStringNode(str.toString());
+            default:
+                throw new UnsupportedOperationException("Unsupported item type: " + tag);
+        }
+    }
+
+    private static AdmObjectNode getOpenFieldAsObject(ARecordPointable recPointable, ARecordType type, int i)
+            throws IOException {
+        ARecordPointable pointable = ARecordPointable.FACTORY.createPointable();
+        int offset = recPointable.getOpenFieldValueOffset(type, i);
+        int len = recPointable.getOpenFieldValueSize(type, i);
+        pointable.set(recPointable.getByteArray(), offset, len);
+        return new AdmObjectNode(getOpenFields(pointable, RecordUtil.FULLY_OPEN_RECORD_TYPE));
+    }
+
+    private static AdmArrayNode getOpenFieldAsArray(ARecordPointable recPointable, ARecordType type, int i)
+            throws IOException {
+        AListPointable pointable = AListPointable.FACTORY.createPointable();
+        int offset = recPointable.getOpenFieldValueOffset(type, i);
+        int len = recPointable.getOpenFieldValueSize(type, i);
+        pointable.set(recPointable.getByteArray(), offset, len);
+        return getAsAdmNode(pointable);
+    }
+
+    public static AdmArrayNode getAsAdmNode(AListPointable listPointable) throws IOException {
+        int count = listPointable.getItemCount();
+        AdmArrayNode node = new AdmArrayNode(count);
+        for (int i = 0; i < count; i++) {
+            byte tagByte = listPointable.getItemTag(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i);
+            ATypeTag itemTag = ATypeTag.VALUE_TYPE_MAPPING[tagByte];
+            switch (itemTag) {
+                case ARRAY:
+                    node.add(getOpenFieldAsArray(listPointable, i));
+                    break;
+                case BIGINT:
+                    node.add(new AdmBigIntNode(LongPointable.getLong(listPointable.getByteArray(),
+                            listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i) + 1)));
+                    break;
+                case BOOLEAN:
+                    node.add(AdmBooleanNode.get(BooleanPointable.getBoolean(listPointable.getByteArray(),
+                            listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i) + 1)));
+                    break;
+                case DOUBLE:
+                    node.add(new AdmDoubleNode(DoublePointable.getDouble(listPointable.getByteArray(),
+                            listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i) + 1)));
+                    break;
+                case NULL:
+                    node.add(AdmNullNode.INSTANCE);
+                    break;
+                case OBJECT:
+                    node.add(getOpenFieldAsObject(listPointable, i));
+                    break;
+                case STRING:
+                    UTF8StringPointable str = UTF8StringPointable.FACTORY.createPointable();
+                    str.set(listPointable.getByteArray(),
+                            listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i) + 1,
+                            listPointable.getItemSize(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i));
+                    node.add(new AdmStringNode(str.toString()));
+                    break;
+                default:
+                    throw new UnsupportedOperationException("Unsupported item type: " + itemTag);
+            }
+        }
+        return node;
+    }
+
+    private static IAdmNode getOpenFieldAsObject(AListPointable listPointable, int i) throws IOException {
+        ARecordPointable pointable = ARecordPointable.FACTORY.createPointable();
+        int offset = listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i);
+        int len = listPointable.getItemSize(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i);
+        pointable.set(listPointable.getByteArray(), offset, len);
+        return new AdmObjectNode(AdmNodeUtils.getOpenFields(pointable, RecordUtil.FULLY_OPEN_RECORD_TYPE));
+    }
+
+    private static AdmArrayNode getOpenFieldAsArray(AListPointable listPointable, int i) throws IOException {
+        AListPointable pointable = AListPointable.FACTORY.createPointable();
+        int offset = listPointable.getItemOffset(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i);
+        int len = listPointable.getItemSize(AOrderedListType.FULL_OPEN_ORDEREDLIST_TYPE, i);
+        pointable.set(listPointable.getByteArray(), offset, len);
+        return getAsAdmNode(pointable);
+    }
+}
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/AbstractPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/AbstractPointable.java
index 05417a8..2e21048 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/AbstractPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/AbstractPointable.java
@@ -19,6 +19,7 @@
 package org.apache.hyracks.data.std.api;
 
 public abstract class AbstractPointable implements IPointable {
+
     protected byte[] bytes;
 
     protected int start;
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/IPointableFactory.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/IPointableFactory.java
index 5294d17..aee3047 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/IPointableFactory.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/api/IPointableFactory.java
@@ -23,7 +23,7 @@
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
 
 public interface IPointableFactory extends Serializable {
-    public IPointable createPointable();
+    IPointable createPointable();
 
-    public ITypeTraits getTypeTraits();
+    ITypeTraits getTypeTraits();
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BooleanPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BooleanPointable.java
index bd18ea0..ea6086d 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BooleanPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BooleanPointable.java
@@ -26,7 +26,6 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class BooleanPointable extends AbstractPointable implements IHashable, IComparable {
-
     public static final BooleanPointableFactory FACTORY = new BooleanPointableFactory();
 
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
@@ -47,11 +46,11 @@
         private static final long serialVersionUID = 1L;
 
         @Override
-        public IPointable createPointable() {
+        public BooleanPointable createPointable() {
             return new BooleanPointable();
         }
 
-        public IPointable createPointable(boolean value) {
+        public BooleanPointable createPointable(boolean value) {
             BooleanPointable pointable = new BooleanPointable();
             pointable.setBoolean(value);
             return pointable;
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BytePointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BytePointable.java
index 5b623e7..9e81083 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BytePointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/BytePointable.java
@@ -27,6 +27,7 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class BytePointable extends AbstractPointable implements IHashable, IComparable, INumeric {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/DoublePointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/DoublePointable.java
index 3464a9f..16294b3 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/DoublePointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/DoublePointable.java
@@ -27,14 +27,15 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class DoublePointable extends AbstractPointable implements IHashable, IComparable, INumeric {
-    private final static double machineEpsilon;
-    static {
-        float epsilon = 1.0f;
 
+    private static final double MACHINE_EPSILON = getMachineEpsilon();
+
+    private static double getMachineEpsilon() {
+        float epsilon = 1.0f;
         do {
             epsilon /= 2.0f;
         } while ((float) (1.0 + (epsilon / 2.0)) != 1.0);
-        machineEpsilon = epsilon;
+        return epsilon;
     }
 
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
@@ -150,6 +151,6 @@
     }
 
     public static double getEpsilon() {
-        return machineEpsilon;
+        return MACHINE_EPSILON;
     }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/FloatPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/FloatPointable.java
index b0f686f..4cb298f 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/FloatPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/FloatPointable.java
@@ -27,6 +27,7 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class FloatPointable extends AbstractPointable implements IHashable, IComparable, INumeric {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/IntegerPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/IntegerPointable.java
index a3b9f44..03aaa97 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/IntegerPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/IntegerPointable.java
@@ -27,6 +27,7 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class IntegerPointable extends AbstractPointable implements IHashable, IComparable, INumeric {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/RawUTF8StringPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/RawUTF8StringPointable.java
index 70bac4d..f75db9d 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/RawUTF8StringPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/RawUTF8StringPointable.java
@@ -32,6 +32,7 @@
  * But it works for single-byte character languages.
  */
 public final class RawUTF8StringPointable extends AbstractPointable implements IHashable, IComparable {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/ShortPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/ShortPointable.java
index 70ad44c..55e6201 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/ShortPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/ShortPointable.java
@@ -27,6 +27,7 @@
 import org.apache.hyracks.data.std.api.IPointableFactory;
 
 public final class ShortPointable extends AbstractPointable implements IHashable, IComparable, INumeric {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/TaggedValuePointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/TaggedValuePointable.java
index 7acd32c..dcb1e75 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/TaggedValuePointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/TaggedValuePointable.java
@@ -20,23 +20,9 @@
 import org.apache.hyracks.data.std.api.AbstractPointable;
 import org.apache.hyracks.data.std.api.IPointable;
 import org.apache.hyracks.data.std.api.IPointableFactory;
-import org.apache.hyracks.data.std.primitive.BytePointable;
-import org.apache.hyracks.data.std.primitive.VoidPointable;
 
 public class TaggedValuePointable extends AbstractPointable {
-    public static final IPointableFactory FACTORY = new IPointableFactory() {
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        public ITypeTraits getTypeTraits() {
-            return VoidPointable.TYPE_TRAITS;
-        }
-
-        @Override
-        public IPointable createPointable() {
-            return new TaggedValuePointable();
-        }
-    };
+    public static final TaggedValuePointableFactory FACTORY = new TaggedValuePointableFactory();
 
     public byte getTag() {
         return BytePointable.getByte(bytes, start);
@@ -45,4 +31,22 @@
     public void getValue(IPointable value) {
         value.set(bytes, start + 1, length - 1);
     }
+
+    public static final class TaggedValuePointableFactory implements IPointableFactory {
+        private static final long serialVersionUID = 1L;
+
+        private TaggedValuePointableFactory() {
+        }
+
+        @Override
+        public ITypeTraits getTypeTraits() {
+            return VoidPointable.TYPE_TRAITS;
+        }
+
+        @Override
+        public TaggedValuePointable createPointable() {
+            return new TaggedValuePointable();
+        }
+
+    }
 }
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercasePointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercasePointable.java
index 6e4810c..57d704f 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercasePointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercasePointable.java
@@ -27,6 +27,7 @@
 import org.apache.hyracks.util.string.UTF8StringUtil;
 
 public final class UTF8StringLowercasePointable extends AbstractPointable implements IHashable, IComparable {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercaseTokenPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercaseTokenPointable.java
index 66c1ab9..01af13e 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercaseTokenPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringLowercaseTokenPointable.java
@@ -29,6 +29,7 @@
  * Instead, the length of this string is provided as a parameter.
  */
 public final class UTF8StringLowercaseTokenPointable extends AbstractPointable implements IHashable, IComparable {
+
     public static final ITypeTraits TYPE_TRAITS = new ITypeTraits() {
         private static final long serialVersionUID = 1L;
 
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
index 376307d..518e688 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
@@ -70,11 +70,16 @@
         }
     };
 
-    public static final IPointableFactory FACTORY = new IPointableFactory() {
+    public static final UTF8StringPointableFactory FACTORY = new UTF8StringPointableFactory();
+
+    public static class UTF8StringPointableFactory implements IPointableFactory {
         private static final long serialVersionUID = 1L;
 
+        private UTF8StringPointableFactory() {
+        }
+
         @Override
-        public IPointable createPointable() {
+        public UTF8StringPointable createPointable() {
             return new UTF8StringPointable();
         }
 
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
index 8500842..5492919 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
@@ -35,6 +35,9 @@
     public static final int EC_FAILED_TO_RECOVER = 3;
     public static final int EC_NC_FAILED_TO_ABORT_ALL_PREVIOUS_TASKS = 4;
     public static final int EC_FAILED_TO_PROCESS_UN_INTERRUPTIBLE_REQUEST = 5;
+    public static final int EC_FAILED_TO_COMMIT_METADATA_TXN = 6;
+    public static final int EC_FAILED_TO_ABORT_METADATA_TXN = 7;
+    public static final int EC_INCONSISTENT_METADATA = 8;
     public static final int EC_UNHANDLED_EXCEPTION = 11;
     public static final int EC_IMMEDIATE_HALT = 33;
     public static final int EC_HALT_ABNORMAL_RESERVED_44 = 44;
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
index 1863b28..e6e21fa 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
@@ -88,7 +88,7 @@
     }
 
     public static InetSocketAddress toInetSocketAddress(String maybeLiteralHost, int port) {
-        return InetSocketAddress.createUnresolved(decodeIPv6LiteralHost(maybeLiteralHost), port);
+        return new InetSocketAddress(decodeIPv6LiteralHost(maybeLiteralHost), port);
     }
 
     public static List<InetSocketAddress> parseInetSocketAddresses(String... hostPortStrings) {
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringUtil.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringUtil.java
index cdb82bb..5597058 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringUtil.java
@@ -294,6 +294,11 @@
         return hash(bytes, start, length, true, false, 31, Integer.MAX_VALUE);
     }
 
+    public static String toString(byte[] bytes, int start) {
+        StringBuilder builder = new StringBuilder();
+        return toString(builder, bytes, start).toString();
+    }
+
     public static StringBuilder toString(StringBuilder builder, byte[] bytes, int start) {
         int utfLen = getUTFLength(bytes, start);
         int offset = getNumBytesToStoreLength(utfLen);
@@ -650,10 +655,10 @@
         if (writer == null) {
             tempBytes = new byte[utflen + 5];
         } else {
-            if (writer.tempBytes == null || writer.tempBytes.length < utflen + 5) {
-                writer.tempBytes = new byte[utflen + 5];
+            if (writer.getTempBytes() == null || writer.getTempBytes().length < utflen + 5) {
+                writer.setTempBytes(new byte[utflen + 5]);
             }
-            tempBytes = writer.tempBytes;
+            tempBytes = writer.getTempBytes();
         }
         return tempBytes;
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringWriter.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringWriter.java
index 485bd7d..3d9a7c5 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringWriter.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/string/UTF8StringWriter.java
@@ -20,9 +20,12 @@
 
 import java.io.DataOutput;
 import java.io.IOException;
+import java.io.Serializable;
 
-public class UTF8StringWriter {
-    byte[] tempBytes;
+public class UTF8StringWriter implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private byte[] tempBytes;
 
     public final void writeUTF8(CharSequence str, DataOutput out) throws IOException {
         UTF8StringUtil.writeUTF8(str, out, this);
@@ -32,4 +35,12 @@
         UTF8StringUtil.writeUTF8(buffer, start, length, out, this);
     }
 
+    public byte[] getTempBytes() {
+        return tempBytes;
+    }
+
+    public void setTempBytes(byte[] tempBytes) {
+        this.tempBytes = tempBytes;
+    }
+
 }
