![JAR search and dependency download from the Maven repository](/logo.png)
com.mongodb.spark.pickle.MaxKeyConstructor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongo-hadoop-spark Show documentation
Show all versions of mongo-hadoop-spark Show documentation
The MongoDB Connector for Hadoop is a plugin for Hadoop that provides the ability to use MongoDB as an input source and/or an output destination.
The newest version!
package com.mongodb.spark.pickle;
import net.razorvine.pickle.IObjectConstructor;
import net.razorvine.pickle.PickleException;
import org.bson.BSON;
import org.bson.types.MaxKey;
import java.util.HashMap;
public class MaxKeyConstructor implements IObjectConstructor {
public static class MaxKeyBox extends BSONValueBox {
private static final MaxKey MAX_KEY = new MaxKey();
static {
BSON.addEncodingHook(MaxKeyBox.class, getTransformer());
}
// CHECKSTYLE:OFF
public void __setstate__(final HashMap state) {
// no state to set here.
}
// CHECKSTYLE:ON
@Override
public MaxKey get() {
return MAX_KEY;
}
}
@Override
public Object construct(final Object[] args) {
if (args.length != 0) {
throw new PickleException(
"MaxKey constructor requires 0 arguments, not " + args.length);
}
return new MaxKeyBox();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy