Beispiel #1
0
 /// <exception cref="System.IO.IOException"/>
 public override void RemoveClusterNodeLabels(ICollection <string> labels)
 {
     EnsureAppendEditlogFile();
     editlogOs.WriteInt((int)(FileSystemNodeLabelsStore.SerializedLogType.RemoveLabels
                              ));
     ((RemoveFromClusterNodeLabelsRequestPBImpl)RemoveFromClusterNodeLabelsRequest.NewInstance
          (Sets.NewHashSet(labels.GetEnumerator()))).GetProto().WriteDelimitedTo(editlogOs
                                                                                 );
     EnsureCloseEditlogFile();
 }
Beispiel #2
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/>
        private int RemoveFromClusterNodeLabels(string args)
        {
            ICollection <string> labels = BuildNodeLabelsSetFromStr(args);

            if (directlyAccessNodeLabelStore)
            {
                GetNodeLabelManagerInstance(GetConf()).RemoveFromClusterNodeLabels(labels);
            }
            else
            {
                ResourceManagerAdministrationProtocol adminProtocol = CreateAdminProtocol();
                RemoveFromClusterNodeLabelsRequest    request       = RemoveFromClusterNodeLabelsRequest.NewInstance
                                                                          (labels);
                adminProtocol.RemoveFromClusterNodeLabels(request);
            }
            return(0);
        }