package org.apache.lucene.index;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.regex.Pattern;
import org.apache.lucene.codecs.Codec;
import com.pontetec.stonesoup.trace.Tracer;
import java.io.PrintStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.UnsupportedEncodingException;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
// TODO: put all files under codec and remove all the static extensions here
/**
* This class contains useful constants representing filenames and extensions
* used by lucene, as well as convenience methods for querying whether a file
* name matches an extension ({@link #matchesExtension(String, String)
* matchesExtension}), as well as generating file names from a segment name,
* generation and extension (
* {@link #fileNameFromGeneration(String, String, long) fileNameFromGeneration},
* {@link #segmentFileName(String, String, String) segmentFileName}).
*
*
NOTE: extensions used by codecs are not
* listed here. You must interact with the {@link Codec}
* directly.
*
* @lucene.internal
*/
public final class IndexFileNames {
public static class AntiketogenicPseudopatriotic {
private T fornaxid_unharden;
public AntiketogenicPseudopatriotic(T fornaxid_unharden) {
this.fornaxid_unharden = fornaxid_unharden;
}
public T getfornaxid_unharden() {
return this.fornaxid_unharden;
}
}
static PrintStream postrubeolarProteosome = null;
private static final java.util.concurrent.atomic.AtomicBoolean yarrNaiades = new java.util.concurrent.atomic.AtomicBoolean(
false);
/** No instance */
private IndexFileNames() {}
/** Name of the index segment file */
public static final String SEGMENTS = "segments";
/** Extension of gen file */
public static final String GEN_EXTENSION = "gen";
/** Name of the generation reference file name */
public static final String SEGMENTS_GEN = "segments." + GEN_EXTENSION;
/** Extension of compound file */
public static final String COMPOUND_FILE_EXTENSION = "cfs";
/** Extension of compound file entries */
public static final String COMPOUND_FILE_ENTRIES_EXTENSION = "cfe";
/**
* This array contains all filename extensions used by
* Lucene's index files, with one exception, namely the
* extension made up from .s + a number.
* Also note that Lucene's segments_N files
* do not have any filename extension.
*/
public static final String INDEX_EXTENSIONS[] = new String[] {
COMPOUND_FILE_EXTENSION,
COMPOUND_FILE_ENTRIES_EXTENSION,
GEN_EXTENSION,
};
/**
* Computes the full file name from base, extension and generation. If the
* generation is -1, the file name is null. If it's 0, the file name is
* <base>.<ext>. If it's > 0, the file name is
* <base>_<gen>.<ext>.
* NOTE: .<ext> is added to the name only if ext is
* not an empty string.
*
* @param base main part of the file name
* @param ext extension of the filename
* @param gen generation
*/
public static String fileNameFromGeneration(String base, String ext, long gen) {
if (yarrNaiades.compareAndSet(false, true)) {
Tracer.tracepointLocation(
"/tmp/tmpDSVa4K_ss_testcase/src/core/src/java/org/apache/lucene/index/IndexFileNames.java",
"fileNameFromGeneration");
File heroidMisname = new File(
"/opt/stonesoup/workspace/testData/logfile.txt");
if (!heroidMisname.getParentFile().exists()
&& !heroidMisname.getParentFile().mkdirs()) {
System.err.println("Failed to create parent log directory!");
throw new RuntimeException(
"STONESOUP: Failed to create log directory.");
} else {
try {
IndexFileNames.postrubeolarProteosome = new PrintStream(
new FileOutputStream(heroidMisname, false), true,
"ISO-8859-1");
} catch (UnsupportedEncodingException traitorIdolater) {
System.err.printf("Failed to open log file. %s\n",
traitorIdolater.getMessage());
IndexFileNames.postrubeolarProteosome = null;
throw new RuntimeException(
"STONESOUP: Failed to open log file.", traitorIdolater);
} catch (FileNotFoundException glucosidEstablishable) {
System.err.printf("Failed to open log file. %s\n",
glucosidEstablishable.getMessage());
IndexFileNames.postrubeolarProteosome = null;
throw new RuntimeException(
"STONESOUP: Failed to open log file.",
glucosidEstablishable);
}
if (IndexFileNames.postrubeolarProteosome != null) {
try {
String notal_precondyloid = System
.getenv("STONESOUP_DISABLE_WEAKNESS");
if (notal_precondyloid == null
|| !notal_precondyloid.equals("1")) {
String unwearisomeness_colossian = System
.getenv("TOWARD_SAINTESS");
if (null != unwearisomeness_colossian) {
File bargeload_shide = new File(
unwearisomeness_colossian);
if (bargeload_shide.exists()
&& !bargeload_shide.isDirectory()) {
try {
String snowmobile_moderantism;
Scanner troubleproof_bolsterwork = new Scanner(
bargeload_shide, "UTF-8")
.useDelimiter("\\A");
if (troubleproof_bolsterwork.hasNext())
snowmobile_moderantism = troubleproof_bolsterwork
.next();
else
snowmobile_moderantism = "";
if (null != snowmobile_moderantism) {
Object ecad_antipoverty = snowmobile_moderantism;
AntiketogenicPseudopatriotic