This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mapreduce example with hadoop job configurations | |
$clusterName = "YourClusterName" | |
$jobConfig = @{ "mapred.output.compress"="true"; "mapred.output.compression.codec"="org.apache.hadoop.io.compress.GzipCodec" } | |
$myWordCountJob = New-AzureHDInsightMapReduceJobDefinition -JarFile "/example/jars/hadoop-examples.jar" -ClassName "wordcount" -jobName "WordCountJob" -StatusFolder "/MyMRJobs/WordCountJobStatus" -Defines $jobConfig | |
$myWordCountJob.Arguments.Add("/example/data/gutenberg/davinci.txt") | |
$myWordCountJob.Arguments.Add("MyMRJobs/WordCountOutput") | |
$MyMRJob = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $myWordCountJob | |
#Hive Job example with hadoop job configurations | |
$clusterName = "YourClusterName" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapReduceJob = new MapReduceJobCreateParameters() | |
{ | |
ClassName = "wordcount", // required | |
JobName = "MyWordCountJob", //optional | |
JarFile = "/example/jars/hadoop-examples.jar", // Required, alternative syntax: wasb://hdijobs@azimasv2.blob.core.windows.net/example/jar/hadoop-examples.jar | |
StatusFolder = "/AzimMRJobs/WordCountJobStatus" //Optional, but good to use to know where logs are uploaded in Azure Storage | |
}; | |
//WordCount progam needs two arguments | |
mapReduceJob.Arguments.Add("/example/data/gutenberg/davinci.txt"); //input file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An Example of using passing hadoop configurations for a job in HDInsight, via direct REST API | |
$MyHDInsightUserName = "YourClusterUserName" | |
$MyHDInsightPwd = "YourPwd" | |
$clusterName = "YourClusterName" | |
$storageAcctname = "YourStorageAcctname" | |
$containerName = "YourDefaultContainerName" | |
$HdInsightPwd = ConvertTo-SecureString $MyHDInsightPwd -AsPlainText -Force | |
$HdInsightCreds = New-Object System.Management.Automation.PSCredential ($MyHDInsightUserName, $HdInsightPwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*1. Create a Visual studio 2012 Project. | |
2. Add HDInsight SDK NuGet to your project - | |
In Visual Studio 2012, Click on Tools -> library package manager -> Package Manager Console | |
PM> Install-Package Microsoft.WindowsAzure.Management.HDInsight | |
3. Use the following code, fill up the relevant info, then build and run - | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> | |
<!-- | |
/** | |
* Copyright 2010 The Apache Software Foundation | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.microsoft.css</groupId> | |
<artifactId>HBaseJavaApiTest</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>HBaseJavaApiTest</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.microsoft.css; | |
/** | |
* Created by muddin on 6/4/2015. | |
*/ | |
import java.sql.*; | |
public class MyHiveJdbcTest { | |
public static void main(String[] args) throws SQLException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.microsoft.css</groupId> | |
<artifactId>HiveJdbcTest</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>HiveJdbcTest</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Execute the function with retries on throttle | |
/// </summary> | |
/// <typeparam name="V"></typeparam> | |
/// <param name="client"></param> | |
/// <param name="function"></param> | |
/// <returns></returns> | |
private static async Task<V> ExecuteWithRetries<V>(DocumentClient client, Func<Task<V>> function) | |
{ | |
TimeSpan sleepTime = TimeSpan.Zero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copied from: https://github.com/Azure/azure-documentdb-net/blob/master/samples/code-samples/ServerSideScripts/JS/BulkImport.js | |
*/ | |
function bulkImport(docs) { | |
var collection = getContext().getCollection(); | |
var collectionLink = collection.getSelfLink(); | |
// The count of imported docs, also used as current doc index. | |
var count = 0; |
OlderNewer