Append service name to each avatar meta directory name

@param conf configuration of NameNode
@param serviceKey the non-empty name of the name node service
170300
public static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
    adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR0_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR1_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_EDITS_DIR0_KEY, serviceKey);
    adjustMetaDirectoryName(conf, DFS_SHARED_EDITS_DIR1_KEY, serviceKey);
  }
86250
public static String concatMetaEntityHref(String baseUri, String qualifiedEntityName) {
    return String.format("%s/%s/meta", baseUri, encodePathSegment(qualifiedEntityName));
  }
634606
public void initConfiguration(Map<?, ?> configurationMap, ServiceRegistryImplementor serviceRegistry) {
		ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
		ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService );

		this.configurationResource = propertyReader
				.property( InfinispanRemoteProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
				.withDefaultStringValue( InfinispanRemoteProperties.DEFAULT_CONFIGURATION_RESOURCE_NAME )
				.getValue();

		this.clientProperties = getHotRodConfiguration( configurationMap, propertyReader, this.configurationResource );

		this.schemaCaptureService = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_CAPTURE_SERVICE, SchemaCapture.class )
				.instantiate()
				.getValue();

		this.schemaOverrideService = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_OVERRIDE_SERVICE, SchemaOverride.class )
				.instantiate()
				.getValue();

		this.schemaOverrideResource = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_OVERRIDE_RESOURCE, URL.class )
				.getValue();

		this.schemaPackageName = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_PACKAGE_NAME, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_SCHEMA_PACKAGE_NAME )
				.getValue();

		this.schemaFileName = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_FILE_NAME, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_SCHEMA_FILE_NAME )
				.withValidator( InfinispanRemoteValidators.SCHEMA_FILE_NAME )
				.getValue();

		this.createCachesEnabled = propertyReader
				.property( OgmProperties.CREATE_DATABASE, boolean.class )
				.withDefault( false )
				.getValue();

		this.cacheConfiguration = propertyReader
				.property( InfinispanRemoteProperties.CACHE_CONFIGURATION, String.class )
				.withDefault( null )
				.getValue();

		String transactionModeString = propertyReader
				.property( InfinispanRemoteProperties.TRANSACTION_MODE, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_TRANSACTION_MODE )
				.getValue();

		this.transactionMode = extractTransactionMode( transactionModeString );

		log.tracef( "Initializing Infinispan Hot Rod client from configuration file at '%1$s'", configurationResource );
	}
1368255
private static void registerDnProtocolAddress(AvatarZooKeeperClient zk,
      Configuration originalConf, Configuration conf, boolean toOverwrite)
      throws UnsupportedEncodingException, IOException {
    LOG.info("Updating Service Address information in ZooKeeper");
    registerSocketAddress(zk,
        originalConf.get(NameNode.DATANODE_PROTOCOL_ADDRESS),
        conf.get(NameNode.DATANODE_PROTOCOL_ADDRESS), toOverwrite);
    registerAliases(zk, conf, FSConstants.DFS_NAMENODE_DN_ALIASES,
        conf.get(NameNode.DATANODE_PROTOCOL_ADDRESS), toOverwrite);
  }
270175
def get_service_keys(self, service_name):
        
        keys = []
        for key in self._get_service_keys(service_name)['resources']:
            keys.append(key['entity']['name'])

        return keys
57513
public static String buildKey(final RegisteredService service) {
        return service.getId() + ";" + service.getName() + ';' + service.getServiceId();
    }
1069490
def _write_service_config(self):
        
        with open(self.config_path, 'w') as output:
            output.write(json.dumps(self.data, sort_keys=True, indent=4))
999903
public final void setApplicationName(String... applicationNames) {
        synchronized (lock) {
            if (applicationNames == null) {
                serviceProperties.remove(APPLICATION_NAME);
            } else {
                serviceProperties.put(APPLICATION_NAME, applicationNames);
            }

            if (serviceRegistration != null) {
                serviceRegistration.setProperties(serviceProperties);
            }
        }
    }
675192
public static AvatarDataNode instantiateDataNode(String args[],
                                      Configuration conf) throws IOException {
    if (conf == null)
      conf = new Configuration();
    if (!parseArguments(args, conf)) {
      printUsage();
      return null;
    }
    if (conf.get("dfs.network.script") != null) {
      LOG.error("This configuration for rack identification is not supported" +
          " anymore. RackID resolution is handled by the NameNode.");
      System.exit(-1);
    }
    String[] dataDirs = getListOfDataDirs(conf);
    return makeInstance(dataDirs, conf);
  }
