public CoreDescriptor(CoreContainer container,String name,Path instanceDir,Map<String,String> coreProps){
  this.coreContainer=container;
  this.instanceDir=instanceDir;
  originalCoreProperties.setProperty(CORE_NAME,name);
  Properties containerProperties=container.getContainerProperties();
  name=PropertiesUtil.substituteProperty(checkPropertyIsNotEmpty(name,CORE_NAME),containerProperties);
  coreProperties.putAll(defaultProperties);
  coreProperties.put(CORE_NAME,name);
  for (  String propname : coreProps.keySet()) {
    String propvalue=coreProps.get(propname);
    if (isUserDefinedProperty(propname))     originalExtraProperties.put(propname,propvalue);
 else     originalCoreProperties.put(propname,propvalue);
    if (!requiredProperties.contains(propname))     coreProperties.setProperty(propname,PropertiesUtil.substituteProperty(propvalue,containerProperties));
  }
  loadExtraProperties();
  buildSubstitutableProperties();
  if (container.isZooKeeperAware()) {
    cloudDesc=new CloudDescriptor(name,coreProperties,this);
  }
 else {
    cloudDesc=null;
  }
  log.debug("Created CoreDescriptor: " + coreProperties);
}

public CoreDescriptor ( CoreContainer container , String name , Path instanceDir , Map < String , String > coreProps ) { this . coreContainer = container ; this . instanceDir = instanceDir ; originalCoreProperties . setProperty ( CORE_NAME , name ) ; Properties containerProperties = container . getContainerProperties ( ) ; name = PropertiesUtil . substituteProperty ( checkPropertyIsNotEmpty ( name , CORE_NAME ) , containerProperties ) ; coreProperties . putAll ( defaultProperties ) ; coreProperties . put ( CORE_NAME , name ) ; for ( String propname : coreProps . keySet ( ) ) { String propvalue = coreProps . get ( propname ) ; if ( isUserDefinedProperty ( propname ) ) originalExtraProperties . put ( propname , propvalue ) ; else originalCoreProperties . put ( propname , propvalue ) ; if ( ! requiredProperties . contains ( propname ) ) coreProperties . setProperty ( propname , PropertiesUtil . substituteProperty ( propvalue , containerProperties ) ) ; } loadExtraProperties ( ) ; buildSubstitutableProperties ( ) ; if ( container . isZooKeeperAware ( ) ) { cloudDesc = new CloudDescriptor ( name , coreProperties , this ) ; } else { cloudDesc = null ; } log . debug ( "Created CoreDescriptor: " + coreProperties ) ; }
create a new coredescriptor .
