Package org.apache.flume

Examples of org.apache.flume.Clock


        + System.currentTimeMillis()), 0, null, null, 30000,
        Executors.newSingleThreadExecutor(), 0, 0);

      // Need to override system time use for test so we know what to expect
      final long testTime = System.currentTimeMillis();
      Clock testClock = new Clock() {
          public long currentTimeMillis() {
              return testTime;
          }
      };
      bucketWriter.setClock(testClock);
View Full Code Here


        // Need to override system time use for test so we know what to expect

        final long testTime = System.currentTimeMillis();

        Clock testClock = new Clock() {
            public long currentTimeMillis() {
                return testTime;
            }
        };
        bucketWriter.setClock(testClock);
View Full Code Here

    );

    // Need to override system time use for test so we know what to expect
    final long testTime = System.currentTimeMillis();

    Clock testClock = new Clock() {
      public long currentTimeMillis() {
        return testTime;
      }
    };
    bucketWriter.setClock(testClock);
View Full Code Here

  @Test
  public void testSimpleAppendLocalTime() throws InterruptedException,
    LifecycleException, EventDeliveryException, IOException {
    final long currentTime = System.currentTimeMillis();
    Clock clk = new Clock() {
      @Override
      public long currentTimeMillis() {
        return currentTime;
      }
    };
View Full Code Here

    Assert.assertEquals(expectedString, escapedString);
  }

  @Test
  public void testDateRace() {
    Clock mockClock = mock(Clock.class);
    DateTimeFormatter parser = ISODateTimeFormat.dateTimeParser();
    long two = parser.parseMillis("2013-04-21T02:59:59-00:00");
    long three = parser.parseMillis("2013-04-21T03:00:00-00:00");
    when(mockClock.currentTimeMillis()).thenReturn(two, three);

    // save & modify static state (yuck)
    Clock origClock = BucketPath.getClock();
    BucketPath.setClock(mockClock);

    String pat = "%H:%M";
    String escaped = BucketPath.escapeString(pat,
        new HashMap<String, String>(),
View Full Code Here

          new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
          0, null, null, 30000, Executors.newSingleThreadExecutor());

      // Need to override system time use for test so we know what to expect
      final long testTime = System.currentTimeMillis();
      Clock testClock = new Clock() {
          public long currentTimeMillis() {
              return testTime;
          }
      };
      bucketWriter.setClock(testClock);
View Full Code Here

        // Need to override system time use for test so we know what to expect

        final long testTime = System.currentTimeMillis();

        Clock testClock = new Clock() {
            public long currentTimeMillis() {
                return testTime;
            }
        };
        bucketWriter.setClock(testClock);
View Full Code Here

        0, null, null, 30000, Executors.newSingleThreadExecutor());

    // Need to override system time use for test so we know what to expect
    final long testTime = System.currentTimeMillis();

    Clock testClock = new Clock() {
      public long currentTimeMillis() {
        return testTime;
      }
    };
    bucketWriter.setClock(testClock);
View Full Code Here

  @Test
  public void testSimpleAppendLocalTime() throws InterruptedException,
    LifecycleException, EventDeliveryException, IOException {
    final long currentTime = System.currentTimeMillis();
    Clock clk = new Clock() {
      @Override
      public long currentTimeMillis() {
        return currentTime;
      }
    };
View Full Code Here

          new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
          0, null);

      // Need to override system time use for test so we know what to expect
      final long testTime = System.currentTimeMillis();
      Clock testClock = new Clock() {
          public long currentTimeMillis() {
              return testTime;
          }
      };
      bucketWriter.setClock(testClock);
View Full Code Here

TOP

Related Classes of org.apache.flume.Clock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.