Beispiel #1
0
        /// <exception cref="System.IO.IOException"/>
        private void RunTestUnfinishedBlockCRCError(bool transferToAllowed, TestFileConcurrentReader.SyncType
                                                    syncType, int writeSize, Configuration conf)
        {
            conf.SetBoolean(DFSConfigKeys.DfsDatanodeTransfertoAllowedKey, transferToAllowed);
            Init(conf);
            Path          file          = new Path("/block-being-written-to");
            int           numWrites     = 2000;
            AtomicBoolean writerDone    = new AtomicBoolean(false);
            AtomicBoolean writerStarted = new AtomicBoolean(false);
            AtomicBoolean error         = new AtomicBoolean(false);

            Sharpen.Thread writer = new Sharpen.Thread(new _Runnable_340(this, file, syncType
                                                                         , error, numWrites, writeSize, writerStarted, writerDone));
            Sharpen.Thread tailer = new Sharpen.Thread(new _Runnable_373(this, writerDone, error
                                                                         , writerStarted, file, writer));
            writer.Start();
            tailer.Start();
            try
            {
                writer.Join();
                tailer.Join();
                NUnit.Framework.Assert.IsFalse("error occurred, see log above", error.Get());
            }
            catch (Exception)
            {
                Log.Info("interrupted waiting for writer or tailer to complete");
                Sharpen.Thread.CurrentThread().Interrupt();
            }
        }
Beispiel #2
0
 public _Runnable_340(TestFileConcurrentReader _enclosing, Path file, TestFileConcurrentReader.SyncType
                      syncType, AtomicBoolean error, int numWrites, int writeSize, AtomicBoolean writerStarted
                      , AtomicBoolean writerDone)
 {
     this._enclosing    = _enclosing;
     this.file          = file;
     this.syncType      = syncType;
     this.error         = error;
     this.numWrites     = numWrites;
     this.writeSize     = writeSize;
     this.writerStarted = writerStarted;
     this.writerDone    = writerDone;
 }
Beispiel #3
0
 /// <exception cref="System.IO.IOException"/>
 private void RunTestUnfinishedBlockCRCError(bool transferToAllowed, TestFileConcurrentReader.SyncType
                                             syncType, int writeSize)
 {
     RunTestUnfinishedBlockCRCError(transferToAllowed, syncType, writeSize, new Configuration
                                        ());
 }