code: public KryoInstantiator setReferences(final boolean ref) {
      return new KryoInstantiator() {
        public Kryo newKryo() {
          Kryo k = KryoInstantiator.this.newKryo();
          /**
           * Kryo 2.17, used in storm, has this method returning void,
           * 2.21 has it returning boolean.
           * Try not to call the method if you don't need to.
           */
          if(k.getReferences() != ref) { k.setReferences(ref); }
          return k;
        }
      };
    }
docs: If true, Kryo keeps a map of all the objects it has seen.
  this can use a ton of memory on hadoop, but save serialization costs in
  some cases