Skip to content

Commit b971afb

Browse files
committed
Fix
1 parent 33e3799 commit b971afb

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

  • samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client

samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Prepare dependencies jar into work dir
44

55
bash ./prepare.sh
6+
67
## Building jars
78

89
bash ./build.sh

samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
<artifactId>webhdfsclientsample</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11-
<name>webhdfsclientsample</name>
12-
<!-- FIXME change it to the project's website -->
13-
<url>http://www.example.com</url>
14-
1511
<properties>
1612
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1713
<maven.compiler.source>1.7</maven.compiler.source>

samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/src/main/java/com/microsoft/mssql/App.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
*/
14
package com.microsoft.mssql;
25

36
import java.security.Principal;
@@ -50,7 +53,7 @@ public void setCredentials(AuthScope authscope, Credentials credentials) {
5053

5154
@Override
5255
public Credentials getCredentials(AuthScope authscope) {
53-
//TODO: this can be enhanced to pass controller use name and password in case the AuthScope authscheme is basic.
56+
//TODO: this can be enhanced to pass user name and password in case the AuthScope authscheme is basic.
5457
return emptyCredentials;
5558
}
5659

@@ -61,8 +64,8 @@ public void clear() {
6164
};
6265
private static void uploadResource(String inputFilePath, String outputFilePath){
6366
System.out.println("Entering create resource");
64-
// Construct Knox endpoint
65-
String createOperationEndpoint = GW_ENDPOINT + outputFilePath + "?op=CREATE&overwrite=true";
67+
// Construct Knox endpoint
68+
String createOperationEndpoint = GW_ENDPOINT + outputFilePath + "?op=CREATE&overwrite=true";
6669
try (CloseableHttpClient client2 = HttpClients.custom().setDefaultCredentialsProvider(provider).build()) {
6770
HttpUriRequest request = new HttpPut(createOperationEndpoint);
6871
// First request to get the location in data nodes
@@ -81,7 +84,7 @@ private static void uploadResource(String inputFilePath, String outputFilePath){
8184
// Second request to put the content to that location
8285
File testUploadFile = new File(inputFilePath);
8386
HttpEntity putData = MultipartEntityBuilder.create().addBinaryBody("upfile", testUploadFile).build();
84-
HttpUriRequest putRequest = RequestBuilder.put(newlocation).setEntity(putData).build();//setEntity(postData).build();
87+
HttpUriRequest putRequest = RequestBuilder.put(newlocation).setEntity(putData).build();
8588
System.out.println("Executing request " + putRequest.getRequestLine());
8689
CloseableHttpResponse response2 = client2.execute(putRequest);
8790
HttpEntity entity2 = response2.getEntity();

0 commit comments

Comments
 (0)