本文整理汇总了Java中com.fasterxml.sort.SortConfig类的典型用法代码示例。如果您正苦于以下问题:Java SortConfig类的具体用法?Java SortConfig怎么用?Java SortConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortConfig类属于com.fasterxml.sort包,在下文中一共展示了SortConfig类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SortedPathIterator
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public SortedPathIterator(final Iterator<Path> iter) throws IOException {
SortConfig config = new SortConfig().withMaxMemoryUsage(1000000);
Sorter sorter = new TextFileSorter(config);
DataReader<byte[]> reader = new DataReader<byte[]>() {
@Override
public byte[] readNext() throws IOException {
if (!iter.hasNext()) {
return null;
}
return iter.next().toString().getBytes(Charsets.UTF_8);
}
@Override
public void close() throws IOException {}
@Override
public int estimateSizeInBytes(byte[] item) { return item.length; }
};
this.sortedIter = sorter.sort(reader);
}
开发者ID:cityzendata,项目名称:warp10-platform,代码行数:21,代码来源:SortedPathIterator.java
示例2: sortFile
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public void sortFile(File in, File out, Comparator<String> cmp) {
try {
long availMem = Runtime.getRuntime().maxMemory()
- (2048 * 1024 * 1024);
long maxMem = (availMem >> 1);
if (maxMem > MAX_HEAP_FOR_PRESORT) {
maxMem = MAX_HEAP_FOR_PRESORT;
} else if (maxMem < MIN_HEAP_FOR_PRESORT) {
maxMem = MIN_HEAP_FOR_PRESORT;
}
final TextFileSorter sorter = new TextFileSorter(
new SortConfig().withMaxMemoryUsage(maxMem));
sorter.sort(new FileInputStream(in), new PrintStream(out));
} catch (IOException e) {
e.printStackTrace();
}
}
开发者ID:sing1ee,项目名称:dict_build,代码行数:19,代码来源:Builder.java
示例3: sortFile
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public void sortFile(File in, File out) {
try {
long availMem = Runtime.getRuntime().maxMemory()
- (40 * 1024 * 1024);
long maxMem = (availMem >> 1);
if (maxMem > MAX_HEAP_FOR_PRESORT) {
maxMem = MAX_HEAP_FOR_PRESORT;
} else if (maxMem < MIN_HEAP_FOR_PRESORT) {
maxMem = MIN_HEAP_FOR_PRESORT;
}
final TextFileSorter sorter = new TextFileSorter(
new SortConfig().withMaxMemoryUsage(maxMem));
sorter.sort(new FileInputStream(in), new PrintStream(out));
} catch (IOException e) {
e.printStackTrace();
}
}
开发者ID:sing1ee,项目名称:dict_build,代码行数:18,代码来源:FastBuilder.java
示例4: CsvFileSorter
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public CsvFileSorter(Class<T> entryType, SortConfig config, CsvMapper mapper, CsvSchema schema, Comparator<T> comparator)
throws IOException
{
super(config, new ReaderFactory<T>(mapper.readerFor(mapper.constructType(entryType)), mapper, schema),
new WriterFactory<T>(mapper, schema),
comparator);
}
开发者ID:ansell,项目名称:csvsum,代码行数:8,代码来源:CsvFileSorter.java
示例5: TextFileShuffler
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public TextFileShuffler() {
this(new SortConfig());
}
开发者ID:cityzendata,项目名称:warp10-platform,代码行数:4,代码来源:TextFileShuffler.java
示例6: getSortConfig
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
private SortConfig getSortConfig (MergeTempFileProvider tmpFileProvider) {
long maxMemory = Long.parseLong(context.getServiceManager().getConfigurationService().getProperty("fdbsql.sort.memory"));
return new SortConfig().withTempFileProvider(tmpFileProvider).withMaxMemoryUsage(maxMemory);
}
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:5,代码来源:MergeJoinSorter.java
示例7: createSorter
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
private Sorter<IdAndVersion> createSorter(IdAndVersionFactory idAndVersionFactory) {
SortConfig sortConfig = new SortConfig().withMaxMemoryUsage(DEFAULT_SORT_MEM);
DataReaderFactory<IdAndVersion> dataReaderFactory = new IdAndVersionDataReaderFactory(idAndVersionFactory);
DataWriterFactory<IdAndVersion> dataWriterFactory = new IdAndVersionDataWriterFactory();
return new Sorter<IdAndVersion>(sortConfig, dataReaderFactory, dataWriterFactory, new NaturalComparator<IdAndVersion>());
}
开发者ID:molindo,项目名称:molindo-elasticsync,代码行数:7,代码来源:Elasticsync.java
示例8: SplitFileSorter
import com.fasterxml.sort.SortConfig; //导入依赖的package包/类
public SplitFileSorter() {
this(new SortConfig());
}
开发者ID:sing1ee,项目名称:dict_build,代码行数:4,代码来源:SplitFileSorter.java
注:本文中的com.fasterxml.sort.SortConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论