Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 83 lines (74 sloc) 2.358 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
<?php

include_once 'config.inc.php';
include_once 'templates/style.css';


if(!@$_GET['path'])
{
$path = "/";
}
else
{
$path = $_GET['path'];
}
$etc = new Etc;
$sql = '"dfs -ls '.$path.'"';

$LANG = 'export LANG='.$env['lang_set'].'; ';
$HADOOP_HOME = 'export HADOOP_HOME='.$env['hadoop_home'].'; ';
$HIVE_HOME = 'export HIVE_HOME='.$env['hive_home'].'; ';
$JAVA_HOME = 'export JAVA_HOME='.$env['java_home'].'; ';
$UDF = ($env['udf'] != "") ? $env['udf'] : "";

$exec = ($LANG . $HADOOP_HOME . $HIVE_HOME . $JAVA_HOME. $env['hive_home'].'/bin/hive '.$UDF.' -e '.$sql);

$time = time();
$filename = $env['output_path'].'/dfs_browse.'.$time.'.out';
$etc->NonBlockingRun($exec,$time,$filename,1,$code);

$list_arr = file($filename);
echo '<div class="container">';
echo '<div class="span10">';

echo "<br>";
echo '<div class="btn-group">';
echo "<a class=\"btn btn-info\" href=fileBrowser.php?dir=/><i class=icon-eject></i>".$lang['backToRoot']."</a>";
echo "<a class=\"btn btn-info\" href=javascript:history.back()><i class=icon-backward></i>".$lang['back']."</a>";
echo "</div><br>";
echo "<table class=\"table table-bordered table-striped table-hover\">";
echo "<tr class=success>";
echo "<td>".$lang['fileProperty']."</td>";
echo "<td>".$lang['fileUser']."</td>";
echo "<td>".$lang['fileGroup']."</td>";
echo "<td>".$lang['filesize']."</td>";
echo "<td>".$lang['fileTime']."</td>";
echo "<td>".$lang['filename']."</td>";
echo "</tr>";
$i = 0;
foreach( $list_arr as $k => $v)
{
if(($i % 2) == 0)
{
$color = $env['trColor1'];
}
else
{
$color = $env['trColor2'];
}
if(!preg_match("/Found/i", $v))
{
echo "<tr bgcolor=\"".$color."\">";
$tmp = explode(" ", $v);
$tmp = $etc->ArrayFilter($tmp);
#var_dump($tmp);
echo "<td>".$tmp[0]."</td>";
echo "<td>".$tmp[2]."</td>";
echo "<td>".$tmp[3]."</td>";
echo "<td>".round($tmp[4]/1024/1024,2)."MB</td>";
echo "<td>".$tmp[5]." ".$tmp[6]."</td>";
echo "<td><a href=fileBrowser.php?path=".$tmp[7].">".$tmp[7]."</a></td>\n";
echo "</tr>";
}
$i++;
}
echo "</table>";
echo '<div class="btn-group">';
echo "<a class=\"btn btn-info\" href=fileBrowser.php?dir=/><i class=icon-eject></i>".$lang['backToRoot']."</a>";
echo "<a class=\"btn btn-info\" href=javascript:history.back()><i class=icon-backward></i>".$lang['back']."</a>";
echo "</div>";
echo "</div></div>";
unlink($filename);

?>
Something went wrong with that request. Please try again.