Examples of Sorter


Examples of org.apache.hadoop.io.SequenceFile.Sorter

          indexFileName[i] = mapOutputFile.getSpillIndexFile(getTaskId(), i);
        }
       
        //create a sorter object as we need access to the SegmentDescriptor
        //class and merge methods
        Sorter sorter = new Sorter(localFs, keyClass, valClass, job);
       
        for (int parts = 0; parts < partitions; parts++){
          List<SegmentDescriptor> segmentList = new ArrayList(numSpills);
          for(int i = 0; i < numSpills; i++) {
            FSDataInputStream indexIn = localFs.open(indexFileName[i]);
            indexIn.seek(parts * 16);
            long segmentOffset = indexIn.readLong();
            long segmentLength = indexIn.readLong();
            indexIn.close();
            SegmentDescriptor s = sorter.new SegmentDescriptor(segmentOffset,
                segmentLength, filename[i]);
            s.preserveInput(true);
            s.doSync();
            segmentList.add(i, s);
          }
          segmentStart = finalOut.getPos();
          SequenceFile.Writer writer = SequenceFile.createWriter(job, finalOut,
              job.getMapOutputKeyClass(), job.getMapOutputValueClass(),
              compressionType, codec);
          sorter.writeFile(sorter.merge(segmentList, new Path(getTaskId())),
                           writer);
          //add a sync block - required esp. for block compression to ensure
          //partition data don't span partition boundaries
          writer.sync();
          //when we write the offset/length to the final index file, we write
View Full Code Here

Examples of org.apache.hadoop.io.SequenceFile.Sorter

          indexFileName[i] = mapOutputFile.getSpillIndexFile(getTaskId(), i);
        }
       
        //create a sorter object as we need access to the SegmentDescriptor
        //class and merge methods
        Sorter sorter = new Sorter(localFs, keyClass, valClass, job);
       
        for (int parts = 0; parts < partitions; parts++){
          List<SegmentDescriptor> segmentList = new ArrayList(numSpills);
          for(int i = 0; i < numSpills; i++) {
            FSDataInputStream indexIn = localFs.open(indexFileName[i]);
            indexIn.seek(parts * 16);
            long segmentOffset = indexIn.readLong();
            long segmentLength = indexIn.readLong();
            indexIn.close();
            SegmentDescriptor s = sorter.new SegmentDescriptor(segmentOffset,
                segmentLength, filename[i]);
            s.preserveInput(true);
            s.doSync();
            segmentList.add(i, s);
          }
          segmentStart = finalOut.getPos();
          SequenceFile.Writer writer = SequenceFile.createWriter(job, finalOut,
              job.getMapOutputKeyClass(), job.getMapOutputValueClass(),
              compressionType, codec);
          sorter.writeFile(sorter.merge(segmentList, new Path(getTaskId())),
                           writer);
          //add a sync block - required esp. for block compression to ensure
          //partition data don't span partition boundaries
          writer.sync();
          //when we write the offset/length to the final index file, we write
View Full Code Here

Examples of org.apache.lucene.index.sorter.Sorter

              return 0;
            }
          }
        };

      r = SortingAtomicReader.wrap(r, new Sorter() {
          @Override
          public Sorter.DocMap sort(AtomicReader reader) throws IOException {
            return Sorter.sort(maxDoc, comparator);
          }
View Full Code Here

Examples of org.apache.lucene.index.sorter.Sorter

              return 0;
            }
          }
        };

      r = SortingAtomicReader.wrap(r, new Sorter() {
          @Override
          public Sorter.DocMap sort(AtomicReader reader) throws IOException {
            return Sorter.sort(maxDoc, comparator);
          }
View Full Code Here

Examples of org.apache.lucene.index.sorter.Sorter

              return 0;
            }
          }
        };

      r = SortingAtomicReader.wrap(r, new Sorter() {
          @Override
          public Sorter.DocMap sort(AtomicReader reader) throws IOException {
            return Sorter.sort(maxDoc, comparator);
          }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.Sorter

        // TODO should be first invokeMethodBinding and the update state
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
      } else {
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        new Sorter().perform((SortActionEvent) facesEvent);
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.Sorter

        // TODO should be first invokeMethodBinding and the update state
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
      } else {
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        new Sorter().perform((SortActionEvent) facesEvent);
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.Sorter

        // TODO should be first invokeMethodBinding and the update state
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
      } else {
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        new Sorter().perform((SortActionEvent) facesEvent);
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.Sorter

        // TODO should be first invokeMethodBinding and the update state
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
      } else {
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        new Sorter().perform((SortActionEvent) facesEvent);
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.Sorter

        // TODO should be first invokeMethodBinding and the update state
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
      } else {
        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
        new Sorter().perform((SortActionEvent) facesEvent);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.