Examples of Attempt


Examples of com.linkedin.whiteelephant.parsing.Attempt

      }
     
      String line = value.toString();
     
      Job job = null;
      Attempt attempt = null;
      Task task = null;
     
      job = LineParsing.tryParseJob(line);
     
      if (job == null)
      {     
        attempt = LineParsing.tryParseAttempt(line);
       
        if (attempt == null)
        {
          task = LineParsing.tryParseTask(line);
        }
      }
     
      LogData data = new LogData();
      String jobId = null;
     
      data.setCluster(_clusterName);
     
      try
      {
        if (job != null)
        {
          // log lines are sometimes truncated, so data may be missing - just ignore these
          if (job.getJobId() != null)
          {
            jobId = job.getJobId().toString();
            job.setTasks(new ArrayList<Task>());
            data.setEntry(job);
            data.setPath(findInputSplitForJob(jobId,inputSplits));
            context.write(new AvroKey<String>(jobId), new AvroValue<LogData>(data));
          }
        }
        else if (attempt != null)
        {
          // log lines are sometimes truncated, so data may be missing - just ignore these
          if (attempt.getJobId() != null && attempt.getTaskId() != null && attempt.getTaskAttemptId() != null && attempt.getType() != null)
          {
            jobId = attempt.getJobId().toString();
            data.setEntry(attempt);
            data.setPath(findInputSplitForJob(jobId,inputSplits));
            context.write(new AvroKey<String>(jobId), new AvroValue<LogData>(data));
          }
        }
View Full Code Here

Examples of com.linkedin.whiteelephant.parsing.Attempt

    {
      // merge together the entries for each task attempt
      Map<String,Attempt> taskAttemptIdToAttempt = new HashMap<String,Attempt>();     
      for (Attempt attempt : attemptEntries)
      {       
        Attempt mergedAttempt;
        if (!taskAttemptIdToAttempt.containsKey(attempt.getTaskAttemptId().toString()))
        {
          mergedAttempt = new Attempt();
          mergedAttempt.setCounters(new HashMap<CharSequence,Long>());
          mergedAttempt.setDerived(new DerivedAttemptData());
          taskAttemptIdToAttempt.put(attempt.getTaskAttemptId().toString(),mergedAttempt);
        }
        else
        {
          mergedAttempt = taskAttemptIdToAttempt.get(attempt.getTaskAttemptId().toString());
        }             
       
        if (attempt.getType() != null)
        {
          mergedAttempt.setType(attempt.getType());
        }
       
        if (attempt.getJobId() != null)
        {
          mergedAttempt.setJobId(attempt.getJobId());
        }
       
        if (attempt.getTaskId() != null)
        {
          mergedAttempt.setTaskId(attempt.getTaskId());
        }
       
        if (attempt.getTaskAttemptId() != null)
        {
          mergedAttempt.setTaskAttemptId(attempt.getTaskAttemptId());
        }
       
        if (attempt.getStartTime() != null)
        {
          // take the later start time in case there are multiple
          if (mergedAttempt.getStartTime() == null || mergedAttempt.getStartTime() < attempt.getStartTime())
          {
            mergedAttempt.setStartTime(attempt.getStartTime());
          }
        }
       
        if (attempt.getFinishTime() != null)
        {
          // take the later finish time in case there are multiple
          if (mergedAttempt.getFinishTime() == null || mergedAttempt.getFinishTime() < attempt.getFinishTime())
          {
            mergedAttempt.setFinishTime(attempt.getFinishTime());
          }
        }
       
        if (attempt.getShuffleFinished() != null)
        {
          // take the later finish time in case there are multiple
          if (mergedAttempt.getShuffleFinished() == null || mergedAttempt.getShuffleFinished() < attempt.getShuffleFinished())
          {
            mergedAttempt.setShuffleFinished(attempt.getShuffleFinished());
          }
        }
       
        if (attempt.getSortFinished() != null)
        {
          // take the later finish time in case there are multiple
          if (mergedAttempt.getSortFinished() == null || mergedAttempt.getSortFinished() < attempt.getSortFinished())
          {
            mergedAttempt.setSortFinished(attempt.getSortFinished());
          }
        }
               
        if (attempt.getTaskStatus() != null)
        {
          mergedAttempt.setTaskStatus(attempt.getTaskStatus());
        }
       
        if (attempt.getCounters() != null && attempt.getCounters().size() > 0)
        {
          mergedAttempt.setCounters(attempt.getCounters());
        }
      }
     
      // filter out bad data
      Collection<Attempt> filteredAttempts = Collections2.filter(taskAttemptIdToAttempt.values(), new Predicate<Attempt>() {
View Full Code Here

Examples of com.linkedin.whiteelephant.parsing.Attempt

  public static Attempt tryParseAttempt(String line)
  {
    // these mess with our pattern matching
    line = line.replace("\\\"", "");
   
    Attempt attempt = null;
   
    Matcher m = attemptLinePattern.matcher(line);
   
    if (m.matches())
    {
      attempt = new Attempt();
           
      attempt.setCounters(new HashMap<CharSequence,Long>());
     
      attempt.setDerived(new DerivedAttemptData());
     
      attempt.setType(TaskType.valueOf(m.group(1).toUpperCase()));
     
      Matcher matcher = parameterPattern.matcher(line);
     
      while (matcher.find())
      {
        String name = matcher.group(1);
        String value = matcher.group(2);
        maybeSetAttemptParam(attempt,name,value);
      }
     
      matcher = counterPattern.matcher(line);
     
      while (matcher.find())
      {
        String name = matcher.group(1);
        String value = matcher.group(2);
        setAttemptCounter(attempt,name,Long.parseLong(value));       
      }
     
      if (attempt.getTaskId() != null)
      {
        Matcher taskMatcher = taskPattern.matcher(attempt.getTaskId());
       
        if (taskMatcher.matches())
        {
          String jobId = String.format("job_%s",taskMatcher.group(1));
          attempt.setJobId(jobId);
        }
        else
        {
          System.out.println("Could not match task ID for " + attempt.getTaskId());
          System.out.println("line: " + line);
        }
      }
      else
      {
View Full Code Here

Examples of net.sourceforge.marathon.util.Retry.Attempt

                cells.add(new Cell(rows[0], cols[i]));
        } else {
        }
        final int maxRow = findMaxRow(cells);
        new Retry("Could not find row " + maxRow + " in table", ComponentFinder.RETRY_INTERVAL_MS,
                ComponentFinder.COMPONENT_SEARCH_RETRY_COUNT, new Attempt() {
                    @Override public void perform() {
                        int rowCount = eventQueueRunner.invokeInteger(table, "getRowCount");
                        if(maxRow >= rowCount)
                            retry();
                    }
View Full Code Here

Examples of net.sourceforge.marathon.util.Retry.Attempt

        this.property = property;
        this.value = value;
    }

    public void play(final ComponentFinder resolver) {
        new Retry("Wait for change in property timed out", 500, 120, new Attempt() {
            public void perform() {
                if (!isValueEqual(resolver))
                    retry();
            }
        });
View Full Code Here

Examples of voldemort.Attempt

            }

            /**
             * Finally, verify that all of the nodes have been discovered
             */
            assertWithBackoff(1000, 60000, new Attempt() {

                private int count = 1;
                private AdminClient adminClient = new AdminClient("tcp://" + hostNames.get(0)
                                                                          + ":6666",
                                                                  new AdminClientConfig(),
View Full Code Here

Examples of voldemort.Attempt

        engine.swapFiles(newDirv2.getAbsolutePath());
        assertVersionsExist(dir, 0, 1, 2);

        // rollback
        engine.rollback(versionDir);
        TestUtils.assertWithBackoff(100, 5000, new Attempt() {

            public void checkCondition() throws Exception, AssertionError {
                assertVersionsExist(dir, 0);
            }
        });
View Full Code Here

Examples of voldemort.Attempt

        // ...and points to 1
        assertTrue(latest.getCanonicalPath().contains("version-1"));

        // ...and version-2 is still in fetch state. Assert with backoff since
        // delete may take time
        TestUtils.assertWithBackoff(100, 5000, new Attempt() {

            public void checkCondition() throws Exception, AssertionError {
                assertEquals(ReadOnlyUtils.getVersionDirs(dir).length, 2);
            }
        });
View Full Code Here

Examples of voldemort.Attempt

        }

        // Wait up to five seconds for Gossip to spread
        final Cluster newFinalCluster = newCluster;
        try {
            TestUtils.assertWithBackoff(5000, new Attempt() {

                public void checkCondition() {
                    int serversSeen = 0;
                    // Now verify that we have gossiped correctly
                    for(VoldemortServer server: servers) {
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.