Package org.teiid.core.types
Class Streamable<T>
- java.lang.Object
-
- org.teiid.core.types.Streamable<T>
-
- All Implemented Interfaces:
Externalizable
,Serializable
- Direct Known Subclasses:
BaseClobType
,BlobType
,XMLType
public abstract class Streamable<T> extends Object implements Externalizable
A large value object which can be streamable in chunks of data each timeA reference stream id is tuple source id for a Streamble object where the object is in buffer manager, but the contents will never be written to disk; this is the ID that client needs to reference to get the chunk of data.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Streamable()
Streamable(T reference)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description long
getLength()
Returns the cached length.T
getReference()
String
getReferenceStreamId()
protected boolean
isBinary()
long
length()
void
readExternal(ObjectInput in)
protected abstract void
readReference(ObjectInput in)
void
setReference(T reference)
void
setReferenceStreamId(String id)
String
toString()
void
writeExternal(ObjectOutput out)
protected abstract void
writeReference(DataOutput out)
-
-
-
Field Detail
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
CHARSET
public static final Charset CHARSET
-
STREAMING_BATCH_SIZE_IN_BYTES
public static final int STREAMING_BATCH_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
reference
protected transient volatile T reference
-
length
protected long length
-
-
Constructor Detail
-
Streamable
public Streamable()
-
Streamable
public Streamable(T reference)
-
-
Method Detail
-
getLength
public long getLength()
Returns the cached length. May be binary or character based.
-
length
public long length() throws SQLException
- Throws:
SQLException
-
getReference
public T getReference()
-
setReference
public void setReference(T reference)
-
getReferenceStreamId
public String getReferenceStreamId()
-
setReferenceStreamId
public void setReferenceStreamId(String id)
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
readReference
protected abstract void readReference(ObjectInput in) throws IOException
- Throws:
IOException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
isBinary
protected boolean isBinary()
-
writeReference
protected abstract void writeReference(DataOutput out) throws IOException
- Throws:
IOException
-
-