Example #1
0
 private static void run(Callable c, boolean read, int size) {
   // Count all i/o time from here, including all retry overheads
   long start_io_ms = System.currentTimeMillis();
   while (true) {
     try {
       long start_ns = System.nanoTime(); // Blocking i/o call timing - without counting repeats
       c.call();
       TimeLine.record_IOclose(start_ns, start_io_ms, read ? 1 : 0, size, Value.HDFS);
       break;
       // Explicitly ignore the following exceptions but
       // fail on the rest IOExceptions
     } catch (EOFException e) {
       ignoreAndWait(e, false);
     } catch (SocketTimeoutException e) {
       ignoreAndWait(e, false);
     } catch (S3Exception e) {
       // Preserve S3Exception before IOException
       // Since this is tricky code - we are supporting different HDFS version
       // New version declares S3Exception as IOException
       // But old versions (0.20.xxx) declares it as RuntimeException
       // So we have to catch it before IOException !!!
       ignoreAndWait(e, false);
     } catch (IOException e) {
       ignoreAndWait(e, true);
     } catch (Exception e) {
       throw Log.errRTExcept(e);
     }
   }
 }
 public Dimension2D calculateDimension(StringBounder stringBounder) {
   int n = 0;
   for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
     n++;
   }
   return new Dimension2DDouble(n * dayWidth, getHeight());
 }
Example #3
0
 public TimeElement getEnd() {
   TimeElement result = start;
   for (int i = 1; i < duration; i++) {
     result = timeLine.next(result);
   }
   return result;
 }
  public void drawU(UGraphic ug) {
    int n = 0;
    String last = null;

    double pendingX = -1;
    for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
      final String text = "" + d.getMonth().name();
      if (pendingX == -1) {
        pendingX = n * dayWidth;
        last = text;
      }
      ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
      ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
      if (text.equals(last) == false) {
        manage(ug, 0, 0, n, last, pendingX);
        pendingX = n * dayWidth;
      }
      last = text;
      n++;
    }
    manage(ug, 0, 0, n, last, pendingX);
  }
Example #5
0
 private static void run(Callable c, boolean read, int size) {
   // Count all i/o time from here, including all retry overheads
   long start_io_ms = System.currentTimeMillis();
   while (true) {
     try {
       long start_ns = System.nanoTime(); // Blocking i/o call timing - without counting repeats
       c.call();
       TimeLine.record_IOclose(start_ns, start_io_ms, read ? 1 : 0, size, Value.HDFS);
       break;
       // Explicitly ignore the following exceptions but
       // fail on the rest IOExceptions
     } catch (EOFException e) {
       ignoreAndWait(e, false);
     } catch (SocketTimeoutException e) {
       ignoreAndWait(e, false);
     } catch (IOException e) {
       ignoreAndWait(e, true);
     } catch (Exception e) {
       throw Log.errRTExcept(e);
     }
   }
 }
Example #6
0
  public void drawU(UGraphic ug, double x, double y) {
    int n = 0;
    String last = null;

    double pendingX = -1;
    for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
      final String text = "" + d.getMonth().name();
      if (pendingX == -1) {
        pendingX = n * dayWidth;
        last = text;
      }
      ug.getParam().setColor(HtmlColorUtils.BLACK);
      ug.getParam().setBackcolor(HtmlColorUtils.WHITE);
      if (text.equals(last) == false) {
        manage(ug, x, y, n, last, pendingX);
        pendingX = n * dayWidth;
      }
      last = text;
      n++;
    }
    manage(ug, x, y, n, last, pendingX);
  }
Example #7
0
 public void onResize(ResizeEvent event) {
   space.setSize("100%", "100%");
   time.setSize("100%", "100%");
   space.checkResizeAndCenter();
 }
Example #8
0
 public TimeElement getCompleted() {
   return timeLine.next(getEnd());
 }