Beispiel #1
0
            /// <exception cref="System.IO.IOException"/>
            public virtual void WriteApplicationOwner(string user)
            {
                DataOutputStream @out = this.writer.PrepareAppendKey(-1);

                ApplicationOwnerKey.Write(@out);
                @out.Close();
                @out = this.writer.PrepareAppendValue(-1);
                @out.WriteUTF(user);
                @out.Close();
            }
Beispiel #2
0
 /// <summary>Returns the owner of the application.</summary>
 /// <returns>the application owner.</returns>
 /// <exception cref="System.IO.IOException"/>
 public virtual string GetApplicationOwner()
 {
     TFile.Reader.Scanner       ownerScanner = reader.CreateScanner();
     AggregatedLogFormat.LogKey key          = new AggregatedLogFormat.LogKey();
     while (!ownerScanner.AtEnd())
     {
         TFile.Reader.Scanner.Entry entry = ownerScanner.Entry();
         key.ReadFields(entry.GetKeyStream());
         if (key.ToString().Equals(ApplicationOwnerKey.ToString()))
         {
             DataInputStream valueStream = entry.GetValueStream();
             return(valueStream.ReadUTF());
         }
         ownerScanner.Advance();
     }
     return(null);
 }