Search in sources :

Example 6 with AUnorderedList

use of org.apache.asterix.om.base.AUnorderedList in project asterixdb by apache.

the class DatasetTupleTranslator method getDatasetHints.

protected Map<String, String> getDatasetHints(ARecord datasetRecord) {
    Map<String, String> hints = new HashMap<>();
    String key;
    String value;
    AUnorderedList list = (AUnorderedList) datasetRecord.getValueByPos(MetadataRecordTypes.DATASET_ARECORD_HINTS_FIELD_INDEX);
    IACursor cursor = list.getCursor();
    while (cursor.next()) {
        ARecord field = (ARecord) cursor.get();
        key = ((AString) field.getValueByPos(MetadataRecordTypes.PROPERTIES_NAME_FIELD_INDEX)).getStringValue();
        value = ((AString) field.getValueByPos(MetadataRecordTypes.PROPERTIES_VALUE_FIELD_INDEX)).getStringValue();
        hints.put(key, value);
    }
    return hints;
}
Also used : ARecord(org.apache.asterix.om.base.ARecord) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) AUnorderedList(org.apache.asterix.om.base.AUnorderedList) AMutableString(org.apache.asterix.om.base.AMutableString) AString(org.apache.asterix.om.base.AString) IACursor(org.apache.asterix.om.base.IACursor)

Aggregations

AUnorderedList (org.apache.asterix.om.base.AUnorderedList)6 ARecord (org.apache.asterix.om.base.ARecord)5 AString (org.apache.asterix.om.base.AString)4 IACursor (org.apache.asterix.om.base.IACursor)4 HashMap (java.util.HashMap)3 AMutableString (org.apache.asterix.om.base.AMutableString)3 ArrayList (java.util.ArrayList)2 AUnorderedListType (org.apache.asterix.om.types.AUnorderedListType)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DataInput (java.io.DataInput)1 DataInputStream (java.io.DataInputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 AsterixException (org.apache.asterix.common.exceptions.AsterixException)1 Feed (org.apache.asterix.metadata.entities.Feed)1 FeedPolicyEntity (org.apache.asterix.metadata.entities.FeedPolicyEntity)1 NodeGroup (org.apache.asterix.metadata.entities.NodeGroup)1 IAObject (org.apache.asterix.om.base.IAObject)1 ARecordType (org.apache.asterix.om.types.ARecordType)1 ATypeTag (org.apache.asterix.om.types.ATypeTag)1 IAType (org.apache.asterix.om.types.IAType)1