case class TReusableBuffer(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
Ordering
- Alphabetic
- By Inheritance
Inherited
- TReusableBuffer
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new TReusableBuffer(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.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def get(): TReusableMemoryTransport
NOTE: This method resets the underlying TReusableMemoryTransport before returning it.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val initialSize: Int
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maxThriftBufferSize: Int
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def reset(): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()