1

Say, I have a List<Entity> to be stored into Google Memcache. But Google Memcache has size limitation to store 1 object, the maximum size is 1MB. But my List<Entity> is about 20MB or more. How do I slice them down from List<Entity> and reconnect them back into one later?

There is a method to overcome this in Python - Avoiding Memcache "1000000 bytes in length" limit on values. But I don't find a way to do this in Java. Please help if you know anything to do with this.

Community
  • 1
  • 1
lannyboy
  • 617
  • 1
  • 10
  • 20
  • How about storing the single `Entity` objects separately? Are they still bigger than 1MB? – Raibaz Jun 27 '13 at 07:42
  • @Raibaz: Well, by doing that way is not an issue. I am asking how to overcome this matter when the object is more than 1MB size? – lannyboy Jun 27 '13 at 07:45

1 Answers1

1

You could write your List<Entity> to a File, and break that file up into multiple files, send the files and put them back together on the receiving end. Here's a tutorial; this may also be helpful. You can use SequenceInputSteam to assist in the deserialization of an object from multiple files.

Community
  • 1
  • 1
Steve P.
  • 14,489
  • 8
  • 42
  • 72