case classTReusableBuffer(initialSize: Int = 512, maxThriftBufferSize: Int = 16 * 1024) extends Product with Serializable
This is a per-thread managed resource and must be reset after use
import com.twitter.scrooge.TReusableBuffer
class Example {
private[this] val reusableBuffer = new TReusableBuffer()
def someMethod(): Unit = {
val buffer = reusableBuffer.get()
try {
// code that uses buffer
} finally {
buffer.reset()
}
}
}
initialSize
The initial buffer size, default is 512.
maxThriftBufferSize
The buffer will reset if it exceeds max buffer
size, default is 16K.
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
Alphabetic
By Inheritance
Inherited
TReusableBuffer
Serializable
Serializable
Product
Equals
AnyRef
Any
Hide All
Show All
Visibility
Public
All
Instance Constructors
newTReusableBuffer(initialSize: Int = 512, maxThriftBufferSize: Int = 16 * 1024)
initialSize
The initial buffer size, default is 512.
maxThriftBufferSize
The buffer will reset if it exceeds max buffer
size, default is 16K.
This is a per-thread managed resource and must be reset after use
The initial buffer size, default is 512.
The buffer will reset if it exceeds max buffer size, default is 16K.