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<Integer> |
read(ByteBuffer buf,
long offset,
long len,
FileId fileId,
String ufsPath,
UfsReadOptions options)
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<Integer> read(ByteBuffer buf, long offset, long len, FileId fileId, String ufsPath, UfsReadOptions options)
buf
- bytebufferoffset
- offset in ufs filelen
- length to readfileId
- file idufsPath
- ufs pathoptions
- read ufs optionsResourceExhaustedRuntimeException
- when too many read task happensOutOfRangeRuntimeException
- offset is negative, len is negative, or len > buf remainingAlluxioRuntimeException
- future complete exceptionally when having exception from ufsCopyright © 2023. All Rights Reserved.