protected class OsmSegmenter.WayFileSorter
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
WayFileSorter(StatusListener listener,
byte[] buf,
int latDirArrayLength,
java.io.PrintStream out)
Create a reusable WayFileSorter instance.
|
WayFileSorter(StatusListener listener,
int bufSize,
FastBlockingQueue<java.io.File> fileSource,
java.io.PrintStream out)
Create a reusable WayFileSorter instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getFailureReason()
Get reason why this sorter crashed.
|
int |
getNumDupWaysDeleted()
Report the number of Way records deleted from the file as being exact duplicates or
subsets of other Ways.
|
int |
getNumSortFailures()
Report the number of times the sort didn't succeed (usually due to file reading problems).
|
void |
run()
DO NOT CALL.
|
void |
setNoMoreFiles(boolean noMoreFiles)
Indicate to parallel way sorter thread that there are no more way files to be put into the queue.
|
void |
sortFile(java.io.File wayFile,
int latIdx)
Sort a temporary ways file into the proper permanent order.
|
public WayFileSorter(StatusListener listener, byte[] buf, int latDirArrayLength, java.io.PrintStream out)
listener
- StatusListener to report progress of sortingbuf
- byte array to use for buffered reading and writing of ways filelatDirArrayLength
- the number of latitude directories to be searched through (for computing percentage progress)out
- PrintStream for OsmSegmenter log filepublic WayFileSorter(StatusListener listener, int bufSize, FastBlockingQueue<java.io.File> fileSource, java.io.PrintStream out)
listener
- StatusListener to report progress of sortingbufSize
- size of byte array to use for buffered reading and writing of ways filefileSource
- FastBlockingQueue that can provide a sequence of File objects to sortout
- PrintStream for OsmSegmenter log filepublic void run()
run
in interface java.lang.Runnable
public void setNoMoreFiles(boolean noMoreFiles)
noMoreFiles
- boolean true if we are out of unsorted way filespublic int getNumSortFailures()
public int getNumDupWaysDeleted()
public void sortFile(java.io.File wayFile, int latIdx) throws java.io.IOException
wayFile
- File identifying the temporary file to sortlatIdx
- int array index of the latitude (used to calculate progress bar percentage)java.io.IOException
- if file could not be read or writtenpublic java.lang.Throwable getFailureReason()