66279
private static void addCommonAttrs(StringBuilder sb) {
        sb.append(getKeyPairs(RpcConstants.CONFIG_KEY_PID, RpcRuntimeContext.PID));
        sb.append(getKeyPairs(RpcConstants.CONFIG_KEY_LANGUAGE, JAVA));
        sb.append(getKeyPairs(RpcConstants.CONFIG_KEY_RPC_VERSION, Version.RPC_VERSION + ""));
    }
479157
private static String[] adjustConf(String[] argv, Configuration conf) {
    String[] serviceId = new String[] { "" };
    String[] filteredArgv = DFSUtil.getServiceName(argv, serviceId);
    
    if (!serviceId[0].equals("")) {
      NameNode.checkServiceName(conf, serviceId[0]);
      DFSUtil.setGenericConf(conf, serviceId[0],
          NameNode.NAMESERVICE_SPECIFIC_KEYS);
      NameNode.setupDefaultURI(conf);
    }
    
    // make it avatar aware (manual option)
    if (optionExist(argv, "-one")) {
      updateConfKeys(conf, "1", serviceId[0]);
    } else {
      updateConfKeys(conf, "0", serviceId[0]);
    }
    return filteredArgv;
  }
22435
public function loadConfiguration()
    {
        // Load extension configuration
        $config = $this->getConfig();

        if(!isset($config['path']))
        {
            throw new ServiceCreationException('Missing required path parameter in PaletteExtension configuration');
        }

        if(!isset($config['url']))
        {
            throw new ServiceCreationException('Missing required url parameter in PaletteExtension configuration');
        }

        // Register extension services
        $builder = $this->getContainerBuilder();

        // Register palette service
        $builder->addDefinition($this->prefix('service'))
                ->setClass('NettePalette\Palette', array(

                    $config['path'],
                    $config['url'],
                    $config['basepath'],
                    empty($config['fallbackImage']) ? NULL : $config['fallbackImage'],
                    empty($config['template']) ? NULL : $config['template'],
                    empty($config['websiteUrl']) ? NULL : $config['websiteUrl'],
                    empty($config['pictureLoader']) ? NULL : $config['pictureLoader'],
                ))
                ->addSetup('setHandleExceptions', [

                    !isset($config['handleException']) ? TRUE : $config['handleException'],
                ]);

        // Register latte filter service
        $builder->addDefinition($this->prefix('filter'))
                ->setClass('NettePalette\LatteFilter', [$this->prefix('@service')]);

        // Register latte filter
        $this->getLatteService()
             ->addSetup('addFilter', ['palette', $this->prefix('@filter')]);

        // Register extension presenter
        $builder->getDefinition('nette.presenterFactory')
                ->addSetup('setMapping', [['Palette' => 'NettePalette\*Presenter']]);
    }
243615
public static void updateParameter(final HierarchicalConfiguration config, final String subKey, final String nameKey, final String valueKey,
		final Map<String, String> parameters) {
		for (HierarchicalConfiguration subConfig : config.configurationsAt(subKey)) {
			subConfig.clear();
		}
		String newNameKey = subKey + "(-1)." + nameKey;
		String newValueKey = subKey + '.' + valueKey;
		for (Map.Entry<String, String> parameter : parameters.entrySet()) {
			config.addProperty(newNameKey, parameter.getKey());
			config.addProperty(newValueKey, parameter.getValue());
		}
	}
750892
public synchronized void updateMasterConf(PropertyKey key, @Nullable String value) {
    mMasters.forEach(master -> master.updateConf(key, value));
  }
199446
public boolean putReference(K key, ServiceReference<V> reference) {
        if (key == null || reference == null)
            return false;

        ConcurrentServiceReferenceElement<V> element = new ConcurrentServiceReferenceElement<V>(referenceName, reference);
        return (elementMap.put(key, element) != null);
    }
779261
public ModelMetadataKey getMetadataKey(String keyName){
        HttpResponse result = invoker.invoke("/metadatakey/" + keyName , null, HttpMethod.GET);

        if (result.getHttpCode() != HTTP_OK) {
           throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }

        ModelMetadataKey key = _deserialize(
                    result.getRetBody(), ModelMetadataKey.class);

        return key;
    }
242330
private void addConfiguredStorageServices(Set<String> serviceSet) {
        List<String> ssList = ServerParams.instance().getModuleParamList("DoradusServer", "storage_services");
        if (ssList != null) {
            serviceSet.addAll(ssList);
        }
    }