/** * Exits with code {@code -1} if maximum memory is below 90% of minimally allowed threshold. * * @param min Minimum memory threshold. */ public static void checkMinMemory(long min) { long maxMem = Runtime.getRuntime().maxMemory(); if (maxMem < .85 * min) { printerrln("Heap limit is too low (" + (maxMem / (1024 * 1024)) + "MB), please increase heap size at least up to " + (min / (1024 * 1024)) + "MB."); System.exit(-1); } }
/** * This method should be used for adding quick debug statements in code * while debugging. Calls to this method should never be committed to master. * * @param msg Message to debug. * @deprecated Calls to this method should never be committed to master. */ @Deprecated public static void debugx(String msg) { X.printerrln(debugPrefix() + msg); }
/** * Depending on whether or not log is provided and quiet mode is enabled logs given * messages as quiet message or normal log WARN message. If {@code log} is {@code null} * or in QUIET mode it will add {@code (wrn)} prefix to the message. * * @param log Optional logger to use when QUIET mode is not enabled. * @param msg Message to log using normal logger. * @param e Optional exception. */ public static void warn(@Nullable IgniteLogger log, Object msg, @Nullable Throwable e) { assert msg != null; if (log != null) log.warning(compact(msg.toString()), e); else { X.println("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] (wrn) " + compact(msg.toString())); if (e != null) e.printStackTrace(System.err); else X.printerrln(); } }
/** * Depending on whether or not log is provided and quiet mode is enabled logs given * messages as quiet message or normal log ERROR message. If {@code log} is {@code null} * or in QUIET mode it will add {@code (err)} prefix to the message. * * @param log Optional logger to use when QUIET mode is not enabled. * @param longMsg Message to log using normal logger. * @param shortMsg Message to log using quiet logger. * @param e Optional exception. */ public static void error(@Nullable IgniteLogger log, Object longMsg, Object shortMsg, @Nullable Throwable e) { assert longMsg != null; assert shortMsg != null; if (log != null) { if (e == null) log.error(compact(longMsg.toString())); else log.error(compact(longMsg.toString()), e); } else { X.printerr("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] (err) " + compact(shortMsg.toString())); if (e != null) e.printStackTrace(System.err); else X.printerrln(); } }
X.printerrln("Could not kill IgniteNodeRunner java processes. Jvm pid = " + jvmId, e);
X.printerrln("Data generation started."); X.printerrln("Data generation complete."); job.setOutputValueClass(NullWritable.class); X.printerrln("Job started."); X.printerrln("Job complete."); X.printerrln("__ file: " + file);
/** * Exits with code {@code -1} if maximum memory is below 90% of minimally allowed threshold. * * @param min Minimum memory threshold. */ public static void checkMinMemory(long min) { long maxMem = Runtime.getRuntime().maxMemory(); if (maxMem < .85 * min) { printerrln("Heap limit is too low (" + (maxMem / (1024 * 1024)) + "MB), please increase heap size at least up to " + (min / (1024 * 1024)) + "MB."); System.exit(-1); } }
/** * This method should be used for adding quick debug statements in code * while debugging. Calls to this method should never be committed to master. * * @param msg Message to debug. * @deprecated Calls to this method should never be committed to master. */ @Deprecated public static void debugx(String msg) { X.printerrln(debugPrefix() + msg); }
/** * Depending on whether or not log is provided and quiet mode is enabled logs given * messages as quiet message or normal log WARN message. If {@code log} is {@code null} * or in QUIET mode it will add {@code (wrn)} prefix to the message. * * @param log Optional logger to use when QUIET mode is not enabled. * @param msg Message to log using normal logger. * @param e Optional exception. */ public static void warn(@Nullable IgniteLogger log, Object msg, @Nullable Throwable e) { assert msg != null; if (log != null) log.warning(compact(msg.toString()), e); else { X.println("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] (wrn) " + compact(msg.toString())); if (e != null) e.printStackTrace(System.err); else X.printerrln(); } }
/** * Depending on whether or not log is provided and quiet mode is enabled logs given * messages as quiet message or normal log ERROR message. If {@code log} is {@code null} * or in QUIET mode it will add {@code (err)} prefix to the message. * * @param log Optional logger to use when QUIET mode is not enabled. * @param longMsg Message to log using normal logger. * @param shortMsg Message to log using quiet logger. * @param e Optional exception. */ public static void error(@Nullable IgniteLogger log, Object longMsg, Object shortMsg, @Nullable Throwable e) { assert longMsg != null; assert shortMsg != null; if (log != null) { if (e == null) log.error(compact(longMsg.toString())); else log.error(compact(longMsg.toString()), e); } else { X.printerr("[" + SHORT_DATE_FMT.format(new java.util.Date()) + "] (err) " + compact(shortMsg.toString())); if (e != null) e.printStackTrace(System.err); else X.printerrln(); } }