rkanumul commented on a change in pull request #6531:
URL: https://github.com/apache/incubator-pinot/pull/6531#discussion_r569958802
##########
File path:
pinot-plugins/pinot-file-system/pinot-adls/src/main/java/org/apache/pinot/plugin/filesystem/ADLSGen2PinotFS.java
##########
@@ -96,6 +99,12 @@
// However, there's some overhead in computing hash. (Adds roughly 3 seconds
for 1GB file)
private boolean _enableChecksum;
+ public ADLSGen2PinotFS(DataLakeFileSystemClient fileSystemClient,
Review comment:
There is no more details to add here, its a constructor and the
signature is self documenting. Also looking at the other classes, doesn't seem
to be a convention for the code base.
But I'm guessing you meant for the other methods that are not in this
change. So added docs for all of them.
##########
File path:
pinot-plugins/pinot-file-system/pinot-adls/src/test/java/org/apache/pinot/plugin/filesystem/test/ADLSGen2PinotFSTest.java
##########
@@ -0,0 +1,395 @@
+/**
+ * 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
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.plugin.filesystem.test;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.storage.blob.BlobClient;
+import com.azure.storage.blob.BlobContainerClient;
+import com.azure.storage.blob.BlobServiceClient;
+import com.azure.storage.blob.specialized.BlobInputStream;
+import com.azure.storage.file.datalake.DataLakeDirectoryClient;
+import com.azure.storage.file.datalake.DataLakeFileClient;
+import com.azure.storage.file.datalake.DataLakeFileSystemClient;
+import com.azure.storage.file.datalake.DataLakeServiceClient;
+import com.azure.storage.file.datalake.models.DataLakeStorageException;
+import com.azure.storage.file.datalake.models.PathItem;
+import com.azure.storage.file.datalake.models.PathProperties;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import org.apache.pinot.plugin.filesystem.ADLSGen2PinotFS;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.mockito.Mockito.*;
+
+
+/**
+ * Tests the Azure implementation of ADLSGen2PinotFS
+ */
+public class ADLSGen2PinotFSTest {
+
+ @Mock
+ private DataLakeFileSystemClient _mockFileSystemClient;
+ @Mock
+ private DataLakeDirectoryClient _mockDirectoryClient;
+ @Mock
+ private BlobServiceClient _mockBlobServiceClient;
+ @Mock
+ private BlobContainerClient _mockBlobContainerClient;
+ @Mock
+ private BlobClient _mockBlobClient;
+ @Mock
+ private BlobInputStream _mockBlobInputStream;
+ @Mock
+ private DataLakeServiceClient _mockServiceClient;
+ @Mock
+ private DataLakeFileClient _mockFileClient;
+ @Mock
+ private DataLakeStorageException _mockDataLakeStorageException;
+ @Mock
+ private SimpleResponse _mockSimpleResponse;
+ @Mock
+ private PathProperties _mockPathProperties;
+ @Mock
+ private PagedIterable _mockPagedIterable;
+ @Mock
+ private PathItem _mockPathItem;
+
+ private URI _mockURI;
+ private ADLSGen2PinotFS _adlsGen2PinotFsUnderTest;
+
+ private final static String MOCK_FILE_SYSTEM_NAME = "fileSystemName";
+
+ @BeforeMethod
+ public void setup() throws URISyntaxException {
+ MockitoAnnotations.initMocks(this);
+ _adlsGen2PinotFsUnderTest = new ADLSGen2PinotFS(_mockFileSystemClient,
_mockBlobServiceClient);
+ _mockURI = new URI("mock://mock");
+ }
+
+ @AfterMethod
+ public void tearDown() {
+ verifyNoMoreInteractions(_mockDataLakeStorageException,
_mockServiceClient, _mockFileSystemClient,
+ _mockSimpleResponse, _mockDirectoryClient, _mockPathItem,
_mockPagedIterable, _mockPathProperties,
+ _mockFileClient, _mockBlobContainerClient, _mockBlobClient,
_mockBlobServiceClient, _mockBlobInputStream);
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void testInitNoAuth() {
+ PinotConfiguration pinotConfiguration = new PinotConfiguration();
+ _adlsGen2PinotFsUnderTest.init(pinotConfiguration);
+ }
+
+ @Test
+ public void testGetOrCreateClientWithFileSystemGet() {
+
when(_mockServiceClient.getFileSystemClient(MOCK_FILE_SYSTEM_NAME)).thenReturn(_mockFileSystemClient);
Review comment:
Can you elaborate ?
It is indented just like other classes in the code base.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]