Tabnine Logo
GridStringBuilder.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.ignite.internal.util.GridStringBuilder
constructor

Best Java code snippets using org.apache.ignite.internal.util.GridStringBuilder.<init> (Showing top 12 results out of 315)

origin: apache/ignite

/**
 * Dumps stack trace of the thread to the given log at warning level.
 *
 * @param t Thread to be dumped.
 * @param log Logger.
 */
public static void dumpThread(Thread t, @Nullable IgniteLogger log) {
  ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
  GridStringBuilder sb = new GridStringBuilder();
  printThreadInfo(mxBean.getThreadInfo(t.getId()), sb, Collections.emptySet());
  warn(log, sb.toString());
}
origin: apache/ignite

/**
 * Creates String key used for equality and hashing.
 */
private String createEqualityKey() {
  GridStringBuilder sb = new GridStringBuilder("(").a(usr).a(")@");
  if (uri.getScheme() != null)
    sb.a(uri.getScheme().toLowerCase());
  sb.a("://");
  if (uri.getAuthority() != null)
    sb.a(uri.getAuthority().toLowerCase());
  return sb.toString();
}
origin: apache/ignite

/**
 * Performs thread dump and prints all available info to the given log.
 *
 * @param log Logger.
 */
public static void dumpThreads(@Nullable IgniteLogger log) {
  ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
  final Set<Long> deadlockedThreadsIds = getDeadlockedThreadIds(mxBean);
  if (deadlockedThreadsIds.isEmpty())
    warn(log, "No deadlocked threads detected.");
  else
    warn(log, "Deadlocked threads detected (see thread dump below) " +
      "[deadlockedThreadsCnt=" + deadlockedThreadsIds.size() + ']');
  ThreadInfo[] threadInfos =
    mxBean.dumpAllThreads(mxBean.isObjectMonitorUsageSupported(), mxBean.isSynchronizerUsageSupported());
  GridStringBuilder sb = new GridStringBuilder("Thread dump at ")
    .a(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(U.currentTimeMillis()))).a(NL);
  for (ThreadInfo info : threadInfos) {
    printThreadInfo(info, sb, deadlockedThreadsIds);
    sb.a(NL);
    if (info.getLockedSynchronizers() != null && info.getLockedSynchronizers().length > 0) {
      printSynchronizersInfo(info.getLockedSynchronizers(), sb);
      sb.a(NL);
    }
  }
  sb.a(NL);
  warn(log, sb.toString());
}
origin: apache/ignite

/**
 * @param ids Ids.
 */
private String composeNodeInfo(final Set<UUID> ids) {
  final GridStringBuilder sb = new GridStringBuilder();
  sb.a("[");
  String delim = "";
  for (UUID id : ids) {
    sb
      .a(delim)
      .a(composeNodeInfo(id));
    delim = ", ";
  }
  sb.a("]");
  return sb.toString();
}
origin: apache/ignite

  /**
   * @param addr Address.
   */
  public static String printPage(long addr, int pageSize) throws IgniteCheckedException {
    PageIO io = getPageIO(addr);

    GridStringBuilder sb = new GridStringBuilder("Header [\n\ttype=");

    sb.a(getType(addr)).a(" (").a(io.getClass().getSimpleName())
      .a("),\n\tver=").a(getVersion(addr)).a(",\n\tcrc=").a(getCrc(addr))
      .a(",\n\t").a(PageIdUtils.toDetailString(getPageId(addr)))
      .a("\n],\n");

    io.printPage(addr, pageSize, sb);

    return sb.toString();
  }
}
origin: apache/ignite

/**
 * Checks starvation in striped pool. Maybe too verbose
 * but this is needed to faster debug possible issues.
 *
 * @return Flag representing presence of possible starvation in striped pool.
 */
public boolean detectStarvation() {
  boolean starvationDetected = false;
  for (Stripe stripe : stripes) {
    boolean active = stripe.active;
    long lastStartedTs = stripe.lastStartedTs;
    if (active && lastStartedTs + threshold < U.currentTimeMillis()) {
      starvationDetected = true;
      boolean deadlockPresent = U.deadlockPresent();
      GridStringBuilder sb = new GridStringBuilder();
      sb.a(">>> Possible starvation in striped pool.").a(U.nl())
        .a("    Thread name: ").a(stripe.thread.getName()).a(U.nl())
        .a("    Queue: ").a(stripe.queueToString()).a(U.nl())
        .a("    Deadlock: ").a(deadlockPresent).a(U.nl())
        .a("    Completed: ").a(stripe.completedCnt).a(U.nl());
      U.printStackTrace(
        stripe.thread.getId(),
        sb);
      String msg = sb.toString();
      U.warn(log, msg);
    }
  }
  return starvationDetected;
}
origin: apache/ignite

