Package alluxio.underfs
Class ObjectUnderFileSystem.OperationBuffer<T>
- java.lang.Object
-
- alluxio.underfs.ObjectUnderFileSystem.OperationBuffer<T>
-
- Direct Known Subclasses:
ObjectUnderFileSystem.DeleteBuffer
,ObjectUnderFileSystem.RenameBuffer
- Enclosing class:
- ObjectUnderFileSystem
protected abstract class ObjectUnderFileSystem.OperationBuffer<T> extends java.lang.Object
Operations added to this buffer are performed concurrently.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ObjectUnderFileSystem.OperationBuffer.OperationThread
Thread class to operate on a batch of objects.
-
Field Summary
Fields Modifier and Type Field Description protected int
mEntriesAdded
Total number of inputs to be operated on across batches.
-
Constructor Summary
Constructors Modifier Constructor Description protected
OperationBuffer()
Construct a newObjectUnderFileSystem.OperationBuffer
instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(T input)
Adds a new input to be operated on.protected abstract int
getBatchSize()
Gets the batch size.java.util.List<T>
getResult()
Gets the combined result from all batches.protected abstract java.util.List<T>
operate(java.util.List<T> paths)
Operate on a list of input typeObjectUnderFileSystem.OperationBuffer
.
-
-
-
Constructor Detail
-
OperationBuffer
protected OperationBuffer()
Construct a newObjectUnderFileSystem.OperationBuffer
instance.
-
-
Method Detail
-
getBatchSize
protected abstract int getBatchSize()
Gets the batch size.- Returns:
- a positive integer denoting the batch size
-
operate
protected abstract java.util.List<T> operate(java.util.List<T> paths) throws java.io.IOException
Operate on a list of input typeObjectUnderFileSystem.OperationBuffer
.- Parameters:
paths
- the list of input typeObjectUnderFileSystem.OperationBuffer
to operate on- Returns:
- list of inputs for successful operations
- Throws:
java.io.IOException
-
add
public void add(T input) throws java.io.IOException
Adds a new input to be operated on.- Parameters:
input
- the input to operate on- Throws:
java.io.IOException
- if a non-Alluxio error occurs
-
getResult
public java.util.List<T> getResult() throws java.io.IOException
Gets the combined result from all batches.- Returns:
- a list of inputs for successful operations
- Throws:
java.io.IOException
- if a non-Alluxio error occurs
-
-