Examples of Clock


Examples of org.apache.cassandra.thrift.Clock

        ColumnPath cp = new ColumnPath("Standard1");
        ColumnParent par = new ColumnParent("Standard1");
        cp.setColumn("name".getBytes("utf-8"));

        // insert
        Clock clock = new Clock();
        clock.setTimestamp(timestamp);
        client.insert(key_user_id, par, new Column("name".getBytes("utf-8"),
                "Ran".getBytes("UTF-8"), clock), ConsistencyLevel.ONE);

        // read
        ColumnOrSuperColumn got = client.get(key_user_id, cp,
View Full Code Here

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

Examples of org.apache.flume.Clock

        // 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

Examples of org.apache.flume.Clock

    );

    // 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

Examples of org.apache.flume.Clock

  @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

Examples of org.apache.hadoop.mapred.Clock

    }
    // fs.setTimes(tagDir, oldtime, -1);

    Thread.sleep(2*THRESHOLD);
    Pattern p = Pattern.compile("^(.+)\\/job_(\\d+)\\.(\\d+)_(\\d+)$");
    ExpireUnusedJobFiles expire = new ExpireUnusedJobFiles(new Clock(), conf,
      new Path(systemDir), p, THRESHOLD);
    expire.run();

    LOG.info("Check dirs under " + systemDir);
    // check if the dirs have been removed
View Full Code Here

Examples of org.apache.hadoop.yarn.Clock

    TaskId taskId = MRBuilderUtils.newTaskId(jobId, 1, TaskType.MAP);
    TaskAttemptListener taListener = mock(TaskAttemptListener.class);
    Path jobFile = mock(Path.class);
    JobConf jobConf = new JobConf();
    OutputCommitter outputCommitter = mock(OutputCommitter.class);
    Clock clock = new SystemClock();
    TaskAttemptImpl taImpl =
        new MapTaskAttemptImpl(taskId, 1, eventHandler, jobFile, 1,
            taskSplitMetaInfo, jobConf, taListener, outputCommitter, null,
            null, clock);
    return taImpl;
View Full Code Here

Examples of org.apache.hadoop.yarn.util.Clock

  @Test
  public void testBasic() throws Exception {
    AppContext mockContext = mock(AppContext.class);
    OutputCommitter mockCommitter = mock(OutputCommitter.class);
    Clock mockClock = mock(Clock.class);
   
    CommitterEventHandler handler = new CommitterEventHandler(mockContext,
        mockCommitter, new TestingRMHeartbeatHandler());
    YarnConfiguration conf = new YarnConfiguration();
    conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
View Full Code Here

Examples of org.apache.hadoop.yarn.util.Clock

  @Test
  public void testFailure() throws Exception {
    AppContext mockContext = mock(AppContext.class);
    OutputCommitter mockCommitter = mock(OutputCommitter.class);
    Clock mockClock = mock(Clock.class);
   
    CommitterEventHandler handler = new CommitterEventHandler(mockContext,
        mockCommitter, new TestingRMHeartbeatHandler());
    YarnConfiguration conf = new YarnConfiguration();
    conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
View Full Code Here

Examples of org.apache.hadoop.yarn.util.Clock

    verifyMillisCounters(10240, 1024, 2048);
  }

  public void verifyMillisCounters(int mapMemMb, int reduceMemMb,
      int minContainerSize) throws Exception {
    Clock actualClock = new SystemClock();
    ControlledClock clock = new ControlledClock(actualClock);
    clock.setTime(10);
    MRApp app =
        new MRApp(1, 1, false, "testSlotMillisCounterUpdate", true, clock);
    Configuration conf = new Configuration();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.