Added asterix project
git-svn-id: https://asterixdb.googlecode.com/svn/trunk/asterix@12 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries.txt b/asterix-app/src/test/resources/metadata-transactions/check-state-queries.txt
new file mode 100644
index 0000000..6618ddd
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries.txt
@@ -0,0 +1,6 @@
+check_dataset.aql
+check_datatype.aql
+check_dataverse.aql
+check_index.aql
+check_node.aql
+check_nodegroup.aql
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataset.aql
new file mode 100644
index 0000000..dd166f0
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataset.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_dataset.adm";
+
+for $c in dataset('Dataset')
+return $c
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_datatype.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_datatype.aql
new file mode 100644
index 0000000..847b9f5
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_datatype.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_datatype.adm";
+
+for $c in dataset('Datatype')
+return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataverse.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataverse.aql
new file mode 100644
index 0000000..51cf69f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_dataverse.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_dataverse.adm";
+
+for $c in dataset('Dataverse')
+return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_index.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_index.aql
new file mode 100644
index 0000000..fbfe9b2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_index.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_index.adm";
+
+for $c in dataset('Index')
+return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_node.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_node.aql
new file mode 100644
index 0000000..e724aad
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_node.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_node.adm";
+
+for $c in dataset('Node')
+return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_nodegroup.aql b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_nodegroup.aql
new file mode 100644
index 0000000..ec8e8b4
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-queries/check_nodegroup.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/check_nodegroup.adm";
+
+for $c in dataset('Nodegroup')
+return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm
new file mode 100644
index 0000000..b1007e3
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataset.adm
@@ -0,0 +1,9 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "PrimaryKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:07 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "DataTypeName": "CustomerType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "cid", "name" ], "PrimaryKey": [ "cid", "name" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:12 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "DataTypeName": "OrderType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "oid" ], "PrimaryKey": [ "oid" ], "GroupName": "group1" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Tue Feb 14 12:55:12 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm
new file mode 100644
index 0000000..e084f41
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_datatype.adm
@@ -0,0 +1,68 @@
+{ "DataverseName": "Metadata", "DatatypeName": "DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "DataTypeName", "FieldType": "string" }, { "FieldName": "DatasetType", "FieldType": "string" }, { "FieldName": "InternalDetails", "FieldType": "Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "ExternalDetails", "FieldType": "Field_ExternalDetails_in_DatasetRecordType" }, { "FieldName": "FeedDetails", "FieldType": "Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatatypeName", "FieldType": "string" }, { "FieldName": "Derived", "FieldType": "Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "DataverseRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DataFormat", "FieldType": "string" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FieldName", "FieldType": "string" }, { "FieldName": "FieldType", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_FunctionParams_in_FunctionRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_NodeNames_in_NodeGroupRecordType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Name", "FieldType": "string" }, { "FieldName": "Value", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_SearchKey_in_IndexRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "string" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "FunctionRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "FunctionName", "FieldType": "string" }, { "FieldName": "FunctionArity", "FieldType": "string" }, { "FieldName": "FunctionParams", "FieldType": "Field_FunctionParams_in_FunctionRecordType" }, { "FieldName": "FunctionBody", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "IndexRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "DataverseName", "FieldType": "string" }, { "FieldName": "DatasetName", "FieldType": "string" }, { "FieldName": "IndexName", "FieldType": "string" }, { "FieldName": "IndexStructure", "FieldType": "string" }, { "FieldName": "SearchKey", "FieldType": "Field_SearchKey_in_IndexRecordType" }, { "FieldName": "IsPrimary", "FieldType": "boolean" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeGroupRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "NodeNames", "FieldType": "Field_NodeNames_in_NodeGroupRecordType" }, { "FieldName": "Timestamp", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "NodeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "NodeName", "FieldType": "string" }, { "FieldName": "NumberOfCores", "FieldType": "int32" }, { "FieldName": "WorkingMemorySize", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Tag", "FieldType": "string" }, { "FieldName": "IsAnonymous", "FieldType": "boolean" }, { "FieldName": "EnumValues", "FieldType": "Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Record", "FieldType": "Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "Union", "FieldType": "Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "UnorderedList", "FieldType": "Field_UnorderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" }, { "FieldName": "OrderedList", "FieldType": "Field_OrderedList_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_EnumValues_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_ExternalDetails_in_DatasetRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" }, { "FieldName": "Adapter", "FieldType": "string" }, { "FieldName": "Properties", "FieldType": "Field_Properties_in_Type_#1_UnionType_Field_FeedDetails_in_DatasetRecordType" }, { "FieldName": "Function", "FieldType": "string" }, { "FieldName": "Status", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "FileStructure", "FieldType": "string" }, { "FieldName": "PartitioningStrategy", "FieldType": "string" }, { "FieldName": "PartitioningKey", "FieldType": "Field_PartitioningKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "PrimaryKey", "FieldType": "Field_PrimaryKey_in_Type_#1_UnionType_Field_InternalDetails_in_DatasetRecordType" }, { "FieldName": "GroupName", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "IsOpen", "FieldType": "boolean" }, { "FieldName": "Fields", "FieldType": "Field_Fields_in_Type_#1_UnionType_Field_Record_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "Type_#1_UnionType_Field_Union_in_Type_#1_UnionType_Field_Derived_in_DatatypeRecordType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "string" }, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "boolean", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int16", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int32", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int64", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "int8", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "line", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "null", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "point3d", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "polygon", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Tue Feb 14 13:02:10 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "AddressType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "street", "FieldType": "StreetType" }, { "FieldName": "city", "FieldType": "string" }, { "FieldName": "state", "FieldType": "string" }, { "FieldName": "zip", "FieldType": "int16" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "CustomerType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "name", "FieldType": "string" }, { "FieldName": "age", "FieldType": "Field_age_in_CustomerType" }, { "FieldName": "address", "FieldType": "Field_address_in_CustomerType" }, { "FieldName": "interests", "FieldType": "Field_interests_in_CustomerType" }, { "FieldName": "children", "FieldType": "Field_children_in_CustomerType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_address_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "AddressType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_age_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_children_in_CustomerType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "name", "FieldType": "string" }, { "FieldName": "dob", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_interests_in_CustomerType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_items_in_OrderType_ItemType" }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "number", "FieldType": "int64" }, { "FieldName": "storeIds", "FieldType": "Field_storeIds_in_Field_items_in_OrderType_ItemType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_number_in_StreetType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_storeIds_in_Field_items_in_OrderType_ItemType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "int8", "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "OrderType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "oid", "FieldType": "int32" }, { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "orderstatus", "FieldType": "string" }, { "FieldName": "orderpriority", "FieldType": "string" }, { "FieldName": "clerk", "FieldType": "string" }, { "FieldName": "total", "FieldType": "float" }, { "FieldName": "items", "FieldType": "Field_items_in_OrderType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "StreetType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "number", "FieldType": "Field_number_in_StreetType" }, { "FieldName": "name", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Tue Feb 14 13:02:14 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataverse.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataverse.adm
new file mode 100644
index 0000000..6877e5b
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_dataverse.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Wed Sep 28 15:04:36 PDT 2011" }
+{ "DataverseName": "custord", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Wed Sep 28 15:04:40 PDT 2011" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm
new file mode 100644
index 0000000..efdf0bb
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_index.adm
@@ -0,0 +1,15 @@
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "Dataset", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataset", "IndexName": "GroupName", "IndexStructure": "BTREE", "SearchKey": [ "GroupName", "DataverseName", "DatasetName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "Datatype", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatatypeName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Datatype", "IndexName": "DatatypeName", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "NestedDatatypeName", "TopDatatypeName" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "IndexName": "Dataverse", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Function", "IndexName": "Function", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "FunctionName", "FunctionArity" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Index", "IndexName": "Index", "IndexStructure": "BTREE", "SearchKey": [ "DataverseName", "DatasetName", "IndexName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Node", "IndexName": "Node", "IndexStructure": "BTREE", "SearchKey": [ "NodeName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "IndexName": "Nodegroup", "IndexStructure": "BTREE", "SearchKey": [ "GroupName" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:31:59 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "custName", "IndexStructure": "BTREE", "SearchKey": [ "name", "cid" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "Orders", "IndexStructure": "BTREE", "SearchKey": [ "oid" ], "IsPrimary": true, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordClerkTotal", "IndexStructure": "BTREE", "SearchKey": [ "clerk", "total" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
+{ "DataverseName": "custord", "DatasetName": "Orders", "IndexName": "ordCustId", "IndexStructure": "BTREE", "SearchKey": [ "cid" ], "IsPrimary": false, "Timestamp": "Tue Feb 14 13:32:04 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_node.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_node.adm
new file mode 100644
index 0000000..f0a6e1d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_node.adm
@@ -0,0 +1,2 @@
+{ "NodeName": "nc1", "NumberOfCores": 0, "WorkingMemorySize": 0 }
+{ "NodeName": "nc2", "NumberOfCores": 0, "WorkingMemorySize": 0 }
diff --git a/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_nodegroup.adm b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_nodegroup.adm
new file mode 100644
index 0000000..343a994
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/check-state-results/check_nodegroup.adm
@@ -0,0 +1,3 @@
+{ "GroupName": "DEFAULT_NG_ALL_NODES", "NodeNames": {{ "nc1", "nc2" }}, "Timestamp": "Sun Feb 19 17:19:39 PST 2012" }
+{ "GroupName": "MetadataGroup", "NodeNames": {{ "nc1" }}, "Timestamp": "Sun Feb 19 17:19:39 PST 2012" }
+{ "GroupName": "group1", "NodeNames": {{ "nc1", "nc2" }}, "Timestamp": "Sun Feb 19 17:19:44 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata-transactions/init-state-queries.txt b/asterix-app/src/test/resources/metadata-transactions/init-state-queries.txt
new file mode 100644
index 0000000..5359017
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/init-state-queries.txt
@@ -0,0 +1 @@
+customers_orders.aql
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql b/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql
new file mode 100644
index 0000000..af15a23
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/init-state-queries/customers_orders.aql
@@ -0,0 +1,57 @@
+drop dataverse custord if exists;
+
+create dataverse custord;
+
+use dataverse custord;
+
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+
+create type AddressType as open {
+ street: StreetType,
+ city: string,
+ state: string,
+ zip: int16
+}
+
+create type CustomerType as closed {
+ cid: int32,
+ name: string,
+ age: int32?,
+ address: AddressType?,
+ interests: {{string}},
+ children: [ {
+ name : string,
+ dob : string
+ } ]
+}
+
+create type OrderType as open {
+ oid: int32,
+ cid: int32,
+ orderstatus: string,
+ orderpriority: string,
+ clerk: string,
+ total: float,
+ items: [ {
+ number: int64,
+ storeIds: {{int8}}
+ } ]
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset Customers(CustomerType)
+ partitioned by key cid, name on group1;
+
+create dataset Orders(OrderType)
+ partitioned by key oid on group1;
+
+create index ordCustId on Orders(cid);
+
+create index custName on Customers(name, cid);
+
+create index ordClerkTotal on Orders(clerk, total);
+
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries.txt b/asterix-app/src/test/resources/metadata-transactions/queries.txt
new file mode 100644
index 0000000..0762364
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries.txt
@@ -0,0 +1,20 @@
+create_duplicate_dataset.aql
+create_duplicate_dataverse.aql
+create_duplicate_index.aql
+create_duplicate_nodegroup.aql
+create_duplicate_type.aql
+drop_nonexistent_dataset.aql
+drop_nonexistent_datatype.aql
+drop_nonexistent_dataverse.aql
+drop_nonexistent_index.aql
+drop_nonexistent_nodegroup.aql
+rollback_drop_dataset.aql
+rollback_drop_datatype.aql
+rollback_drop_dataverse.aql
+rollback_drop_index.aql
+rollback_drop_nodegroup.aql
+rollback_new_dataset.aql
+rollback_new_datatype.aql
+rollback_new_dataverse.aql
+rollback_new_index.aql
+rollback_new_nodegroup.aql
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql
new file mode 100644
index 0000000..047eddf
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataset.aql
@@ -0,0 +1,4 @@
+use dataverse custord;
+
+create dataset Customers(CustomerType)
+ partitioned by key cid, name on group1;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataverse.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataverse.aql
new file mode 100644
index 0000000..da387c2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_dataverse.aql
@@ -0,0 +1 @@
+create dataverse custord;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_index.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_index.aql
new file mode 100644
index 0000000..be26b33
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_index.aql
@@ -0,0 +1,5 @@
+use dataverse custord;
+
+create index ordCustId on Orders(cid);
+
+
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_nodegroup.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_nodegroup.aql
new file mode 100644
index 0000000..6bfd2ea
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_nodegroup.aql
@@ -0,0 +1,3 @@
+use dataverse custord;
+
+create nodegroup group1 on nc1, nc2;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_type.aql b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_type.aql
new file mode 100644
index 0000000..bf4986e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/create_duplicate_type.aql
@@ -0,0 +1,6 @@
+use dataverse custord;
+
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataset.aql
new file mode 100644
index 0000000..af823aa
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataset.aql
@@ -0,0 +1,3 @@
+use dataverse custord;
+
+drop dataset baddataset;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_datatype.aql b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_datatype.aql
new file mode 100644
index 0000000..7e74668
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_datatype.aql
@@ -0,0 +1,3 @@
+use dataverse custord;
+
+drop type badtype;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataverse.aql b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataverse.aql
new file mode 100644
index 0000000..d301ebc
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_dataverse.aql
@@ -0,0 +1 @@
+drop dataverse baddataverse;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_index.aql b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_index.aql
new file mode 100644
index 0000000..6c461ef
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_index.aql
@@ -0,0 +1,3 @@
+use dataverse custord;
+
+drop index Customers.badindex;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_nodegroup.aql b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_nodegroup.aql
new file mode 100644
index 0000000..f8b8179
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/drop_nonexistent_nodegroup.aql
@@ -0,0 +1,3 @@
+use dataverse custord;
+
+drop nodegroup badnodegroup;
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql
new file mode 100644
index 0000000..860a714
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataset.aql
@@ -0,0 +1,10 @@
+use dataverse custord;
+
+drop dataset Customers;
+
+// Creating this duplicate type should fail,
+// and rollback should add the Customer type again.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_datatype.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_datatype.aql
new file mode 100644
index 0000000..00a0a7e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_datatype.aql
@@ -0,0 +1,12 @@
+use dataverse custord;
+
+// In order to drop the CustomerType we need to drop the Customer dataset.
+drop dataset Customers;
+drop type CustomerType;
+
+// Creating this duplicate type should fail,
+// and rollback should add the Customer type and dataset again.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataverse.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataverse.aql
new file mode 100644
index 0000000..2e505e9
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_dataverse.aql
@@ -0,0 +1,10 @@
+use dataverse custord;
+
+drop dataverse custord;
+
+// Creating this duplicate type should fail,
+// and rollback should add the secondary index again.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_index.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_index.aql
new file mode 100644
index 0000000..76db8ed
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_index.aql
@@ -0,0 +1,10 @@
+use dataverse custord;
+
+drop index Customers.custName;
+
+// Creating this duplicate type should fail,
+// and rollback should add the secondary index again.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_nodegroup.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_nodegroup.aql
new file mode 100644
index 0000000..52b32f2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_drop_nodegroup.aql
@@ -0,0 +1,13 @@
+use dataverse custord;
+
+// In order to drop a nodegroup we must drop all datasets partitioned on it.
+drop dataset Customers;
+drop dataset Orders;
+drop nodegroup group1;
+
+// Creating this duplicate type should fail,
+// and rollback should add the secondary index again.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql
new file mode 100644
index 0000000..aa76ae2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataset.aql
@@ -0,0 +1,12 @@
+use dataverse custord;
+
+// Creating this dataset should succeed.
+create dataset NewDataset(CustomerType)
+ partitioned by key cid, name on group1;
+
+
+// Creating this duplicate type should fail, and rollback should remove the new dataverse.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_datatype.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_datatype.aql
new file mode 100644
index 0000000..930e680
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_datatype.aql
@@ -0,0 +1,14 @@
+use dataverse custord;
+
+// Creating this type should succeed.
+create type NewType as closed {
+ number: int32?,
+ name: string
+}
+
+// Creating this duplicate type should fail, and rollback should remove the new datatype.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataverse.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataverse.aql
new file mode 100644
index 0000000..54eead9
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_dataverse.aql
@@ -0,0 +1,11 @@
+// Creating this dataverse should succeed.
+create dataverse newdataverse;
+
+use dataverse custord;
+
+// Creating this duplicate type should fail, and rollback should remove the new dataverse.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_index.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_index.aql
new file mode 100644
index 0000000..1c837af
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_index.aql
@@ -0,0 +1,10 @@
+use dataverse custord;
+
+// Creating this index should succeed.
+create index ordTotal on Orders(total);
+
+// Creating this duplicate type should fail, and rollback should remove the new index.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
diff --git a/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_nodegroup.aql b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_nodegroup.aql
new file mode 100644
index 0000000..75680c0
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata-transactions/queries/rollback_new_nodegroup.aql
@@ -0,0 +1,11 @@
+use dataverse custord;
+
+// Creating this nodegroup should succeed.
+create nodegroup newgroup if not exists on nc1, nc2;
+
+// Creating this duplicate type should fail, and rollback should remove the new nodegroup.
+create type StreetType as closed {
+ number: int32?,
+ name: string
+}
+