热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.lucene.index.IndexFileNames.stripExtension()方法的使用及代码示例

本文整理了Java中org.apache.lucene.index.IndexFileNames.stripExtension()方法的一些代码示例,展示了

本文整理了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);

推荐阅读
author-avatar
王小瑶p_35ps
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有