/// <exception cref="System.Exception"/> public virtual int Run(string[] args) { if (args.Length != 1) { System.Console.Error.WriteLine("usage: " + typeof(TestMultiThreadedHflush).Name + " <path to test file> "); System.Console.Error.WriteLine("Configurations settable by -D options:\n" + " num.threads [default 10] - how many threads to run\n" + " write.size [default 511] - bytes per write\n" + " num.writes [default 50000] - how many writes to perform" ); System.Environment.Exit(1); } TestMultiThreadedHflush test = new TestMultiThreadedHflush(); Configuration conf = GetConf(); Path p = new Path(args[0]); int numThreads = conf.GetInt("num.threads", 10); int writeSize = conf.GetInt("write.size", 511); int numWrites = conf.GetInt("num.writes", 50000); int replication = conf.GetInt(DFSConfigKeys.DfsReplicationKey, DFSConfigKeys.DfsReplicationDefault ); StopWatch sw = new StopWatch().Start(); test.DoMultithreadedWrites(conf, p, numThreads, writeSize, numWrites, replication ); sw.Stop(); System.Console.Out.WriteLine("Finished in " + sw.Now(TimeUnit.Milliseconds) + "ms" ); System.Console.Out.WriteLine("Latency quantiles (in microseconds):\n" + test.quantiles ); return(0); }
public WriterThread(TestMultiThreadedHflush _enclosing, FSDataOutputStream stm, AtomicReference <Exception> thrown, CountDownLatch countdown, int numWrites) { this._enclosing = _enclosing; this.stm = stm; this.thrown = thrown; this.numWrites = numWrites; this.countdown = countdown; }