From b971afb0cbffc30ecbf3fc2dfa29178c416cddef Mon Sep 17 00:00:00 2001 From: pengyuehaha Date: Sun, 25 Oct 2020 22:19:59 -0700 Subject: [PATCH] Fix --- .../connectivity/webhdfs-java-client/README.md | 1 + .../connectivity/webhdfs-java-client/pom.xml | 4 ---- .../src/main/java/com/microsoft/mssql/App.java | 11 +++++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/README.md b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/README.md index 4f2d0630..0ac1fe9e 100644 --- a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/README.md +++ b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/README.md @@ -3,6 +3,7 @@ ## Prepare dependencies jar into work dir bash ./prepare.sh + ## Building jars bash ./build.sh diff --git a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/pom.xml b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/pom.xml index 6983fb59..6553f33d 100644 --- a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/pom.xml +++ b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/pom.xml @@ -8,10 +8,6 @@ webhdfsclientsample 1.0-SNAPSHOT - webhdfsclientsample - - http://www.example.com - UTF-8 1.7 diff --git a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/src/main/java/com/microsoft/mssql/App.java b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/src/main/java/com/microsoft/mssql/App.java index 3af5b735..4bdf2cf8 100644 --- a/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/src/main/java/com/microsoft/mssql/App.java +++ b/samples/features/sql-big-data-cluster/connectivity/webhdfs-java-client/src/main/java/com/microsoft/mssql/App.java @@ -1,3 +1,6 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + */ package com.microsoft.mssql; import java.security.Principal; @@ -50,7 +53,7 @@ public class App { @Override public Credentials getCredentials(AuthScope authscope) { - //TODO: this can be enhanced to pass controller use name and password in case the AuthScope authscheme is basic. + //TODO: this can be enhanced to pass user name and password in case the AuthScope authscheme is basic. return emptyCredentials; } @@ -61,8 +64,8 @@ public class App { }; private static void uploadResource(String inputFilePath, String outputFilePath){ System.out.println("Entering create resource"); - // Construct Knox endpoint - String createOperationEndpoint = GW_ENDPOINT + outputFilePath + "?op=CREATE&overwrite=true"; + // Construct Knox endpoint + String createOperationEndpoint = GW_ENDPOINT + outputFilePath + "?op=CREATE&overwrite=true"; try (CloseableHttpClient client2 = HttpClients.custom().setDefaultCredentialsProvider(provider).build()) { HttpUriRequest request = new HttpPut(createOperationEndpoint); // First request to get the location in data nodes @@ -81,7 +84,7 @@ public class App { // Second request to put the content to that location File testUploadFile = new File(inputFilePath); HttpEntity putData = MultipartEntityBuilder.create().addBinaryBody("upfile", testUploadFile).build(); - HttpUriRequest putRequest = RequestBuilder.put(newlocation).setEntity(putData).build();//setEntity(postData).build(); + HttpUriRequest putRequest = RequestBuilder.put(newlocation).setEntity(putData).build(); System.out.println("Executing request " + putRequest.getRequestLine()); CloseableHttpResponse response2 = client2.execute(putRequest); HttpEntity entity2 = response2.getEntity();