示例#1
0
 private static string Parameters2String(TestTFileSeqFileComparison.MyOptions options
                                         )
 {
     return(string.Format("KLEN: %d-%d... VLEN: %d-%d...MinBlkSize: %.2fKB...Target Size: %.2fMB...Compression: ...%s"
                          , options.keyLength, options.keyLength * 2, options.valueLength, options.valueLength
                          * 2, (double)options.minBlockSize / 1024, (double)options.fileSize / 1024 / 1024
                          , options.compress));
 }
示例#2
0
        /// <exception cref="System.IO.IOException"/>
        protected override void SetUp()
        {
            if (options == null)
            {
                options = new TestTFileSeqFileComparison.MyOptions(new string[0]);
            }
            conf = new Configuration();
            conf.SetInt("tfile.fs.input.buffer.size", options.fsInputBufferSize);
            conf.SetInt("tfile.fs.output.buffer.size", options.fsOutputBufferSize);
            Path path = new Path(options.rootDir);

            fs        = path.GetFileSystem(conf);
            formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            SetUpDictionary();
        }
示例#3
0
        /// <exception cref="System.IO.IOException"/>
        public static void Main(string[] args)
        {
            TestTFileSeqFileComparison testCase = new TestTFileSeqFileComparison();

            TestTFileSeqFileComparison.MyOptions options = new TestTFileSeqFileComparison.MyOptions
                                                               (args);
            if (options.proceed == false)
            {
                return;
            }
            testCase.options = options;
            string parameters = Parameters2String(options);

            testCase.SetUp();
            if (testCase.options.format.Equals("tfile"))
            {
                if (options.DoCreate())
                {
                    testCase.CreateTFile(parameters, options.compress);
                }
                if (options.DoRead())
                {
                    testCase.ReadTFile(parameters, options.DoCreate());
                }
            }
            else
            {
                if (options.DoCreate())
                {
                    testCase.CreateSeqFile(parameters, options.compress);
                }
                if (options.DoRead())
                {
                    testCase.ReadSeqFile(parameters, options.DoCreate());
                }
            }
            testCase.TearDown();
        }