Ejemplo n.º 1
0
 internal BackupJournalManager(NamenodeRegistration bnReg, NamenodeRegistration nnReg
                               )
 {
     journalInfo = new JournalInfo(nnReg.GetLayoutVersion(), nnReg.GetClusterID(), nnReg
                                   .GetNamespaceID());
     this.bnReg = bnReg;
 }
Ejemplo n.º 2
0
        public virtual void TestConvertNamenodeRegistration()
        {
            StorageInfo          info = GetStorageInfo(HdfsServerConstants.NodeType.NameNode);
            NamenodeRegistration reg  = new NamenodeRegistration("address:999", "http:1000", info
                                                                 , HdfsServerConstants.NamenodeRole.Namenode);

            HdfsProtos.NamenodeRegistrationProto regProto = PBHelper.Convert(reg);
            NamenodeRegistration reg2 = PBHelper.Convert(regProto);

            NUnit.Framework.Assert.AreEqual(reg.GetAddress(), reg2.GetAddress());
            NUnit.Framework.Assert.AreEqual(reg.GetClusterID(), reg2.GetClusterID());
            NUnit.Framework.Assert.AreEqual(reg.GetCTime(), reg2.GetCTime());
            NUnit.Framework.Assert.AreEqual(reg.GetHttpAddress(), reg2.GetHttpAddress());
            NUnit.Framework.Assert.AreEqual(reg.GetLayoutVersion(), reg2.GetLayoutVersion());
            NUnit.Framework.Assert.AreEqual(reg.GetNamespaceID(), reg2.GetNamespaceID());
            NUnit.Framework.Assert.AreEqual(reg.GetRegistrationID(), reg2.GetRegistrationID()
                                            );
            NUnit.Framework.Assert.AreEqual(reg.GetRole(), reg2.GetRole());
            NUnit.Framework.Assert.AreEqual(reg.GetVersion(), reg2.GetVersion());
        }