2. Port
• HDFS: http://localhost:50070/
• Oozie: http://localhost:11000/oozie/v1/
admin/status
• Templeton: http://localhost:50111/
templeton/v1/status
• ODBC: use port 10000 in DSN
configuration or connection string.
5. List Directory
var client = new WebHDFSClient(new Uri("http://localhost:50070"),"hadoop");!
client.GetDirectoryStatus("/").ContinueWith(dl => dl.Result.Directories.ToList().ForEach(d => Console.WriteLine("/" +
d.PathSuffix)));
6. Create Directory
var client = new WebHDFSClient(new Uri("http://localhost:50070"), "hadoop");!
var created = await client.CreateDirectory("/TEST");!
Console.WriteLine("True or False, we created the directory " + created.ToString());!
var deleted = await client.DeleteDirectory("/TEST");!
Console.WriteLine("True or False, we deleted the directory " + deleted.ToString());
18. HiveRow
public class TitlesRow : HiveRow!
{!
public string MovieId { get; set; }!
public string Name { get; set; }!
public int Year { get; set; }!
public string Rating { get; set; }!
}!
!
public class AwardsRow : HiveRow!
{!
public string MovieId { get; set; }!
public string AwardId { get; set; }!
public int Year { get; set; }!
public string Won { get; set; }!
public string Type { get; set; }!
public string Category { get; set; }!
}!
!
public class ActorsRow : HiveRow!
{!
public string MovieId { get; set; }!
public string ActorId { get; set; }!
public int AwardsCount { get; set; }!
public string Name { get; set; }!
20. Simple Linq
var db = new MyHiveDatabase(!
webHCatUri: new Uri("http://localhost:50111"),!
userName: "hadoop", password: null,!
storageAccount: “ASV storage account name”, storageKey: “ASV storage account key”);!
!
var q = from x in!
(from a in db.Actors!
select new { a.ActorId, foo = a.AwardsCount })!
group x by x.ActorId into g!
select new { ActorId = g.Key, bar = g.Average(z => z.foo) };!
!
q.ExecuteQuery().Wait();!
var results1 = q.ToList();!
!!
var projectionQuery = from aw in db.Awards!
join t in db.Titles!
on aw.MovieId equals t.MovieId!
where t.Year == 1994 && aw.Won == "True"!
select new { MovieId = t.MovieId, Name = t.Name, Type = aw.Type, Category = aw.Category,
Year = t.Year };!
!!
var newTable = projectionQuery.CreateTable("AwardsIn1994");