作者:王小瑶p_35ps | 来源:互联网 | 2023-08-06 18:23
本文整理了Java中org.apache.lucene.index.IndexFileNames.stripExtension()
方法的一些代码示例,展示了IndexFileNames.stripExtension()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndexFileNames.stripExtension()
方法的具体详情如下:
包路径:org.apache.lucene.index.IndexFileNames
类名称:IndexFileNames
方法名:stripExtension
IndexFileNames.stripExtension介绍
[英]Removes the extension (anything after the first '.'), otherwise returns the original filename.
[中]删除扩展名(第一个“.”之后的任何内容),否则返回原始文件名。
代码示例
代码示例来源:origin: org.apache.lucene/lucene-core
/** Returns the generation from this file name, or 0 if there is no
* generation. */
public static long parseGeneration(String filename) {
assert filename.startsWith("_");
String parts[] = stripExtension(filename).substring(1).split("_");
// 4 cases:
// segment.ext
// segment_gen.ext
// segment_codec_suffix.ext
// segment_gen_codec_suffix.ext
if (parts.length == 2 || parts.length == 4) {
return Long.parseLong(parts[1], Character.MAX_RADIX);
} else {
return 0;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
/** Returns the generation from this file name, or 0 if there is no
* generation. */
public static long parseGeneration(String filename) {
assert filename.startsWith("_");
String parts[] = stripExtension(filename).substring(1).split("_");
// 4 cases:
// segment.ext
// segment_gen.ext
// segment_codec_suffix.ext
// segment_gen_codec_suffix.ext
if (parts.length == 2 || parts.length == 4) {
return Long.parseLong(parts[1], Character.MAX_RADIX);
} else {
return 0;
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/** Returns the generation from this file name, or 0 if there is no
* generation. */
public static long parseGeneration(String filename) {
assert filename.startsWith("_");
String parts[] = stripExtension(filename).substring(1).split("_");
// 4 cases:
// segment.ext
// segment_gen.ext
// segment_codec_suffix.ext
// segment_gen_codec_suffix.ext
if (parts.length == 2 || parts.length == 4) {
return Long.parseLong(parts[1], Character.MAX_RADIX);
} else {
return 0;
}
}
代码示例来源:origin: harbby/presto-connectors
/** Returns the generation from this file name, or 0 if there is no
* generation. */
public static long parseGeneration(String filename) {
assert filename.startsWith("_");
String parts[] = stripExtension(filename).substring(1).split("_");
// 4 cases:
// segment.ext
// segment_gen.ext
// segment_codec_suffix.ext
// segment_gen_codec_suffix.ext
if (parts.length == 2 || parts.length == 4) {
return Long.parseLong(parts[1], Character.MAX_RADIX);
} else {
return 0;
}
}
代码示例来源:origin: harbby/presto-connectors
/**
* Create the compound stream in the specified file. The file name is the
* entire name (no extensions are added).
*
* @throws NullPointerException
* if dir
or name
is null
*/
Lucene40CompoundWriter(Directory dir, String name, IOContext context) {
if (dir == null)
throw new NullPointerException("directory cannot be null");
if (name == null)
throw new NullPointerException("name cannot be null");
directory = dir;
entryTableName = IndexFileNames.segmentFileName(
IndexFileNames.stripExtension(name), "",
Lucene40CompoundFormat.COMPOUND_FILE_ENTRIES_EXTENSION);
dataFileName = name;
this.cOntext= context;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
assert FIELD_INFOS_FILE_EXTENSION.equals(extension) == false || IndexFileNames.stripExtension(IndexFileNames.stripSegmentName(meta.name())).isEmpty() : "FieldInfos are generational but updateable DV are not supported in elasticsearch";
if (IndexFileNames.SEGMENTS.equals(segmentId) || DEL_FILE_EXTENSION.equals(extension) || LIV_FILE_EXTENSION.equals(extension)) {
代码示例来源:origin: harbby/presto-connectors
assert FIELD_INFOS_FILE_EXTENSION.equals(extension) == false || IndexFileNames.stripExtension(IndexFileNames.stripSegmentName(meta.name())).isEmpty() : "FieldInfos are generational but updateable DV are not supported in elasticsearch";
if (IndexFileNames.SEGMENTS.equals(segmentId) || DEL_FILE_EXTENSION.equals(extension) || LIV_FILE_EXTENSION.equals(extension)) {
代码示例来源:origin: harbby/presto-connectors
try {
final String entriesFileName = IndexFileNames.segmentFileName(
IndexFileNames.stripExtension(name), "",
Lucene40CompoundFormat.COMPOUND_FILE_ENTRIES_EXTENSION);
entriesStream = dir.openChecksumInput(entriesFileName, IOContext.READONCE);