Question: I am trying to return each row in my database as a separate array of information. At the moment I have only managed to return all rows in the database as a single array, but that is not what I want.
My current code to do that is:

```
$previous_info = array();
            $sql = "SELECT * FROM trips WHERE id =$user_id_session";
            $records = mysql_query($sql); 
            while($trip=mysql_fetch_assoc($records)){
                $previous_info[] = $trip;   
            }

            print_r ($previous_info);

```

This will return all the information inside a single array, but I don't know how to separate the information for each row?

Answer: 
Have a look at these SE posts to understand how HDFS writes work:

[Hadoop 2.0 data write operation acknowledgement](https://stackoverflow.com/questions/32038000/hadoop-2-0-data-write-operation-acknowledgement)

[Hadoop file write](https://stackoverflow.com/questions/34464187/hadoop-file-write/34464676#34464676)

[Hadoop: HDFS File Writes & Reads](https://stackoverflow.com/questions/24301085/hadoop-hdfs-file-writes-reads/34715456#34715456)

Apart from file/block writes, above question explain about datanode failure scenarios.

> 
> The current block on the good datanodes is given a new identity, which is communicated to the namenode, so that the partial block on the failed datanode will be deleted if the failed datanode recovers later on. The failed datanode is removed from the pipeline, and a new pipeline is constructed from the two good datanodes.
> 
> 
> 

One failure in datanode triggers corrective actions by framework.

Regarding your second query :

You have two types of schedulers :

[FairScheduler](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/FairScheduler.html)

[CapacityScheduler](https://hadoop.apache.org/docs/r2.4.1/hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html)

Have a look at this [article](https://issues.apache.org/jira/browse/YARN-2172) on suspend and resume

> 
> In a multi-application cluster environment, jobs running inside **Hadoop YARN** may be of lower-priority than jobs running outside **Hadoop YARN** like HBase. To give way to other higher-priority jobs inside Hadoop, a user or some cluster-level resource scheduling ***service should be able to suspend and/or resume some particular jobs within Hadoop YARN***.
> 
> 
> ***When target jobs inside Hadoop are suspended, those already allocated and running task containers will continue to run until their completion or active preemption by other ways***. But no more new containers would be allocated to the target jobs.
> 
> 
> In contrast, when suspended jobs are put into resume mode, they will continue to run from the previous job progress and have new task containers allocated to complete the rest of the jobs.
> 
> 
>
So as far as I understand the process of a Datanode receives the data from the client's process (who requests to store some data in HDFS) and stores it. Then this Datanode forwards the exact same data to another Datanode (to achieve replication) and so on. When the replication will finish, an acknowledgement will go back to the Namenode who will finally inform the client about the completion of his write-request.

Based on the above flow, It is impossible to suspend an HDFS write operation in order to serve a second client's write-request (let's assume that the second client has higher priority) because if we suspend the Datanode by itself it will remain suspended for everyone who wants to write on it and as a result this part of the HDFS will be remained blocked. Finally, if I suspend a job from JobController class functions, I actually suspend the client's process (if I actually manage to catch it before his request will be done). Please correct me if I am wrong.