Search in sources :

Example 6 with TaskTracker

use of org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker in project hive by apache.

the class ReplLoadTask method updateDatabaseLastReplID.

/**
 * There was a database update done before and we want to make sure we update the last repl
 * id on this database as we are now going to switch to processing a new database.
 * This has to be last task in the graph since if there are intermediate tasks and the last.repl.id
 * is a root level task then in the execution phase the root level tasks will get executed first,
 * however if any of the child tasks of the bootstrap load failed then even though the bootstrap has failed
 * the last repl status of the target database will return a valid value, which will not represent
 * the state of the database.
 */
private TaskTracker updateDatabaseLastReplID(int maxTasks, Context context, Scope scope) throws SemanticException {
    /*
    we don't want to put any limits on this task as this is essential before we start
    processing new database events.
   */
    TaskTracker taskTracker = new AlterDatabase(context, work.databaseEvent(context.hiveConf), work.dbNameToLoadIn, new TaskTracker(maxTasks), work.getMetricCollector()).tasks();
    AddDependencyToLeaves function = new AddDependencyToLeaves(taskTracker.tasks());
    DAGTraversal.traverse(scope.rootTasks, function);
    return taskTracker;
}
Also used : TaskTracker(org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker) AlterDatabase(org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.LoadDatabase.AlterDatabase) AddDependencyToLeaves(org.apache.hadoop.hive.ql.exec.repl.util.AddDependencyToLeaves)

Example 7 with TaskTracker

use of org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker in project hive by apache.

the class ReplLoadTask method addLoadConstraintsTasks.

private TaskTracker addLoadConstraintsTasks(Context loadContext, BootstrapEvent next, TaskTracker dbTracker, Scope scope) throws IOException, SemanticException {
    LoadConstraint loadConstraint = new LoadConstraint(loadContext, (ConstraintEvent) next, work.dbNameToLoadIn, dbTracker, (new Path(work.dumpDirectory)).getParent().toString(), work.getMetricCollector());
    TaskTracker constraintTracker = loadConstraint.tasks();
    scope.rootTasks.addAll(constraintTracker.tasks());
    constraintTracker.debugLog("constraints");
    return constraintTracker;
}
Also used : Path(org.apache.hadoop.fs.Path) TaskTracker(org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker) LoadConstraint(org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.LoadConstraint)

Example 8 with TaskTracker

use of org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker in project hive by apache.

the class TestTaskTracker method taskTrackerCompositionInitializesTheMaxTasksCorrectly.

@Test
public void taskTrackerCompositionInitializesTheMaxTasksCorrectly() {
    TaskTracker taskTracker = new TaskTracker(1);
    assertTrue(taskTracker.canAddMoreTasks());
    taskTracker.addTask(task);
    assertFalse(taskTracker.canAddMoreTasks());
    TaskTracker taskTracker2 = new TaskTracker(taskTracker);
    assertFalse(taskTracker2.canAddMoreTasks());
}
Also used : TaskTracker(org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker) Test(org.junit.Test)

Aggregations

TaskTracker (org.apache.hadoop.hive.ql.exec.repl.util.TaskTracker)8 Path (org.apache.hadoop.fs.Path)4 LoadConstraint (org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.LoadConstraint)3 AddDependencyToLeaves (org.apache.hadoop.hive.ql.exec.repl.util.AddDependencyToLeaves)3 FileNotFoundException (java.io.FileNotFoundException)2 Task (org.apache.hadoop.hive.ql.exec.Task)2 LoadDatabase (org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.LoadDatabase)2 AlterDatabase (org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.LoadDatabase.AlterDatabase)2 LoadPartitions (org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.table.LoadPartitions)2 TableContext (org.apache.hadoop.hive.ql.exec.repl.bootstrap.load.table.TableContext)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 ReplScope (org.apache.hadoop.hive.common.repl.ReplScope)1 Database (org.apache.hadoop.hive.metastore.api.Database)1 DDLWork (org.apache.hadoop.hive.ql.ddl.DDLWork)1 AlterDatabaseSetPropertiesDesc (org.apache.hadoop.hive.ql.ddl.database.alter.poperties.AlterDatabaseSetPropertiesDesc)1 BootstrapEvent (org.apache.hadoop.hive.ql.exec.repl.bootstrap.events.BootstrapEvent)1