[
https://issues.apache.org/jira/browse/HADOOP-17428?focusedWorklogId=642526&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-642526
]
ASF GitHub Bot logged work on HADOOP-17428:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 26/Aug/21 18:47
Start Date: 26/Aug/21 18:47
Worklog Time Spent: 10m
Work Description: sumangala-patki commented on a change in pull request
#2549:
URL: https://github.com/apache/hadoop/pull/2549#discussion_r696892660
##########
File path:
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/ContentSummaryProcessor.java
##########
@@ -0,0 +1,147 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.hadoop.fs.azurebfs.services;
+
+import java.io.IOException;
+import java.util.concurrent.CompletionService;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.hadoop.fs.azurebfs.utils.TracingContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hadoop.fs.ContentSummary;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+
+public class ContentSummaryProcessor {
+ private static final int CORE_POOL_SIZE = 1;
+ private static final int MAX_THREAD_COUNT = 16;
+ private static final int KEEP_ALIVE_TIME = 5;
+ private static final int POLL_TIMEOUT = 100;
+ private static final Logger LOG =
LoggerFactory.getLogger(ContentSummaryProcessor.class);
+ private final AtomicLong fileCount = new AtomicLong(0L);
+ private final AtomicLong directoryCount = new AtomicLong(0L);
+ private final AtomicLong totalBytes = new AtomicLong(0L);
+ private final AtomicInteger numTasks = new AtomicInteger(0);
+ private final ListingSupport abfsStore;
+ private final ExecutorService executorService = new ThreadPoolExecutor(
+ CORE_POOL_SIZE, MAX_THREAD_COUNT, KEEP_ALIVE_TIME, TimeUnit.SECONDS,
+ new SynchronousQueue<>());
+ private final CompletionService<Void> completionService =
Review comment:
done
Changes: abfsStore creates thread pool executor; each individual
getContentSummary call creates a separate completionService instance (which
uses the common thread pool)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 642526)
Time Spent: 1h 10m (was: 1h)
> ABFS: Implementation for getContentSummary
> ------------------------------------------
>
> Key: HADOOP-17428
> URL: https://issues.apache.org/jira/browse/HADOOP-17428
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.3.0
> Reporter: Sumangala Patki
> Assignee: Sumangala Patki
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Adds implementation for HDFS method getContentSummary, which takes in a Path
> argument and returns details such as file/directory count and space utilized
> under that path.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]