Examples of Clock


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

        counters.findCounter(JobCounter.VCORES_MILLIS_REDUCES).getValue());
  }

  private TaskAttemptImpl createMapTaskAttemptImplForTest(
      EventHandler eventHandler, TaskSplitMetaInfo taskSplitMetaInfo) {
    Clock clock = new SystemClock();
    return createMapTaskAttemptImplForTest(eventHandler, taskSplitMetaInfo, clock);
  }
View Full Code Here

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

  private static final int NUM_REDUCERS = 0;

  @Test
  public void testSpeculateSuccessfulWithoutUpdateEvents() throws Exception {

    Clock actualClock = new SystemClock();
    final ControlledClock clock = new ControlledClock(actualClock);
    clock.setTime(System.currentTimeMillis());

    MRApp app =
        new MRApp(NUM_MAPPERS, NUM_REDUCERS, false, "test", true, clock);
View Full Code Here

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

  }

  @Test
  public void testSepculateSuccessfulWithUpdateEvents() throws Exception {

    Clock actualClock = new SystemClock();
    final ControlledClock clock = new ControlledClock(actualClock);
    clock.setTime(System.currentTimeMillis());

    MRApp app =
        new MRApp(NUM_MAPPERS, NUM_REDUCERS, false, "test", true, clock);
View Full Code Here

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

    JobConf conf = new JobConf();
    TaskAttemptListener taskAttemptListener = mock(TaskAttemptListener.class);
    Token<JobTokenIdentifier> jobToken =
        (Token<JobTokenIdentifier>) mock(Token.class);
    Credentials credentials = null;
    Clock clock = new SystemClock();
    int appAttemptId = 3;
    MRAppMetrics metrics = mock(MRAppMetrics.class);
    Resource minContainerRequirements = mock(Resource.class);
    when(minContainerRequirements.getMemory()).thenReturn(1000);
View Full Code Here

Examples of org.apache.jackrabbit.oak.stats.Clock

    @Test
    public void readWriteMode() throws InterruptedException {

        MemoryDocumentStore mem = new MemoryDocumentStore();
        Clock clock = new Clock.Virtual();
        clock.waitUntil(System.currentTimeMillis());
        ClusterNodeInfo.setClock(clock);

        DocumentNodeStore ns1 = new DocumentMK.Builder().
                setDocumentStore(mem).
                setAsyncDelay(0).
                getNodeStore();
        DocumentNodeStore ns2 = new DocumentMK.Builder().
                setDocumentStore(mem).
                setAsyncDelay(0).
                getNodeStore();
        // Bring the current time forward to after the leaseTime which would have been
        // updated in the DocumentNodeStore initialization.
        clock.waitUntil(clock.getTime() + ns1.getClusterInfo().getLeaseTime());

        ns1.getClusterInfo().setLeaseTime(0);
        ns2.getClusterInfo().setLeaseTime(0);

        List<ClusterNodeInfoDocument> list = mem.query(
View Full Code Here

Examples of org.apache.s4.util.clock.Clock

        }

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock clock = (Clock) context.getBean("clock");
        if (clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
View Full Code Here

Examples of org.apache.samza.util.Clock

  /**
   * Default constructor using default window size
   */
  public SlidingTimeWindowReservoir() {
    this(DEFAULT_WINDOW_SIZE_MS, new Clock() {
      public long currentTimeMillis() {
        return System.currentTimeMillis();
      }
    });
  }
View Full Code Here

Examples of org.apache.samza.util.Clock

   * Construct the SlidingTimeWindowReservoir with window size
   *
   * @param windowMs the size of the window. unit is millisecond.
   */
  public SlidingTimeWindowReservoir(long windowMs) {
    this(windowMs, new Clock() {
      public long currentTimeMillis() {
        return System.currentTimeMillis();
      }
    });
  }
View Full Code Here

Examples of org.apache.samza.util.Clock

   *          How many threads to run.
   * @param brokerSleepMs
   *          How long each thread should sleep between batch writes.
   */
  public MockSystemConsumer(int messagesPerBatch, int threadCount, int brokerSleepMs) {
    super(new MetricsRegistryMap("test-container-performance"), new Clock() {
      @Override
      public long currentTimeMillis() {
        return System.currentTimeMillis();
      }
    });
View Full Code Here

Examples of org.gradle.util.Clock

     * ready for the projects to be evaluated.
     */
    public void load(ProjectDescriptor rootProjectDescriptor, GradleInternal gradle,
                     Map<String, String> externalProjectProperties) {
        LOGGER.debug("Loading Project objects");
        Clock clock = new Clock();
        createProjects(rootProjectDescriptor, gradle, externalProjectProperties);
        attachDefaultProject(gradle);
        LOGGER.debug("Timing: Loading projects took: " + clock.getTime());
    }
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.