lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantyn Smirnov <inject...@yahoo.com>
Subject Re: Serializing RAMDirectory in 4.6.0
Date Sat, 18 Jan 2014 12:32:10 GMT
Yeah, already done that (after some experimenting):

  static void serializeRAMDirectory( RAMDirectory dir, output ){
    if( null == dir ) return
    output?.withObjectOutputStream{ out ->
      out.writeLong dir.sizeInBytes()
      out.writeInt dir.fileMap.size()
      dir.fileMap.each{ String name, RAMFile rf ->
        out.writeObject name
        out.writeLong rf.length
        out.writeLong rf.sizeInBytes
        out.writeObject rf.buffers
      }
    }
  }

unwrapping - in the opposite direction

The goal was to send an index segment over the network. Now it's working
again!



--
View this message in context: http://lucene.472066.n3.nabble.com/Serializing-RAMDirectory-in-4-6-0-tp4111999p4112060.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message