Package org.apache.uima.cas.impl

Examples of org.apache.uima.cas.impl.BinaryCasSerDes6


          msg.put(AsynchAEMessage.CAS, serializedBinaryCAS);
          break;
        case COMPRESSED_FILTERED:
          // can't use uimaserializer directly - project doesn't have ref to this one
          // for storing the reuse info
          BinaryCasSerDes6 bcs = new BinaryCasSerDes6(aCAS, this.getRemoteTypeSystem());
          ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
          bcs.serialize(baos);
          requestToCache.setCompress6ReuseInfo(bcs.getReuseInfo());          
          msg.put(AsynchAEMessage.CAS, baos.toByteArray());
          break;
        default:
          throw new UIMARuntimeException(new Exception("Internal Error"));   
        }
View Full Code Here


        switch (serialFormat) {
        case BINARY:
          ((CASImpl)cas).reinit(istream);
          break;
        case COMPRESSED_FILTERED:
          BinaryCasSerDes6 bcs = new BinaryCasSerDes6(cas, (MarkerImpl) cacheEntry.getMarker(), endpointWithTimer.getTypeSystemImpl(), cacheEntry.getCompress6ReuseInfo());         
          bcs.deserialize(istream, AllowPreexistingFS.allow);
          break;
        case XMI:
          if (aMessageContext.getMessageBooleanProperty(AsynchAEMessage.SentDeltaCas)) {
            int highWaterMark = cacheEntry.getHighWaterMark();
            deserialize(xmi, cas, casReferenceId, highWaterMark, AllowPreexistingFS.allow);
View Full Code Here

          msg.put(AsynchAEMessage.CAS, serializedBinaryCAS);
          break;
        case COMPRESSED_FILTERED:
          // can't use uimaserializer directly - project doesn't have ref to this one
          // for storing the reuse info
          BinaryCasSerDes6 bcs = new BinaryCasSerDes6(aCAS, this.getRemoteTypeSystem());
          ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
          bcs.serialize(baos);
          requestToCache.setCompress6ReuseInfo(bcs.getReuseInfo());          
          msg.put(AsynchAEMessage.CAS, baos.toByteArray());
          break;
        default:
          throw new UIMARuntimeException(new Exception("Internal Error"));   
        }
View Full Code Here

 
  // used to return non-delta cas's (used if delta cas disallowed, for instance by having a CPP delegate)
  public byte[] serializeCasToBinary6(CAS aCAS) throws Exception {
    ByteArrayOutputStream fos = null;
    fos = new ByteArrayOutputStream();
    BinaryCasSerDes6 bcs = new BinaryCasSerDes6(aCAS);
    bcs.serialize(fos);
    return fos.toByteArray();
  }
View Full Code Here

  // used to send CASes to remotes
  public byte[] serializeCasToBinary6(CAS aCAS, CacheEntry entry, TypeSystemImpl tgtTs) throws Exception {
    ByteArrayOutputStream fos = null;
    fos = new ByteArrayOutputStream();
    BinaryCasSerDes6 bcs = new BinaryCasSerDes6(aCAS, tgtTs);
    bcs.serialize(fos);
    entry.setCompress6ReuseInfo(bcs.getReuseInfo());
    return fos.toByteArray();
  }
View Full Code Here

  }
 
  public byte[] serializeCasToBinary6(CAS aCAS, Marker aMark, ReuseInfo reuseInfo) throws Exception {
    ByteArrayOutputStream fos = null;
    fos = new ByteArrayOutputStream();
    BinaryCasSerDes6 bcs = new BinaryCasSerDes6(aCAS, (MarkerImpl) aMark, null, reuseInfo);
    bcs.serialize(fos);
    return fos.toByteArray();
  }
View Full Code Here

        switch (serialFormat) {
        case BINARY:
          ((CASImpl)cas).reinit(istream);
          break;
        case COMPRESSED_FILTERED:
          BinaryCasSerDes6 bcs = new BinaryCasSerDes6(cas, (MarkerImpl) cacheEntry.getMarker(), endpointWithTimer.getTypeSystemImpl(), cacheEntry.getCompress6ReuseInfo());         
          bcs.deserialize(istream, AllowPreexistingFS.allow);
          break;
        case XMI:
          if (aMessageContext.getMessageBooleanProperty(AsynchAEMessage.SentDeltaCas)) {
            int highWaterMark = cacheEntry.getHighWaterMark();
            deserialize(xmi, cas, casReferenceId, highWaterMark, AllowPreexistingFS.allow);
View Full Code Here

  public void testDeltaWithRefsBelow() {
    lfs.clear();
    TTypeSystem m = getTT(EqTwoTypes);
    remoteCas = setupCas(m);
    loadCas(casSrc, mSrc);
    ReuseInfo ri[] = serializeDeserialize(casSrc, remoteCas, null, null);
    MarkerImpl marker = (MarkerImpl) remoteCas.createMarker();
   
    lfs = getIndexedFSs(remoteCas, m);
    FeatureStructure fs = remoteCas.createFS(m.getType(Akof1));
    maybeSetFeature(fs, m, lfs.get(0));
View Full Code Here

  public void testDeltaWithMods() {
    lfs.clear();
    TTypeSystem m = getTT(EqTwoTypes);
    remoteCas = setupCas(m);
    loadCas(casSrc, mSrc);
    ReuseInfo ri[] = serializeDeserialize(casSrc, remoteCas, null, null);
    MarkerImpl marker = (MarkerImpl) remoteCas.createMarker();
   
    lfs = getIndexedFSs(remoteCas, m);
    FeatureStructure fs = remoteCas.createFS(m.getType(Akof1));
    maybeSetFeatureKind( lfs.get(0), m, "Fs", fs);
View Full Code Here

  public void checkDeltaWithAllMods() {
    makeRandomFss(casSrc, mSrc, Akof1, 7);
    TTypeSystem m = getTT(EqTwoTypes);
    remoteCas = setupCas(m);
    loadCas(casSrc, mSrc);
    ReuseInfo ri[] = serializeDeserialize(casSrc, remoteCas, null, null);
    MarkerImpl marker = (MarkerImpl) remoteCas.createMarker();
   
    lfs = getIndexedFSs(remoteCas, m);
   
    makeRandomFss(remoteCas, m, Akof1, 8);
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.impl.BinaryCasSerDes6

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.