Given a storedefinition, constructs the xml string to be sent out in
response to a "schemata" fetch request

@param storeDefinition
@return serialized store definition
422617
public static String constructSerializerInfoXml(StoreDefinition storeDefinition) {
        Element store = new Element(StoreDefinitionsMapper.STORE_ELMT);
        store.addContent(new Element(StoreDefinitionsMapper.STORE_NAME_ELMT).setText(storeDefinition.getName()));
        Element keySerializer = new Element(StoreDefinitionsMapper.STORE_KEY_SERIALIZER_ELMT);
        StoreDefinitionsMapper.addSerializer(keySerializer, storeDefinition.getKeySerializer());
        store.addContent(keySerializer);

        Element valueSerializer = new Element(StoreDefinitionsMapper.STORE_VALUE_SERIALIZER_ELMT);
        StoreDefinitionsMapper.addSerializer(valueSerializer, storeDefinition.getValueSerializer());
        store.addContent(valueSerializer);

        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        return serializer.outputString(store);
    }
908942
ConstructorFunction<Void, RecordFactory> createRecordFactoryConstructor(final SerializationService serializationService) {
        return notUsedArg -> {
            switch (mapConfig.getInMemoryFormat()) {
                case BINARY:
                    return new DataRecordFactory(mapConfig, serializationService, partitioningStrategy);
                case OBJECT:
                    return new ObjectRecordFactory(mapConfig, serializationService);
                default:
                    throw new IllegalArgumentException("Invalid storage format: " + mapConfig.getInMemoryFormat());
            }
        };
    }
808317
public MappedField getMappedField(final String storedName) {
        for (final MappedField mf : persistenceFields) {
            for (final String n : mf.getLoadNames()) {
                if (storedName.equals(n)) {
                    return mf;
                }
            }
        }

        return null;
    }
516426
JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) {
        if (definitionId == null) return null;
        return nodeTypes().getChildNodeDefinition(definitionId);
    }
1023513
function mapping (type, stateDefinitions, contractName) {
  var match = type.match(/mapping\((.*?)=>(.*)\)$/)
  var keyTypeName = match[1].trim()
  var valueTypeName = match[2].trim()

  var keyType = parseType(keyTypeName, stateDefinitions, contractName, 'storage')
  var valueType = parseType(valueTypeName, stateDefinitions, contractName, 'storage')

  var underlyingTypes = {
    'keyType': keyType,
    'valueType': valueType
  }
  return new MappingType(underlyingTypes, 'location', util.removeLocation(type))
}
758288
@Override
    public void updateStoreDefinition(StoreDefinition storeDef) {
        this.storeDef = storeDef;
        if(storeDef.hasRetentionPeriod())
            this.retentionTimeMs = storeDef.getRetentionDays() * Time.MS_PER_DAY;
    }
224063
public String getSpaces(String storeID) throws ResourceException {

        Element spacesElem = new Element("spaces");

        try {
            StorageProvider storage =
                storageProviderFactory.getStorageProvider(storeID);

            Iterator<String> spaces = storage.getSpaces();
            while (spaces.hasNext()) {
                String spaceID = spaces.next();
                Element spaceElem = new Element("space");
                spaceElem.setAttribute("id", spaceID);
                spacesElem.addContent(spaceElem);
            }
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("Error attempting to build spaces XML",
                                        e);
        }

        Document doc = new Document(spacesElem);
        XMLOutputter xmlConverter = new XMLOutputter();
        return xmlConverter.outputString(doc);
    }
1097603
@Override
	public String getContext() {

		final AbstractSchemaNode parent = getProperty(SchemaMethod.schemaNode);
		final StringBuilder buf = new StringBuilder();

		if (parent != null) {

			buf.append(parent.getProperty(SchemaNode.name));
			buf.append(".");
			buf.append(getProperty(name));
		}

		return buf.toString();
	}
1112417
public static Map<String, StoreDefinition> getUserStoreDefMapOnNode(AdminClient adminClient,
                                                                        Integer nodeId) {
        List<StoreDefinition> storeDefinitionList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId)
                                                                               .getValue();
        Map<String, StoreDefinition> storeDefinitionMap = Maps.newHashMap();
        for(StoreDefinition storeDefinition: storeDefinitionList) {
            storeDefinitionMap.put(storeDefinition.getName(), storeDefinition);
        }
        return storeDefinitionMap;
    }
