Exemplo n.º 1
0
 /**
  * Log task mapped.
  *
  * @param log Logger.
  * @param clazz Task class.
  * @param nodes Mapped nodes.
  */
 public static void logMapped(
     @Nullable IgniteLogger log, Class<?> clazz, Collection<ClusterNode> nodes) {
   log0(
       log,
       U.currentTimeMillis(),
       String.format("[%s]: MAPPED: %s", clazz.getSimpleName(), U.toShortString(nodes)));
 }
Exemplo n.º 2
0
  /**
   * Log finished.
   *
   * @param log Logger.
   * @param clazz Class.
   * @param start Start time.
   */
  public static void logFinish(@Nullable IgniteLogger log, Class<?> clazz, long start) {
    final long end = U.currentTimeMillis();

    log0(
        log,
        end,
        String.format(
            "[%s]: FINISHED, duration: %s", clazz.getSimpleName(), formatDuration(end - start)));
  }
Exemplo n.º 3
0
  /**
   * Log message.
   *
   * @param log Logger.
   * @param msg Message to log.
   * @param clazz class.
   * @param start start time.
   * @return Time when message was logged.
   */
  public static long log(@Nullable IgniteLogger log, String msg, Class<?> clazz, long start) {
    final long end = U.currentTimeMillis();

    log0(
        log,
        end,
        String.format(
            "[%s]: %s, duration: %s", clazz.getSimpleName(), msg, formatDuration(end - start)));

    return end;
  }
Exemplo n.º 4
0
 private static boolean generateParameterJava(
     PrintWriter writer,
     VariableElement param,
     TypeInfo type_info,
     boolean native_stub,
     final boolean printTypes,
     boolean first_parameter,
     Mode mode) {
   Class buffer_type = Utils.getNIOBufferType(param.asType());
   if (!first_parameter) {
     writer.print(", ");
   }
   BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
   if (bo_annotation != null && mode == Mode.BUFFEROBJECT) {
     if (buffer_type == null) {
       throw new RuntimeException(
           "type of "
               + param
               + " is not a nio Buffer parameter but is annotated as buffer object");
     }
     if (printTypes) {
       writer.print("long ");
     }
     writer.print(param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
   } else {
     if (native_stub && param.getAnnotation(PointerWrapper.class) != null) {
       writer.print("long ");
     } else {
       Class type = type_info.getType();
       if (native_stub
           && (type == CharSequence.class
               || type == CharSequence[].class
               || type == PointerBuffer.class
               || Buffer.class.isAssignableFrom(type))) {
         writer.print("long ");
       } else if (printTypes) {
         writer.print(type.getSimpleName() + " ");
       }
     }
     AutoSize auto_size_annotation = param.getAnnotation(AutoSize.class);
     if (auto_size_annotation != null) {
       writer.print(auto_size_annotation.value() + "_");
     }
     writer.print(param.getSimpleName());
   }
   return false;
 }
Exemplo n.º 5
0
 /**
  * Log start.
  *
  * @param log Logger.
  * @param clazz Class.
  * @param start Start time.
  */
 public static void logStart(@Nullable IgniteLogger log, Class<?> clazz, long start) {
   log0(log, start, "[" + clazz.getSimpleName() + "]: STARTED");
 }