/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDir Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final File... tmpDir) { return new SortingCollection<T>(componentType, codec, comparator, maxRecordsInRAM, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDir Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Path... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDir Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Path... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param printRecordSizeSampling If true record size will be sampled and output at DEBUG log level * @param tmpDir Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final boolean printRecordSizeSampling, final Path... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, printRecordSizeSampling, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param printRecordSizeSampling If true record size will be sampled and output at DEBUG log level * @param tmpDir Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final boolean printRecordSizeSampling, final Path... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, printRecordSizeSampling, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters. Writes files to java.io.tmpdir * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM) { final Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir")); return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters. Writes files to java.io.tmpdir * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM) { final File tmpDir = new File(System.getProperty("java.io.tmpdir")); return new SortingCollection<T>(componentType, codec, comparator, maxRecordsInRAM, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters. Writes files to java.io.tmpdir * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM) { final Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir")); return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters. Writes files to java.io.tmpdir * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param printRecordSizeSampling If true record size will be sampled and output at DEBUG log level */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final boolean printRecordSizeSampling) { final Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir")); return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, printRecordSizeSampling, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters. Writes files to java.io.tmpdir * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param printRecordSizeSampling If true record size will be sampled and output at DEBUG log level */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final boolean printRecordSizeSampling) { final Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir")); return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, printRecordSizeSampling, tmpDir); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDirs Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Collection<File> tmpDirs) { return new SortingCollection<T>(componentType, codec, comparator, maxRecordsInRAM, tmpDirs.toArray(new File[tmpDirs.size()])); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDirs Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstanceFromPaths(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Collection<Path> tmpDirs) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDirs.toArray(new Path[tmpDirs.size()])); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDirs Where to write files of records that will not fit in RAM */ public static <T> SortingCollection<T> newInstanceFromPaths(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Collection<Path> tmpDirs) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDirs.toArray(new Path[tmpDirs.size()])); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDir Where to write files of records that will not fit in RAM * @deprecated since 2017-09. Use {@link #newInstance(Class, Codec, Comparator, int, Path...)} instead */ @Deprecated public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final File... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, Arrays.stream(tmpDir).map(File::toPath).toArray(Path[]::new)); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDir Where to write files of records that will not fit in RAM * @deprecated since 2017-09. Use {@link #newInstance(Class, Codec, Comparator, int, Path...)} instead */ @Deprecated public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final File... tmpDir) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, Arrays.stream(tmpDir).map(File::toPath).toArray(Path[]::new)); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDirs Where to write files of records that will not fit in RAM * @deprecated since 2017-09. Use {@link #newInstanceFromPaths(Class, Codec, Comparator, int, Collection)} instead */ @Deprecated public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Collection<File> tmpDirs) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDirs.stream().map(File::toPath).toArray(Path[]::new)); }
/** * Syntactic sugar around the ctor, to save some typing of type parameters * * @param componentType Class of the record to be sorted. Necessary because of Java generic lameness. * @param codec For writing records to file and reading them back into RAM * @param comparator Defines output sort order * @param maxRecordsInRAM how many records to accumulate in memory before spilling to disk * @param tmpDirs Where to write files of records that will not fit in RAM * @deprecated since 2017-09. Use {@link #newInstanceFromPaths(Class, Codec, Comparator, int, Collection)} instead */ @Deprecated public static <T> SortingCollection<T> newInstance(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRAM, final Collection<File> tmpDirs) { return new SortingCollection<>(componentType, codec, comparator, maxRecordsInRAM, false, tmpDirs.stream().map(File::toPath).toArray(Path[]::new)); }