Ejemplo n.º 1
0
            // add a bunch of transactions.
            public virtual void Run()
            {
                thr = Sharpen.Thread.CurrentThread();
                FsPermission p = new FsPermission((short)0x1ff);
                int          i = 0;

                while (!stopped)
                {
                    try
                    {
                        string dirname = "/thr-" + thr.GetId() + "-dir-" + i;
                        nn.Mkdirs(dirname, p, true);
                        nn.Delete(dirname, true);
                    }
                    catch (SafeModeException)
                    {
                    }
                    catch (Exception e)
                    {
                        // This is OK - the tests will bring NN in and out of safemode
                        Log.Warn("Got error in transaction thread", e);
                        caught.CompareAndSet(null, e);
                        break;
                    }
                    i++;
                }
            }