@SuppressForbidden(reason = "System.out/err detection") public boolean isSystemStream() { return stream == System.out || stream == System.err; }
@SuppressForbidden(reason = "Uses a Long instance as a marker") public final class PositiveIntOutputs extends Outputs<Long> {
@SuppressForbidden(reason = "System.out required: command line tool") private static void printUsage() { System.err.println("Upgrades an index so all segments created with a previous Lucene version are rewritten."); System.err.println("Usage:"); System.err.println(" java " + IndexUpgrader.class.getName() + " [-delete-prior-commits] [-verbose] [-dir-impl X] indexDir"); System.err.println("This tool keeps only the last commit in an index; for this"); System.err.println("reason, if the incoming index has more than one commit, the tool"); System.err.println("refuses to run by default. Specify -delete-prior-commits to override"); System.err.println("this, allowing the tool to delete all but the last commit."); System.err.println("Specify a " + FSDirectory.class.getSimpleName() + " implementation through the -dir-impl option to force its use. If no package is specified the " + FSDirectory.class.getPackage().getName() + " package will be used."); System.err.println("WARNING: This tool may reorder document IDs!"); System.exit(1); }
@SuppressForbidden(reason = "System.out required: command line tool") public static void main(String[] args) throws Exception {
@SuppressForbidden(reason = "System.out required: command line tool") private static int doMain(String args[]) throws IOException, InterruptedException { Options opts;
@SuppressForbidden(reason = "System.out required: command line tool") static IndexUpgrader parseArgs(String[] args) throws IOException { String path = null;
@SuppressForbidden(reason = "System.out required: command line tool") @SuppressWarnings("try") public static void main(String[] args) throws Exception {
@SuppressForbidden(reason = "Needs access to private APIs in DirectBuffer, sun.misc.Cleaner, and sun.misc.Unsafe to enable hack") private static Object unmapHackImpl() { final Lookup lookup = lookup();
/** * Creates an instance using the context classloader to load resources and classes. * Resource paths must be absolute. * * @deprecated You should not use this ctor, because it uses the thread's context * class loader, which is bad programming style. Please specify a reference class or * a {@link ClassLoader} instead. * @see #ClasspathResourceLoader(ClassLoader) * @see #ClasspathResourceLoader(Class) */ @Deprecated @SuppressForbidden(reason = "Deprecated method uses thread's context classloader, but there for backwards compatibility") public ClasspathResourceLoader() { this(Thread.currentThread().getContextClassLoader()); }
@SuppressForbidden(reason = "System.out/err detection") public boolean isSystemStream() { return stream == System.out || stream == System.err; }
@SuppressForbidden(reason = "System.out/err detection") public boolean isSystemStream() { return stream == System.out || stream == System.err; }
@SuppressForbidden(reason = "System.out required: command line tool") private static void usage() { System.out .println("\n\n" + "java org.apache.lucene.misc.HighFreqTerms <index dir> [-t] [number_terms] [field]\n\t -t: order by totalTermFreq\n\n"); }
@SuppressForbidden(reason = "System.out required: command line tool") private static void usage() { System.out .println("\n\n" + "java org.apache.lucene.misc.HighFreqTerms <index dir> [-t] [number_terms] [field]\n\t -t: order by totalTermFreq\n\n"); }
@SuppressForbidden(reason = "System.out required: command line tool") private static void usage() { System.out .println("\n\n" + "java org.apache.lucene.misc.HighFreqTerms <index dir> [-t] [number_terms] [field]\n\t -t: order by totalTermFreq\n\n"); }
@Override @SuppressForbidden(reason = "This class needs to access to the 'prefix' private field in Jakarta's REProgram. This class will be removed in Lucene 6.") public Field run() { try { final Field f = REProgram.class.getDeclaredField("prefix"); f.setAccessible(true); return f; } catch (Exception e) { return null; } } });
@Override @SuppressForbidden(reason = "This methods needs to access private attribute fields. Method will be abstract in 6.x") public Object run() { try { f.setAccessible(true); return f.get(AttributeImpl.this); } catch (IllegalAccessException e) { throw new RuntimeException("Cannot access private fields.", e); } } }));
@Override @SuppressForbidden(reason = "This methods needs to access private attribute fields. Method will be abstract in 6.x") public Object run() { try { f.setAccessible(true); return f.get(AttributeImpl.this); } catch (IllegalAccessException e) { throw new RuntimeException("Cannot access private fields.", e); } } }));
@SuppressForbidden(reason = "System.out required: command line tool") public void listSegments() throws IOException { DecimalFormat formatter = new DecimalFormat("###,###.###", DecimalFormatSymbols.getInstance(Locale.ROOT)); for (int x = 0; x < infos.size(); x++) { SegmentCommitInfo info = infos.info(x); String sizeStr = formatter.format(info.sizeInBytes()); System.out.println(info.info.name + " " + sizeStr); } }
@SuppressForbidden(reason = "System.out required: command line tool") public void listSegments() throws IOException { DecimalFormat formatter = new DecimalFormat("###,###.###", DecimalFormatSymbols.getInstance(Locale.ROOT)); for (int x = 0; x < infos.size(); x++) { SegmentCommitInfo info = infos.info(x); String sizeStr = formatter.format(info.sizeInBytes()); System.out.println(info.info.name + " " + sizeStr); } }
@SuppressForbidden(reason = "System.out required: command line tool") public void listSegments() throws IOException { DecimalFormat formatter = new DecimalFormat("###,###.###", DecimalFormatSymbols.getInstance(Locale.ROOT)); for (int x = 0; x < infos.size(); x++) { SegmentCommitInfo info = infos.info(x); String sizeStr = formatter.format(info.sizeInBytes()); System.out.println(info.info.name + " " + sizeStr); } }