973302
public static String getSerializedWithNewPackage(String serialized) {
    serialized = serialized.replace("\"gobblin.data.management.", "\"org.apache.gobblin.data.management.");
    log.debug("Serialized updated copy entity: " + serialized);
    return serialized;
  }
617694
public StorageComponent<KeyType, ValueType> getStorageComponent(final KeyType key) {

        KeyToStorageComponent<KeyType, ValueType> storage = getkeyToStorage();
        StorageComponent<KeyType, ValueType> storageComponent = storage.get(key);
        if (storageComponent == null) {
            storageComponent = new StorageComponent<KeyType, ValueType>();
            storage.put(key, storageComponent);
        }
        return storageComponent;
    }
290110
public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
    {
        $storageDef->dataText1 = $fieldDef->defaultValue->data;
    }
1328530
@Override
    public String getEntityDefinitionJson(String guid) throws AtlasException {
        guid = ParamChecker.notEmpty(guid, "entity id");

        final ITypedReferenceableInstance instance = repository.getEntityDefinition(guid);
        return InstanceSerialization.toJson(instance, true);
    }
918110
public static StoreDefinition getStoreDef(List<StoreDefinition> list, String name) {
        for(StoreDefinition def: list)
            if(def.getName().equals(name))
                return def;
        return null;
    }
986368
Map<String, Object> serialize() {

		final Map<String, Object> map = new TreeMap<>();

		for (final StructrTypeDefinition type : typeDefinitions) {

			map.put(type.getName(), type.serialize());
		}

		return map;
	}
1078986
private static SchemaStoreItemStream getSchemaStore(MessageStore msgStore) throws MessageStoreException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getSchemaStore");

    // Check the local cache first.
    SchemaStoreItemStream store = schemaStores.get(msgStore);

    // Not in the local cache, so try to find it in the MessageStore
    if (store == null) {
      Filter filter = new Filter() {
        public boolean filterMatches(AbstractItem item) {
          return (item instanceof SchemaStoreItemStream);
        }
      };
      store = (SchemaStoreItemStream)msgStore.findFirstMatching(filter);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && store != null) SibTr.debug(tc, "Schema store found in message store");

      // Not in the MessageStore, so try to create a new one
      if (store == null) {
        store = new SchemaStoreItemStream();
        msgStore.add(store, msgStore.getTransactionFactory().createAutoCommitTransaction());
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "New schema store created");
      }

      schemaStores.put(msgStore, store);

    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getSchemaStore");
    return store;
  }
683388
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
    {
        $options = [];
        $multiLingualOptions = [$fieldDef->mainLanguageCode => []];

        if (isset($storageDef->dataText5)) {
            $optionsXml = simplexml_load_string($storageDef->dataText5);
            if ($optionsXml !== false) {
                foreach ($optionsXml->options->option as $option) {
                    $options[(int)$option['id']] = (string)$option['name'];
                }
            }
        }

        if (isset($fieldDef->mainLanguageCode) && !empty($options)) {
            $multiLingualOptions[$fieldDef->mainLanguageCode] = $options;
        }

        foreach ($storageDef->multilingualData as $languageCode => $mlData) {
            $xml = simplexml_load_string($mlData->dataText);
            if ($xml !== false) {
                foreach ($xml->options->option as $option) {
                    $multiLingualOptions[$languageCode][(int)$option['id']] = (string)$option['name'];
                }
            }
        }

        $fieldDef->fieldTypeConstraints->fieldSettings = new FieldSettings([
                'isMultiple' => !empty($storageDef->dataInt1) ? (bool)$storageDef->dataInt1 : false,
                'options' => $options,
                'multilingualOptions' => $multiLingualOptions,
            ]
        );

        // @todo: Can Selection store a default value in the DB?
        $fieldDef->defaultValue = new FieldValue();
        $fieldDef->defaultValue->data = array();
        $fieldDef->defaultValue->sortKey = '';
    }