Exemplo n.º 1
0
        public virtual void TestUpperBound()
        {
            Configuration conf = new Configuration();

            BinaryPartitioner.SetRightOffset(conf, 4);
            BinaryPartitioner <object> partitioner = ReflectionUtils.NewInstance <BinaryPartitioner
                                                                                  >(conf);
            BinaryComparable key1 = new BytesWritable(new byte[] { 1, 2, 3, 4, 5 });
            BinaryComparable key2 = new BytesWritable(new byte[] { 1, 2, 3, 4, 6 });
            int partition1        = partitioner.GetPartition(key1, null, 10);
            int partition2        = partitioner.GetPartition(key2, null, 10);

            NUnit.Framework.Assert.IsTrue(partition1 != partition2);
        }