Package org.bson

Examples of org.bson.LazyBSONCallback


    return orQueryFilter;
  }

  public static BasicDBObject deserializeFilter(byte[] filterBytes) {
    DBObject dbo = new LazyWriteableDBObject(filterBytes,
        new LazyBSONCallback());
    BasicDBObject result = new BasicDBObject();
    result.putAll(dbo);
    return result;
  }
View Full Code Here


        FileSystem fs = file.getFileSystem(configuration);
        in = fs.open(file, 16 * 1024 * 1024);
        in.seek(fileSplit.getStart());

        if (MongoConfigUtil.getLazyBSON(configuration)) {
            callback = new LazyBSONCallback();
            decoder = new LazyBSONDecoder();
        } else {
            callback = new BasicBSONCallback();
            decoder = new BasicBSONDecoder();
        }
View Full Code Here

        Path file = fileSplit.getPath();
        FileSystem fs = file.getFileSystem(conf);
        in = fs.open(file, 16 * 1024 * 1024);
        in.seek(fileSplit.getStart());
        if (MongoConfigUtil.getLazyBSON(conf)) {
            callback = new LazyBSONCallback();
            decoder = new LazyBSONDecoder();
        } else {
            callback = new BasicBSONCallback();
            decoder = new BasicBSONDecoder();
        }
View Full Code Here

    }


    @Override
    public int compare(final byte[] b1, final int s1, final int l1, final byte[] b2, final int s2, final int l2) {
        LazyBSONCallback cb = new LazyBSONCallback();
        DECODER.decode(b1, cb);
        BSONObject a = (BSONObject) cb.get();

        cb.reset();
        DECODER.decode(b2, cb);
        BSONObject b = (BSONObject) cb.get();
        return compare(a, b);
    }
View Full Code Here

        public Object createObject(byte[] data, int offset) {
            if (GridFSDBFile.class.equals(collection.getObjectClass())) {
                return DefaultDBDecoder.FACTORY.create().decode(data, collection);
            }

            DBObject dbo = new RelaxedLazyDBObject(data, new LazyBSONCallback());

            Iterator it = dbo.keySet().iterator();
            if (it.hasNext() && it.next().equals("$ref") && dbo.containsField("$id")) {
                return new DBRef(db, dbo);
            }
View Full Code Here

    public byte[] toByteArray() {
        return bytes;
    }

    public DBObject toDBObject() {
        return new LazyDBObject(bytes, new LazyBSONCallback());
    }
View Full Code Here

        private final Object id;
        private final Marshaller marshaller;

        private LazyIdDBObject(byte[] data, Marshaller marshaller, Object id) {
            super(data, new LazyBSONCallback());
            this.marshaller = marshaller;
            this.id = id;
        }
View Full Code Here

TOP

Related Classes of org.bson.LazyBSONCallback

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.