Writes all of the information in the SpaceCentricTypedTask into a Task

@return a Task based on the information stored in this SpaceCentricTypedTask
545901
public Task writeTask() {
        Task task = new Task();
        addProperty(task, ACCOUNT_PROP, getAccount());
        addProperty(task, STORE_ID_PROP, getStoreId());
        addProperty(task, SPACE_ID_PROP, getSpaceId());
        return task;
    }
208171
private void writeProjectProperties(ProjectProperties record) throws IOException
   {
      // the ProjectProperties class from MPXJ has the details of how many days per week etc....
      // so I've assigned these variables in here, but actually use them in other methods
      // see the write task method, that's where they're used, but that method only has a Task object
      m_minutesPerDay = record.getMinutesPerDay().doubleValue();
      m_minutesPerWeek = record.getMinutesPerWeek().doubleValue();
      m_daysPerMonth = record.getDaysPerMonth().doubleValue();

      // reset buffer to be empty, then concatenate data as required by USACE
      m_buffer.setLength(0);
      m_buffer.append("PROJ ");
      m_buffer.append(m_formatter.format(record.getStartDate()).toUpperCase() + " "); // DataDate
      m_buffer.append(SDEFmethods.lset(record.getManager(), 4) + " "); // ProjIdent
      m_buffer.append(SDEFmethods.lset(record.getProjectTitle(), 48) + " "); // ProjName
      m_buffer.append(SDEFmethods.lset(record.getSubject(), 36) + " "); // ContrName
      m_buffer.append("P "); // ArrowP
      m_buffer.append(SDEFmethods.lset(record.getKeywords(), 7)); // ContractNum
      m_buffer.append(m_formatter.format(record.getStartDate()).toUpperCase() + " "); // ProjStart
      m_buffer.append(m_formatter.format(record.getFinishDate()).toUpperCase()); // ProjEnd
      m_writer.println(m_buffer);
   }
714210
def _CreateTaskStorageWriter(self, path, task):
    
    return SQLiteStorageFileWriter(
        self._session, path,
        storage_type=definitions.STORAGE_TYPE_TASK, task=task)
492760
function Task(task) {
  _.extend(this, task);
  if (task != undefined) this.createId();

  // Short id
  this.__defineGetter__('id', function () {
    return this.__uuid__.substr(0, 8).toString();
  });

  // Keyword
  this.__defineGetter__('keyword', function () {
    return this.labels[0].replace('#', '').toUpperCase();
  });

  // Stemmed
  this.__defineGetter__('stemmed', function () {
    return (this.title+' '+this.body).toLowerCase()
      .split(' ').map(stem).join(' ');
  });

  // All
  this.__defineGetter__('all', function () {
    return '*';
  });
}
218732
public TaskEntity getParentTask() {
    if ( parentTask == null && parentTaskId != null) {
      this.parentTask = Context.getCommandContext()
                                .getTaskManager()
                                .findTaskById(parentTaskId);
    }
    return parentTask;
  }
78658
def CreateRetryTask(self):
    
    retry_task = Task(session_identifier=self.session_identifier)
    retry_task.file_entry_type = self.file_entry_type
    retry_task.merge_priority = self.merge_priority
    retry_task.path_spec = self.path_spec
    retry_task.storage_file_size = self.storage_file_size

    self.has_retry = True

    return retry_task
1271960
@Override public Task addTask()
   {
      ProjectFile parent = getParentFile();

      Task task = new Task(parent, this);

      m_children.add(task);

      parent.getTasks().add(task);

      setSummary(true);

      return (task);
   }
1339711
public void write(DataOutput out) throws IOException {
    Text.writeString(out, trackerName);
    Text.writeString(out, host);
    out.writeInt(httpPort);
    out.writeInt(failures);
    out.writeInt(maxMapTasks);
    out.writeInt(maxReduceTasks);
    resStatus.write(out);
    out.writeInt(taskReports.size());

    for (TaskStatus taskStatus : taskReports) {
      TaskStatus.writeTaskStatus(out, taskStatus);
    }
    getHealthStatus().write(out);
  }
1231529
private TaskRecord storeTaskRecord(Tenant tenant, Task task) {
        DBTransaction dbTran = DBService.instance(tenant).startTransaction();
        TaskRecord taskRecord = new TaskRecord(task.getTaskID());
        Map<String, String> propMap = taskRecord.getProperties();
        assert propMap.size() > 0 : "Need at least one property to store a row!";
        for (String propName : propMap.keySet()) {
            dbTran.addColumn(TaskManagerService.TASKS_STORE_NAME, task.getTaskID(), propName, propMap.get(propName));
        }
        DBService.instance(tenant).commit(dbTran);
        return taskRecord;
    }
