public class Serialization extends Object
Constructor and Description |
---|
Serialization() |
Modifier and Type | Method and Description |
---|---|
static CAS |
createCAS(CASMgr casMgr,
CASSerializer casSer)
Deserialize the data in a CASSerializer into an existing CAS, return the currentview in that
Cas.
|
static CASMgr |
createCASMgr(CASMgrSerializer ser)
Deserialize a type system and index repository definition and use to initialize a new instance
of a CAS.
|
static SerialFormat |
deserializeCAS(CAS cas,
InputStream istream)
Deserialize a CAS, in various binary formats, into an existing CAS
Note: this form supports deserializing the following binary representations:
- plain (uncompressed)
- compressed, no type filtering (form 4), Delta and not-delta
- compressed, no type filtering (form 6), not-delta only.
|
static BinaryCasSerDes6 |
deserializeCAS(CAS cas,
InputStream istream,
TypeSystem tgtTypeSystem,
BinaryCasSerDes6.ReuseInfo reuseInfo)
Deserialize a CAS, in various binary formats, into an existing CAS
Note: this form supports deserializing the following binary representations:
- compressed, type filtering (form 6), delta and not-delta.
|
static BinaryCasSerDes6 |
deserializeCAS(CAS cas,
InputStream istream,
TypeSystem tgtTypeSystem,
BinaryCasSerDes6.ReuseInfo reuseInfo,
AllowPreexistingFS allowPreexisting)
Deserialize a CAS, in various binary formats, into an existing CAS
Note: this form supports deserializing the following binary representations:
- compressed, type filtering (form 6), delta and not-delta.
|
static void |
deserializeCASComplete(CASCompleteSerializer casCompSer,
CASMgr casMgr)
Deserialize the data in a CASCompleteSerializer into an existing CAS
|
static CASSerializer |
serializeCAS(CAS cas)
Convert a CAS to a CASSerializer object.
|
static void |
serializeCAS(CAS cas,
OutputStream ostream)
Serialize a CAS including what's indexed, to an output stream Uses uncompressed binary
serialization
|
static void |
serializeCAS(CAS cas,
OutputStream ostream,
Marker mark)
Serializes CAS data added or modified after the tracking Marker was created and writes it to
the output stream in Delta CAS format using uncompressed binary format
|
static CASCompleteSerializer |
serializeCASComplete(CASMgr casMgr)
Convert a CAS + the type system and index definitions into a CASCompleteSerializer object
|
static CASMgrSerializer |
serializeCASMgr(CASMgr casMgr)
Convert a Type System and Index Repository into a CASMgrSerializer object which can be
serialized
|
static CASMgrSerializer |
serializeCASMgrTypeSystemOnly(CASMgr casMgr)
Convert a Type System into a CASMgrSerializer object which can be serialized
|
static CASSerializer |
serializeNoMetaData(CAS cas)
Convert a CAS to a CASSerializer object.
|
static void |
serializeWithCompression(CAS cas,
Object out)
Serialize in compressed binary form 4
|
static BinaryCasSerDes6.ReuseInfo |
serializeWithCompression(CAS cas,
Object out,
boolean includeTS,
boolean includeTSI)
Serialize in compressed binary with type filtering This method can use type filtering to omit
sending those types and/or features not present in the target type system.
|
static void |
serializeWithCompression(CAS cas,
Object out,
Marker marker)
Serialize in compress binary form 4, only the delta part of a CAS
|
static BinaryCasSerDes6.ReuseInfo |
serializeWithCompression(CAS cas,
Object out,
TypeSystem tgtTypeSystem)
Serialize in compressed binary with type filtering This method can use type filtering to omit
sending those types and/or features not present in the target type system.
|
static void |
serializeWithCompression(CAS cas,
Object out,
TypeSystem tgtTypeSystem,
Marker mark,
BinaryCasSerDes6.ReuseInfo reuseInfo)
Delta Serialize in compressed form, with type filtering This method can use type filtering to
omit sending those types and/or features not present in the target type system.
|
public static CASSerializer serializeCAS(CAS cas)
cas
- the CAS which serves as the source for a new CASSerializer objectpublic static CASSerializer serializeNoMetaData(CAS cas)
cas
- the source for a new CASSerializer objectpublic static CASMgrSerializer serializeCASMgr(CASMgr casMgr)
casMgr
- the type system and index repo definitionspublic static CASMgrSerializer serializeCASMgrTypeSystemOnly(CASMgr casMgr)
casMgr
- the type system and index repo definitionspublic static CASCompleteSerializer serializeCASComplete(CASMgr casMgr)
casMgr
- the source for a new CASCompleteSerializer objectpublic static void deserializeCASComplete(CASCompleteSerializer casCompSer, CASMgr casMgr)
casCompSer
- the source for deserializationcasMgr
- the CAS to receive the datapublic static CASMgr createCASMgr(CASMgrSerializer ser)
ser
- the CAS to receive the type systempublic static CAS createCAS(CASMgr casMgr, CASSerializer casSer)
casMgr
- the CAS ManagercasSer
- the serializerpublic static void serializeCAS(CAS cas, OutputStream ostream)
cas
- the CAS to serializeostream
- the output streampublic static SerialFormat deserializeCAS(CAS cas, InputStream istream)
cas
- the CAS to deserialize into. If the incoming representation is a Delta Cas, then the receiving CAS is not reset, but is added to.istream
- the input streampublic static void serializeCAS(CAS cas, OutputStream ostream, Marker mark)
cas
- the Cas to serializeostream
- the output streammark
- the cas mark (for delta CASes)public static void serializeWithCompression(CAS cas, Object out) throws IOException
cas
- the CAS to serializeout
- - an OutputStream, a DataOutputStream, or a FileIOException
- if IO exceptionpublic static void serializeWithCompression(CAS cas, Object out, Marker marker) throws IOException
cas
- the CAS to serializeout
- - an OutputStream, a DataOutputStream, or a Filemarker
- identifying where the delta startsIOException
- if IO exceptionpublic static BinaryCasSerDes6.ReuseInfo serializeWithCompression(CAS cas, Object out, boolean includeTS, boolean includeTSI) throws IOException, ResourceInitializationException
cas
- the CAS to serializeout
- an OutputStream, a DataOutputStream, or a FileincludeTS
- true to serialize the type systemincludeTSI
- true to serialize the type system and the indexes definitionIOException
- if IO exceptionResourceInitializationException
- if target type system is incompatible with this CAS's type systempublic static BinaryCasSerDes6.ReuseInfo serializeWithCompression(CAS cas, Object out, TypeSystem tgtTypeSystem) throws IOException, ResourceInitializationException
cas
- the CAS to serializeout
- an OutputStream, a DataOutputStream, or a FiletgtTypeSystem
- null or a target TypeSystem, which must be mergable with this CAS's type systemIOException
- if IO exceptionResourceInitializationException
- if target type system is incompatible with this CAS's type systempublic static void serializeWithCompression(CAS cas, Object out, TypeSystem tgtTypeSystem, Marker mark, BinaryCasSerDes6.ReuseInfo reuseInfo) throws IOException, ResourceInitializationException
cas
- the CAS to serializeout
- an OutputStream, a DataOutputStream, or a FiletgtTypeSystem
- null or a target TypeSystem, which must be mergable with this CAS's type systemmark
- null or where the mark is in the CAS. If not null, indicates doing a delta CAS
serializationreuseInfo
- if mark is not null, this parameter is required and must have been computed when the
original deserialization (of the CAS now being serialized as a delta CAS) was doneIOException
- if IO exceptionResourceInitializationException
- if the target type system and the CAS's type system can't be mergedpublic static BinaryCasSerDes6 deserializeCAS(CAS cas, InputStream istream, TypeSystem tgtTypeSystem, BinaryCasSerDes6.ReuseInfo reuseInfo) throws IOException, ResourceInitializationException
cas
- the CAS to deserialize into. If the incoming representation is a Delta Cas, then the receiving CAS is not reset, but is added to.istream
- the input streamtgtTypeSystem
- The typeSystem of the serialized form of the CAS; must be compatible with the type system of the receiving cas.reuseInfo
- If delta CAS is being received and form 6 compression is being used, then this must be the reuseInfo captured when the
original CAS (being updated by the delta coming in) was sent out.IOException
- if IO exceptionResourceInitializationException
- if the target type system and the CAS's type system can't be mergedpublic static BinaryCasSerDes6 deserializeCAS(CAS cas, InputStream istream, TypeSystem tgtTypeSystem, BinaryCasSerDes6.ReuseInfo reuseInfo, AllowPreexistingFS allowPreexisting) throws IOException, ResourceInitializationException
cas
- the CAS to deserialize into. If the incoming representation is a Delta Cas, then the receiving CAS is not reset, but is added to.istream
- the input streamtgtTypeSystem
- The typeSystem of the serialized form of the CAS; must be compatible with the type system of the receiving cas.reuseInfo
- If delta CAS is being received and form 6 compression is being used, then this must be the reuseInfo captured when the
original CAS (being updated by the delta coming in) was sent out.allowPreexisting
- used to control what happens when a delta cas is modifying Feature Structures below the lineIOException
- if IO exceptionResourceInitializationException
- if the target type system and the CAS's type system can't be mergedCopyright © 2006–2022 The Apache Software Foundation. All rights reserved.