public void configure(JobConf job) { super.setConf(job); } }
public void configure(JobConf job) { super.setConf(job); } }
public void configure(JobConf job) { super.setConf(job); } }
public void configure(JobConf job) { super.setConf(job); } }
public void configure(JobConf job) { super.setConf(job); } }
Configuration conf = new Configuration(); conf.setInt("num.key.fields.for.partition", 10); kfbp.setConf(conf); assertEquals("Empty key should map to 0th partition", 0, kfbp.getPartition(new Text(), new Text(), numReducers)); kfbp.setConf(conf); String input = "abc\tdef\txyz"; int hashCode = input.hashCode(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2,2"); kfbp.setConf(conf); String expectedOutput = "def"; byte[] eBytes = expectedOutput.getBytes(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2,5"); kfbp.setConf(conf); expectedOutput = "def\txyz"; eBytes = expectedOutput.getBytes(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2"); kfbp.setConf(conf); expectedOutput = "def\txyz"; eBytes = expectedOutput.getBytes(); conf = new Configuration();
Configuration conf = new Configuration(); conf.setInt("num.key.fields.for.partition", 10); kfbp.setConf(conf); assertEquals("Empty key should map to 0th partition", 0, kfbp.getPartition(new Text(), new Text(), numReducers)); kfbp.setConf(conf); String input = "abc\tdef\txyz"; int hashCode = input.hashCode(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2,2"); kfbp.setConf(conf); String expectedOutput = "def"; byte[] eBytes = expectedOutput.getBytes(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2,5"); kfbp.setConf(conf); expectedOutput = "def\txyz"; eBytes = expectedOutput.getBytes(); conf = new Configuration(); conf.set(KeyFieldBasedPartitioner.PARTITIONER_OPTIONS, "-k2"); kfbp.setConf(conf); expectedOutput = "def\txyz"; eBytes = expectedOutput.getBytes(); conf = new Configuration();