290592
public TaskSubmissionResult startTask() {

		final AllocatedResource ar = this.allocatedResource.get();

		if (ar == null) {
			final TaskSubmissionResult result = new TaskSubmissionResult(getID(),
				AbstractTaskResult.ReturnCode.NO_INSTANCE);
			result.setDescription("Assigned instance of vertex " + this.toString() + " is null!");
			return result;
		}

		final List<TaskDeploymentDescriptor> tasks = new SerializableArrayList<TaskDeploymentDescriptor>();
		tasks.add(constructDeploymentDescriptor());

		try {
			final List<TaskSubmissionResult> results = ar.getInstance().submitTasks(tasks);

			return results.get(0);

		} catch (IOException e) {
			final TaskSubmissionResult result = new TaskSubmissionResult(getID(),
				AbstractTaskResult.ReturnCode.IPC_ERROR);
			result.setDescription(StringUtils.stringifyException(e));
			return result;
		}
	}
122018
public Task getTask()
    {
        if (this.getScreenField() instanceof BasePanel)
            return ((BasePanel)this.getScreenField()).getTask();
        else
            return this.getScreenField().getParentScreen().getTask();
    }
907789
public Long createTask(String taskName, String data) {
		return tedDriverImpl.createTask(taskName, data, null, null, null);
	}
1060060
private static TaskHandle createTaskHandle(
            TaskStateMachine taskStateMachine,
            TaskContext taskContext,
            OutputBuffer outputBuffer,
            LocalExecutionPlan localExecutionPlan,
            TaskExecutor taskExecutor)
    {
        TaskHandle taskHandle = taskExecutor.addTask(
                taskStateMachine.getTaskId(),
                outputBuffer::getUtilization,
                getInitialSplitsPerNode(taskContext.getSession()),
                getSplitConcurrencyAdjustmentInterval(taskContext.getSession()),
                getMaxDriversPerTask(taskContext.getSession()));
        taskStateMachine.addStateChangeListener(state -> {
            if (state.isDone()) {
                taskExecutor.removeTask(taskHandle);
                for (DriverFactory factory : localExecutionPlan.getDriverFactories()) {
                    factory.noMoreDrivers();
                }
            }
        });
        return taskHandle;
    }
507705
public Iterator<JobTaskVertex> getTaskVertices() {

		final Collection<JobTaskVertex> coll = this.taskVertices.values();

		return coll.iterator();
	}
555338
public Long createAndExecuteTask(String taskName, String data, String key1, String key2) {
		return tedDriverImpl.createAndExecuteTask(taskName, data, key1, key2, false);
	}
997112
@Override
    public Task createTask(Task task) throws NameConflictException {
        try {
            return taskDao.createTask(task);
        } catch (DuplicateKeyException e) {
            throw new NameConflictException("Task name is already in use", e);
        }
    }
1291115
protected long createTaskInternal(final String name, final String channel, final String data, final String key1, final String key2, final Long batchId, int postponeSec, TedStatus status) {
		final String sqlLogId = "create_task";
		if (status == null)
			status = TedStatus.NEW;
		String nextts = (status == TedStatus.NEW ? dbType.sql.now() + " + " + dbType.sql.intervalSeconds(postponeSec) : "null");

		String sql = " insert into tedtask (taskId, `system`, name, channel, bno, status, createTs, nextTs, retries, data, key1, key2, batchId)" +
				" values(null, '$sys', ?, ?, null, '$status', $now, $nextts, 0, ?, ?, ?, ?)" +
				" ";
		sql = sql.replace("$nextTaskId", dbType.sql.sequenceSql("SEQ_TEDTASK_ID"));
		sql = sql.replace("$now", dbType.sql.now());
		sql = sql.replace("$sys", thisSystem);
		sql = sql.replace("$nextts", nextts);
		sql = sql.replace("$status", status.toString());

		final String finalSql = sql;
		Long taskId = JdbcSelectTed.runInConn(dataSource, new ExecInConn<Long>() {
			@Override
			public Long execute(Connection connection) throws SQLException {
				int res = JdbcSelectTedImpl.executeUpdate(connection, finalSql, asList(
						sqlParam(name, JetJdbcParamType.STRING),
						sqlParam(channel, JetJdbcParamType.STRING),
						sqlParam(data, JetJdbcParamType.STRING),
						sqlParam(key1, JetJdbcParamType.STRING),
						sqlParam(key2, JetJdbcParamType.STRING),
						sqlParam(batchId, JetJdbcParamType.LONG)
				));
				if (res != 1)
					throw new IllegalStateException("expected 1 insert");
				String sql = "select last_insert_id()";
				return JdbcSelectTedImpl.selectSingleLong(connection, sql, Collections.<SqlParam>emptyList());
			}
		});

		logger.trace("Task {} {} created successfully. ", name, taskId);
		return taskId;

	}