Package org.apache.hadoop.fs.s3a.impl
Class GetContentSummaryOperation
java.lang.Object
org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation<org.apache.hadoop.fs.ContentSummary>
org.apache.hadoop.fs.s3a.impl.GetContentSummaryOperation
- All Implemented Interfaces:
org.apache.hadoop.fs.statistics.IOStatisticsSource,org.apache.hadoop.util.functional.CallableRaisingIOE<org.apache.hadoop.fs.ContentSummary>
public class GetContentSummaryOperation
extends ExecutingStoreOperation<org.apache.hadoop.fs.ContentSummary>
implements org.apache.hadoop.fs.statistics.IOStatisticsSource
GetContentSummary operation.
It is optimized for s3 and performs a deep tree listing,
inferring directory counts from the paths returned.
The Operation serves up IOStatistics; this counts
the cost of all the list operations, but not the
initial HEAD probe to see if the path is a file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallbacks used by the operation. -
Constructor Summary
ConstructorsConstructorDescriptionGetContentSummaryOperation(StoreContext storeContext, org.apache.hadoop.fs.Path path, GetContentSummaryOperation.GetContentSummaryCallbacks callbacks) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.fs.ContentSummaryexecute()Return theContentSummaryof a given path.org.apache.hadoop.fs.ContentSummarygetDirSummary(org.apache.hadoop.fs.Path dir) Return theContentSummaryof a given directory.org.apache.hadoop.fs.statistics.IOStatisticsMethods inherited from class org.apache.hadoop.fs.s3a.impl.ExecutingStoreOperation
apply, executeOnlyOnceMethods inherited from class org.apache.hadoop.fs.s3a.impl.AbstractStoreOperation
activateAuditSpan, getAuditSpan, getStoreContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.util.functional.CallableRaisingIOE
unchecked
-
Constructor Details
-
GetContentSummaryOperation
public GetContentSummaryOperation(StoreContext storeContext, org.apache.hadoop.fs.Path path, GetContentSummaryOperation.GetContentSummaryCallbacks callbacks) Constructor.- Parameters:
storeContext- context.path- path to summarizecallbacks- callbacks for S3 access.
-
-
Method Details
-
getIOStatistics
public org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()- Specified by:
getIOStatisticsin interfaceorg.apache.hadoop.fs.statistics.IOStatisticsSource
-
execute
Return theContentSummaryof a given path.- Specified by:
executein classExecutingStoreOperation<org.apache.hadoop.fs.ContentSummary>- Returns:
- the summary.
- Throws:
FileNotFoundException- if the path does not resolveIOException- failure
-
getDirSummary
public org.apache.hadoop.fs.ContentSummary getDirSummary(org.apache.hadoop.fs.Path dir) throws IOException Return theContentSummaryof a given directory.- Parameters:
dir- dir to scan- Returns:
- the content summary
- Throws:
FileNotFoundException- if the path does not resolveIOException- IO failureFileNotFoundException- the path does not existIOException- failure
-