public final class Sort
extends java.lang.Object
sort(File, File)| Modifier and Type | Class and Description |
|---|---|
static class |
Sort.BufferSize
A bit more descriptive unit for constructors.
|
static class |
Sort.ByteSequencesReader
Utility class to read length-prefixed byte[] entries from an input.
|
static class |
Sort.ByteSequencesWriter
Utility class to emit length-prefixed byte[] entries to an output stream for sorting.
|
class |
Sort.SortInfo
Sort info (debugging mostly).
|
| Modifier and Type | Field and Description |
|---|---|
static long |
ABSOLUTE_MIN_SORT_BUFFER_SIZE
Absolute minimum required buffer size for sorting.
|
static java.util.Comparator<BytesRef> |
DEFAULT_COMPARATOR |
static long |
GB |
static int |
MAX_TEMPFILES
Maximum number of temporary files before doing an intermediate merge.
|
static long |
MB |
static long |
MIN_BUFFER_SIZE_MB
Minimum recommended buffer size for sorting.
|
| Constructor and Description |
|---|
Sort()
Defaults constructor.
|
Sort(java.util.Comparator<BytesRef> comparator) |
Sort(java.util.Comparator<BytesRef> comparator,
Sort.BufferSize ramBufferSize,
java.io.File tempDirectory,
int maxTempfiles)
All-details constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static java.io.File |
defaultTempDir()
Returns the default temporary directory.
|
java.util.Comparator<BytesRef> |
getComparator() |
Sort.SortInfo |
sort(java.io.File input,
java.io.File output)
Sort input to output, explicit hint for the buffer size.
|
protected java.io.File |
sortPartition(int len)
Sort a single partition in-memory.
|
public static final long MB
public static final long GB
public static final long MIN_BUFFER_SIZE_MB
public static final long ABSOLUTE_MIN_SORT_BUFFER_SIZE
public static final int MAX_TEMPFILES
public static final java.util.Comparator<BytesRef> DEFAULT_COMPARATOR
public Sort()
throws java.io.IOException
java.io.IOExceptiondefaultTempDir(),
Sort.BufferSize.automatic()public Sort(java.util.Comparator<BytesRef> comparator) throws java.io.IOException
java.io.IOExceptionpublic Sort(java.util.Comparator<BytesRef> comparator, Sort.BufferSize ramBufferSize, java.io.File tempDirectory, int maxTempfiles)
public Sort.SortInfo sort(java.io.File input, java.io.File output) throws java.io.IOException
java.io.IOExceptionpublic static java.io.File defaultTempDir()
throws java.io.IOException
java.io.IOExceptionprotected java.io.File sortPartition(int len)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Comparator<BytesRef> getComparator()
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.