GridStringBuilder b = new GridStringBuilder("CREATE TABLE \"NameTest\" (id int primary key, x varchar) WITH " +
  "wrap_key,wrap_value");
origin: org.apache.ignite/ignite-core

/**
 * Dumps stack trace of the thread to the given log at warning level.
 *
 * @param t Thread to be dumped.
 * @param log Logger.
 */
public static void dumpThread(Thread t, @Nullable IgniteLogger log) {
  ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
  GridStringBuilder sb = new GridStringBuilder();
  printThreadInfo(mxBean.getThreadInfo(t.getId()), sb, Collections.emptySet());
  warn(log, sb.toString());
}
origin: org.apache.ignite/ignite-core

/**
 * Performs thread dump and prints all available info to the given log.
 *
 * @param log Logger.
 */
public static void dumpThreads(@Nullable IgniteLogger log) {
  ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
  final Set<Long> deadlockedThreadsIds = getDeadlockedThreadIds(mxBean);
  if (deadlockedThreadsIds.isEmpty())
    warn(log, "No deadlocked threads detected.");
  else
    warn(log, "Deadlocked threads detected (see thread dump below) " +
      "[deadlockedThreadsCnt=" + deadlockedThreadsIds.size() + ']');
  ThreadInfo[] threadInfos =
    mxBean.dumpAllThreads(mxBean.isObjectMonitorUsageSupported(), mxBean.isSynchronizerUsageSupported());
  GridStringBuilder sb = new GridStringBuilder("Thread dump at ")
    .a(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(U.currentTimeMillis()))).a(NL);
  for (ThreadInfo info : threadInfos) {
    printThreadInfo(info, sb, deadlockedThreadsIds);
    sb.a(NL);
    if (info.getLockedSynchronizers() != null && info.getLockedSynchronizers().length > 0) {
      printSynchronizersInfo(info.getLockedSynchronizers(), sb);
      sb.a(NL);
    }
  }
  sb.a(NL);
  warn(log, sb.toString());
}
origin: org.apache.ignite/ignite-core

/**
 * @param ids Ids.
 */
private String composeNodeInfo(final Set<UUID> ids) {
  final GridStringBuilder sb = new GridStringBuilder();
  sb.a("[");
  String delim = "";
  for (UUID id : ids) {
    sb
      .a(delim)
      .a(composeNodeInfo(id));
    delim = ", ";
  }
  sb.a("]");
  return sb.toString();
}
origin: org.apache.ignite/ignite-core

  /**
   * @param addr Address.
   */
  public static String printPage(long addr, int pageSize) throws IgniteCheckedException {
    PageIO io = getPageIO(addr);

    GridStringBuilder sb = new GridStringBuilder("Header [\n\ttype=");

    sb.a(getType(addr)).a(" (").a(io.getClass().getSimpleName())
      .a("),\n\tver=").a(getVersion(addr)).a(",\n\tcrc=").a(getCrc(addr))
      .a(",\n\t").a(PageIdUtils.toDetailString(getPageId(addr)))
      .a("\n],\n");

    io.printPage(addr, pageSize, sb);

    return sb.toString();
  }
}
origin: org.apache.ignite/ignite-core

/**
 * Checks starvation in striped pool. Maybe too verbose
 * but this is needed to faster debug possible issues.
 */
public void checkStarvation() {
  for (int i = 0; i < stripes.length; i++) {
    Stripe stripe = stripes[i];
    long completedCnt = stripe.completedCnt;
    boolean active = stripe.active;
    if (completedCntrs[i] != -1 &&
      completedCntrs[i] == completedCnt &&
      active) {
      boolean deadlockPresent = U.deadlockPresent();
      GridStringBuilder sb = new GridStringBuilder();
      sb.a(">>> Possible starvation in striped pool.").a(U.nl())
        .a("    Thread name: ").a(stripe.thread.getName()).a(U.nl())
        .a("    Queue: ").a(stripe.queueToString()).a(U.nl())
        .a("    Deadlock: ").a(deadlockPresent).a(U.nl())
        .a("    Completed: ").a(completedCnt).a(U.nl());
      U.printStackTrace(
        stripe.thread.getId(),
        sb);
      String msg = sb.toString();
      U.warn(log, msg);
    }
    if (active || completedCnt > 0)
      completedCntrs[i] = completedCnt;
  }
}
org.apache.ignite.internal.utilGridStringBuilder<init>

Popular methods of GridStringBuilder

  • a
  • toString
  • appendHex
    Appends given long value as a hex string to this string builder.
  • appendCodePoint
  • i
  • setLength

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JLabel (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now