Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.WritableComparator


     * grouping testing.
     * @throws Exception if failed
     */
    @Test
    public void grouping() throws Exception {
        WritableComparator comp = new Group();
        Mock o11 = new Mock("1", "1");
        Mock o12 = new Mock("1", "2");
        Mock o21 = new Mock("2", "1");
        Mock o22 = new Mock("2", "2");

View Full Code Here


     * ordering testing.
     * @throws Exception if failed
     */
    @Test
    public void ordering() throws Exception {
        WritableComparator comp = new Order();
        Mock o11 = new Mock("1", "1");
        Mock o12 = new Mock("1", "2");
        Mock o21 = new Mock("2", "1");
        Mock o22 = new Mock("2", "2");

View Full Code Here

    sortProgress.setDaemon(true);
    sortProgress.setName("Sort progress reporter for task "+getTaskId());

    Path tempDir = new Path(getTaskId());

    WritableComparator comparator = job.getOutputValueGroupingComparator();
   
    SequenceFile.Sorter.RawKeyValueIterator rIter;
    try {
      setPhase(TaskStatus.Phase.SORT);
View Full Code Here

      };
    sortProgress.setName("Sort progress reporter for task "+getTaskId());

    Path tempDir = job.getLocalPath(getTaskId());

    WritableComparator comparator = job.getOutputKeyComparator();
  
    SequenceFile.Sorter.RawKeyValueIterator rIter;
    try {
      setPhase(TaskStatus.Phase.SORT) ;
View Full Code Here

    if (!q.isEmpty()) {
      int highpos = -1;
      ArrayList<ComposableRecordReader<K, ?>> list = new ArrayList<ComposableRecordReader<K, ?>>(
          kids.length);
      q.peek().key(iterkey);
      final WritableComparator cmp = getComparator();
      while (0 == cmp.compare(q.peek().key(), iterkey)) {
        ComposableRecordReader<K, ?> t = q.poll();
        if (-1 == highpos || list.get(highpos).id() < t.id()) {
          highpos = list.size();
        }
        list.add(t);
View Full Code Here

      };
    sortProgress.setName("Sort progress reporter for task "+getTaskId());

    Path tempDir = job.getLocalPath(getTaskId());

    WritableComparator comparator = job.getOutputKeyComparator();
  
    SequenceFile.Sorter.RawKeyValueIterator rIter;
    try {
      setPhase(TaskStatus.Phase.SORT) ;
View Full Code Here

    assertTrue(pair4.compareTo(pair5) < 0);
  }

  @Test
  public void testComparison2() throws IOException {
    WritableComparator comparator = new PairOfLongFloat.Comparator();

    PairOfLongFloat pair1 = new PairOfLongFloat(1L, 2.0f);
    PairOfLongFloat pair2 = new PairOfLongFloat(1L, 2.0f);
    PairOfLongFloat pair3 = new PairOfLongFloat(1L, 1.0f);
    PairOfLongFloat pair4 = new PairOfLongFloat(0L, 9.0f);
View Full Code Here

    assertTrue(pair4.compareTo(pair5) < 0);   
  }

  @Test
  public void testComparison2() throws IOException {
    WritableComparator comparator = new PairOfStringInt.Comparator();

    PairOfStringInt pair1 = new PairOfStringInt("hi", 1);
    PairOfStringInt pair2 = new PairOfStringInt("hi", 1);
    PairOfStringInt pair3 = new PairOfStringInt("hi", 0);
    PairOfStringInt pair4 = new PairOfStringInt("a", 0);
View Full Code Here

    assertTrue(pair4.compareTo(pair5) < 0);
  }

  @Test
  public void testComparison2() throws IOException {
    WritableComparator comparator = new PairOfIntString.Comparator();

    PairOfIntString pair1 = new PairOfIntString(1, "2");
    PairOfIntString pair2 = new PairOfIntString(1, "2");
    PairOfIntString pair3 = new PairOfIntString(1, "1");
    PairOfIntString pair4 = new PairOfIntString(0, "9");
View Full Code Here

    assertTrue(threeInts2.compareTo(threeInts4) > 0);
  }

  @Test
  public void testComparison2() throws IOException {
    WritableComparator comparator = new TripleOfInts.Comparator();

    TripleOfInts threeInts1 = new TripleOfInts(1, 2, 3);
    TripleOfInts threeInts2 = new TripleOfInts(1, 2, 3);
    TripleOfInts threeInts3 = new TripleOfInts(1, 2, 2);
    TripleOfInts threeInts4 = new TripleOfInts(1, 1, 3);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.WritableComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.