您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

用于 Java 的 Azure Data Lake Analytics 库Azure Data Lake Analytics libraries for Java

概述Overview

使用 Azure Data Lake Analytics 运行可扩展为大规模数据集的大数据分析作业。Run big data analysis jobs that scale to massive data sets with Azure Data Lake Analytics.

若要开始使用 Azure Data Lake Analytics,请参阅通过 Java SDK 开始使用 Azure Data Lake AnalyticsTo get started with Azure Data Lake Analytics, see Get started with Azure Data Lake Analytics using Java SDK.

管理 APIManagement API

使用管理 API 管理 Data Lake Analytics 帐户、作业、策略和目录。Use the management API to manage Data Lake Analytics accounts, jobs, policies, and catalogs.

向 Maven pom.xml 文件中添加依赖项,以便在项目中使用管理 API。Add a dependency to your Maven pom.xml file to use the management API in your project.

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-mgmt-datalake-analytics</artifactId>
    <version>1.0.0-beta1.3</version>
</dependency>

示例Example

将新的 U-SQL 作业提交到 Data Lake Analytics。Submit a new U-SQL job to Data Lake Analytics.

// authenticate with service principal credentials
ApplicationTokenCredentials creds = new ApplicationTokenCredentials(_clientId, _tenantId, _clientSecret, null);
DataLakeAnalyticsJobManagementClient adlaJobClient = new DataLakeAnalyticsJobManagementClientImpl(creds);

// set up job parameters
UUID jobId = java.util.UUID.randomUUID();
USqlJobProperties properties = new USqlJobProperties();
properties.setScript("@input =  EXTRACT Data string FROM \"/input1.csv\" USING Extractors.Csv(); OUTPUT @input TO @\"/output1.csv\" USING Outputters.Csv();");
JobInformation parameters = new JobInformation();
parameters.setName("testJob");
parameters.setJobId(jobId);
parameters.setType(JobType.USQL);
parameters.setProperties(properties);

// create the job
JobInformation jobInfo = adlaJobClient.getJobOperations().create(accountName, jobId, parameters).getBody();

示例Samples

使用 Java SDK 管理 Azure Data Lake AnalyticsAzure Data Lake Analytics using Java SDK

查看 Azure Data Lake Analytics 示例的完整列表View the complete list of Azure Data Lake Analytics samples.