/// <exception cref="System.Exception"/> public virtual void TestFSRMStateStoreClientRetry() { HdfsConfiguration conf = new HdfsConfiguration(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(2).Build(); cluster.WaitActive(); try { TestFSRMStateStore.TestFSRMStateStoreTester fsTester = new TestFSRMStateStore.TestFSRMStateStoreTester (this, cluster, false); RMStateStore store = fsTester.GetRMStateStore(); store.SetRMDispatcher(new RMStateStoreTestBase.TestDispatcher()); AtomicBoolean assertionFailedInThread = new AtomicBoolean(false); cluster.ShutdownNameNodes(); Sharpen.Thread clientThread = new _Thread_381(store, assertionFailedInThread); Sharpen.Thread.Sleep(2000); clientThread.Start(); cluster.RestartNameNode(); clientThread.Join(); NUnit.Framework.Assert.IsFalse(assertionFailedInThread.Get()); } finally { cluster.Shutdown(); } }
/// <exception cref="System.Exception"/> public virtual void TestCheckMajorVersionChange() { HdfsConfiguration conf = new HdfsConfiguration(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(1).Build(); try { fsTester = new _TestFSRMStateStoreTester_291(this, cluster, false); // default version RMStateStore store = fsTester.GetRMStateStore(); Version defaultVersion = fsTester.GetCurrentVersion(); store.CheckVersion(); NUnit.Framework.Assert.AreEqual(defaultVersion, store.LoadVersion()); } finally { cluster.Shutdown(); } }
/// <exception cref="System.Exception"/> public virtual void TestFSRMStateStore() { HdfsConfiguration conf = new HdfsConfiguration(); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(1).Build(); try { fsTester = new TestFSRMStateStore.TestFSRMStateStoreTester(this, cluster, false); // If the state store is FileSystemRMStateStore then add corrupted entry. // It should discard the entry and remove it from file system. FSDataOutputStream fsOut = null; FileSystemRMStateStore fileSystemRMStateStore = (FileSystemRMStateStore)fsTester. GetRMStateStore(); string appAttemptIdStr3 = "appattempt_1352994193343_0001_000003"; ApplicationAttemptId attemptId3 = ConverterUtils.ToApplicationAttemptId(appAttemptIdStr3 ); Path appDir = fsTester.store.GetAppDir(attemptId3.GetApplicationId().ToString()); Path tempAppAttemptFile = new Path(appDir, attemptId3.ToString() + ".tmp"); fsOut = fileSystemRMStateStore.fs.Create(tempAppAttemptFile, false); fsOut.Write(Sharpen.Runtime.GetBytesForString("Some random data ")); fsOut.Close(); TestRMAppStateStore(fsTester); NUnit.Framework.Assert.IsFalse(fsTester.workingDirPathURI.GetFileSystem(conf).Exists (tempAppAttemptFile)); TestRMDTSecretManagerStateStore(fsTester); TestCheckVersion(fsTester); TestEpoch(fsTester); TestAppDeletion(fsTester); TestDeleteStore(fsTester); TestAMRMTokenSecretManagerStateStore(fsTester); } finally { cluster.Shutdown(); } }