示例#1
0
 /// <summary>
 /// Validate and set clusterId from
 /// <see cref="Sharpen.Properties"/>
 ///
 /// </summary>
 /// <exception cref="Org.Apache.Hadoop.Hdfs.Server.Common.InconsistentFSStateException
 ///     "/>
 protected internal virtual void SetClusterId(Properties props, int layoutVersion,
                                              Storage.StorageDirectory sd)
 {
     // Set cluster ID in version that supports federation
     if (LayoutVersion.Supports(GetServiceLayoutFeatureMap(), LayoutVersion.Feature.Federation
                                , layoutVersion))
     {
         string cid = GetProperty(props, sd, "clusterID");
         if (!(clusterID.Equals(string.Empty) || cid.Equals(string.Empty) || clusterID.Equals
                   (cid)))
         {
             throw new InconsistentFSStateException(sd.GetRoot(), "cluster Id is incompatible with others."
                                                    );
         }
         clusterID = cid;
     }
 }
示例#2
0
 public void setLayoutVersion(LayoutVersion version)
 {
     mLayoutVersion = version;
 }
 public static bool Supports(LayoutVersion.LayoutFeature f, int lv)
 {
     return(LayoutVersion.Supports(Features, f, lv));
 }
 static DataNodeLayoutVersion()
 {
     LayoutVersion.UpdateMap(Features, LayoutVersion.Feature.Values());
     LayoutVersion.UpdateMap(Features, DataNodeLayoutVersion.Feature.Values());
 }
示例#5
0
 public virtual bool VersionSupportsFederation(IDictionary <int, ICollection <LayoutVersion.LayoutFeature
                                                                              > > map)
 {
     return(LayoutVersion.Supports(map, LayoutVersion.Feature.Federation, layoutVersion
                                   ));
 }
示例#6
0
 static NameNodeLayoutVersion()
 {
     LayoutVersion.UpdateMap(Features, LayoutVersion.Feature.Values());
     LayoutVersion.UpdateMap(Features, NameNodeLayoutVersion.Feature.Values());
 }