public class UfsIOManager extends Object implements Closeable
Constructor and Description |
---|
UfsIOManager(UfsManager.UfsClient ufsClient) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close.
|
double |
getUsedThroughput(com.codahale.metrics.Meter meter)
Get used throughput.
|
CompletableFuture<byte[]> |
read(long blockId,
long offset,
long length,
String ufsPath,
boolean positionShort,
String tag)
Read from ufs.
|
void |
setQuota(String tag,
long throughput)
Set throughput quota for tag.
|
void |
start()
Start schedule thread.
|
public UfsIOManager(UfsManager.UfsClient ufsClient)
ufsClient
- ufs clientpublic void start()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void setQuota(String tag, long throughput)
tag
- the client name or tagthroughput
- throughput limit in bytespublic double getUsedThroughput(com.codahale.metrics.Meter meter)
meter
- throughput meterpublic CompletableFuture<byte[]> read(long blockId, long offset, long length, String ufsPath, boolean positionShort, String tag) throws ResourceExhaustedException
blockId
- block idoffset
- offset in ufs filelength
- length to readufsPath
- ufs pathpositionShort
- is position short or not, used for HDFS performance optimization. When
the client buffer size is large ( > 2MB) and reads are guaranteed
to be somewhat sequential, the `pread` API to HDFS is not as efficient as
simple `read`. We introduce a heuristic to choose which API to use.tag
- user/client name or specific identifier of the read taskResourceExhaustedException
- when too many read task happensCopyright © 2023. All Rights Reserved.