Ejemplo n.º 1
0
 /// <exception cref="System.IO.IOException"/>
 private void DumpCacheManagerSection(InputStream @is)
 {
     @out.Write("<CacheManagerSection>");
     FsImageProto.CacheManagerSection s = FsImageProto.CacheManagerSection.ParseDelimitedFrom
                                              (@is);
     O("nextDirectiveId", s.GetNextDirectiveId());
     for (int i = 0; i < s.GetNumPools(); ++i)
     {
         ClientNamenodeProtocolProtos.CachePoolInfoProto p = ClientNamenodeProtocolProtos.CachePoolInfoProto
                                                             .ParseDelimitedFrom(@is);
         @out.Write("<pool>");
         O("poolName", p.GetPoolName()).O("ownerName", p.GetOwnerName()).O("groupName", p.
                                                                           GetGroupName()).O("mode", p.GetMode()).O("limit", p.GetLimit()).O("maxRelativeExpiry"
                                                                                                                                             , p.GetMaxRelativeExpiry());
         @out.Write("</pool>\n");
     }
     for (int i_1 = 0; i_1 < s.GetNumDirectives(); ++i_1)
     {
         ClientNamenodeProtocolProtos.CacheDirectiveInfoProto p = ClientNamenodeProtocolProtos.CacheDirectiveInfoProto
                                                                  .ParseDelimitedFrom(@is);
         @out.Write("<directive>");
         O("id", p.GetId()).O("path", p.GetPath()).O("replication", p.GetReplication()).O(
             "pool", p.GetPool());
         @out.Write("<expiration>");
         ClientNamenodeProtocolProtos.CacheDirectiveInfoExpirationProto e = p.GetExpiration
                                                                                ();
         O("millis", e.GetMillis()).O("relatilve", e.GetIsRelative());
         @out.Write("</expiration>\n");
         @out.Write("</directive>\n");
     }
     @out.Write("</CacheManagerSection>\n");
 }
Ejemplo n.º 2
0
            /// <exception cref="System.IO.IOException"/>
            private void LoadCacheManagerSection(InputStream @in)
            {
                FsImageProto.CacheManagerSection s = FsImageProto.CacheManagerSection.ParseDelimitedFrom
                                                         (@in);
                AList <ClientNamenodeProtocolProtos.CachePoolInfoProto> pools = Lists.NewArrayListWithCapacity
                                                                                    (s.GetNumPools());
                AList <ClientNamenodeProtocolProtos.CacheDirectiveInfoProto> directives = Lists.NewArrayListWithCapacity
                                                                                              (s.GetNumDirectives());

                for (int i = 0; i < s.GetNumPools(); ++i)
                {
                    pools.AddItem(ClientNamenodeProtocolProtos.CachePoolInfoProto.ParseDelimitedFrom(
                                      @in));
                }
                for (int i_1 = 0; i_1 < s.GetNumDirectives(); ++i_1)
                {
                    directives.AddItem(ClientNamenodeProtocolProtos.CacheDirectiveInfoProto.ParseDelimitedFrom
                                           (@in));
                }
                fsn.GetCacheManager().LoadState(new CacheManager.PersistState(s, pools, directives
                                                                              ));
            }